Added bridge swap

This commit is contained in:
Aleksandr Kraiz
2023-02-23 23:55:57 +04:00
parent a5e464c9ad
commit 07ef06648d
6 changed files with 383 additions and 9 deletions

View File

@@ -34,6 +34,7 @@ Orions SDK is free to use and does not require an API key or registration. Re
- [Get assets](#get-assets)
- [Get pairs](#get-pairs)
- [Get Orion Bridge history](#get-orion-bridge-history)
- [Bridge swap](#bridge-swap)
- [Withdraw](#withdraw)
- [Deposit](#deposit)
- [Get swap info](#get-swap-info)
@@ -149,6 +150,26 @@ const bridgeHistory = await orion.bridge.getHistory(
);
```
### Bridge swap
```ts
const orion = new Orion("production");
const wallet = new Wallet(privateKey);
orion.bridge.swap(
"ORN", // Asset name
0.12345678, // Amount
SupportedChainId.FANTOM_OPERA,
SupportedChainId.BSC,
wallet,
{
autoApprove: true,
logger: console.log,
withdrawToWallet: true, // Enable withdraw to wallet
}
);
```
### Withdraw
```ts