@xoxno/sdk-js 1.0.123 → 1.0.126

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.
@@ -0,0 +1,16 @@
1
+ import { type StellarNetwork } from './contracts';
2
+ import type { BuiltStellarTx, StellarBuilderOptions } from './lending';
3
+ export interface BuildStellarCctpForwardTxArgs extends StellarBuilderOptions {
4
+ forwarderAddress: string;
5
+ message: string;
6
+ attestation: string;
7
+ /** Default 10_000_000 stroops — CCTP mint_and_forward is resource-heavy. */
8
+ fee?: string;
9
+ /** Default 120 seconds. */
10
+ timeoutSeconds?: number;
11
+ }
12
+ /**
13
+ * Build an unsigned XDR for the Stellar CCTP forwarder `mint_and_forward`.
14
+ */
15
+ export declare function buildStellarCctpForwardTx(opts: BuildStellarCctpForwardTxArgs): BuiltStellarTx;
16
+ export type { StellarNetwork };
@@ -4,3 +4,7 @@ export * from './admin';
4
4
  export * from './events';
5
5
  export * from './quote';
6
6
  export * from './swap';
7
+ export * from './prepare';
8
+ export * from './position-mode';
9
+ export * from './repay-swap';
10
+ export * from './cctp';
@@ -72,20 +72,47 @@ export type { StellarSwapVenue } from './scval-encode';
72
72
  * does this via `rpc.Server.prepareTransaction`.
73
73
  */
74
74
  export declare function buildTx(opts: StellarBuilderOptions, method: string, params: xdr.ScVal[]): BuiltStellarTx;
75
+ export interface StellarTokenAmount {
76
+ token: string;
77
+ amount: string;
78
+ }
79
+ export interface StellarSupplyBatchArgs {
80
+ accountNonce?: number;
81
+ eModeCategory?: number;
82
+ assets: ReadonlyArray<StellarTokenAmount>;
83
+ }
84
+ export interface StellarBorrowBatchArgs {
85
+ accountNonce: number;
86
+ borrows: ReadonlyArray<StellarTokenAmount>;
87
+ }
88
+ export interface StellarWithdrawBatchArgs {
89
+ accountNonce: number;
90
+ withdrawals: ReadonlyArray<StellarTokenAmount>;
91
+ }
92
+ export interface StellarRepayBatchArgs {
93
+ accountNonce: number;
94
+ payments: ReadonlyArray<StellarTokenAmount>;
95
+ }
75
96
  /**
76
97
  * supply(caller, account_id: u64, e_mode_category: u32, assets: Vec<(Address, i128)>)
98
+ */
99
+ export declare function buildStellarSupplyBatchTx(opts: StellarBuilderOptions, args: StellarSupplyBatchArgs): BuiltStellarTx;
100
+ /**
77
101
  * @xoxno/types `SupplyArgs` is a single-asset shape; the Stellar contract
78
102
  * expects a batch — we wrap the single asset in a 1-element Vec.
79
103
  */
80
104
  export declare function buildStellarSupplyTx(opts: StellarBuilderOptions, args: SupplyArgs): BuiltStellarTx;
105
+ export declare function buildStellarBorrowBatchTx(opts: StellarBuilderOptions, args: StellarBorrowBatchArgs): BuiltStellarTx;
81
106
  /**
82
107
  * borrow(caller, account_id: u64, borrows: Vec<(Address, i128)>)
83
108
  */
84
109
  export declare function buildStellarBorrowTx(opts: StellarBuilderOptions, args: BorrowArgs): BuiltStellarTx;
110
+ export declare function buildStellarWithdrawBatchTx(opts: StellarBuilderOptions, args: StellarWithdrawBatchArgs): BuiltStellarTx;
85
111
  /**
86
112
  * withdraw(caller, account_id: u64, withdrawals: Vec<(Address, i128)>)
87
113
  */
88
114
  export declare function buildStellarWithdrawTx(opts: StellarBuilderOptions, args: WithdrawArgs): BuiltStellarTx;
115
+ export declare function buildStellarRepayBatchTx(opts: StellarBuilderOptions, args: StellarRepayBatchArgs): BuiltStellarTx;
89
116
  /**
90
117
  * repay(caller, account_id: u64, payments: Vec<(Address, i128)>)
91
118
  */
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Map MVX `PositionMode` numbering to the Stellar lending controller enum.
3
+ *
4
+ * MVX: None=0, Normal=1, Multiply=2, Long=3, Short=4
5
+ * Stellar: Normal=0, Multiply=1, Long=2, Short=3
6
+ */
7
+ export declare function toStellarPositionMode(mvxMode: number): number;
@@ -0,0 +1,14 @@
1
+ import type { rpc } from '@stellar/stellar-sdk';
2
+ import type { BuiltStellarTx } from './lending';
3
+ export declare function tagStellarInvokedContractError(contractId: string, error: unknown): Error;
4
+ /**
5
+ * Simulate a built Soroban envelope (footprint, auth, resource fee) and return
6
+ * prepared base64 XDR. Optionally tag failures with the invoked contract id so
7
+ * UIs can map `Error(Contract, #N)` codes to the right ABI.
8
+ */
9
+ export declare function prepareStellarTxXdr(server: Pick<rpc.Server, 'prepareTransaction'>, xdr: string, opts?: {
10
+ invokedContractId?: string;
11
+ }): Promise<string>;
12
+ export declare function prepareStellarBuiltTx(server: Pick<rpc.Server, 'prepareTransaction'>, built: BuiltStellarTx, opts?: {
13
+ invokedContractId?: string;
14
+ }): Promise<string>;
@@ -0,0 +1,7 @@
1
+ import type { StellarStrategyPayloadInput } from './scval-encode';
2
+ /**
3
+ * Placeholder aggregator route when `repay_debt_with_collateral` has
4
+ * `collateral_token === debt_token`. The controller short-circuits and never
5
+ * decodes the route, but the Soroban arg must still be valid `Bytes`.
6
+ */
7
+ export declare function buildSameTokenRepaySwapSteps(token: string, collateralAmount: string): StellarStrategyPayloadInput;
@@ -376,7 +376,9 @@ export declare const endpoints: {
376
376
  readonly output: LendingAccountProfile[];
377
377
  };
378
378
  readonly "/lending/market/indexes": {
379
- readonly input: {};
379
+ readonly input: {
380
+ chain?: ActivityChain[];
381
+ };
380
382
  readonly output: Record<string, LendingIndexesDto>;
381
383
  };
382
384
  readonly "/user/lending/position/:identifier": {
@@ -1135,6 +1137,16 @@ export declare const endpoints: {
1135
1137
  };
1136
1138
  readonly output: AnalyticsVolumeDto[];
1137
1139
  };
1140
+ readonly "/collections/analytics/volume": {
1141
+ readonly input: {
1142
+ collections: string;
1143
+ startTime?: string;
1144
+ endTime?: string;
1145
+ bin?: string;
1146
+ chain: ActivityChain[];
1147
+ };
1148
+ readonly output: Record<string, AnalyticsVolumeDto[]>;
1149
+ };
1138
1150
  readonly "/user/:address/analytics/volume": {
1139
1151
  readonly input: {};
1140
1152
  readonly output: UserAnalyticsDto;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xoxno/sdk-js",
3
- "version": "1.0.123",
3
+ "version": "1.0.126",
4
4
  "description": "The SDK to interact with the XOXNO Protocol!",
5
5
  "type": "module",
6
6
  "exports": {