diff --git a/src/formulas/formulas/contract/voting/daoVotingCw721Staked.ts b/src/formulas/formulas/contract/voting/daoVotingCw721Staked.ts index 2533599..cc14a8e 100644 --- a/src/formulas/formulas/contract/voting/daoVotingCw721Staked.ts +++ b/src/formulas/formulas/contract/voting/daoVotingCw721Staked.ts @@ -40,6 +40,7 @@ export const dao = makeSimpleContractFormula({ type NftClaim = { token_id: string release_at: Expiration + legacy: boolean } export const nftClaims: ContractFormula = { @@ -66,8 +67,16 @@ export const nftClaims: ContractFormula = { throw new Error('missing `address`') } - const legacyClaims = - (await get(contractAddress, 'nft_claims', address)) ?? [] + const legacyClaims = ( + (await get[]>( + contractAddress, + 'nft_claims', + address + )) ?? [] + ).map((claim) => ({ + ...claim, + legacy: true, + })) const claims = Object.entries( (await getTransformationMap( @@ -78,6 +87,7 @@ export const nftClaims: ContractFormula = { ([token_id, release_at]): NftClaim => ({ token_id, release_at, + legacy: false, }) ) diff --git a/src/formulas/formulas/contract/voting/daoVotingOnftStaked.ts b/src/formulas/formulas/contract/voting/daoVotingOnftStaked.ts index f50c5fb..303ac4e 100644 --- a/src/formulas/formulas/contract/voting/daoVotingOnftStaked.ts +++ b/src/formulas/formulas/contract/voting/daoVotingOnftStaked.ts @@ -50,6 +50,7 @@ export const dao = makeSimpleContractFormula({ type NftClaim = { token_id: string release_at: Expiration + legacy: boolean } export const nftClaims: ContractFormula = { @@ -76,8 +77,16 @@ export const nftClaims: ContractFormula = { throw new Error('missing `address`') } - const legacyClaims = - (await get(contractAddress, 'nft_claims', address)) ?? [] + const legacyClaims = ( + (await get[]>( + contractAddress, + 'nft_claims', + address + )) ?? [] + ).map((claim) => ({ + ...claim, + legacy: true, + })) const claims = Object.entries( (await getTransformationMap( @@ -88,6 +97,7 @@ export const nftClaims: ContractFormula = { ([token_id, release_at]): NftClaim => ({ token_id, release_at, + legacy: false, }) )