@xoxno/sdk-js 1.0.236 → 1.0.238

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
@@ -666,9 +666,6 @@ sdk.liquid.xoxno.stats(...); // XoxnoLiquidStatsDto
666
666
  // GET /liquid/egld/stats
667
667
  sdk.liquid.egld.stats(...); // XoxnoLiquidStatsDto
668
668
 
669
- // GET /liquid/sui/stats
670
- sdk.liquid.sui.stats(...); // XoxnoLiquidStatsDto
671
-
672
669
  // GET /liquid/egld/rate
673
670
  sdk.liquid.egld.rate(...); // RateType
674
671
 
@@ -19,7 +19,7 @@
19
19
  * | controller `migrate_from_blend` | `blend_pool.submit(caller, controller, controller, [withdraw / withdraw_collateral / repay])`, at most twice | `contracts/controller/src/external/blend.rs:46-97` |
20
20
  * | controller `borrow`, `withdraw`, `swap_debt`, `swap_collateral`, `repay_debt_with_collateral`, `flash_loan`, `flash_position`, any other | none | the controller funds these from its own custody (`strategies/legs.rs:50`, `strategies/flash_position.rs:285`) |
21
21
  * | governance, any | none | proposer auth only |
22
- * | router `execute_strategy` | `token_in.transfer(sender, router, <= total_in)` | `contracts/swap-aggregator/src/execute/mod.rs:81` |
22
+ * | router `execute_strategy` | `token_in.transfer(sender, router, <= total_in)`; `token_out.trust(sender)` at most once, when the sender has no trustline for a Stellar Asset Contract output (CAP-73) | `contracts/swap-aggregator/src/execute/mod.rs:81`, `:139` |
23
23
  */
24
24
  import { xdr } from '@stellar/stellar-sdk';
25
25
  import { type StellarNetwork } from './contracts.js';
@@ -305,10 +305,6 @@ export declare const endpoints: {
305
305
  readonly input: {};
306
306
  readonly output: XoxnoLiquidStatsDto;
307
307
  };
308
- readonly "/liquid/sui/stats": {
309
- readonly input: {};
310
- readonly output: XoxnoLiquidStatsDto;
311
- };
312
308
  readonly "/analytics/marketplace-unique-users": {
313
309
  readonly input: {
314
310
  before: string;
@@ -32,7 +32,7 @@ function _define_property(obj, key, value) {
32
32
  * | controller `migrate_from_blend` | `blend_pool.submit(caller, controller, controller, [withdraw / withdraw_collateral / repay])`, at most twice | `contracts/controller/src/external/blend.rs:46-97` |
33
33
  * | controller `borrow`, `withdraw`, `swap_debt`, `swap_collateral`, `repay_debt_with_collateral`, `flash_loan`, `flash_position`, any other | none | the controller funds these from its own custody (`strategies/legs.rs:50`, `strategies/flash_position.rs:285`) |
34
34
  * | governance, any | none | proposer auth only |
35
- * | router `execute_strategy` | `token_in.transfer(sender, router, <= total_in)` | `contracts/swap-aggregator/src/execute/mod.rs:81` |
35
+ * | router `execute_strategy` | `token_in.transfer(sender, router, <= total_in)`; `token_out.trust(sender)` at most once, when the sender has no trustline for a Stellar Asset Contract output (CAP-73) | `contracts/swap-aggregator/src/execute/mod.rs:81`, `:139` |
36
36
  */ import { Address, scValToBigInt, StrKey, xdr } from "@stellar/stellar-sdk";
37
37
  import { getStellarDeployment } from "./contracts.js";
38
38
  import { decodeStellarRouteBytes } from "./route-verify.js";
@@ -222,6 +222,15 @@ const blendSubmitAllowance = (blendPool, caller, controller)=>({
222
222
  maxAmount: totalIn
223
223
  }
224
224
  ];
225
+ // `ensure_trustline` opens the sender's missing trustline for the output token before the payout.
226
+ policy.calls = [
227
+ {
228
+ contract: route.tokenOut,
229
+ fn: 'trust',
230
+ maxCount: 1,
231
+ reject: (trustArgs)=>trustArgs.length === 1 && addressOf(trustArgs[0]) === caller ? undefined : '`trust` is not for the caller'
232
+ }
233
+ ];
225
234
  return policy;
226
235
  }
227
236
  if (contract !== deployment.lendingController) {
@@ -281,10 +281,6 @@ export const endpoints = {
281
281
  "input": {},
282
282
  "output": {}
283
283
  },
284
- "/liquid/sui/stats": {
285
- "input": {},
286
- "output": {}
287
- },
288
284
  "/analytics/marketplace-unique-users": {
289
285
  "input": {},
290
286
  "output": {}
@@ -1,14 +1,12 @@
1
1
  export const isValidCollectionTicker = (ticker)=>{
2
- const isSuiCollection = /* (ticker.length >= 4 && ticker.length <= 40) || */ /^0x[a-fA-F0-9]{1,64}-[a-zA-Z0-9_]+-[a-zA-Z0-9_]+(<.+>)?$/.test(decodeURIComponent(ticker));
3
2
  const isXoxnoCollection = /^[A-Z0-9]{3,10}-[a-z0-9]{6}$/.test(ticker);
4
3
  // Stellar: the collection IS the NFT contract (Soroban contract strkey)
5
4
  const isStellarCollection = /^C[A-Z2-7]{55}$/.test(ticker);
6
- return isSuiCollection || isXoxnoCollection || isStellarCollection;
5
+ return isXoxnoCollection || isStellarCollection;
7
6
  };
8
7
  export const isValidNftIdentifier = (identifier)=>{
9
- const isSuiNft = /^0x[a-fA-F0-9]{1,64}$/.test(identifier);
10
8
  const isXoxnoNft = /^[A-Za-z0-9]{3,10}-[A-Za-z0-9]{6}-[A-Za-z0-9]{2,7}(?:-\d+(?:-[A-Za-z0-9]+)?)?$/.test(identifier);
11
9
  // Stellar: `{contract strkey}-{decimal token id}`
12
10
  const isStellarNft = /^C[A-Z2-7]{55}-\d+$/.test(identifier);
13
- return isSuiNft || isXoxnoNft || isStellarNft;
11
+ return isXoxnoNft || isStellarNft;
14
12
  };