mirror of
https://github.com/oceanprotocol/ocean-subgraph.git
synced 2024-12-02 05:57:29 +01:00
Add lockedAmount to veDelegation
This commit is contained in:
parent
e30047c430
commit
9b41d025e8
@ -468,6 +468,7 @@ type VeDelegation @entity {
|
|||||||
receiver: VeOCEAN!
|
receiver: VeOCEAN!
|
||||||
tokenId: BigInt!
|
tokenId: BigInt!
|
||||||
amount: BigDecimal!
|
amount: BigDecimal!
|
||||||
|
lockedAmount BigDecimal!
|
||||||
cancelTime: BigInt!
|
cancelTime: BigInt!
|
||||||
expireTime: BigInt!
|
expireTime: BigInt!
|
||||||
updates: [VeDelegationUpdate!] @derivedFrom(field: "veDelegation")
|
updates: [VeDelegationUpdate!] @derivedFrom(field: "veDelegation")
|
||||||
@ -609,4 +610,3 @@ type NftTransferHistory @entity {
|
|||||||
timestamp: Int!
|
timestamp: Int!
|
||||||
block: Int!
|
block: Int!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ export function handleDelegation(event: DelegateBoost): void {
|
|||||||
const _expireTime = event.params._expire_time
|
const _expireTime = event.params._expire_time
|
||||||
// create veOcean if does not exists
|
// create veOcean if does not exists
|
||||||
getveOCEAN(_receiver)
|
getveOCEAN(_receiver)
|
||||||
getveOCEAN(_delegator)
|
const delegator = getveOCEAN(_delegator)
|
||||||
|
|
||||||
const veDelegation = getveDelegation(event.address, _tokenId.toHex())
|
const veDelegation = getveDelegation(event.address, _tokenId.toHex())
|
||||||
veDelegation.delegator = _delegator
|
veDelegation.delegator = _delegator
|
||||||
@ -28,9 +28,11 @@ export function handleDelegation(event: DelegateBoost): void {
|
|||||||
_amount.toBigDecimal(),
|
_amount.toBigDecimal(),
|
||||||
BigInt.fromI32(18).toI32()
|
BigInt.fromI32(18).toI32()
|
||||||
)
|
)
|
||||||
|
veDelegation.lockedAmount = delegator.lockedAmount
|
||||||
veDelegation.cancelTime = _cancelTime
|
veDelegation.cancelTime = _cancelTime
|
||||||
veDelegation.expireTime = _expireTime
|
veDelegation.expireTime = _expireTime
|
||||||
veDelegation.save()
|
veDelegation.
|
||||||
|
veDelegation.save()
|
||||||
|
|
||||||
const veDelegationUpdate = new VeDelegationUpdate(
|
const veDelegationUpdate = new VeDelegationUpdate(
|
||||||
event.transaction.hash.toHex() + '-' + event.logIndex.toString()
|
event.transaction.hash.toHex() + '-' + event.logIndex.toString()
|
||||||
|
Loading…
Reference in New Issue
Block a user