Class ThirdwebBridge
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
BigIntegerThe chain ID of the origin chain.
originTokenAddress
stringThe address of the token on the origin chain.
destinationChainId
BigIntegerThe chain ID of the destination chain.
destinationTokenAddress
stringThe address of the token on the destination chain.
buyAmountWei
BigIntegerThe amount of tokens to buy in wei.
sender
stringThe address of the sender.
receiver
stringThe 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
BigIntegerThe chain ID of the origin chain.
originTokenAddress
stringThe address of the token on the origin chain.
destinationChainId
BigIntegerThe chain ID of the destination chain.
destinationTokenAddress
stringThe address of the token on the destination chain.
buyAmountWei
BigIntegerThe 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
ThirdwebClientThe 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
BigIntegerThe chain ID of the origin chain.
originTokenAddress
stringThe address of the token on the origin chain.
destinationChainId
BigIntegerThe chain ID of the destination chain.
destinationTokenAddress
stringThe address of the token on the destination chain.
sellAmountWei
BigIntegerThe amount of tokens to sell in wei.
sender
stringThe address of the sender.
receiver
stringThe 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
BigIntegerThe chain ID of the origin chain.
originTokenAddress
stringThe address of the token on the origin chain.
destinationChainId
BigIntegerThe chain ID of the destination chain.
destinationTokenAddress
stringThe address of the token on the destination chain.
sellAmountWei
BigIntegerThe 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
stringThe hash of the transaction.
chainId
BigIntegerThe 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
BigIntegerThe chain ID of the token.
tokenAddress
stringThe address of the token.
transferAmountWei
BigIntegerThe amount of tokens to transfer in wei.
sender
stringThe address of the sender.
receiver
stringThe address of the receiver.
Returns
- Task<TransferPrepareData>
A TransferPrepareData object representing the prepare data.
Exceptions
- ArgumentException
Thrown when one of the parameters is invalid.