@layerzerolabs/onesig-stellar-sdk 0.2.53 → 0.2.54
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/2LBFEV2A.mjs +28 -0
- package/dist/2LBFEV2A.mjs.map +1 -0
- package/dist/5T7UM34D.js +320 -0
- package/dist/5T7UM34D.js.map +1 -0
- package/dist/LLFTVQ4V.mjs +279 -0
- package/dist/LLFTVQ4V.mjs.map +1 -0
- package/dist/ZJZTH3QQ.js +30 -0
- package/dist/ZJZTH3QQ.js.map +1 -0
- package/dist/generated/index.d.ts +6 -10
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/generated/index.js +17 -17
- package/dist/generated/index.mjs +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -40
- package/dist/index.mjs +2 -3
- package/dist/leafGenerator.d.ts +3 -6
- package/dist/leafGenerator.d.ts.map +1 -1
- package/dist/leafGenerator.js +2 -3
- package/dist/leafGenerator.mjs +1 -2
- package/package.json +6 -6
- package/dist/CBYK2NKH.mjs +0 -43
- package/dist/CBYK2NKH.mjs.map +0 -1
- package/dist/CF25XTZY.mjs +0 -280
- package/dist/CF25XTZY.mjs.map +0 -1
- package/dist/F6ZSIYGU.mjs +0 -59
- package/dist/F6ZSIYGU.mjs.map +0 -1
- package/dist/OTB7AYEJ.js +0 -45
- package/dist/OTB7AYEJ.js.map +0 -1
- package/dist/RTZYI6T6.js +0 -321
- package/dist/RTZYI6T6.js.map +0 -1
- package/dist/WX2KPL4Q.js +0 -65
- package/dist/WX2KPL4Q.js.map +0 -1
- package/dist/calls.d.ts +0 -7
- package/dist/calls.d.ts.map +0 -1
- package/dist/calls.js +0 -29
- package/dist/calls.js.map +0 -1
- package/dist/calls.mjs +0 -4
- package/dist/calls.mjs.map +0 -1
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,99 +1,78 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var RTZYI6T6_js = require('./RTZYI6T6.js');
|
|
3
|
+
var ZJZTH3QQ_js = require('./ZJZTH3QQ.js');
|
|
4
|
+
var _5T7UM34D_js = require('./5T7UM34D.js');
|
|
6
5
|
require('./VUOMXK5T.js');
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
|
|
10
|
-
Object.defineProperty(exports, "createSetExecutorCall", {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () { return WX2KPL4Q_js.createSetExecutorCall; }
|
|
13
|
-
});
|
|
14
|
-
Object.defineProperty(exports, "createSetExecutorRequiredCall", {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: function () { return WX2KPL4Q_js.createSetExecutorRequiredCall; }
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "createSetSeedCall", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () { return WX2KPL4Q_js.createSetSeedCall; }
|
|
21
|
-
});
|
|
22
|
-
Object.defineProperty(exports, "createSetSignerCall", {
|
|
23
|
-
enumerable: true,
|
|
24
|
-
get: function () { return WX2KPL4Q_js.createSetSignerCall; }
|
|
25
|
-
});
|
|
26
|
-
Object.defineProperty(exports, "createSetThresholdCall", {
|
|
27
|
-
enumerable: true,
|
|
28
|
-
get: function () { return WX2KPL4Q_js.createSetThresholdCall; }
|
|
29
|
-
});
|
|
30
9
|
Object.defineProperty(exports, "stellarLeafGenerator", {
|
|
31
10
|
enumerable: true,
|
|
32
|
-
get: function () { return
|
|
11
|
+
get: function () { return ZJZTH3QQ_js.stellarLeafGenerator; }
|
|
33
12
|
});
|
|
34
13
|
Object.defineProperty(exports, "AuthError", {
|
|
35
14
|
enumerable: true,
|
|
36
|
-
get: function () { return
|
|
15
|
+
get: function () { return _5T7UM34D_js.AuthError; }
|
|
37
16
|
});
|
|
38
17
|
Object.defineProperty(exports, "BufferReaderError", {
|
|
39
18
|
enumerable: true,
|
|
40
|
-
get: function () { return
|
|
19
|
+
get: function () { return _5T7UM34D_js.BufferReaderError; }
|
|
41
20
|
});
|
|
42
21
|
Object.defineProperty(exports, "BufferWriterError", {
|
|
43
22
|
enumerable: true,
|
|
44
|
-
get: function () { return
|
|
23
|
+
get: function () { return _5T7UM34D_js.BufferWriterError; }
|
|
45
24
|
});
|
|
46
25
|
Object.defineProperty(exports, "BytesExtError", {
|
|
47
26
|
enumerable: true,
|
|
48
|
-
get: function () { return
|
|
27
|
+
get: function () { return _5T7UM34D_js.BytesExtError; }
|
|
49
28
|
});
|
|
50
29
|
Object.defineProperty(exports, "Client", {
|
|
51
30
|
enumerable: true,
|
|
52
|
-
get: function () { return
|
|
31
|
+
get: function () { return _5T7UM34D_js.Client; }
|
|
53
32
|
});
|
|
54
33
|
Object.defineProperty(exports, "MultiSigError", {
|
|
55
34
|
enumerable: true,
|
|
56
|
-
get: function () { return
|
|
35
|
+
get: function () { return _5T7UM34D_js.MultiSigError; }
|
|
57
36
|
});
|
|
58
37
|
Object.defineProperty(exports, "OneSigError", {
|
|
59
38
|
enumerable: true,
|
|
60
|
-
get: function () { return
|
|
39
|
+
get: function () { return _5T7UM34D_js.OneSigError; }
|
|
61
40
|
});
|
|
62
41
|
Object.defineProperty(exports, "OwnableError", {
|
|
63
42
|
enumerable: true,
|
|
64
|
-
get: function () { return
|
|
43
|
+
get: function () { return _5T7UM34D_js.OwnableError; }
|
|
65
44
|
});
|
|
66
45
|
Object.defineProperty(exports, "RbacError", {
|
|
67
46
|
enumerable: true,
|
|
68
|
-
get: function () { return
|
|
47
|
+
get: function () { return _5T7UM34D_js.RbacError; }
|
|
69
48
|
});
|
|
70
49
|
Object.defineProperty(exports, "TtlConfigurableError", {
|
|
71
50
|
enumerable: true,
|
|
72
|
-
get: function () { return
|
|
51
|
+
get: function () { return _5T7UM34D_js.TtlConfigurableError; }
|
|
73
52
|
});
|
|
74
53
|
Object.defineProperty(exports, "UpgradeableError", {
|
|
75
54
|
enumerable: true,
|
|
76
|
-
get: function () { return
|
|
55
|
+
get: function () { return _5T7UM34D_js.UpgradeableError; }
|
|
77
56
|
});
|
|
78
57
|
Object.defineProperty(exports, "WASM_BASE64", {
|
|
79
58
|
enumerable: true,
|
|
80
|
-
get: function () { return
|
|
59
|
+
get: function () { return _5T7UM34D_js.WASM_BASE64; }
|
|
81
60
|
});
|
|
82
61
|
Object.defineProperty(exports, "WASM_HASH", {
|
|
83
62
|
enumerable: true,
|
|
84
|
-
get: function () { return
|
|
63
|
+
get: function () { return _5T7UM34D_js.WASM_HASH; }
|
|
85
64
|
});
|
|
86
65
|
Object.defineProperty(exports, "contract", {
|
|
87
66
|
enumerable: true,
|
|
88
|
-
get: function () { return
|
|
67
|
+
get: function () { return _5T7UM34D_js.contract; }
|
|
89
68
|
});
|
|
90
69
|
Object.defineProperty(exports, "getWasmBuffer", {
|
|
91
70
|
enumerable: true,
|
|
92
|
-
get: function () { return
|
|
71
|
+
get: function () { return _5T7UM34D_js.getWasmBuffer; }
|
|
93
72
|
});
|
|
94
73
|
Object.defineProperty(exports, "rpc", {
|
|
95
74
|
enumerable: true,
|
|
96
|
-
get: function () { return
|
|
75
|
+
get: function () { return _5T7UM34D_js.rpc; }
|
|
97
76
|
});
|
|
98
77
|
//# sourceMappingURL=index.js.map
|
|
99
78
|
//# sourceMappingURL=index.js.map
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export { AuthError, BufferReaderError, BufferWriterError, BytesExtError, Client, MultiSigError, OneSigError, OwnableError, RbacError, TtlConfigurableError, UpgradeableError, WASM_BASE64, WASM_HASH, contract, getWasmBuffer, rpc } from './CF25XTZY.mjs';
|
|
1
|
+
export { stellarLeafGenerator } from './2LBFEV2A.mjs';
|
|
2
|
+
export { AuthError, BufferReaderError, BufferWriterError, BytesExtError, Client, MultiSigError, OneSigError, OwnableError, RbacError, TtlConfigurableError, UpgradeableError, WASM_BASE64, WASM_HASH, contract, getWasmBuffer, rpc } from './LLFTVQ4V.mjs';
|
|
4
3
|
import './YYM473VY.mjs';
|
|
5
4
|
//# sourceMappingURL=index.mjs.map
|
|
6
5
|
//# sourceMappingURL=index.mjs.map
|
package/dist/leafGenerator.d.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import type { xdr } from '@stellar/stellar-sdk';
|
|
2
1
|
import { type BaseLeafData, type GenerateLeafsResult } from '@layerzerolabs/onesig-core';
|
|
3
|
-
export interface
|
|
4
|
-
|
|
5
|
-
functionName: string;
|
|
6
|
-
args: xdr.ScVal[];
|
|
2
|
+
export interface StellarCallData {
|
|
3
|
+
invocation: Buffer;
|
|
7
4
|
}
|
|
8
|
-
export type StellarLeafData = BaseLeafData<string,
|
|
5
|
+
export type StellarLeafData = BaseLeafData<string, StellarCallData>;
|
|
9
6
|
export declare function stellarLeafGenerator(leafs: StellarLeafData[]): GenerateLeafsResult<StellarLeafData>;
|
|
10
7
|
//# sourceMappingURL=leafGenerator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leafGenerator.d.ts","sourceRoot":"","sources":["../src/leafGenerator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"leafGenerator.d.ts","sourceRoot":"","sources":["../src/leafGenerator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAGzF,MAAM,WAAW,eAAe;IAE5B,UAAU,EAAE,MAAM,CAAC;CACtB;AAOD,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;AAGpE,wBAAgB,oBAAoB,CAChC,KAAK,EAAE,eAAe,EAAE,GACzB,mBAAmB,CAAC,eAAe,CAAC,CAuBtC"}
|
package/dist/leafGenerator.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./RTZYI6T6.js');
|
|
3
|
+
var ZJZTH3QQ_js = require('./ZJZTH3QQ.js');
|
|
5
4
|
require('./VUOMXK5T.js');
|
|
6
5
|
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
Object.defineProperty(exports, "stellarLeafGenerator", {
|
|
10
9
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
10
|
+
get: function () { return ZJZTH3QQ_js.stellarLeafGenerator; }
|
|
12
11
|
});
|
|
13
12
|
//# sourceMappingURL=leafGenerator.js.map
|
|
14
13
|
//# sourceMappingURL=leafGenerator.js.map
|
package/dist/leafGenerator.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@layerzerolabs/onesig-stellar-sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.54",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "TypeScript SDK for OneSig Stellar contract",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@stellar/stellar-sdk": "^14.1.1",
|
|
21
|
-
"@layerzerolabs/onesig-core": "0.2.
|
|
21
|
+
"@layerzerolabs/onesig-core": "0.2.54"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@types/node": "^22.18.6",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"tsup": "^8.4.0",
|
|
27
27
|
"typescript": "^5.8.2",
|
|
28
28
|
"vitest": "^3.2.3",
|
|
29
|
-
"@layerzerolabs/
|
|
30
|
-
"@layerzerolabs/tsup-configuration": "0.2.
|
|
31
|
-
"@layerzerolabs/
|
|
32
|
-
"@layerzerolabs/
|
|
29
|
+
"@layerzerolabs/onesig-stellar": "0.2.54",
|
|
30
|
+
"@layerzerolabs/tsup-configuration": "0.2.54",
|
|
31
|
+
"@layerzerolabs/typescript-configuration": "0.2.54",
|
|
32
|
+
"@layerzerolabs/vm-tooling-stellar": "0.2.54"
|
|
33
33
|
},
|
|
34
34
|
"publishConfig": {
|
|
35
35
|
"access": "public",
|
package/dist/CBYK2NKH.mjs
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Client } from './CF25XTZY.mjs';
|
|
2
|
-
import { __name } from './YYM473VY.mjs';
|
|
3
|
-
import { Address, StrKey } from '@stellar/stellar-sdk';
|
|
4
|
-
|
|
5
|
-
var ONE_SIG_SPEC = new Client({
|
|
6
|
-
contractId: "",
|
|
7
|
-
rpcUrl: "",
|
|
8
|
-
networkPassphrase: "",
|
|
9
|
-
allowHttp: true
|
|
10
|
-
}).spec;
|
|
11
|
-
var callsInput = ONE_SIG_SPEC.getFunc("encode_leaf").inputs().find((input) => input.name().toString() === "calls");
|
|
12
|
-
if (!callsInput) throw new Error("Could not find calls parameter in encode_leaf function");
|
|
13
|
-
var VEC_CALL_TYPE = callsInput.type();
|
|
14
|
-
function stellarLeafGenerator(leafs) {
|
|
15
|
-
return {
|
|
16
|
-
leafs,
|
|
17
|
-
/** Encode OneSig contract address (C...) to 32-byte buffer */
|
|
18
|
-
encodeAddress(address) {
|
|
19
|
-
try {
|
|
20
|
-
return StrKey.decodeContract(address);
|
|
21
|
-
} catch {
|
|
22
|
-
throw new Error(`Invalid OneSig contract address: ${address}. Expected: C...`);
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
/** Encode Stellar contract calls to XDR buffer using Vec<Call> encoding */
|
|
26
|
-
encodeCalls(calls) {
|
|
27
|
-
if (calls.length === 0) {
|
|
28
|
-
throw new Error("Stellar leaf must have at least one call");
|
|
29
|
-
}
|
|
30
|
-
const callObjects = calls.map((call) => ({
|
|
31
|
-
to: Address.fromString(call.contractAddress),
|
|
32
|
-
func: call.functionName,
|
|
33
|
-
args: call.args
|
|
34
|
-
}));
|
|
35
|
-
return ONE_SIG_SPEC.nativeToScVal(callObjects, VEC_CALL_TYPE).toXDR();
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
__name(stellarLeafGenerator, "stellarLeafGenerator");
|
|
40
|
-
|
|
41
|
-
export { stellarLeafGenerator };
|
|
42
|
-
//# sourceMappingURL=CBYK2NKH.mjs.map
|
|
43
|
-
//# sourceMappingURL=CBYK2NKH.mjs.map
|
package/dist/CBYK2NKH.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/leafGenerator.ts"],"names":["ONE_SIG_SPEC","Client","contractId","rpcUrl","networkPassphrase","allowHttp","spec","callsInput","getFunc","inputs","find","input","name","toString","Error","VEC_CALL_TYPE","type","stellarLeafGenerator","leafs","encodeAddress","address","StrKey","decodeContract","encodeCalls","calls","length","callObjects","map","call","to","Address","fromString","contractAddress","func","functionName","args","nativeToScVal","toXDR"],"mappings":";;;;AAQA,IAAMA,YAAAA,GAAe,IAAIC,MAAAA,CAAO;EAC5BC,UAAAA,EAAY,EAAA;EACZC,MAAAA,EAAQ,EAAA;EACRC,iBAAAA,EAAmB,EAAA;EACnBC,SAAAA,EAAW;AACf,CAAA,CAAA,CAAGC,IAAAA;AACH,IAAMC,UAAAA,GAAaP,YAAAA,CAAaQ,OAAAA,CAAQ,aAAA,EACnCC,MAAAA,EAAM,CACNC,IAAAA,CAAK,CAACC,UAAqCA,KAAAA,CAAMC,IAAAA,EAAI,CAAGC,QAAAA,OAAe,OAAA,CAAA;AAC5E,IAAI,CAACN,UAAAA,EAAY,MAAM,IAAIO,MAAM,wDAAA,CAAA;AACjC,IAAMC,aAAAA,GAAgBR,WAAWS,IAAAA,EAAI;AAiB9B,SAASC,qBACZC,KAAAA,EAAwB;AAExB,EAAA,OAAO;AACHA,IAAAA,KAAAA;;AAGAC,IAAAA,aAAAA,CAAcC,OAAAA,EAAe;AACzB,MAAA,IAAI;AACA,QAAA,OAAOC,MAAAA,CAAOC,eAAeF,OAAAA,CAAAA;MACjC,CAAA,CAAA,MAAQ;AACJ,QAAA,MAAM,IAAIN,KAAAA,CAAM,CAAA,iCAAA,EAAoCM,OAAAA,CAAAA,gBAAAA,CAAyB,CAAA;AACjF,MAAA;AACJ,IAAA,CAAA;;AAGAG,IAAAA,WAAAA,CAAYC,KAAAA,EAAoB;AAC5B,MAAA,IAAIA,KAAAA,CAAMC,WAAW,CAAA,EAAG;AACpB,QAAA,MAAM,IAAIX,MAAM,0CAAA,CAAA;AACpB,MAAA;AAEA,MAAA,MAAMY,WAAAA,GAAcF,KAAAA,CAAMG,GAAAA,CAAI,CAACC,IAAAA,MAAU;QACrCC,EAAAA,EAAIC,OAAAA,CAAQC,UAAAA,CAAWH,IAAAA,CAAKI,eAAe,CAAA;AAC3CC,QAAAA,IAAAA,EAAML,IAAAA,CAAKM,YAAAA;AACXC,QAAAA,IAAAA,EAAMP,IAAAA,CAAKO;OACf,CAAA,CAAA;AAEA,MAAA,OAAOnC,YAAAA,CAAaoC,aAAAA,CAAcV,WAAAA,EAAaX,aAAAA,EAAesB,KAAAA,EAAK;AACvE,IAAA;AACJ,GAAA;AACJ;AA9BgBpB,MAAAA,CAAAA,oBAAAA,EAAAA,sBAAAA,CAAAA","file":"CBYK2NKH.mjs","sourcesContent":["import type { xdr } from '@stellar/stellar-sdk';\nimport { Address, StrKey } from '@stellar/stellar-sdk';\n\nimport { type BaseLeafData, type GenerateLeafsResult } from '@layerzerolabs/onesig-core';\n\nimport { Client } from './generated/index';\n\n// Get the contract spec and Vec<Call> type at module load\nconst ONE_SIG_SPEC = new Client({\n contractId: '',\n rpcUrl: '',\n networkPassphrase: '',\n allowHttp: true,\n}).spec;\nconst callsInput = ONE_SIG_SPEC.getFunc('encode_leaf')\n .inputs()\n .find((input: xdr.ScSpecFunctionInputV0) => input.name().toString() === 'calls');\nif (!callsInput) throw new Error('Could not find calls parameter in encode_leaf function');\nconst VEC_CALL_TYPE = callsInput.type();\n\n/**\n * Stellar contract call data structure\n *\n * Arguments are provided as pre-encoded ScVal[] matching the contract function's parameter types.\n * The entire Call struct (to, func, args) is encoded using nativeToScVal for XDR encoding.\n */\nexport interface StellarCall {\n contractAddress: string; // Soroban contract address (C...)\n functionName: string; // Function name to call\n args: xdr.ScVal[]; // Function arguments as ScVal[] matching contract parameters\n}\n\nexport type StellarLeafData = BaseLeafData<string, StellarCall>;\n\n/** Generates Stellar leaf data for OneSig Merkle tree */\nexport function stellarLeafGenerator(\n leafs: StellarLeafData[],\n): GenerateLeafsResult<StellarLeafData> {\n return {\n leafs,\n\n /** Encode OneSig contract address (C...) to 32-byte buffer */\n encodeAddress(address: string): Buffer {\n try {\n return StrKey.decodeContract(address);\n } catch {\n throw new Error(`Invalid OneSig contract address: ${address}. Expected: C...`);\n }\n },\n\n /** Encode Stellar contract calls to XDR buffer using Vec<Call> encoding */\n encodeCalls(calls: StellarCall[]): Buffer {\n if (calls.length === 0) {\n throw new Error('Stellar leaf must have at least one call');\n }\n\n const callObjects = calls.map((call) => ({\n to: Address.fromString(call.contractAddress),\n func: call.functionName,\n args: call.args,\n }));\n\n return ONE_SIG_SPEC.nativeToScVal(callObjects, VEC_CALL_TYPE).toXDR();\n },\n };\n}\n"]}
|