Skip to main content

teleport-sdk.teleportbridge

Home > teleport-sdk > TeleportBridge

TeleportBridge class

Main Teleport Bridge implementation

Signature:
export declare class TeleportBridge 

Remarks

This is the enrypoint for all Teleport operations

Constructors

ConstructorModifiersDescription
(constructor)({ srcDomain, dstDomain, srcDomainProvider, dstDomainProvider, settings })Constructs a new instance of the TeleportBridge class

Properties

PropertyModifiersTypeDescription
dstDomainDomainId
dstDomainProviderProvider
settingsAllBridgeSettings
srcDomainDomainId
srcDomainProviderProvider

Methods

MethodModifiersDescription
approveSrcGateway(sender, amount, overrides)Approve the source domain's Gateway contract to spend tokens.
canMintWithoutOracle(txHash)Check if a teleport action can be completed without oracle attestations
getAmounts(withdrawn, isHighPriority, relayAddress)Calculate received token amounts on the target domain and fees to be paid both to the bridge and the relayer
getAmountsForTeleportGUID(teleportGUID, isHighPriority, relayParams, relayAddress)
getAttestations(txHash, onNewSignatureReceived, timeoutMs, pollingIntervalMs, teleportGUID)Collect oracle attestations for a given transaciton
getDstBalance(userAddress)Get the user's token balance on the Destination Domain
getRelayFee(isHighPriority, relayParams, relayAddress)Get the relayer fee for a certain transaction
getSrcBalance(userAddress)Get the user's token balance on the Source Domain
getSrcGatewayAllowance(userAddress)Get the user's token allowance set to the Source Domain's Gateway contract
getTeleportGuidFromTxHash(txHash)
initRelayedTeleport(receiverAddress, amount, sender, relayAddress, overrides)Helper for initiating a relayed teleportation.
initTeleport(receiverAddress, amount, operatorAddress, sender, overrides)Initiate manual token teleportation
mintWithOracles(teleportGUID, signatures, maxFeePercentage, operatorFee, sender, overrides)Mint tokens using oracle attestations on the target domain
mintWithoutOracles(sender, txHash, overrides)Mint tokens on the target domain without collecting oracle attestations
relayMintWithOracles(receiver, teleportGUID, signatures, relayFee, maxFeePercentage, expiry, to, data, relayAddress, pollingIntervalMs, timeoutMs, onPayloadSigned, onRelayTaskCreated)Relay a mint transaction on the target domain using oracle attestations
requestFaucetDai(sender, overrides)Request some tokens from the registered faucet for the source domain
requestRelay(receiver, teleportGUID, signatures, relayFee, maxFeePercentage, expiry, to, data, relayAddress, onPayloadSigned)Request a transaction relay from a relayer
signRelay(receiver, teleportGUID, relayFee, maxFeePercentage, expiry)
waitForMint(teleportGUIDorGUIDHash, pollingIntervalMs, timeoutMs)
waitForRelayTask(taskId, pollingIntervalMs, timeoutMs)Wait for a relayed transaction to go through