Network code was added

This commit is contained in:
Mikhail Gladchenko
2023-08-30 09:37:08 +01:00
parent 7c1e582d40
commit 1de01439d1
2 changed files with 12 additions and 7 deletions

View File

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

View File

@@ -232,26 +232,31 @@ class BlockchainService {
);
getPlatformFees = (
{ assetIn, assetOut, walletAddress }: {
{ assetIn, assetOut, walletAddress, fromWidget }: {
assetIn?: string | undefined,
assetOut?: string | undefined,
walletAddress?: string | undefined
walletAddress?: string | undefined,
fromWidget?: string | undefined
}
) => {
const url = new URL(`${this.apiUrl}/api/platform-fees`);
if (assetIn) {
if (assetIn !== undefined) {
url.searchParams.append('assetIn', assetIn);
}
if (assetOut) {
if (assetOut !== undefined) {
url.searchParams.append('assetOut', assetOut);
}
if (walletAddress) {
if (walletAddress !== undefined) {
url.searchParams.append('walletAddress', walletAddress);
}
if (fromWidget !== undefined) {
url.searchParams.append('fromWidget', fromWidget);
}
return fetchWithValidation(
url.toString(),
z.record(z.string()).transform(makePartial),