Class ThirdwebBridge
public class ThirdwebBridge
- Inheritance
-
ThirdwebBridge
- Inherited Members
- Extension Methods
Methods
Buy_Prepare(BigInteger, string, BigInteger, string, BigInteger, string, string, int, object)
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, int maxSteps = 3, object purchaseData = null)
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.
maxSteps
intThe maximum number of steps in the returned route.
purchaseData
objectArbitrary purchase data to be included with the payment and returned with all webhooks and status checks.
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, int)
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, int maxSteps = 3)
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.
maxSteps
intThe maximum number of steps in the returned route.
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.
Onramp_Prepare(OnrampProvider, BigInteger, string, string, string, string, BigInteger?, string, int?, List<BigInteger>, object)
public Task<OnrampPrepareData> Onramp_Prepare(OnrampProvider onramp, BigInteger chainId, string tokenAddress, string amount, string receiver, string onrampTokenAddress = null, BigInteger? onrampChainId = null, string currency = "USD", int? maxSteps = 3, List<BigInteger> excludeChainIds = null, object purchaseData = null)
Parameters
onramp
OnrampProviderchainId
BigIntegertokenAddress
stringamount
stringreceiver
stringonrampTokenAddress
stringonrampChainId
BigInteger?currency
stringmaxSteps
int?excludeChainIds
List<BigInteger>purchaseData
object
Returns
Onramp_Status(string)
public Task<OnrampStatusData> Onramp_Status(string id)
Parameters
id
string
Returns
Sell_Prepare(BigInteger, string, BigInteger, string, BigInteger, string, string, int, object)
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, int maxSteps = 3, object purchaseData = null)
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.
maxSteps
intThe maximum number of steps in the returned route.
purchaseData
objectArbitrary purchase data to be included with the payment and returned with all webhooks and status checks.
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, int)
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, int maxSteps = 3)
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.
maxSteps
intThe maximum number of steps in the returned route.
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, string, object)
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, string feePayer = "sender", object purchaseData = null)
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.
feePayer
stringThe fee payer (default is "sender").
purchaseData
objectArbitrary purchase data to be included with the payment and returned with all webhooks and status checks.
Returns
- Task<TransferPrepareData>
A TransferPrepareData object representing the prepare data.
Exceptions
- ArgumentException
Thrown when one of the parameters is invalid.