Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add supply to collapsing cap #1495

Merged
merged 2 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
216 changes: 63 additions & 153 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"@types/lodash": "^4.17.14",
"@types/mime-types": "^2.1.4",
"@types/node": "^22.8.6",
"@typescript-eslint/eslint-plugin": "^8.12.2",
"@typescript-eslint/eslint-plugin": "^8.19.1",
"@typescript-eslint/parser": "^8.19.1",
"eslint": "^9.17.0",
"eslint-config-prettier": "^9.1.0",
Expand All @@ -79,4 +79,4 @@
"reflect-metadata": "^0.2.2",
"typeorm": "^0.3.11"
}
}
}
1 change: 1 addition & 0 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,7 @@ union TokenCap = TokenCapSingleMint | TokenCapSupply

type TokenCapSingleMint {
type: CapType!
supply: BigInt!
}

type TokenCapSupply {
Expand Down
1 change: 1 addition & 0 deletions src/mappings/multiTokens/events/token_created.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export function getCapType(cap: TokenCap) {

return new TokenCapSingleMint({
type: CapType.SingleMint,
supply: cap.__kind === 'CollapsingSupply' ? cap.value : 0n,
})
}

Expand Down
2 changes: 1 addition & 1 deletion src/mappings/multiTokens/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function isNonFungible(token: Token): boolean {
if (token.cap?.type === CapType.SingleMint) {
// If the token is set as SingleMint and only one was minted it is non-fungible
// If more than one was minted it is fungible.
return token.supply === 1n
return token.supply <= 1n
}

// All other cases we can't be sure if it is fungible or non-fungible.
Expand Down
Loading
Loading