Created
May 23, 2023 03:03
-
-
Save xiaojay/12659c6b91f306e8c76dc543e95b2d6d to your computer and use it in GitHub Desktop.
gist used to get stamp contract from arweave gateway
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {WarpFactory, defaultCacheOptions,} from 'warp-contracts'; | |
const contractId = 'TlqASNDLA1Uh8yFiH-BzR_1FDag4s735F3PoUFEv2Mo'; | |
const warp = WarpFactory.forMainnet(defaultCacheOptions, true) | |
const stamp = warp.contract(contractId).setEvaluationOptions({ | |
allowBigInt: true, | |
unsafeClient: "skip" | |
}); | |
async function getState() { | |
try { | |
const { sortKey, cachedValue } = await stamp.readState(); | |
console.log(sortKey, cachedValue.errorMessages, cachedValue.state, cachedValue.validity) | |
} catch (error) { | |
console.log('readState error:', error, 'contractId:', contractId); | |
} | |
} | |
getState() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment