x402z-shared 0.0.13 → 0.0.14

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/index.d.mts CHANGED
@@ -168,9 +168,9 @@ declare const confidentialTokenAbi: readonly [{
168
168
  readonly name: "p";
169
169
  readonly type: "tuple";
170
170
  }, {
171
- readonly internalType: "bytes";
171
+ readonly internalType: "externalEuint64";
172
172
  readonly name: "encryptedAmountInput";
173
- readonly type: "bytes";
173
+ readonly type: "bytes32";
174
174
  }, {
175
175
  readonly internalType: "bytes";
176
176
  readonly name: "inputProof";
@@ -411,7 +411,7 @@ type RelayerSigner = {
411
411
 
412
412
  declare function createRelayer(config: FhevmInstanceConfig): Promise<RelayerInstance>;
413
413
 
414
- declare function createEncryptedAmountInput(relayer: RelayerInstance, contractAddress: string, senderAddress: string, amount: number): Promise<{
414
+ declare function createEncryptedAmountInput(relayer: RelayerInstance, contractAddress: string, callerAddress: string, amount: number): Promise<{
415
415
  handle: `0x${string}`;
416
416
  inputProof: `0x${string}`;
417
417
  }>;
package/dist/index.d.ts CHANGED
@@ -168,9 +168,9 @@ declare const confidentialTokenAbi: readonly [{
168
168
  readonly name: "p";
169
169
  readonly type: "tuple";
170
170
  }, {
171
- readonly internalType: "bytes";
171
+ readonly internalType: "externalEuint64";
172
172
  readonly name: "encryptedAmountInput";
173
- readonly type: "bytes";
173
+ readonly type: "bytes32";
174
174
  }, {
175
175
  readonly internalType: "bytes";
176
176
  readonly name: "inputProof";
@@ -411,7 +411,7 @@ type RelayerSigner = {
411
411
 
412
412
  declare function createRelayer(config: FhevmInstanceConfig): Promise<RelayerInstance>;
413
413
 
414
- declare function createEncryptedAmountInput(relayer: RelayerInstance, contractAddress: string, senderAddress: string, amount: number): Promise<{
414
+ declare function createEncryptedAmountInput(relayer: RelayerInstance, contractAddress: string, callerAddress: string, amount: number): Promise<{
415
415
  handle: `0x${string}`;
416
416
  inputProof: `0x${string}`;
417
417
  }>;
package/dist/index.js CHANGED
@@ -123,7 +123,11 @@ var confidentialTokenAbi = [
123
123
  name: "p",
124
124
  type: "tuple"
125
125
  },
126
- { internalType: "bytes", name: "encryptedAmountInput", type: "bytes" },
126
+ {
127
+ internalType: "externalEuint64",
128
+ name: "encryptedAmountInput",
129
+ type: "bytes32"
130
+ },
127
131
  { internalType: "bytes", name: "inputProof", type: "bytes" },
128
132
  { internalType: "bytes", name: "sig", type: "bytes" }
129
133
  ],
@@ -273,10 +277,10 @@ async function createRelayer(config) {
273
277
  }
274
278
  return instance;
275
279
  }
276
- async function createEncryptedAmountInput(relayer, contractAddress, senderAddress, amount) {
280
+ async function createEncryptedAmountInput(relayer, contractAddress, callerAddress, amount) {
277
281
  const normalizedContract = (0, import_viem2.getAddress)(contractAddress);
278
- const normalizedSender = (0, import_viem2.getAddress)(senderAddress);
279
- const encrypted = await relayer.createEncryptedInput(normalizedContract, normalizedSender).add64(amount).encrypt();
282
+ const normalizedCaller = (0, import_viem2.getAddress)(callerAddress);
283
+ const encrypted = await relayer.createEncryptedInput(normalizedContract, normalizedCaller).add64(amount).encrypt();
280
284
  const handle = typeof encrypted.handles[0] === "string" ? encrypted.handles[0] : (0, import_viem2.toHex)(encrypted.handles[0]);
281
285
  const inputProof = typeof encrypted.inputProof === "string" ? encrypted.inputProof : (0, import_viem2.toHex)(encrypted.inputProof);
282
286
  return {
package/dist/index.mjs CHANGED
@@ -85,7 +85,11 @@ var confidentialTokenAbi = [
85
85
  name: "p",
86
86
  type: "tuple"
87
87
  },
88
- { internalType: "bytes", name: "encryptedAmountInput", type: "bytes" },
88
+ {
89
+ internalType: "externalEuint64",
90
+ name: "encryptedAmountInput",
91
+ type: "bytes32"
92
+ },
89
93
  { internalType: "bytes", name: "inputProof", type: "bytes" },
90
94
  { internalType: "bytes", name: "sig", type: "bytes" }
91
95
  ],
@@ -235,10 +239,10 @@ async function createRelayer(config) {
235
239
  }
236
240
  return instance;
237
241
  }
238
- async function createEncryptedAmountInput(relayer, contractAddress, senderAddress, amount) {
242
+ async function createEncryptedAmountInput(relayer, contractAddress, callerAddress, amount) {
239
243
  const normalizedContract = getAddress(contractAddress);
240
- const normalizedSender = getAddress(senderAddress);
241
- const encrypted = await relayer.createEncryptedInput(normalizedContract, normalizedSender).add64(amount).encrypt();
244
+ const normalizedCaller = getAddress(callerAddress);
245
+ const encrypted = await relayer.createEncryptedInput(normalizedContract, normalizedCaller).add64(amount).encrypt();
242
246
  const handle = typeof encrypted.handles[0] === "string" ? encrypted.handles[0] : toHex2(encrypted.handles[0]);
243
247
  const inputProof = typeof encrypted.inputProof === "string" ? encrypted.inputProof : toHex2(encrypted.inputProof);
244
248
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x402z-shared",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",