@thru/programs 0.2.30 → 0.2.32
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/amm/index.cjs +6424 -0
- package/dist/amm/index.cjs.map +1 -0
- package/dist/amm/index.d.cts +1424 -0
- package/dist/amm/index.d.ts +1424 -0
- package/dist/amm/index.js +6360 -0
- package/dist/amm/index.js.map +1 -0
- package/dist/chunk-P5OABVJI.js +28 -0
- package/dist/chunk-P5OABVJI.js.map +1 -0
- package/dist/multicall/index.cjs +1 -1
- package/dist/multicall/index.cjs.map +1 -1
- package/dist/multicall/index.d.cts +2 -2
- package/dist/multicall/index.d.ts +2 -2
- package/dist/multicall/index.js +1 -1
- package/dist/multicall/index.js.map +1 -1
- package/dist/passkey-manager/index.cjs +33 -27
- package/dist/passkey-manager/index.cjs.map +1 -1
- package/dist/passkey-manager/index.d.cts +4 -3
- package/dist/passkey-manager/index.d.ts +4 -3
- package/dist/passkey-manager/index.js +9 -28
- package/dist/passkey-manager/index.js.map +1 -1
- package/dist/token/index.cjs +1760 -275
- package/dist/token/index.cjs.map +1 -1
- package/dist/token/index.d.cts +124 -20
- package/dist/token/index.d.ts +124 -20
- package/dist/token/index.js +1760 -275
- package/dist/token/index.js.map +1 -1
- package/package.json +9 -2
- package/src/amm/abi/thru/common/primitives/types.ts +2269 -0
- package/src/amm/abi/thru/program/amm/types.ts +5621 -0
- package/src/amm/index.test.ts +255 -0
- package/src/amm/index.ts +434 -0
- package/src/helpers/bytes.ts +25 -0
- package/src/multicall/abi/thru/common/primitives/types.ts +5 -6
- package/src/multicall/abi/thru/program/multicall/types.ts +1 -2
- package/src/passkey-manager/abi/thru/blockchain/state_proof/types.ts +0 -1
- package/src/passkey-manager/abi/thru/common/primitives/types.ts +0 -1
- package/src/passkey-manager/abi/thru/program/passkey_manager/types.ts +4 -5
- package/src/passkey-manager/encoding.ts +2 -26
- package/src/token/abi/thru/blockchain/state_proof/types.ts +101 -21
- package/src/token/abi/thru/common/primitives/types.ts +1295 -167
- package/src/token/abi/thru/program/token/types.ts +647 -237
- package/tsup.config.ts +1 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// src/helpers/bytes.ts
|
|
2
|
+
function bytesEqual(a, b) {
|
|
3
|
+
if (a.length !== b.length) return false;
|
|
4
|
+
for (let i = 0; i < a.length; i++) {
|
|
5
|
+
if (a[i] !== b[i]) return false;
|
|
6
|
+
}
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
function compareBytes(a, b) {
|
|
10
|
+
const len = Math.min(a.length, b.length);
|
|
11
|
+
for (let i = 0; i < len; i++) {
|
|
12
|
+
if (a[i] !== b[i]) return a[i] - b[i];
|
|
13
|
+
}
|
|
14
|
+
return a.length - b.length;
|
|
15
|
+
}
|
|
16
|
+
function uniqueAccounts(accounts) {
|
|
17
|
+
const unique = [];
|
|
18
|
+
for (const account of accounts) {
|
|
19
|
+
if (!unique.some((candidate) => bytesEqual(candidate, account))) {
|
|
20
|
+
unique.push(account);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return unique;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { bytesEqual, compareBytes, uniqueAccounts };
|
|
27
|
+
//# sourceMappingURL=chunk-P5OABVJI.js.map
|
|
28
|
+
//# sourceMappingURL=chunk-P5OABVJI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/helpers/bytes.ts"],"names":[],"mappings":";AAAO,SAAS,UAAA,CAAW,GAAe,CAAA,EAAwB;AAChE,EAAA,IAAI,CAAA,CAAE,MAAA,KAAW,CAAA,CAAE,MAAA,EAAQ,OAAO,KAAA;AAClC,EAAA,KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,CAAA,CAAE,QAAQ,CAAA,EAAA,EAAK;AACjC,IAAA,IAAI,EAAE,CAAC,CAAA,KAAM,CAAA,CAAE,CAAC,GAAG,OAAO,KAAA;AAAA,EAC5B;AACA,EAAA,OAAO,IAAA;AACT;AAEO,SAAS,YAAA,CAAa,GAAe,CAAA,EAAuB;AACjE,EAAA,MAAM,MAAM,IAAA,CAAK,GAAA,CAAI,CAAA,CAAE,MAAA,EAAQ,EAAE,MAAM,CAAA;AACvC,EAAA,KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,GAAA,EAAK,CAAA,EAAA,EAAK;AAC5B,IAAA,IAAI,CAAA,CAAE,CAAC,CAAA,KAAM,CAAA,CAAE,CAAC,CAAA,EAAG,OAAO,CAAA,CAAE,CAAC,CAAA,GAAI,CAAA,CAAE,CAAC,CAAA;AAAA,EACtC;AACA,EAAA,OAAO,CAAA,CAAE,SAAS,CAAA,CAAE,MAAA;AACtB;AAEO,SAAS,eAAe,QAAA,EAAsC;AACnE,EAAA,MAAM,SAAuB,EAAC;AAC9B,EAAA,KAAA,MAAW,WAAW,QAAA,EAAU;AAC9B,IAAA,IAAI,CAAC,OAAO,IAAA,CAAK,CAAC,cAAc,UAAA,CAAW,SAAA,EAAW,OAAO,CAAC,CAAA,EAAG;AAC/D,MAAA,MAAA,CAAO,KAAK,OAAO,CAAA;AAAA,IACrB;AAAA,EACF;AACA,EAAA,OAAO,MAAA;AACT","file":"chunk-P5OABVJI.js","sourcesContent":["export function bytesEqual(a: Uint8Array, b: Uint8Array): boolean {\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) return false;\n }\n return true;\n}\n\nexport function compareBytes(a: Uint8Array, b: Uint8Array): number {\n const len = Math.min(a.length, b.length);\n for (let i = 0; i < len; i++) {\n if (a[i] !== b[i]) return a[i] - b[i];\n }\n return a.length - b.length;\n}\n\nexport function uniqueAccounts(accounts: Uint8Array[]): Uint8Array[] {\n const unique: Uint8Array[] = [];\n for (const account of accounts) {\n if (!unique.some((candidate) => bytesEqual(candidate, account))) {\n unique.push(account);\n }\n }\n return unique;\n}\n"]}
|
package/dist/multicall/index.cjs
CHANGED
|
@@ -1270,7 +1270,7 @@ var InstructionDataBuilder = class {
|
|
|
1270
1270
|
const elementCount = bytes.length;
|
|
1271
1271
|
this.__tnFam_data = bytes;
|
|
1272
1272
|
this.__tnFam_dataCount = elementCount;
|
|
1273
|
-
this.set_data_size(elementCount);
|
|
1273
|
+
this.set_data_size(__tnToBigInt(elementCount));
|
|
1274
1274
|
this.__tnInvalidate();
|
|
1275
1275
|
});
|
|
1276
1276
|
}
|