@xoxno/sdk-js 1.0.233 → 1.0.235
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/dist/cjs/sdk/stellar/lending-api-types.d.ts +20 -0
- package/dist/cjs/sdk/stellar/read/schemas.d.ts +37 -1
- package/dist/cjs/sdk/stellar/read/types.d.ts +9 -0
- package/dist/esm/sdk/stellar/read/schemas.js +19 -5
- package/dist/index.cjs +1 -1
- package/dist/sdk/stellar/index.cjs +1 -1
- package/dist/sdk/stellar/index.esm.js +1 -1
- package/dist/sdk/stellar/lending-api-types.d.ts +20 -0
- package/dist/sdk/stellar/read/index.cjs +1 -1
- package/dist/sdk/stellar/read/index.esm.js +1 -1
- package/dist/sdk/stellar/read/schemas.d.ts +37 -1
- package/dist/sdk/stellar/read/types.d.ts +9 -0
- package/package.json +2 -2
|
@@ -29,6 +29,8 @@ export type StellarAssetListItemDto = {
|
|
|
29
29
|
"marketCount": number;
|
|
30
30
|
/** The two underlying token SACs when this asset is an AMM LP share, so clients can render the pair instead of the share itself, which has no logo. Present only when both oracle legs are Token price keys — a Ref leg is registry-only and has no SAC — so "present" means "renderable pair", with no partial case to handle. */
|
|
31
31
|
"lpUnderlying"?: StellarDomain.StellarLpUnderlying;
|
|
32
|
+
/** Estimated underlying annualized yield, separate from base lending APY. Fractions: 0.05 = 5%. */
|
|
33
|
+
"extraApy"?: (MarketExtraApy);
|
|
32
34
|
};
|
|
33
35
|
export type StellarLendingContextDto = {
|
|
34
36
|
"assets": Array<StellarAssetListItemDto>;
|
|
@@ -128,6 +130,8 @@ export type StellarReserveListItemDto = {
|
|
|
128
130
|
"useAsCollateral": boolean;
|
|
129
131
|
/** Interest-rate-model curve (ray-scaled) for APY simulation in supply/borrow modals. */
|
|
130
132
|
"irm"?: (ReserveIrmCurveDto);
|
|
133
|
+
/** Estimated underlying annualized yield, separate from base lending APY. Fractions: 0.05 = 5%. */
|
|
134
|
+
"extraApy"?: (MarketExtraApy);
|
|
131
135
|
};
|
|
132
136
|
export type ReserveDto = {
|
|
133
137
|
"spokeId": number;
|
|
@@ -200,6 +204,8 @@ export type ReserveDto = {
|
|
|
200
204
|
"supportedCollateral": Array<string>;
|
|
201
205
|
/** Assets borrowable in this spoke (token addresses). */
|
|
202
206
|
"borrowable": Array<string>;
|
|
207
|
+
/** Estimated underlying annualized yield, separate from base lending APY. Fractions: 0.05 = 5%. */
|
|
208
|
+
"extraApy"?: (MarketExtraApy);
|
|
203
209
|
};
|
|
204
210
|
export type TopHoldersDto = {
|
|
205
211
|
"spokeId"?: number;
|
|
@@ -241,6 +247,8 @@ export type AssetDto = {
|
|
|
241
247
|
"maxBorrowApy": number;
|
|
242
248
|
/** Current indexed oracle configuration; null until first configure. */
|
|
243
249
|
"oracleProvider": ((AssetOracleConfigDto)) | null;
|
|
250
|
+
/** Estimated underlying annualized yield, separate from base lending APY. Fractions: 0.05 = 5%. */
|
|
251
|
+
"extraApy"?: (MarketExtraApy);
|
|
244
252
|
};
|
|
245
253
|
export type AssetPageDto = {
|
|
246
254
|
"asset": string;
|
|
@@ -327,6 +335,8 @@ export type AssetMarketDto = {
|
|
|
327
335
|
"liveSupplyIndexRay": string;
|
|
328
336
|
/** Live borrow index applied (ray, 1e27). */
|
|
329
337
|
"liveBorrowIndexRay": string;
|
|
338
|
+
/** Estimated underlying annualized yield, separate from base lending APY. Fractions: 0.05 = 5%. */
|
|
339
|
+
"extraApy"?: (MarketExtraApy);
|
|
330
340
|
};
|
|
331
341
|
export type HubDto = {
|
|
332
342
|
"hubId": number;
|
|
@@ -512,6 +522,12 @@ export type StellarActivityPageDto = {
|
|
|
512
522
|
"hasMoreResults": boolean;
|
|
513
523
|
"continuationToken"?: string;
|
|
514
524
|
};
|
|
525
|
+
export type MarketExtraApy = {
|
|
526
|
+
/** Native APY for derivatives tokes */
|
|
527
|
+
"nativeApy"?: number;
|
|
528
|
+
/** LP fees APR */
|
|
529
|
+
"feesApr"?: number;
|
|
530
|
+
};
|
|
515
531
|
export type StellarMarketIndexByHub = {
|
|
516
532
|
"hubId": number;
|
|
517
533
|
"asset": string;
|
|
@@ -603,6 +619,8 @@ export type HubAssetDto = {
|
|
|
603
619
|
"liveSupplyIndexRay": string;
|
|
604
620
|
/** Live borrow index applied (ray, 1e27). */
|
|
605
621
|
"liveBorrowIndexRay": string;
|
|
622
|
+
/** Estimated underlying annualized yield, separate from base lending APY. Fractions: 0.05 = 5%. */
|
|
623
|
+
"extraApy"?: (MarketExtraApy);
|
|
606
624
|
};
|
|
607
625
|
export type SpokeConnectedHubDto = {
|
|
608
626
|
"hubId": number;
|
|
@@ -651,6 +669,8 @@ export type SpokeMarketDto = {
|
|
|
651
669
|
"liveSupplyIndexRay": string;
|
|
652
670
|
/** Live borrow index applied (ray, 1e27). */
|
|
653
671
|
"liveBorrowIndexRay": string;
|
|
672
|
+
/** Estimated underlying annualized yield, separate from base lending APY. Fractions: 0.05 = 5%. */
|
|
673
|
+
"extraApy"?: (MarketExtraApy);
|
|
654
674
|
};
|
|
655
675
|
export type AccountPositionDto = {
|
|
656
676
|
"accountId": string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{createStellarLendingReadClient:()=>
|
|
1
|
+
(()=>{"use strict";var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{createStellarLendingReadClient:()=>g,lendingAssetsSchema:()=>f,lendingPositionsSchema:()=>y});const r={type:"string"},n={type:"number"},a={type:"boolean"},o={...r,nullable:!0},i={...n,nullable:!0},s={...r,enum:["mainnet","testnet"]},l={...r,enum:["ready","stale","incomplete"]};function p(e,t=[]){return{type:"object",required:Object.keys(e).filter((e=>!t.includes(e))),properties:e}}const d={sac:r,symbol:r,name:r,decimals:i,logoUrl:o},c=p({valid:a,stale:a,deviation:a,timestamp:i}),u={type:"object",properties:{nativeApy:n,feesApr:n},description:"Embedded annualized yield fractions, separate from base lending interest."},m=p({extraApy:u,...d,hubId:n,hubName:r,amountRaw:{...o,description:"Integer token base units, never scaled shares."},amount:o,apy:{...i,description:"Fraction: 0.05 means 5%."},priceUsd:i,valueUsd:i,priceStatus:c,indexRay:o,indexedAt:n,indexedLedger:n},["extraApy"]),w=p({amountRaw:o,amount:o,usd:i}),h=p({spokeId:n,spokeName:r,ltvBps:n,supplyCapacity:w,borrowCapacity:w,canSupply:a,canBeCollateral:a,canBorrow:a,canOpenAccount:{...a,description:"Spoke admits new accounts; other entry gates still apply."}}),y={type:"array",items:p({accountId:r,nftContract:r,nftImage:{...r,format:"uri",description:"Dynamic position SVG served by the network's XOXNO API."},network:s,spokeId:i,spokeName:o,supplied:{type:"array",items:m},borrow:{type:"array",items:m},hasDebt:{...a,nullable:!0,description:"Null when account rows are unavailable."},healthFactor:{...i,description:"Null without debt or when risk inputs are unavailable."},borrowLimitUsd:i,availableBorrowUsd:{...i,description:"Account headroom, before per-market constraints."},netApy:{...i,description:"Net annual yield divided by positive net equity; fraction."},dataStatus:l})},f={type:"array",items:p({extraApy:u,...d,hubId:n,hubName:r,network:s,supplyApy:{...i,description:"Fraction: 0.05 means 5%."},borrowApy:{...i,description:"Fraction: 0.05 means 5%."},priceUsd:i,priceStatus:c,spokes:{type:"array",items:h},dataStatus:l,indexedAt:{...n,description:"Pool state timestamp. Capacities are indexed snapshot estimates; prepare/simulate before signing."},indexedLedger:n},["extraApy"])};function b(e){if(!e)return;const t=/\s*<([^<>\s]+)>\s*((?:;\s*[\w!#$%&'*+.^`|~-]+\s*=\s*(?:"(?:[^"\\\r\n]|\\.)*"|[\w!#$%&'*+.^`|~:/-]+)\s*)*)(,|$)/gy;let r,n=0;for(;n<e.length;){const a=t.exec(e);if(!a||a[3]&&t.lastIndex===e.length)throw new Error("Invalid pagination Link header");let o=!1,i=!1;for(const e of a[2].matchAll(/;\s*([\w!#$%&'*+.^`|~-]+)\s*=\s*(?:"((?:[^"\\\r\n]|\\.)*)"|([\w!#$%&'*+.^`|~:/-]+))\s*/g))if("rel"===e[1].toLowerCase()){if(i)throw new Error("Duplicate pagination link relation");i=!0,o=(e[2]??e[3]).replace(/\\(.)/g,"$1").toLowerCase().split(/\s+/).includes("next")}if(o){if(void 0!==r)throw new Error("Multiple next pagination links");r=a[1]}n=t.lastIndex}return r}function g(e){const t=new URL(e.baseUrl.trim());if(!["https:","http:"].includes(t.protocol)||t.username||t.password||t.search||t.hash)throw new Error("baseUrl must be an HTTP API root without credentials, query or fragment");t.pathname=`${t.pathname.replace(/\/+$/,"")}/`;const r=e.fetch??globalThis.fetch?.bind(globalThis);if(!r)throw new Error("A fetch implementation is required");async function n(e,n){const a=new URL(`stellar-lending/v1/${e}`,t);let o=a;const i=new Set,s=[];for(;;){if(i.has(o.href))throw new Error("Pagination Link cycle");i.add(o.href);const e=await r(o.href,{signal:n,redirect:"manual"});if("opaqueredirect"===e.type||e.status>=300&&e.status<400||e.redirected||e.url&&new URL(e.url).href!==o.href)throw new Error("Stellar lending redirects are not allowed");if(!e.ok)throw new Error(`Stellar lending request failed: HTTP ${e.status}`);const t=await e.json();if(!Array.isArray(t))throw new Error("Stellar lending response must be an array");s.push(...t);const l=b(e.headers.get("Link"));if(!l)break;const p=new URL(l,o);if(p.origin!==a.origin||p.pathname!==a.pathname||p.username||p.password||p.hash)throw new Error("Pagination Link must stay on the same API endpoint");o=p}return s}return{assets:({usage:e,signal:t}={})=>{if(void 0!==e&&"collateral"!==e&&"borrow"!==e)throw new Error("usage must be collateral or borrow");return n("assets"+(e?`?usage=${e}`:""),t)},positions:(e,{signal:t}={})=>{if(!e.trim()||"."===e||".."===e)throw new Error("owner is required");return n(`users/${encodeURIComponent(e)}/positions`,t)}}}module.exports=t})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e={type:"string"},t={type:"number"},r={type:"boolean"},n={...e,nullable:!0},a={...t,nullable:!0},
|
|
1
|
+
const e={type:"string"},t={type:"number"},r={type:"boolean"},n={...e,nullable:!0},a={...t,nullable:!0},i={...e,enum:["mainnet","testnet"]},s={...e,enum:["ready","stale","incomplete"]};function o(e,t=[]){return{type:"object",required:Object.keys(e).filter((e=>!t.includes(e))),properties:e}}const l={sac:e,symbol:e,name:e,decimals:a,logoUrl:n},p=o({valid:r,stale:r,deviation:r,timestamp:a}),c={type:"object",properties:{nativeApy:t,feesApr:t},description:"Embedded annualized yield fractions, separate from base lending interest."},d=o({extraApy:c,...l,hubId:t,hubName:e,amountRaw:{...n,description:"Integer token base units, never scaled shares."},amount:n,apy:{...a,description:"Fraction: 0.05 means 5%."},priceUsd:a,valueUsd:a,priceStatus:p,indexRay:n,indexedAt:t,indexedLedger:t},["extraApy"]),u=o({amountRaw:n,amount:n,usd:a}),w=o({spokeId:t,spokeName:e,ltvBps:t,supplyCapacity:u,borrowCapacity:u,canSupply:r,canBeCollateral:r,canBorrow:r,canOpenAccount:{...r,description:"Spoke admits new accounts; other entry gates still apply."}}),m={type:"array",items:o({accountId:e,nftContract:e,nftImage:{...e,format:"uri",description:"Dynamic position SVG served by the network's XOXNO API."},network:i,spokeId:a,spokeName:n,supplied:{type:"array",items:d},borrow:{type:"array",items:d},hasDebt:{...r,nullable:!0,description:"Null when account rows are unavailable."},healthFactor:{...a,description:"Null without debt or when risk inputs are unavailable."},borrowLimitUsd:a,availableBorrowUsd:{...a,description:"Account headroom, before per-market constraints."},netApy:{...a,description:"Net annual yield divided by positive net equity; fraction."},dataStatus:s})},h={type:"array",items:o({extraApy:c,...l,hubId:t,hubName:e,network:i,supplyApy:{...a,description:"Fraction: 0.05 means 5%."},borrowApy:{...a,description:"Fraction: 0.05 means 5%."},priceUsd:a,priceStatus:p,spokes:{type:"array",items:w},dataStatus:s,indexedAt:{...t,description:"Pool state timestamp. Capacities are indexed snapshot estimates; prepare/simulate before signing."},indexedLedger:t},["extraApy"])};function y(e){if(!e)return;const t=/\s*<([^<>\s]+)>\s*((?:;\s*[\w!#$%&'*+.^`|~-]+\s*=\s*(?:"(?:[^"\\\r\n]|\\.)*"|[\w!#$%&'*+.^`|~:/-]+)\s*)*)(,|$)/gy;let r,n=0;for(;n<e.length;){const a=t.exec(e);if(!a||a[3]&&t.lastIndex===e.length)throw new Error("Invalid pagination Link header");let i=!1,s=!1;for(const e of a[2].matchAll(/;\s*([\w!#$%&'*+.^`|~-]+)\s*=\s*(?:"((?:[^"\\\r\n]|\\.)*)"|([\w!#$%&'*+.^`|~:/-]+))\s*/g))if("rel"===e[1].toLowerCase()){if(s)throw new Error("Duplicate pagination link relation");s=!0,i=(e[2]??e[3]).replace(/\\(.)/g,"$1").toLowerCase().split(/\s+/).includes("next")}if(i){if(void 0!==r)throw new Error("Multiple next pagination links");r=a[1]}n=t.lastIndex}return r}function f(e){const t=new URL(e.baseUrl.trim());if(!["https:","http:"].includes(t.protocol)||t.username||t.password||t.search||t.hash)throw new Error("baseUrl must be an HTTP API root without credentials, query or fragment");t.pathname=`${t.pathname.replace(/\/+$/,"")}/`;const r=e.fetch??globalThis.fetch?.bind(globalThis);if(!r)throw new Error("A fetch implementation is required");async function n(e,n){const a=new URL(`stellar-lending/v1/${e}`,t);let i=a;const s=new Set,o=[];for(;;){if(s.has(i.href))throw new Error("Pagination Link cycle");s.add(i.href);const e=await r(i.href,{signal:n,redirect:"manual"});if("opaqueredirect"===e.type||e.status>=300&&e.status<400||e.redirected||e.url&&new URL(e.url).href!==i.href)throw new Error("Stellar lending redirects are not allowed");if(!e.ok)throw new Error(`Stellar lending request failed: HTTP ${e.status}`);const t=await e.json();if(!Array.isArray(t))throw new Error("Stellar lending response must be an array");o.push(...t);const l=y(e.headers.get("Link"));if(!l)break;const p=new URL(l,i);if(p.origin!==a.origin||p.pathname!==a.pathname||p.username||p.password||p.hash)throw new Error("Pagination Link must stay on the same API endpoint");i=p}return o}return{assets:({usage:e,signal:t}={})=>{if(void 0!==e&&"collateral"!==e&&"borrow"!==e)throw new Error("usage must be collateral or borrow");return n("assets"+(e?`?usage=${e}`:""),t)},positions:(e,{signal:t}={})=>{if(!e.trim()||"."===e||".."===e)throw new Error("owner is required");return n(`users/${encodeURIComponent(e)}/positions`,t)}}}export{f as createStellarLendingReadClient,h as lendingAssetsSchema,m as lendingPositionsSchema};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** OpenAPI response schema for LendingPosition[].
|
|
1
|
+
/** OpenAPI response schema for LendingPosition[]. Nullable data remains explicit; underlying yield is optional. */
|
|
2
2
|
export declare const lendingPositionsSchema: {
|
|
3
3
|
type: "array";
|
|
4
4
|
items: {
|
|
@@ -108,6 +108,18 @@ export declare const lendingPositionsSchema: {
|
|
|
108
108
|
nullable: boolean;
|
|
109
109
|
type: "string";
|
|
110
110
|
};
|
|
111
|
+
extraApy: {
|
|
112
|
+
type: "object";
|
|
113
|
+
properties: {
|
|
114
|
+
nativeApy: {
|
|
115
|
+
type: "number";
|
|
116
|
+
};
|
|
117
|
+
feesApr: {
|
|
118
|
+
type: "number";
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
description: string;
|
|
122
|
+
};
|
|
111
123
|
};
|
|
112
124
|
};
|
|
113
125
|
};
|
|
@@ -191,6 +203,18 @@ export declare const lendingPositionsSchema: {
|
|
|
191
203
|
nullable: boolean;
|
|
192
204
|
type: "string";
|
|
193
205
|
};
|
|
206
|
+
extraApy: {
|
|
207
|
+
type: "object";
|
|
208
|
+
properties: {
|
|
209
|
+
nativeApy: {
|
|
210
|
+
type: "number";
|
|
211
|
+
};
|
|
212
|
+
feesApr: {
|
|
213
|
+
type: "number";
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
description: string;
|
|
217
|
+
};
|
|
194
218
|
};
|
|
195
219
|
};
|
|
196
220
|
};
|
|
@@ -370,6 +394,18 @@ export declare const lendingAssetsSchema: {
|
|
|
370
394
|
nullable: boolean;
|
|
371
395
|
type: "string";
|
|
372
396
|
};
|
|
397
|
+
extraApy: {
|
|
398
|
+
type: "object";
|
|
399
|
+
properties: {
|
|
400
|
+
nativeApy: {
|
|
401
|
+
type: "number";
|
|
402
|
+
};
|
|
403
|
+
feesApr: {
|
|
404
|
+
type: "number";
|
|
405
|
+
};
|
|
406
|
+
};
|
|
407
|
+
description: string;
|
|
408
|
+
};
|
|
373
409
|
};
|
|
374
410
|
};
|
|
375
411
|
};
|
|
@@ -14,7 +14,14 @@ export interface LendingPriceStatus {
|
|
|
14
14
|
deviation: boolean;
|
|
15
15
|
timestamp: number | null;
|
|
16
16
|
}
|
|
17
|
+
/** Yield fractions: 0.05 means 5%; separate from base lending interest. */
|
|
18
|
+
export interface LendingExtraApy {
|
|
19
|
+
nativeApy?: number;
|
|
20
|
+
feesApr?: number;
|
|
21
|
+
}
|
|
17
22
|
export interface PositionAsset extends LendingToken {
|
|
23
|
+
/** Embedded annualized yield; apy remains base lending interest. */
|
|
24
|
+
extraApy?: LendingExtraApy;
|
|
18
25
|
hubId: number;
|
|
19
26
|
hubName: string;
|
|
20
27
|
/** Integer token base units, never scaled shares. */
|
|
@@ -68,6 +75,8 @@ export interface AssetSpoke {
|
|
|
68
75
|
canOpenAccount: boolean;
|
|
69
76
|
}
|
|
70
77
|
export interface LendingAsset extends LendingToken {
|
|
78
|
+
/** Embedded annualized yield; supplyApy/borrowApy remain base lending interest. */
|
|
79
|
+
extraApy?: LendingExtraApy;
|
|
71
80
|
hubId: number;
|
|
72
81
|
hubName: string;
|
|
73
82
|
network: 'mainnet' | 'testnet';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xoxno/sdk-js",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.235",
|
|
4
4
|
"description": "The SDK to interact with the XOXNO Protocol!",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
"dependencies": {
|
|
141
141
|
"@multiversx/sdk-core": "^15.3.2",
|
|
142
142
|
"@multiversx/sdk-network-providers": "^2.9.3",
|
|
143
|
-
"@xoxno/types": "1.0.
|
|
143
|
+
"@xoxno/types": "1.0.503",
|
|
144
144
|
"buffer": "^6.0.3"
|
|
145
145
|
},
|
|
146
146
|
"peerDependencies": {
|