Created
November 2, 2021 19:51
-
-
Save AlexBHarley/6ffc07e15847dfd017099b90748fc048 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 { InMemorySigner } from '@taquito/signer'; | |
import { TezosToolkit } from '@taquito/taquito'; | |
async function main() { | |
const tezos = new TezosToolkit('https://mainnet.api.tez.ie'); | |
tezos.setProvider({ | |
signer: InMemorySigner.fromFundraiser( | |
'hello', | |
'there', | |
[ | |
'cart', | |
'will', | |
'page', | |
'bench', | |
'notice', | |
'leisure', | |
'penalty', | |
'medal', | |
'define', | |
'odor', | |
'ride', | |
'devote', | |
'cannon', | |
'setup', | |
'rescue', | |
].join(' ') | |
), | |
}); | |
const contract = await tezos.contract.at( | |
'KT1LN4LPSqTMS7Sd2CJw4bbDGRkMv2t68Fy9' | |
); | |
try { | |
const result = await contract.views | |
.getBalance('tz1QGZ1paPTpQpAK2B3sLr9cVkyRVrnxAaJt') | |
.read(); | |
console.log(result); | |
} catch (e) { | |
console.log(e); | |
} | |
} | |
main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment