@xoxno/sdk-js 1.0.223 → 1.0.224

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.
Files changed (29) hide show
  1. package/dist/cjs/sdk/stellar/__tests__/admin.test.d.ts +0 -12
  2. package/dist/cjs/sdk/stellar/__tests__/builders-hubasset.test.d.ts +0 -11
  3. package/dist/cjs/sdk/stellar/__tests__/governance.test.d.ts +0 -4
  4. package/dist/cjs/sdk/stellar/__tests__/lending.test.d.ts +0 -20
  5. package/dist/cjs/sdk/stellar/__tests__/strategy-program.test.d.ts +0 -8
  6. package/dist/cjs/sdk/stellar/__tests__/swap-history.test.d.ts +1 -0
  7. package/dist/cjs/sdk/stellar/index.d.ts +1 -0
  8. package/dist/cjs/sdk/stellar/swap-history.d.ts +25 -0
  9. package/dist/cjs/sdk/stellar/swap-index.d.ts +2 -0
  10. package/dist/cjs/sdk/stellar/xdr-compat.d.ts +11 -0
  11. package/dist/index.cjs +1 -1
  12. package/dist/index.esm.js +1 -1
  13. package/dist/sdk/stellar/__tests__/admin.test.d.ts +0 -12
  14. package/dist/sdk/stellar/__tests__/builders-hubasset.test.d.ts +0 -11
  15. package/dist/sdk/stellar/__tests__/governance.test.d.ts +0 -4
  16. package/dist/sdk/stellar/__tests__/lending.test.d.ts +0 -20
  17. package/dist/sdk/stellar/__tests__/strategy-program.test.d.ts +0 -8
  18. package/dist/sdk/stellar/__tests__/swap-history.test.d.ts +1 -0
  19. package/dist/sdk/stellar/index.cjs +1 -1
  20. package/dist/sdk/stellar/index.d.ts +1 -0
  21. package/dist/sdk/stellar/index.esm.js +1 -1
  22. package/dist/sdk/stellar/swap-history.d.ts +25 -0
  23. package/dist/sdk/stellar/swap-index.cjs +2 -0
  24. package/dist/sdk/stellar/swap-index.cjs.LICENSE.txt +8 -0
  25. package/dist/sdk/stellar/swap-index.d.ts +2 -0
  26. package/dist/sdk/stellar/swap-index.esm.js +2 -0
  27. package/dist/sdk/stellar/swap-index.esm.js.LICENSE.txt +8 -0
  28. package/dist/sdk/stellar/xdr-compat.d.ts +11 -0
  29. package/package.json +15 -4
@@ -1,13 +1 @@
1
- /**
2
- * Snapshot + structural tests for the Stellar lending admin / config / keeper /
3
- * access transaction builders.
4
- *
5
- * Beyond the function-name / arg-count / determinism / snapshot guards, this
6
- * suite decodes the complex `#[contracttype]` struct args
7
- * (`MarketOracleConfigInput`, `AssetConfigRaw`) back out of the XDR and asserts
8
- * the ScMap keys are ascending-sorted (the Soroban host requires sorted symbol
9
- * keys) and that the oracle union / custom-option tags are well-formed. For the
10
- * all-lowercase snake_case field sets used here, JS lexicographic order matches
11
- * Soroban's symbol collation.
12
- */
13
1
  export {};
@@ -1,12 +1 @@
1
- /**
2
- * Multi-hub ABI encoding tests for the Stellar lending builders.
3
- *
4
- * Asserts the on-the-wire ScVal shape after the migration from the old
5
- * `(Address, i128)` + `e_mode_category` ABI to the multi-hub
6
- * `(HubAssetKey, i128)` + `spoke_id` ABI:
7
- * - `supply` carries `spoke_id` as a `u32` and a `Vec<(HubAssetKey, i128)>`.
8
- * - each `HubAssetKey` is a struct/map whose symbol keys are sorted
9
- * (`asset`, `hub_id`) — the canonical Soroban `#[contracttype]` layout.
10
- * - `borrow` carries the same `Vec<(HubAssetKey, i128)>` payload.
11
- */
12
1
  export {};
@@ -1,5 +1 @@
1
- /**
2
- * Snapshot + structural tests for governance `propose_*` transaction builders
3
- * used by the admin dashboard (timelock proposals).
4
- */
5
1
  export {};
@@ -1,21 +1 @@
1
- /**
2
- * Snapshot + sanity tests for the Stellar Soroban lending transaction builders.
3
- *
4
- * These tests assert:
5
- * 1. Every builder returns a non-empty base64 XDR.
6
- * 2. XDR parses back into a valid Transaction with exactly one InvokeHostFunction
7
- * operation targeting the configured controller contract.
8
- * 3. The function name encoded in the XDR matches the Stellar controller
9
- * entry point exactly (`supply`, `borrow`, `withdraw`, `repay`,
10
- * `liquidate`, `flash_loan`, `multiply`, `swap_debt`, `swap_collateral`,
11
- * `repay_debt_with_collateral`).
12
- * 4. The XDR is deterministic — identical fixture inputs yield identical XDR.
13
- * 5. Stable snapshots for the full XDR of every builder (regression guard
14
- * for any unintended encoding change).
15
- *
16
- * Builders are RPC-free — they accept a `sourceSequence` so output is
17
- * fully deterministic and snapshot-testable. The UI layer is responsible
18
- * for fetching the sequence and running `rpc.Server.prepareTransaction`
19
- * before signing.
20
- */
21
1
  export {};
@@ -1,9 +1 @@
1
- /**
2
- * Cross-language wire-format check for the aggregator's packed strategy program.
3
- *
4
- * The same fixtures are asserted byte-for-byte in
5
- * `contracts/swap-aggregator/tests/unit/payload_wire_format.rs` and
6
- * `arb-algo/stellar-indexer/src/transaction/abi.rs`. If this file and those
7
- * diverge, routes built by this SDK will be rejected on-chain.
8
- */
9
1
  export {};
@@ -14,6 +14,7 @@ export * from './governance.js';
14
14
  export * from './events/index.js';
15
15
  export * from './quote.js';
16
16
  export * from './swap.js';
17
+ export * from './swap-history.js';
17
18
  export * from './route-verify.js';
18
19
  export * from './auth-policy.js';
19
20
  export * from './prepare.js';
@@ -0,0 +1,25 @@
1
+ export interface StellarSwapEnvelopeOptions {
2
+ envelopeXdr: string;
3
+ networkPassphrase: string;
4
+ /** Router pinned by the application for this network. */
5
+ routerAddress: string;
6
+ /** Only swaps whose encoded sender equals this address are returned. */
7
+ viewer: string;
8
+ /** Zero-based operation index in the inner transaction. */
9
+ operationIndex?: number;
10
+ }
11
+ export interface DecodedStellarSwapEnvelope {
12
+ tokenIn: string;
13
+ tokenOut: string;
14
+ /** Exact positive input in base units; never converted to a JS number. */
15
+ amountInAtoms: string;
16
+ operationIndex: number;
17
+ }
18
+ /**
19
+ * Synchronously decode direct XOXNO router swaps, including fee-bump envelopes.
20
+ * Returns null for malformed, unrelated or ambiguous envelopes. Without an
21
+ * operation index exactly one matching swap is required. No RPC or output
22
+ * amount inference: the route minimum is not the amount actually received.
23
+ * The network passphrase parses the envelope; it cannot prove its network.
24
+ */
25
+ export declare function decodeStellarSwapEnvelope(options: StellarSwapEnvelopeOptions): DecodedStellarSwapEnvelope | null;
@@ -0,0 +1,2 @@
1
+ export { decodeStellarSwapEnvelope } from './swap-history.js';
2
+ export type { DecodedStellarSwapEnvelope, StellarSwapEnvelopeOptions } from './swap-history.js';
@@ -0,0 +1,11 @@
1
+ import { Buffer } from 'buffer';
2
+ type FieldValue<T> = T extends (...args: never[]) => infer R ? R : T;
3
+ /** SDK 16 exposes XDR getters; SDK 17 exposes the same fields as properties. */
4
+ export declare function xdrField<T, K extends keyof T>(value: T, key: K): FieldValue<T[K]>;
5
+ export declare function xdrType(value: unknown): string | undefined;
6
+ /** SDK 17 opaque byte fields wrap their Uint8Array in `value`. */
7
+ export declare function xdrBytes(value: {
8
+ bytes: unknown;
9
+ }): Buffer;
10
+ export declare function xdrOpaque(value: unknown): Buffer;
11
+ export {};