0.1.2 • Published 1 year ago

@sifchain/evm v0.1.2

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
1 year ago

@sifchain/evm

Installation

yarn add @sifchain/evm@snapshot

Example usage

import { getTestnetSdk } from "@sifchain/evm";
import { ethers } from "ethers";

const testnetProvider = ethers.getDefaultProvider("testnet");
const defaultSigner = ethers.Wallet.createRandom().connect(testnetProvider);

const sdk = getTestnetSdk(defaultSigner);

const lockTransaction = await sdk.peggy.bridgeBank.lock(
  "cosmos_recipient_address",
  "erc20_token_address",
  1_000_000,
);

await lockTransaction.wait();

const burnTransaction = await sdk.peggy.bridgeBank.burn(
  "cosmos_recipient_address",
  "erc20_token_address",
  1_000_000,
);

await burnTransaction.wait();

// convenience method for sending tokens to Cosmos
const burnOrLockTransaction = await sdk.peggy.sendTokensToCosmos(
  "cosmos_recipient_address",
  "erc20_token_address",
  ethers.utils.parseEther("1.0"),
);

await burnOrLockTransaction.wait();
0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago