@ref-finance/ref-sdk 1.1.5 → 1.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -120,10 +120,12 @@ Response
120
120
 
121
121
  Get tokens metadata and set token id as index.
122
122
 
123
+ Will fetch token matadata if the token not included in the allTokens.
124
+
123
125
  Parameters
124
126
 
125
127
  ```plain
126
- tokenIds: string[]
128
+ (tokenIds: string[], allTokens: Record<string, TokenMetadata>)
127
129
  ```
128
130
 
129
131
  Example
@@ -132,7 +134,7 @@ Example
132
134
  const tokensMetadata = await ftGetTokensMetadata([
133
135
  'ref.fakes.testnet',
134
136
  'wrap.testnet',
135
- ]);
137
+ ],{});
136
138
  ```
137
139
 
138
140
  Response
@@ -241,6 +243,75 @@ Response
241
243
  ]
242
244
  ```
243
245
 
246
+ ---
247
+
248
+ #### getPoolByIds
249
+
250
+ Input pool id array to get according pools detail
251
+
252
+ Parameters
253
+
254
+ ```
255
+ ids: number[]
256
+ ```
257
+
258
+ Example
259
+
260
+ ```
261
+ const pools = await getPoolByIds([1, 2, 20])
262
+ ```
263
+
264
+ Response
265
+
266
+ ```
267
+ [
268
+ {
269
+ "id": 1,
270
+ "tokenIds": [
271
+ "nusdt.ft-fin.testnet",
272
+ "nusdc.ft-fin.testnet"
273
+ ],
274
+ "supplies": {
275
+ "nusdt.ft-fin.testnet": "194177",
276
+ "nusdc.ft-fin.testnet": "54127"
277
+ },
278
+ "fee": 20,
279
+ "shareSupply": "1004672374319452764166320",
280
+ "pool_kind": "SIMPLE_POOL"
281
+ },
282
+ {
283
+ "id": 2,
284
+ "tokenIds": [
285
+ "wrap.testnet",
286
+ "rft.tokenfactory.testnet"
287
+ ],
288
+ "supplies": {
289
+ "wrap.testnet": "511569006838329327251856820",
290
+ "rft.tokenfactory.testnet": "860281941972"
291
+ },
292
+ "fee": 20,
293
+ "shareSupply": "935312501418615016412773941",
294
+ "pool_kind": "SIMPLE_POOL"
295
+ },
296
+ {
297
+ "id": 20,
298
+ "tokenIds": [
299
+ "usdc.fakes.testnet",
300
+ "nusdc.ft-fin.testnet"
301
+ ],
302
+ "supplies": {
303
+ "usdc.fakes.testnet": "129199395436",
304
+ "nusdc.ft-fin.testnet": "26747"
305
+ },
306
+ "fee": 20,
307
+ "shareSupply": "7084500646929369809446253",
308
+ "pool_kind": "SIMPLE_POOL"
309
+ }
310
+ ]
311
+ ```
312
+
313
+
314
+
244
315
  ---
245
316
 
246
317
  ### Swap
@@ -696,7 +767,7 @@ A QuickStart of Ref Swap component.
696
767
  ```plain
697
768
  export interface SwapWidgetProps {
698
769
  theme?: Theme;
699
- extraTokenList?: string[];
770
+ defaultTokenList?: string[];
700
771
  onSwap: (transactionsRef: Transaction[]) => void;
701
772
  onDisConnect: () => void;
702
773
  width: string;
@@ -720,7 +791,7 @@ export interface SwapWidgetProps {
720
791
  ```
721
792
 
722
793
  - theme: widget theme for customization.
723
- - extraTokenListintroduce extra tokens with ref whitelist into default token list in the widget.
794
+ - defaultTokenListdefault tokens with ref whitelist into token list in the widget.
724
795
  - onSwap: Swap button triggers this function.
725
796
  - width: width of widget component.
726
797
  - height: height of widget component.
package/dist/error.d.ts CHANGED
@@ -5,7 +5,7 @@ export declare const ZeroInputError: Error;
5
5
  export declare const NoPoolError: Error;
6
6
  export declare const NotLoginError: Error;
7
7
  export declare const SwapRouteError: Error;
8
- export declare const TokenNotExistError: Error;
8
+ export declare const TokenNotExistError: (id: string) => Error;
9
9
  export declare const NoPuiblicKeyError: Error;
10
10
  export declare const NoLocalSignerError: Error;
11
11
  export declare const InValidAccessKeyError: Error;