-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
4,035 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
generated | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
1. clone this project | ||
2. run "yarn global add @graphprotocol/graph-cli" or "npm i -g @graphprotocol/graph-cli" | ||
3. run "graph codegen && graph build" | ||
4. to deploy run "graph deploy --product hosted-service norvirae/podship" | ||
|
||
you can query this subgraph from your graphql dapp at "https://api.thegraph.com/subgraphs/name/norvirae/podship" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,236 @@ | ||
[ | ||
{ "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, | ||
{ "inputs": [], "name": "PodShip__ZeroAddress", "type": "error" }, | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ | ||
"indexed": true, | ||
"internalType": "address", | ||
"name": "account", | ||
"type": "address" | ||
}, | ||
{ | ||
"indexed": true, | ||
"internalType": "address", | ||
"name": "operator", | ||
"type": "address" | ||
}, | ||
{ | ||
"indexed": false, | ||
"internalType": "bool", | ||
"name": "approved", | ||
"type": "bool" | ||
} | ||
], | ||
"name": "PodShipSupporterNFTApprovalForAll", | ||
"type": "event" | ||
}, | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ | ||
"indexed": true, | ||
"internalType": "address", | ||
"name": "operator", | ||
"type": "address" | ||
}, | ||
{ | ||
"indexed": true, | ||
"internalType": "address", | ||
"name": "from", | ||
"type": "address" | ||
}, | ||
{ | ||
"indexed": true, | ||
"internalType": "address", | ||
"name": "to", | ||
"type": "address" | ||
}, | ||
{ | ||
"indexed": false, | ||
"internalType": "uint256[]", | ||
"name": "ids", | ||
"type": "uint256[]" | ||
}, | ||
{ | ||
"indexed": false, | ||
"internalType": "uint256[]", | ||
"name": "values", | ||
"type": "uint256[]" | ||
} | ||
], | ||
"name": "TransferBatch", | ||
"type": "event" | ||
}, | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ | ||
"indexed": true, | ||
"internalType": "address", | ||
"name": "operator", | ||
"type": "address" | ||
}, | ||
{ | ||
"indexed": true, | ||
"internalType": "address", | ||
"name": "from", | ||
"type": "address" | ||
}, | ||
{ | ||
"indexed": true, | ||
"internalType": "address", | ||
"name": "to", | ||
"type": "address" | ||
}, | ||
{ | ||
"indexed": false, | ||
"internalType": "uint256", | ||
"name": "id", | ||
"type": "uint256" | ||
}, | ||
{ | ||
"indexed": false, | ||
"internalType": "uint256", | ||
"name": "value", | ||
"type": "uint256" | ||
} | ||
], | ||
"name": "TransferSingle", | ||
"type": "event" | ||
}, | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ | ||
"indexed": false, | ||
"internalType": "string", | ||
"name": "value", | ||
"type": "string" | ||
}, | ||
{ | ||
"indexed": true, | ||
"internalType": "uint256", | ||
"name": "id", | ||
"type": "uint256" | ||
} | ||
], | ||
"name": "URI", | ||
"type": "event" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "PodShipSupporterNft", | ||
"outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "address", "name": "account", "type": "address" }, | ||
{ "internalType": "uint256", "name": "id", "type": "uint256" } | ||
], | ||
"name": "balanceOf", | ||
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "address[]", "name": "accounts", "type": "address[]" }, | ||
{ "internalType": "uint256[]", "name": "ids", "type": "uint256[]" } | ||
], | ||
"name": "balanceOfBatch", | ||
"outputs": [ | ||
{ "internalType": "uint256[]", "name": "", "type": "uint256[]" } | ||
], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [{ "internalType": "uint256", "name": "id", "type": "uint256" }], | ||
"name": "exists", | ||
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "address", "name": "account", "type": "address" }, | ||
{ "internalType": "address", "name": "operator", "type": "address" } | ||
], | ||
"name": "isApprovedForAll", | ||
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "address", "name": "_winner", "type": "address" } | ||
], | ||
"name": "mintPodShipSupporterNFT", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "address", "name": "from", "type": "address" }, | ||
{ "internalType": "address", "name": "to", "type": "address" }, | ||
{ "internalType": "uint256[]", "name": "ids", "type": "uint256[]" }, | ||
{ "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" }, | ||
{ "internalType": "bytes", "name": "data", "type": "bytes" } | ||
], | ||
"name": "safeBatchTransferFrom", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "address", "name": "from", "type": "address" }, | ||
{ "internalType": "address", "name": "to", "type": "address" }, | ||
{ "internalType": "uint256", "name": "id", "type": "uint256" }, | ||
{ "internalType": "uint256", "name": "amount", "type": "uint256" }, | ||
{ "internalType": "bytes", "name": "data", "type": "bytes" } | ||
], | ||
"name": "safeTransferFrom", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "address", "name": "operator", "type": "address" }, | ||
{ "internalType": "bool", "name": "approved", "type": "bool" } | ||
], | ||
"name": "setApprovalForAll", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" } | ||
], | ||
"name": "supportsInterface", | ||
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [{ "internalType": "uint256", "name": "id", "type": "uint256" }], | ||
"name": "totalSupply", | ||
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [{ "internalType": "uint256", "name": "_id", "type": "uint256" }], | ||
"name": "uri", | ||
"outputs": [{ "internalType": "string", "name": "", "type": "string" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,31 @@ | ||
type ExampleEntity @entity { | ||
type PodSale @entity { | ||
id: ID! | ||
count: BigInt! | ||
owner: Bytes! # address | ||
approved: Bytes! # address | ||
podcast: Podcast! | ||
# isOnSale: Boolean #set isOnsale = true when OfferCreated, AuctionCreated is emitted, and isOnSale = false when OfferCancelled, OfferPurchased, AuctionCancelled, AuctionPurchased, AuctionResulted is called | ||
amount: BigInt #can be reserved_price for auction or price for fixed | ||
isOnSale: Boolean | ||
startTime: BigInt | ||
endTime: BigInt | ||
podcastId: ID! | ||
duration: BigInt | ||
buyer: User | ||
seller: User | ||
} | ||
|
||
type Podcast @entity { | ||
id: ID! | ||
podcastId: ID! | ||
metadataURI: String! | ||
baseURI: String! | ||
isOnSale: Boolean | ||
created: BigInt! | ||
ownerAddress: User! | ||
creator: User! | ||
} | ||
|
||
type User @entity{ | ||
id: ID! | ||
podcasts: [Podcast!]! @derivedFrom(field: "ownerAddress") | ||
created: [Podcast!]! @derivedFrom(field: "creator") | ||
} | ||
|
Oops, something went wrong.