Skip to content

Instantly share code, notes, and snippets.

@AlexBHarley
Created November 2, 2021 19:51
Show Gist options
  • Save AlexBHarley/6ffc07e15847dfd017099b90748fc048 to your computer and use it in GitHub Desktop.
Save AlexBHarley/6ffc07e15847dfd017099b90748fc048 to your computer and use it in GitHub Desktop.
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