How to use the @taquito/taquito.Tezos.contract 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-origination2.ts View on Github external
"bring",
        "ridge",
        "traffic",
        "initial",
        "piece",
        "annual",
        "give",
        "say",
        "wrestle",
        "rare",
        "ability"
    ].join(" "), "7d4c8c3796fdbf4869edb5703758f0e5831f5081")

    try {
        console.log('Deploying Ligo simple contract...')
        const op = await Tezos.contract.originate({
            balance: "1",
            code: ligoSample,
            init: { int: "0" },
            fee: 30000,
            storageLimit: 2000,
            gasLimit: 90000,
        })
        console.log('Awaiting confirmation...')
        const contract = await op.contract()
        console.log('Storage', await contract.storage())
        console.log("Operation hash:", op.hash, "Included in block level:", op.includedInBlock)
    } catch (ex) {
        console.error(ex)
    }
}
github ecadlabs / taquito / example / contract-origination.ts View on Github external
"bring",
        "ridge",
        "traffic",
        "initial",
        "piece",
        "annual",
        "give",
        "say",
        "wrestle",
        "rare",
        "ability"
    ].join(" "), "7d4c8c3796fdbf4869edb5703758f0e5831f5081")

    try {
        console.log('Deploying Hello world contract...')
        const op = await Tezos.contract.originate({
            balance: "0",
            code: `parameter string;
            storage string;
            code {CAR;
                  PUSH string "Hello ";
                  CONCAT;
                  NIL operation; PAIR};
            `,
            init: `"test1234"`
        })

        console.log('Awaiting confirmation...')
        const contract = await op.contract()
        console.log('Gas Used', op.consumedGas)
        console.log('Storage Paid', op.storageDiff)
        console.log('Storage Size', op.storageSize)
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)
    }
}