Bridger: Raw<{
    chainType: ChainTypes;
    chains: Computed<BridgeChain[]>;
    isInitialized: Ref<boolean>;
    provider: IProvider;
    approve(token, operator) => Promise<void | TransactionResponse>;
    approveIfNeeded(token, operator, amount?) => Promise<void | TransactionResponse>;
    getChainById(id) => void | BridgeChain;
    getDestinationTx(sourceChain, sourceTxHash) => Promise<DestinationTransaction>;
    getSupportedChains(kind?) => Promise<BridgeChain[]>;
    init() => Promise<void>;
    isApproveRequired(token, operator, amount?) => Promise<boolean>;
}>

Type declaration

  • chainType: ChainTypes
  • chains: Computed<BridgeChain[]>
  • isInitialized: Ref<boolean>
  • provider: IProvider
  • approve:function
    • Sets allowance for the provided operator address to spend the token

      Parameters

      • token: Token
      • operator: string

      Returns Promise<void | TransactionResponse>

      A Transaction Response or undefined if input token is native

  • approveIfNeeded:function
    • Sets allowance for the provided operator address to spend the token if allowance amount is less than provided one

      Parameters

      • token: Token
      • operator: string
      • Optional amount: Amount

      Returns Promise<void | TransactionResponse>

      A Transaction Response or undefined if input token is native or allowance is enough

  • getChainById:function
  • getDestinationTx:function
    • Get the destination chain transaction hash as the result of the bridging

      Parameters

      Returns Promise<DestinationTransaction>

      Destination transaction hash and transaction status

  • getSupportedChains:function
  • init:function
  • isApproveRequired:function
    • Checks if the allowance is less than the provided amount or doesn't exist

      Parameters

      • token: Token
      • operator: string
      • Optional amount: Amount

      Returns Promise<boolean>

      true if the allowance is less than the provided amount or doesn't exist

Generated using TypeDoc