@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
|
@@ -3800,7 +3800,8 @@ __tnRegisterFootprint3("AuthorityRecord", (params) => AuthorityRecord.__tnInvoke
|
|
|
3800
3800
|
__tnRegisterValidate3("AuthorityRecord", (buffer, params) => AuthorityRecord.__tnInvokeValidate(buffer, params));
|
|
3801
3801
|
__tnRegisterDynamicValidate3("AuthorityRecord", (buffer) => {
|
|
3802
3802
|
const result = AuthorityRecord.validate(buffer);
|
|
3803
|
-
|
|
3803
|
+
const params = result.params;
|
|
3804
|
+
return { ok: result.ok, code: result.code, consumed: result.consumed === void 0 ? void 0 : __tnToBigInt3(result.consumed), params };
|
|
3804
3805
|
});
|
|
3805
3806
|
var __tn_ir_P256Point = {
|
|
3806
3807
|
typeName: "P256Point",
|
|
@@ -6174,7 +6175,8 @@ var PasskeyEventBuilder = class {
|
|
|
6174
6175
|
if (this.__tnCachedParams) return this.__tnCachedParams;
|
|
6175
6176
|
const params = PasskeyEvent.Params.fromValues({
|
|
6176
6177
|
payload_event_type: (() => {
|
|
6177
|
-
|
|
6178
|
+
if (this.__tnField_event_type === null) throw new Error("PasskeyEventBuilder: missing enum tag");
|
|
6179
|
+
return __tnToBigInt3(this.__tnField_event_type);
|
|
6178
6180
|
})()
|
|
6179
6181
|
});
|
|
6180
6182
|
this.__tnCachedParams = params;
|
|
@@ -6253,8 +6255,8 @@ var CreateArgs = class _CreateArgs {
|
|
|
6253
6255
|
if (__tnCursorMutable + 2 > __tnLength) return null;
|
|
6254
6256
|
view.getUint16(__tnCursorMutable, true);
|
|
6255
6257
|
__tnCursorMutable += 2;
|
|
6256
|
-
if (__tnCursorMutable +
|
|
6257
|
-
__tnCursorMutable +=
|
|
6258
|
+
if (__tnCursorMutable + 73 > __tnLength) return null;
|
|
6259
|
+
__tnCursorMutable += 73;
|
|
6258
6260
|
if (__tnCursorMutable + 32 > __tnLength) return null;
|
|
6259
6261
|
__tnCursorMutable += 32;
|
|
6260
6262
|
const __tnTyperefResult_state_proof = __tnInvokeDynamicValidate3("StateProof", buffer.subarray(__tnCursorMutable));
|
|
@@ -7691,6 +7693,33 @@ async function deriveCredentialLookupAddress(credentialId, programAddress) {
|
|
|
7691
7693
|
const seed = await createCredentialLookupSeed(credentialId);
|
|
7692
7694
|
return deriveWalletAddress(seed, programAddress);
|
|
7693
7695
|
}
|
|
7696
|
+
|
|
7697
|
+
// src/helpers/bytes.ts
|
|
7698
|
+
function bytesEqual(a, b) {
|
|
7699
|
+
if (a.length !== b.length) return false;
|
|
7700
|
+
for (let i = 0; i < a.length; i++) {
|
|
7701
|
+
if (a[i] !== b[i]) return false;
|
|
7702
|
+
}
|
|
7703
|
+
return true;
|
|
7704
|
+
}
|
|
7705
|
+
function compareBytes(a, b) {
|
|
7706
|
+
const len = Math.min(a.length, b.length);
|
|
7707
|
+
for (let i = 0; i < len; i++) {
|
|
7708
|
+
if (a[i] !== b[i]) return a[i] - b[i];
|
|
7709
|
+
}
|
|
7710
|
+
return a.length - b.length;
|
|
7711
|
+
}
|
|
7712
|
+
function uniqueAccounts(accounts) {
|
|
7713
|
+
const unique = [];
|
|
7714
|
+
for (const account of accounts) {
|
|
7715
|
+
if (!unique.some((candidate) => bytesEqual(candidate, account))) {
|
|
7716
|
+
unique.push(account);
|
|
7717
|
+
}
|
|
7718
|
+
}
|
|
7719
|
+
return unique;
|
|
7720
|
+
}
|
|
7721
|
+
|
|
7722
|
+
// src/passkey-manager/encoding.ts
|
|
7694
7723
|
function arrayBufferToBase64Url(buffer) {
|
|
7695
7724
|
const bytes = new Uint8Array(buffer);
|
|
7696
7725
|
let base64 = "";
|
|
@@ -7736,29 +7765,6 @@ function bytesToHex(bytes) {
|
|
|
7736
7765
|
function hexToBytes(hex) {
|
|
7737
7766
|
return helpers.hexToBytes(hex);
|
|
7738
7767
|
}
|
|
7739
|
-
function bytesEqual(a, b) {
|
|
7740
|
-
if (a.length !== b.length) return false;
|
|
7741
|
-
for (let i = 0; i < a.length; i++) {
|
|
7742
|
-
if (a[i] !== b[i]) return false;
|
|
7743
|
-
}
|
|
7744
|
-
return true;
|
|
7745
|
-
}
|
|
7746
|
-
function compareBytes(a, b) {
|
|
7747
|
-
const len = Math.min(a.length, b.length);
|
|
7748
|
-
for (let i = 0; i < len; i++) {
|
|
7749
|
-
if (a[i] !== b[i]) return a[i] - b[i];
|
|
7750
|
-
}
|
|
7751
|
-
return a.length - b.length;
|
|
7752
|
-
}
|
|
7753
|
-
function uniqueAccounts(accounts) {
|
|
7754
|
-
const unique = [];
|
|
7755
|
-
for (const account of accounts) {
|
|
7756
|
-
if (!unique.some((candidate) => bytesEqual(candidate, account))) {
|
|
7757
|
-
unique.push(account);
|
|
7758
|
-
}
|
|
7759
|
-
}
|
|
7760
|
-
return unique;
|
|
7761
|
-
}
|
|
7762
7768
|
|
|
7763
7769
|
// src/passkey-manager/context.ts
|
|
7764
7770
|
var FEE_PAYER_ADDRESS = "taVcZv3wB2m-euBpMHm2rF9fQRY_fO_g7WdOjs70CxDh_S";
|