Table of Contents

Class ThirdwebBridge

Namespace
Thirdweb.Bridge
Assembly
Thirdweb.dll
public class ThirdwebBridge
Inheritance
ThirdwebBridge
Inherited Members
Extension Methods

Methods

Buy_Prepare(BigInteger, string, BigInteger, string, BigInteger, string, string)

Get the transactions required to buy a specific amount of tokens on any chain, alongside the quote.

public Task<BuyPrepareData> Buy_Prepare(BigInteger originChainId, string originTokenAddress, BigInteger destinationChainId, string destinationTokenAddress, BigInteger buyAmountWei, string sender, string receiver)

Parameters

originChainId BigInteger

The chain ID of the origin chain.

originTokenAddress string

The address of the token on the origin chain.

destinationChainId BigInteger

The chain ID of the destination chain.

destinationTokenAddress string

The address of the token on the destination chain.

buyAmountWei BigInteger

The amount of tokens to buy in wei.

sender string

The address of the sender.

receiver string

The address of the receiver.

Returns

Task<BuyPrepareData>

A BuyPrepareData object representing the prepare data.

Exceptions

ArgumentException

Thrown when one of the parameters is invalid.

Buy_Quote(BigInteger, string, BigInteger, string, BigInteger)

Get a quote for buying a specific amount of tokens on any chain.

public Task<BuyQuoteData> Buy_Quote(BigInteger originChainId, string originTokenAddress, BigInteger destinationChainId, string destinationTokenAddress, BigInteger buyAmountWei)

Parameters

originChainId BigInteger

The chain ID of the origin chain.

originTokenAddress string

The address of the token on the origin chain.

destinationChainId BigInteger

The chain ID of the destination chain.

destinationTokenAddress string

The address of the token on the destination chain.

buyAmountWei BigInteger

The amount of tokens to buy in wei.

Returns

Task<BuyQuoteData>

A BuyQuoteData object representing the quote.

Exceptions

ArgumentException

Thrown when one of the parameters is invalid.

Create(ThirdwebClient)

Create a new instance of the ThirdwebBridge class.

public static Task<ThirdwebBridge> Create(ThirdwebClient client)

Parameters

client ThirdwebClient

The ThirdwebClient instance.

Returns

Task<ThirdwebBridge>

A new instance of ThirdwebBridge.

Sell_Prepare(BigInteger, string, BigInteger, string, BigInteger, string, string)

Get the transactions required to sell a specific amount of tokens on any chain, alongside the quote.

public Task<SellPrepareData> Sell_Prepare(BigInteger originChainId, string originTokenAddress, BigInteger destinationChainId, string destinationTokenAddress, BigInteger sellAmountWei, string sender, string receiver)

Parameters

originChainId BigInteger

The chain ID of the origin chain.

originTokenAddress string

The address of the token on the origin chain.

destinationChainId BigInteger

The chain ID of the destination chain.

destinationTokenAddress string

The address of the token on the destination chain.

sellAmountWei BigInteger

The amount of tokens to sell in wei.

sender string

The address of the sender.

receiver string

The address of the receiver.

Returns

Task<SellPrepareData>

A SellPrepareData object representing the prepare data.

Exceptions

ArgumentException

Thrown when one of the parameters is invalid.

Sell_Quote(BigInteger, string, BigInteger, string, BigInteger)

Get a quote for selling a specific amount of tokens on any chain.

public Task<SellQuoteData> Sell_Quote(BigInteger originChainId, string originTokenAddress, BigInteger destinationChainId, string destinationTokenAddress, BigInteger sellAmountWei)

Parameters

originChainId BigInteger

The chain ID of the origin chain.

originTokenAddress string

The address of the token on the origin chain.

destinationChainId BigInteger

The chain ID of the destination chain.

destinationTokenAddress string

The address of the token on the destination chain.

sellAmountWei BigInteger

The amount of tokens to sell in wei.

Returns

Task<SellQuoteData>

A SellQuoteData object representing the quote.

Exceptions

ArgumentException

Thrown when one of the parameters is invalid.

Status(string, BigInteger)

Get the status of any bridge-initiated transaction.

public Task<StatusData> Status(string transactionHash, BigInteger chainId)

Parameters

transactionHash string

The hash of the transaction.

chainId BigInteger

The chain ID of the transaction.

Returns

Task<StatusData>

A StatusData object representing the status.

Exceptions

ArgumentException

Thrown when one of the parameters is invalid.

Transfer_Prepare(BigInteger, string, BigInteger, string, string)

Get the transactions required to transfer a specific amount of tokens on any chain.

public Task<TransferPrepareData> Transfer_Prepare(BigInteger chainId, string tokenAddress, BigInteger transferAmountWei, string sender, string receiver)

Parameters

chainId BigInteger

The chain ID of the token.

tokenAddress string

The address of the token.

transferAmountWei BigInteger

The amount of tokens to transfer in wei.

sender string

The address of the sender.

receiver string

The address of the receiver.

Returns

Task<TransferPrepareData>

A TransferPrepareData object representing the prepare data.

Exceptions

ArgumentException

Thrown when one of the parameters is invalid.