@xoxno/sdk-js 1.0.231 → 1.0.232

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.
@@ -535,11 +535,11 @@ export type StellarMarketIndexByHub = {
535
535
  export type ReserveIrmCurveDto = {
536
536
  /** Base borrow rate (ray, 1e27). */
537
537
  "baseRateRay": string;
538
- /** Slope below the optimal utilization (ray). */
538
+ /** Rate added from zero to the mid utilization kink (ray). */
539
539
  "slope1Ray": string;
540
- /** Slope between optimal and mid utilization (ray). */
540
+ /** Rate added between the mid and optimal utilization kinks (ray). */
541
541
  "slope2Ray": string;
542
- /** Slope above the mid utilization (ray). */
542
+ /** Rate added from the optimal kink to full utilization (ray). */
543
543
  "slope3Ray": string;
544
544
  /** Optimal utilization kink (ray). */
545
545
  "optimalUtilizationRay": string;
@@ -37,11 +37,11 @@ export type StellarUserActivityItem = Api.StellarUserActivityItemDto;
37
37
  export type StellarLendingMarketSide = 'deposit' | 'borrow';
38
38
  /** Holder-list balance selector. Also used by holder distribution. */
39
39
  export type StellarLendingHoldersSide = 'deposits' | 'borrows';
40
- /** Time window for API charts. Dates are ISO-8601; bin examples: 1h, 1d. */
40
+ /** Time window for API charts. Dates are calendar days (yyyy-MM-dd, e.g. 2026-09-01); the API rejects ISO-8601 datetimes with HTTP 400. Bin examples: 1h, 1d. */
41
41
  export interface StellarMarketGraphQuery {
42
- /** Window start. */
42
+ /** Window start day, yyyy-MM-dd. */
43
43
  from: string;
44
- /** Window end. */
44
+ /** Window end day, yyyy-MM-dd. */
45
45
  to: string;
46
46
  /** Kusto timespan, for example 1h or 1d. */
47
47
  bin: string;
@@ -51,11 +51,16 @@ export type StellarActivityQuery = (typeof endpoints)['/stellar-lending/users/:o
51
51
  export type StellarActivityPageQuery = (typeof endpoints)['/stellar-lending/users/:owner/activity/page']['input'];
52
52
  export type StellarGovernanceQuery = (typeof endpoints)['/stellar-lending/governance/proposals']['input'];
53
53
  export type StellarPositionsQuery = (typeof endpoints)['/stellar-lending/positions']['input'];
54
+ /** from/to are calendar days (yyyy-MM-dd); the API rejects ISO-8601 datetimes with HTTP 400. */
54
55
  export type StellarRevenueQuery = (typeof endpoints)['/stellar-lending/revenue']['input'];
56
+ /** from/to are calendar days (yyyy-MM-dd); the API rejects ISO-8601 datetimes with HTTP 400. */
55
57
  export type StellarFeeRevenueQuery = (typeof endpoints)['/stellar-lending/revenue/fees']['input'];
56
58
  export type StellarParticipantsQuery = (typeof endpoints)['/stellar-lending/participants']['input'];
59
+ /** from/to are calendar days (yyyy-MM-dd); the API rejects ISO-8601 datetimes with HTTP 400. */
57
60
  export type StellarLiquidationsQuery = (typeof endpoints)['/stellar-lending/liquidations']['input'];
58
61
  export type StellarLiquidationsLeaderboardQuery = (typeof endpoints)['/stellar-lending/liquidations/leaderboard']['input'];
62
+ /** from/to are calendar days (yyyy-MM-dd); the API rejects ISO-8601 datetimes with HTTP 400. */
59
63
  export type StellarVolumeQuery = (typeof endpoints)['/stellar-lending/volume']['input'];
60
64
  export type StellarDistributionQuery = (typeof endpoints)['/stellar-lending/distribution']['input'];
65
+ /** from/to are calendar days (yyyy-MM-dd); the API rejects ISO-8601 datetimes with HTTP 400. */
61
66
  export type StellarRateSpreadQuery = (typeof endpoints)['/stellar-lending/rate-spread']['input'];
@@ -2,7 +2,7 @@ import type { LendingAsset, LendingAssetUsage, LendingPosition } from './types.j
2
2
  export interface StellarLendingReadClientOptions {
3
3
  /** API root, for example https://api.xoxno.com. May include a deployment prefix. */
4
4
  baseUrl: string;
5
- /** Inject the host's fetch implementation when unavailable globally; it must honor redirect: 'error'. */
5
+ /** Inject the host's fetch implementation when unavailable globally; it must honor redirect: 'manual'. */
6
6
  fetch?: typeof globalThis.fetch;
7
7
  }
8
8
  export interface StellarLendingReadOptions {
@@ -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:()=>b,lendingAssetsSchema:()=>y,lendingPositionsSchema:()=>h});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 d(e){return{type:"object",required:Object.keys(e),properties:e}}const c={sac:r,symbol:r,name:r,decimals:i,logoUrl:o},p=d({valid:a,stale:a,deviation:a,timestamp:i}),u=d({...c,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:p,indexRay:o,indexedAt:n,indexedLedger:n}),m=d({amountRaw:o,amount:o,usd:i}),w=d({spokeId:n,spokeName:r,ltvBps:n,supplyCapacity:m,borrowCapacity:m,canSupply:a,canBeCollateral:a,canBorrow:a,canOpenAccount:{...a,description:"Spoke admits new accounts; other entry gates still apply."}}),h={type:"array",items:d({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:u},borrow:{type:"array",items:u},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})},y={type:"array",items:d({...c,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:p,spokes:{type:"array",items:w},dataStatus:l,indexedAt:{...n,description:"Pool state timestamp. Capacities are indexed snapshot estimates; prepare/simulate before signing."},indexedLedger:n})};function f(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 b(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:"error"});if(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=f(e.headers.get("Link"));if(!l)break;const d=new URL(l,o);if(d.origin!==a.origin||d.pathname!==a.pathname||d.username||d.password||d.hash)throw new Error("Pagination Link must stay on the same API endpoint");o=d}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
+ (()=>{"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:()=>b,lendingAssetsSchema:()=>y,lendingPositionsSchema:()=>h});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 d(e){return{type:"object",required:Object.keys(e),properties:e}}const c={sac:r,symbol:r,name:r,decimals:i,logoUrl:o},p=d({valid:a,stale:a,deviation:a,timestamp:i}),u=d({...c,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:p,indexRay:o,indexedAt:n,indexedLedger:n}),m=d({amountRaw:o,amount:o,usd:i}),w=d({spokeId:n,spokeName:r,ltvBps:n,supplyCapacity:m,borrowCapacity:m,canSupply:a,canBeCollateral:a,canBorrow:a,canOpenAccount:{...a,description:"Spoke admits new accounts; other entry gates still apply."}}),h={type:"array",items:d({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:u},borrow:{type:"array",items:u},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})},y={type:"array",items:d({...c,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:p,spokes:{type:"array",items:w},dataStatus:l,indexedAt:{...n,description:"Pool state timestamp. Capacities are indexed snapshot estimates; prepare/simulate before signing."},indexedLedger:n})};function f(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 b(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=f(e.headers.get("Link"));if(!l)break;const d=new URL(l,o);if(d.origin!==a.origin||d.pathname!==a.pathname||d.username||d.password||d.hash)throw new Error("Pagination Link must stay on the same API endpoint");o=d}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},o={...e,enum:["mainnet","testnet"]},i={...e,enum:["ready","stale","incomplete"]};function s(e){return{type:"object",required:Object.keys(e),properties:e}}const l={sac:e,symbol:e,name:e,decimals:a,logoUrl:n},p=s({valid:r,stale:r,deviation:r,timestamp:a}),c=s({...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}),d=s({amountRaw:n,amount:n,usd:a}),u=s({spokeId:t,spokeName:e,ltvBps:t,supplyCapacity:d,borrowCapacity:d,canSupply:r,canBeCollateral:r,canBorrow:r,canOpenAccount:{...r,description:"Spoke admits new accounts; other entry gates still apply."}}),w={type:"array",items:s({accountId:e,nftContract:e,nftImage:{...e,format:"uri",description:"Dynamic position SVG served by the network's XOXNO API."},network:o,spokeId:a,spokeName:n,supplied:{type:"array",items:c},borrow:{type:"array",items:c},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:i})},h={type:"array",items:s({...l,hubId:t,hubName:e,network:o,supplyApy:{...a,description:"Fraction: 0.05 means 5%."},borrowApy:{...a,description:"Fraction: 0.05 means 5%."},priceUsd:a,priceStatus:p,spokes:{type:"array",items:u},dataStatus:i,indexedAt:{...t,description:"Pool state timestamp. Capacities are indexed snapshot estimates; prepare/simulate before signing."},indexedLedger:t})};function m(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 y(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:"error"});if(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=m(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)}}}export{y as createStellarLendingReadClient,h as lendingAssetsSchema,w as lendingPositionsSchema};
1
+ const e={type:"string"},t={type:"number"},r={type:"boolean"},n={...e,nullable:!0},a={...t,nullable:!0},o={...e,enum:["mainnet","testnet"]},s={...e,enum:["ready","stale","incomplete"]};function i(e){return{type:"object",required:Object.keys(e),properties:e}}const l={sac:e,symbol:e,name:e,decimals:a,logoUrl:n},p=i({valid:r,stale:r,deviation:r,timestamp:a}),c=i({...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}),d=i({amountRaw:n,amount:n,usd:a}),u=i({spokeId:t,spokeName:e,ltvBps:t,supplyCapacity:d,borrowCapacity:d,canSupply:r,canBeCollateral:r,canBorrow:r,canOpenAccount:{...r,description:"Spoke admits new accounts; other entry gates still apply."}}),w={type:"array",items:i({accountId:e,nftContract:e,nftImage:{...e,format:"uri",description:"Dynamic position SVG served by the network's XOXNO API."},network:o,spokeId:a,spokeName:n,supplied:{type:"array",items:c},borrow:{type:"array",items:c},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:i({...l,hubId:t,hubName:e,network:o,supplyApy:{...a,description:"Fraction: 0.05 means 5%."},borrowApy:{...a,description:"Fraction: 0.05 means 5%."},priceUsd:a,priceStatus:p,spokes:{type:"array",items:u},dataStatus:s,indexedAt:{...t,description:"Pool state timestamp. Capacities are indexed snapshot estimates; prepare/simulate before signing."},indexedLedger:t})};function m(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,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,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 y(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 s=new Set,i=[];for(;;){if(s.has(o.href))throw new Error("Pagination Link cycle");s.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");i.push(...t);const l=m(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 i}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{y as createStellarLendingReadClient,h as lendingAssetsSchema,w as lendingPositionsSchema};
@@ -7,8 +7,9 @@ export interface MapSorobanErrorOptions {
7
7
  *
8
8
  * RPC simulation errors usually carry only the top-level code
9
9
  * (`HostError: Error(Contract, #N)`). With only the tag, a code raised by a
10
- * nested contract (for example the swap aggregator) cannot be told apart;
11
- * read the simulation's diagnostic events when that matters.
10
+ * nested contract (for example the swap aggregator or a token) cannot be told
11
+ * apart; read the simulation's diagnostic events when that matters.
12
+ * Tag-only matches on codes 1, 3, 6, 10, 11 and 12 return `null`.
12
13
  */
13
14
  contracts?: readonly string[];
14
15
  }
@@ -19,7 +20,11 @@ export interface MapSorobanErrorOptions {
19
20
  * strings can contain unrelated numbers (fees, ledgers, sequence numbers).
20
21
  *
21
22
  * Without `opts.contracts` it maps the first code in the string, whichever
22
- * contract emitted it.
23
+ * contract emitted it. A failed nested call (token, swap aggregator, oracle)
24
+ * reports its own code at the top level, so an unscoped or tag-only result can
25
+ * name the wrong lending error: a token's `#10` BalanceError reads as
26
+ * InvalidWasmHash. Pass `contracts` and, where available, the simulation's
27
+ * diagnostic event log to attribute the code to its emitter.
23
28
  */
24
29
  export declare function mapSorobanError(raw: string, opts?: MapSorobanErrorOptions): {
25
30
  code: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xoxno/sdk-js",
3
- "version": "1.0.231",
3
+ "version": "1.0.232",
4
4
  "description": "The SDK to interact with the XOXNO Protocol!",
5
5
  "type": "module",
6
6
  "exports": {