mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-14 06:02:36 +03:00
Added bridge swap
This commit is contained in:
21
README.md
21
README.md
@@ -34,6 +34,7 @@ Orion’s 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
|
||||
|
||||
Reference in New Issue
Block a user