This package provides the latest typescript Substrate SDK for building products using Sygma Protocol.
yarn add @buildwithsygma/substrate
or
npm install @buildwithsygma/substrate
Bridge configuration and list of supported networks for each environment can be found at: Sygma bridge shared configuration github
import { createSubstrateFungibleAssetTransfer } from '@buildwithsygma/substrate';
import { Environment } from '@buildwithsygma/core';
...
const transferParams = {
sourceDomain: 5231,
destinationDomain: 11155111,
sourceNetworkProvider: apiPromise,
resource: '0x0000000000000000000000000000000000000000000000000000000000001100',
amount: BigInt('5000000'),
destinationAddress: recipientAddress,
environment: Environment.TESTNET
};
...
const transfer = await createSubstrateFungibleAssetTransfer(transferParams);
const transferTx = await transfer.getTransferTransaction();
The SDK monorepo contains the following examples demonstrating the usage of Substrate Package: