getStableCoins

This commit is contained in:
Kirill Litvinov
2024-04-08 15:33:45 +03:00
parent 5e19224114
commit 515888a268
3 changed files with 14 additions and 3 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@orionprotocol/sdk",
"version": "0.20.81",
"version": "0.20.82",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@orionprotocol/sdk",
"version": "0.20.81",
"version": "0.20.82",
"hasInstallScript": true,
"license": "ISC",
"dependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "@orionprotocol/sdk",
"version": "0.20.81",
"version": "0.20.82-rc1",
"description": "Orion Protocol SDK",
"main": "./lib/index.cjs",
"module": "./lib/index.js",

View File

@@ -61,6 +61,7 @@ class Aggregator {
this.getPairsList = this.getPairsList.bind(this);
this.getSwapInfo = this.getSwapInfo.bind(this);
this.getTradeProfits = this.getTradeProfits.bind(this);
this.getStableCoins = this.getStableCoins.bind(this);
this.placeAtomicSwap = this.placeAtomicSwap.bind(this);
this.placeOrder = this.placeOrder.bind(this);
this.cancelOrder = this.cancelOrder.bind(this);
@@ -340,6 +341,16 @@ class Aggregator {
);
};
getStableCoins = () => {
const url = new URL(`${this.apiUrl}/api/v1/tokens/stable/`);
return fetchWithValidation(
url.toString(),
z.array(z.string()),
{ headers: this.basicAuthHeaders },
errorSchema,
);
};
/**
* Placing atomic swap. Placement must take place on the target chain.
* @param secretHash Secret hash