Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
782d0d3
made owner change track func generic
rahul7668gupta Feb 4, 2023
cb71ad4
some pr comments addressed from PR #34
rahul7668gupta Feb 5, 2023
5ea9486
moved is migrated outside module
rahul7668gupta Feb 5, 2023
581bfe0
created air extra for ttl
rahul7668gupta Feb 5, 2023
892ddbc
minor update
rahul7668gupta Feb 5, 2023
9849f83
update domain moduel
rahul7668gupta Feb 5, 2023
c25ac5f
updated unit tests
rahul7668gupta Feb 5, 2023
bfc4202
removed chainId from track funcs
rahul7668gupta Feb 5, 2023
d9fc108
updated module inputs
rahul7668gupta Feb 5, 2023
e5e98cf
addr to resolved address
rahul7668gupta Feb 5, 2023
dc66d3a
updated chain ids for common
rahul7668gupta Feb 5, 2023
d3953a5
updated module with latest changes
rahul7668gupta Feb 5, 2023
856ce80
minor update to eth registrar
rahul7668gupta Feb 5, 2023
d2fe208
removed resolver addresses from yaml file
rahul7668gupta Feb 5, 2023
19dd944
minor update
rahul7668gupta Feb 5, 2023
ade56f8
null cost in registration event
rahul7668gupta Feb 5, 2023
7016b6b
updated unit test
rahul7668gupta Feb 5, 2023
0c72079
updating owner in domain transfer txn
rahul7668gupta Feb 5, 2023
bec8999
updated tests
rahul7668gupta Feb 5, 2023
a6feb4b
moved label to labelHash
rahul7668gupta Feb 5, 2023
1978e6b
domain name module read me
rahul7668gupta Feb 5, 2023
4bd341c
updated docs for nft marketplace
rahul7668gupta Feb 5, 2023
6482870
minor update
rahul7668gupta Feb 5, 2023
abc5b9c
updated readmes
rahul7668gupta Feb 5, 2023
bce8ff8
minor domain module updates
rahul7668gupta Feb 5, 2023
f978a58
integrated module in ens subgraph
rahul7668gupta Feb 5, 2023
607d2e5
Merge pull request #39 from Airstack-xyz/ens-airstack-module-refactor
0xsarvesh Feb 6, 2023
28d6869
moved air account to common, updated modules
rahul7668gupta Feb 6, 2023
7cbd0fb
updated module with domain name changes
rahul7668gupta Feb 6, 2023
f1d5371
updated readme links to main repo
rahul7668gupta Feb 6, 2023
ffd6108
updated trackNameRenewedOrRegistrationByController func and docs
rahul7668gupta Feb 6, 2023
e30d912
Revert "updated trackNameRenewedOrRegistrationByController func and d…
rahul7668gupta Feb 6, 2023
7d32d42
updating domain expiry in renewal from controller event
rahul7668gupta Feb 6, 2023
bc709c0
saving air account after get/create
rahul7668gupta Feb 7, 2023
5c90906
updated module
rahul7668gupta Feb 7, 2023
4c61bd1
updated domain module, ens unit tests, deployed
rahul7668gupta Feb 7, 2023
2af335d
nft marketplace module update, air account
rahul7668gupta Feb 8, 2023
4665f3a
pointing urls to main branch
rahul7668gupta Feb 9, 2023
0b4e5da
module/common name, slug version update
rahul7668gupta Feb 9, 2023
77f5209
requested changes addresses, module integrated
rahul7668gupta Feb 9, 2023
c132f14
process -> get in network and chain id, deployed
rahul7668gupta Feb 9, 2023
af7f30b
updated readme comment from #42
rahul7668gupta Feb 9, 2023
cb6f1f8
saving all entities outside
rahul7668gupta Feb 10, 2023
722add5
removed newOwner account duplication
rahul7668gupta Feb 10, 2023
b74fbb2
refactor
rahul7668gupta Feb 10, 2023
998a1d0
saving domain before
rahul7668gupta Feb 10, 2023
5ef437f
removed domainId in airExtras
rahul7668gupta Feb 10, 2023
319c38a
moved air extras to common code
rahul7668gupta Feb 10, 2023
a927c6f
moved air extras and token into module common
rahul7668gupta Feb 10, 2023
ea2fc5b
addresses pr comments
rahul7668gupta Feb 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# Subgraphs
Airstack Subgraphs

## Verticals Supported in airstack-modules
1. NFT_MARKET_PLACE - [Check docs here](https://github.com/Airstack-xyz/Subgraphs/tree/main/airstack-modules/modules/airstack/nft-marketplace/Readme.md)

2. DOMAIN_NAME - [Check docs here](https://github.com/Airstack-xyz/Subgraphs/tree/main/airstack-modules/modules/airstack/domain-name/Readme.md)
201 changes: 4 additions & 197 deletions airstack-modules/bin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,211 +69,18 @@ for (let index = START_INDEX; index < args.length; index++) {
integrate(vertical, yaml, graphql, dataSources, templates)
.then(() => {
switch (vertical) {
case Vertical.Dex:
console.log(`
Integration done. Please call the following functions.
1. Add pool

function addDexPool(
poolAddress: string,
fee: BigInt,
inputTokens: Array<string>,
weights: Array<BigDecimal> | null = null,
outputToken: string | null = null
): void

2. Add pool

function swap(
poolAddress: string,
inputAmounts: Array<BigInt>,
outputAmounts: Array<BigInt>,
inputTokenIndex: i32,
outputTokenIndex: i32,
from: string,
to: string,
hash: string,
logIndex: BigInt,
timestamp: BigInt,
blockNumber: BigInt
): void

For documentation and examples please check: https://github.com/Airstack-xyz/Subgraphs
`);
break;

case Vertical.NftMarketplace:
console.log(`
Integration done. Please call the following functions.

1. Track NFT trade transaction
trackNFTSaleTransactions(
chainID: string,
txHash: string,
txIndex: BigInt,
NftSales: Sale[],
protocolType: string,
protocolActionType: string,
timestamp: BigInt,
blockHeight: BigInt,
blockHash: string
)

For documentation and examples please check: https://github.com/Airstack-xyz/Subgraphs
Integration for NFT_MARKET_PLACE vertical done. For documentation and examples please check below link:
https://github.com/Airstack-xyz/Subgraphs/tree/main/airstack-modules/modules/airstack/nft-marketplace/Readme.md
`);
break;

case Vertical.DomainName:
console.log(`
Integration done. Please call the following functions.

1. Track domain owner change transaction
trackDomainOwnerChangedTransaction(
blockHeight: BigInt,
blockHash: string,
blockTimestamp: BigInt,
logIndex: BigInt,
chainId: string,
newOwner: string,
transactionHash: string,
isMigrated: boolean,
node: Bytes,
label: Bytes,
tokenAddress: string,
fromOldRegistry: boolean,
)

2. Track domain transfer transaction
trackDomainTransferTransaction(
node: string,
chainId: string,
newOwnerAddress: string,
blockHeight: BigInt,
blockHash: string,
blockTimestamp: BigInt,
logIndex: BigInt,
transactionHash: string,
tokenAddress: string,
fromOldRegistry: boolean,
)

3. Track domain new resolver transaction
trackDomainNewResolverTransaction(
resolver: string,
node: string,
chainId: string,
blockHeight: BigInt,
blockHash: string,
blockTimestamp: BigInt,
transactionHash: string,
logIndex: BigInt,
tokenAddress: string,
fromOldRegistry: boolean,
)

4. Track domain new ttl transaction
trackDomainNewTTLTransaction(
node: string,
newTTL: BigInt,
chainId: string,
blockHeight: BigInt,
blockHash: string,
blockTimestamp: BigInt,
logIndex: BigInt,
transactionHash: string,
tokenAddress: string,
fromOldRegistry: boolean,
)

5. Track name registered transaction
trackNameRegisteredTransaction(
transactionHash: string,
blockHeight: BigInt,
blockHash: string,
blockTimestamp: BigInt,
logIndex: BigInt,
chainId: string,
registrantAddress: string,
expiryTimestamp: BigInt,
cost: BigInt,
paymentToken: string,
labelId: BigInt,
rootNode: ByteArray,
tokenAddress: string,
)

6. Track name renewed transaction
trackNameRenewedTransaction(
transactionHash: string,
blockHeight: BigInt,
blockHash: string,
blockTimestamp: BigInt,
chainId: string,
cost: BigInt | null,
paymentToken: string,
renewer: string,
labelId: BigInt,
rootNode: ByteArray,
expiryTimestamp: BigInt,
tokenAddress: string,
)

7. Track set name preimage transaction
trackSetNamePreImage(
name: string,
label: Bytes,
cost: BigInt,
paymentToken: string,
blockHeight: BigInt,
blockHash: string,
blockTimestamp: BigInt,
chainId: string,
rootNode: ByteArray,
tokenAddress: string,
transactionHash: string,
renewer: string | null,
expiryTimestamp: BigInt | null,
fromRegistrationEvent: boolean,
)

8. Track addr(resolvedAddress) changed transaction
trackAddrChangedTransaction(
chainId: string,
logIndex: BigInt,
resolverAddress: string,
addr: string,
node: string,
blockHeight: BigInt,
blockHash: string,
blockTimestamp: BigInt,
transactionHash: string,
tokenAddress: string,
)

9. Track resolver version changed transaction
trackResolverVersionChange(
chainId: string,
blockHeight: BigInt,
blockHash: string,
blockTimestamp: BigInt,
node: string,
resolverAddress: string,
tokenAddress: string,
)

10. Track set primary domain transaction
trackSetPrimaryDomainTransaction(
ensName: string,
chainId: string,
from: string,
blockHeight: BigInt,
blockHash: string,
blockTimestamp: BigInt,
transactionHash: string,
tokenAddress: string,
)

For documentation and examples please check: https://github.com/Airstack-xyz/Subgraphs
Integration for DOMAIN_NAME vertical done. For documentation and examples please check below link:
https://github.com/Airstack-xyz/Subgraphs/tree/main/airstack-modules/modules/airstack/domain-name/Readme.md
`
);
break;
Expand Down
21 changes: 14 additions & 7 deletions airstack-modules/graphql/airstack-domain-name-schema.graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,16 @@ type AirEntityCounter @entity {
lastUpdatedAt: AirBlock!
}

type AirExtra @entity {
id: ID! # Concatenation of domainId and name
name: String!
value: String!
}

type AirAccount @entity {
id: ID!
address: String!
createdAt: AirBlock!
}

type AirToken @entity {
Expand All @@ -39,22 +46,22 @@ type AirDomain @entity {
id: ID! # The namehash of the name
name: String # The human readable name, if known. Unknown portions replaced with hash in square brackets (eg, foo.[1234].eth)
labelName: String # The human readable label name (imported from CSV), if known
labelHash: Bytes # keccak256(labelName)
labelHash: String # keccak256(labelName)
tokenId: String # dec(labelHash)
parent: AirDomain # The namehash (id) of the parent name
subdomains: [AirDomain!]! @derivedFrom(field: "parent") # Can count domains from length of array
subdomainCount: BigInt! # The number of subdomains
resolvedAddress: AirAccount # Address logged from current resolver, if any
owner: AirAccount!
resolver: AirResolver
ttl: BigInt
isPrimary: Boolean! # - NA # Is the primary domain for the resolved address
expiryTimestamp: BigInt!
registrationCost: BigInt! # Cost of domain registration in wei
paymentToken: AirToken # Token used to pay for registration
tokenAddress: AirToken! # Domain (eg: ens) token contract address
createdAt: AirBlock!
lastBlock: AirBlock #- NA
lastUpdatedBlock: AirBlock #- NA
extras: [AirExtra!]
}

type AirDomainTransferTransaction implements AirDomainEvent @entity {
Expand Down Expand Up @@ -105,14 +112,14 @@ type AirResolver @entity {
id: ID! # Concatenation of resolver address and namehash
domain: AirDomain
address: AirAccount! # Address of resolver contract
resolvedAddress: AirAccount # Current value of addr record (per events)
resolvedAddress: AirAccount # Current value of resolved address record (per events)
}

type AirAddrChanged implements AirDomainEvent @entity {
type AirResolvedAddressChanged implements AirDomainEvent @entity {
id: ID!
resolver: AirResolver!
previousResolvedAddress: AirAccount # previous addr record
newResolvedAddress: AirAccount! # new addr record
previousResolvedAddress: AirAccount # previous resolved address record
newResolvedAddress: AirAccount! # new resolved address record
block: AirBlock!
transactionHash: String!
tokenId: String # dec(labelhash) - NA
Expand Down
Loading