fixes
This commit is contained in:
parent
3b4e6c8fca
commit
a31ac25971
|
@ -65,7 +65,9 @@ export function handleNewToken(event: TokenCreated): void {
|
|||
export function handleNew721Template(event: Template721Added): void {
|
||||
const dbId = getErc721TemplateId(event.params._templateAddress)
|
||||
if (dbId === BigInt.zero()) {
|
||||
const template = new Erc721Template(event.params._templateAddress)
|
||||
const template = new Erc721Template(
|
||||
event.params._templateAddress.toHexString()
|
||||
)
|
||||
template.templateId = event.params.nftTemplateCount
|
||||
template.save()
|
||||
}
|
||||
|
@ -74,7 +76,9 @@ export function handleNew721Template(event: Template721Added): void {
|
|||
export function handleNew20Template(event: Template20Added): void {
|
||||
const dbId = getErc20TemplateId(event.params._templateAddress)
|
||||
if (dbId === BigInt.zero()) {
|
||||
const template = new Erc20Template(event.params._templateAddress)
|
||||
const template = new Erc20Template(
|
||||
event.params._templateAddress.toHexString()
|
||||
)
|
||||
template.templateId = event.params.nftTemplateCount
|
||||
template.save()
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@ export function getUSDValue(
|
|||
}
|
||||
|
||||
export function getErc721TemplateId(address: Address): BigInt {
|
||||
const template = Erc721Template.load(address)
|
||||
const template = Erc721Template.load(address.toHexString())
|
||||
if (template) {
|
||||
return template.templateId
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ export function getErc721TemplateId(address: Address): BigInt {
|
|||
}
|
||||
|
||||
export function getErc20TemplateId(address: Address): BigInt {
|
||||
const template = Erc20Template.load(address)
|
||||
const template = Erc20Template.load(address.toHexString())
|
||||
if (template) {
|
||||
return template.templateId
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue