@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 +0 -3
- package/dist/cjs/sdk/stellar/auth-policy.d.ts +1 -1
- package/dist/cjs/sdk/swagger.d.ts +0 -4
- package/dist/esm/sdk/stellar/auth-policy.js +10 -1
- package/dist/esm/sdk/swagger.js +0 -4
- package/dist/esm/utils/regex.js +2 -4
- package/dist/index.cjs +1 -1
- package/dist/sdk/stellar/auth-policy.d.ts +1 -1
- package/dist/sdk/stellar/index.cjs +1 -1
- package/dist/sdk/stellar/index.esm.js +1 -1
- package/dist/sdk/swagger.d.ts +0 -4
- package/package.json +2 -2
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) {
|
package/dist/esm/sdk/swagger.js
CHANGED
package/dist/esm/utils/regex.js
CHANGED
|
@@ -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
|
|
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
|
|
11
|
+
return isXoxnoNft || isStellarNft;
|
|
14
12
|
};
|