How to use the @taquito/taquito.Tezos.setProvider function in @taquito/taquito

To help you get started, we’ve selected a few @taquito/taquito examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ecadlabs / taquito / example / contract-schema.ts View on Github external
async function example() {
    const provider = 'https://alphanet-node.tzscan.io';
    const signer: any = new InMemorySigner('edsk3xkqabYfWWpcEKTWk75cRQv2bgHA3EHuuHSFH3ejqzKPx69Zh9');
    Tezos.setProvider({ rpc: provider, signer });
    try {
        const contract = await Tezos.contract.at('KT1SawqvsVdAbDzqc4KwPpaS1S1veuFgF9AN');
        console.log("Printing contract methods...");
        console.log(contract.methods);
        console.log("Showing initial storage...");
        console.log(await contract.storage())
        const op = await contract.methods.mint("tz1QZ6KY7d3BuZDT1d19dUxoQrtFPN2QJ3hn", 100).send({ fee: 30000, gasLimit: 200000 })
        console.log('Awaiting confirmation...');
        await op.confirmation();
        console.log(op.hash, op.includedInBlock);
        console.log("Showing final storage...");
        console.log(await contract.storage())
    } catch (ex) {
        console.log(ex)
    }
}
github ecadlabs / taquito / example / example-activate.ts View on Github external
async function example() {
    const provider = 'https://alphanet-node.tzscan.io';
    Tezos.setProvider({ rpc: provider });
    try {
        const op = await Tezos.tz.activate("tz1ZfrERcALBwmAqwonRXYVQBDT9BjNjBHJu", "161d907951bf5594bedb1d70bb03c938d63c22be")
        console.log('Awaiting confirmation...');
        await op.confirmation();
        console.log(op.hash, op.includedInBlock);
    } catch (ex) {
        console.log(ex)
    }
}
github ecadlabs / taquito / example / contract-origination2.ts View on Github external
async function example() {
    Tezos.setProvider({ rpc: provider } as any)
    await Tezos.importKey("peqjckge.qkrrajzs@tezos.example.org", "y4BX7qS1UE", [
        "skate",
        "damp",
        "faculty",
        "morning",
        "bring",
        "ridge",
        "traffic",
        "initial",
        "piece",
        "annual",
        "give",
        "say",
        "wrestle",
        "rare",
        "ability"
github ecadlabs / taquito / example / contract-origination.ts View on Github external
async function example() {
    Tezos.setProvider({ rpc: provider } as any)
    await Tezos.importKey("peqjckge.qkrrajzs@tezos.example.org", "y4BX7qS1UE", [
        "skate",
        "damp",
        "faculty",
        "morning",
        "bring",
        "ridge",
        "traffic",
        "initial",
        "piece",
        "annual",
        "give",
        "say",
        "wrestle",
        "rare",
        "ability"