@xoxno/sdk-js 1.0.120 → 1.0.125
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/index.bundled.d.cts +66 -1
- package/dist/index.bundled.d.ts +66 -1
- package/dist/index.cjs +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/sdk/stellar/cctp.d.ts +16 -0
- package/dist/sdk/stellar/index.d.ts +4 -0
- package/dist/sdk/stellar/lending.d.ts +27 -0
- package/dist/sdk/stellar/position-mode.d.ts +7 -0
- package/dist/sdk/stellar/prepare.d.ts +14 -0
- package/dist/sdk/stellar/repay-swap.d.ts +7 -0
- package/package.json +2 -2
|
@@ -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 };
|
|
@@ -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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xoxno/sdk-js",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.125",
|
|
4
4
|
"description": "The SDK to interact with the XOXNO Protocol!",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -104,6 +104,6 @@
|
|
|
104
104
|
"@multiversx/sdk-core": "^15.3.2",
|
|
105
105
|
"@multiversx/sdk-network-providers": "^2.9.3",
|
|
106
106
|
"@stellar/stellar-sdk": "^15.0.1",
|
|
107
|
-
"@xoxno/types": "^1.0.
|
|
107
|
+
"@xoxno/types": "^1.0.410"
|
|
108
108
|
}
|
|
109
109
|
}
|