@xoxno/sdk-js 1.0.134 → 1.0.136
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/sdk/stellar/events/decode.d.ts +9 -2
- package/dist/sdk/stellar/prepare.d.ts +14 -3
- package/package.json +8 -8
- package/dist/index.bundled.d.cts +0 -2853
- package/dist/index.bundled.d.ts +0 -2853
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Decoders for the
|
|
2
|
+
* Decoders for the Stellar lending controller `#[contractevent]`s.
|
|
3
|
+
*
|
|
4
|
+
* The controller defines 20 contractevents; this SDK decodes 19. The lone
|
|
5
|
+
* omission is `config:min_borrow_collateral` (a single global `i128` floor with
|
|
6
|
+
* no indexing/UI consumer — the governance `SetMinBorrowCollateral` proposal
|
|
7
|
+
* already surfaces the value), so `decodeStellarLendingEvent` returns `null` for
|
|
8
|
+
* it like any other unhandled topic.
|
|
3
9
|
*
|
|
4
10
|
* The public API takes base64-XDR strings (`decodeStellarLendingEvent(topicsB64,
|
|
5
11
|
* dataB64)`) and parses them with this SDK's bundled `@stellar/stellar-sdk`, so
|
|
@@ -27,7 +33,8 @@ export declare const toBase64Xdr: (scv: {
|
|
|
27
33
|
}) => string;
|
|
28
34
|
/** Build the `"<domain>:<action>"` dispatch key from the event topic ScVals. */
|
|
29
35
|
export declare const stellarLendingDispatchKey: (topicsB64: readonly string[]) => string;
|
|
30
|
-
/** Topic keys this SDK can decode (the
|
|
36
|
+
/** Topic keys this SDK can decode (19 of the controller's 20 contractevents;
|
|
37
|
+
* `config:min_borrow_collateral` is intentionally not decoded). */
|
|
31
38
|
export declare const STELLAR_LENDING_TOPICS: readonly string[];
|
|
32
39
|
/**
|
|
33
40
|
* Decode a Stellar lending controller event from its base64-XDR topics and
|
|
@@ -1,14 +1,25 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { FeeBumpTransaction, Transaction } from '@stellar/stellar-sdk';
|
|
2
2
|
import type { BuiltStellarTx } from './lending';
|
|
3
|
+
/**
|
|
4
|
+
* The single `rpc.Server` capability the prepare helpers need. Declared
|
|
5
|
+
* structurally instead of `Pick<rpc.Server, 'prepareTransaction'>` so the
|
|
6
|
+
* published `.d.ts` references stellar-sdk's concrete `Transaction` exports
|
|
7
|
+
* rather than its `rpc` namespace — the namespaced form trips
|
|
8
|
+
* `dts-bundle-generator`'s external-type resolution under stellar-sdk v16. A
|
|
9
|
+
* real `rpc.Server` satisfies this structurally, so call sites are unchanged.
|
|
10
|
+
*/
|
|
11
|
+
export interface StellarTxPreparer {
|
|
12
|
+
prepareTransaction(tx: Transaction | FeeBumpTransaction): Promise<Transaction>;
|
|
13
|
+
}
|
|
3
14
|
export declare function tagStellarInvokedContractError(contractId: string, error: unknown): Error;
|
|
4
15
|
/**
|
|
5
16
|
* Simulate a built Soroban envelope (footprint, auth, resource fee) and return
|
|
6
17
|
* prepared base64 XDR. Optionally tag failures with the invoked contract id so
|
|
7
18
|
* UIs can map `Error(Contract, #N)` codes to the right ABI.
|
|
8
19
|
*/
|
|
9
|
-
export declare function prepareStellarTxXdr(server:
|
|
20
|
+
export declare function prepareStellarTxXdr(server: StellarTxPreparer, xdr: string, opts?: {
|
|
10
21
|
invokedContractId?: string;
|
|
11
22
|
}): Promise<string>;
|
|
12
|
-
export declare function prepareStellarBuiltTx(server:
|
|
23
|
+
export declare function prepareStellarBuiltTx(server: StellarTxPreparer, built: BuiltStellarTx, opts?: {
|
|
13
24
|
invokedContractId?: string;
|
|
14
25
|
}): Promise<string>;
|
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xoxno/sdk-js",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.136",
|
|
4
4
|
"description": "The SDK to interact with the XOXNO Protocol!",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
8
|
"import": {
|
|
9
|
-
"types": "./dist/index.
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
10
|
"default": "./dist/index.esm.js"
|
|
11
11
|
},
|
|
12
12
|
"require": {
|
|
13
|
-
"types": "./dist/index.
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
14
|
"default": "./dist/index.cjs"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
|
-
"types": "./dist/index.
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
19
|
"main": "./dist/index.cjs",
|
|
20
20
|
"module": "./dist/index.esm.js",
|
|
21
21
|
"files": [
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
],
|
|
24
24
|
"sideEffects": false,
|
|
25
25
|
"scripts": {
|
|
26
|
-
"test": "jest",
|
|
26
|
+
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
27
27
|
"build:sdk": "npx bun run src/sdk/parseSwagger.ts && npx oxlint src/sdk/swagger.ts --fix && npx bun run md/extract.ts",
|
|
28
|
-
"build:types": "tsc --emitDeclarationOnly
|
|
28
|
+
"build:types": "tsc --emitDeclarationOnly",
|
|
29
29
|
"build:esm": "webpack --config webpack-esm.config.mjs",
|
|
30
30
|
"build:cjs": "webpack --config webpack-cjs.config.mjs",
|
|
31
31
|
"build": "npm run build:sdk && npm run build:types && npm run build:esm && npm run build:cjs",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"@nestjs/swagger": "^11.4.4",
|
|
75
75
|
"@semantic-release/changelog": "^6.0.3",
|
|
76
76
|
"@semantic-release/git": "^10.0.1",
|
|
77
|
-
"@stellar/stellar-sdk": "^
|
|
77
|
+
"@stellar/stellar-sdk": "^16.0.0",
|
|
78
78
|
"@swc/cli": "^0.8.0",
|
|
79
79
|
"@swc/core": "^1.15.11",
|
|
80
80
|
"@types/jest": "^30.0.0",
|
|
@@ -107,6 +107,6 @@
|
|
|
107
107
|
"@xoxno/types": "1.0.416"
|
|
108
108
|
},
|
|
109
109
|
"peerDependencies": {
|
|
110
|
-
"@stellar/stellar-sdk": "
|
|
110
|
+
"@stellar/stellar-sdk": ">=15.0.0 <17.0.0"
|
|
111
111
|
}
|
|
112
112
|
}
|