Skip to main content

Transfer

class Transfer<TInput extends Currency>
constructor(    direction: Direction,    amount: CurrencyAmount<TInput>,    destinationAddress: string,    transferDelay: number  )

The Transfer entity represents a helper entity contaning all the necessary data for performing a cross-layer transfer

Example#

import { Currency, CurrencyAmount, Direction, Vault, Token } from '@composable-finance/v1-sdk-typescript'
const USDC = new Token(...);const directionObj = new Direction(...);const amount =  CurrencyAmount.fromRawAmount(USDC, '30');const destinationAddress = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";const transferDelay = 100;
const transfer = new Transfer(directionObj, amount, destinationAddress, transferDelay);

Properties#

direction

readonly direction: Direction

direction is an entity used for representing the source and the destination layers

amount

readonly amount: CurrencyAmount<TInput>

amount represents the amount used in the transfer action

destinationAddress

readonly destinationAddress: string

destinationAddress represents the receiving wallet on the destination chain

transferDelay

readonly transferDelay: number

transferDelay represents the current transfer wait time. After transferDelay (in seconds), transfer is considered as invalid and funds are returned to the source address