x402z-shared-web 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 +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +8 -4
- package/dist/index.mjs +8 -4
- package/package.json +1 -1
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: "
|
|
171
|
+
readonly internalType: "externalEuint64";
|
|
172
172
|
readonly name: "encryptedAmountInput";
|
|
173
|
-
readonly type: "
|
|
173
|
+
readonly type: "bytes32";
|
|
174
174
|
}, {
|
|
175
175
|
readonly internalType: "bytes";
|
|
176
176
|
readonly name: "inputProof";
|
|
@@ -414,7 +414,7 @@ declare function getBrowserEthereumProvider(): BrowserEthereumProvider;
|
|
|
414
414
|
declare function createBrowserSigner(provider?: BrowserEthereumProvider): Promise<BrowserSigner>;
|
|
415
415
|
|
|
416
416
|
interface RelayerInstance {
|
|
417
|
-
createEncryptedInput: (contractAddress: string,
|
|
417
|
+
createEncryptedInput: (contractAddress: string, callerAddress: string) => {
|
|
418
418
|
add64: (amount: number) => {
|
|
419
419
|
encrypt: () => Promise<{
|
|
420
420
|
handles: Array<string | Uint8Array>;
|
|
@@ -471,7 +471,7 @@ type RelayerSigner = {
|
|
|
471
471
|
};
|
|
472
472
|
declare function createRelayer(config: FhevmInstanceConfig): Promise<RelayerInstance>;
|
|
473
473
|
declare function initSDK(params?: Parameters<RelayerSdkModule["initSDK"]>[0]): Promise<boolean>;
|
|
474
|
-
declare function createEncryptedAmountInput(relayer: RelayerInstance, contractAddress: string,
|
|
474
|
+
declare function createEncryptedAmountInput(relayer: RelayerInstance, contractAddress: string, callerAddress: string, amount: number): Promise<{
|
|
475
475
|
handle: `0x${string}`;
|
|
476
476
|
inputProof: `0x${string}`;
|
|
477
477
|
}>;
|
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: "
|
|
171
|
+
readonly internalType: "externalEuint64";
|
|
172
172
|
readonly name: "encryptedAmountInput";
|
|
173
|
-
readonly type: "
|
|
173
|
+
readonly type: "bytes32";
|
|
174
174
|
}, {
|
|
175
175
|
readonly internalType: "bytes";
|
|
176
176
|
readonly name: "inputProof";
|
|
@@ -414,7 +414,7 @@ declare function getBrowserEthereumProvider(): BrowserEthereumProvider;
|
|
|
414
414
|
declare function createBrowserSigner(provider?: BrowserEthereumProvider): Promise<BrowserSigner>;
|
|
415
415
|
|
|
416
416
|
interface RelayerInstance {
|
|
417
|
-
createEncryptedInput: (contractAddress: string,
|
|
417
|
+
createEncryptedInput: (contractAddress: string, callerAddress: string) => {
|
|
418
418
|
add64: (amount: number) => {
|
|
419
419
|
encrypt: () => Promise<{
|
|
420
420
|
handles: Array<string | Uint8Array>;
|
|
@@ -471,7 +471,7 @@ type RelayerSigner = {
|
|
|
471
471
|
};
|
|
472
472
|
declare function createRelayer(config: FhevmInstanceConfig): Promise<RelayerInstance>;
|
|
473
473
|
declare function initSDK(params?: Parameters<RelayerSdkModule["initSDK"]>[0]): Promise<boolean>;
|
|
474
|
-
declare function createEncryptedAmountInput(relayer: RelayerInstance, contractAddress: string,
|
|
474
|
+
declare function createEncryptedAmountInput(relayer: RelayerInstance, contractAddress: string, callerAddress: string, amount: number): Promise<{
|
|
475
475
|
handle: `0x${string}`;
|
|
476
476
|
inputProof: `0x${string}`;
|
|
477
477
|
}>;
|
package/dist/index.js
CHANGED
|
@@ -137,7 +137,11 @@ var confidentialTokenAbi = [
|
|
|
137
137
|
name: "p",
|
|
138
138
|
type: "tuple"
|
|
139
139
|
},
|
|
140
|
-
{
|
|
140
|
+
{
|
|
141
|
+
internalType: "externalEuint64",
|
|
142
|
+
name: "encryptedAmountInput",
|
|
143
|
+
type: "bytes32"
|
|
144
|
+
},
|
|
141
145
|
{ internalType: "bytes", name: "inputProof", type: "bytes" },
|
|
142
146
|
{ internalType: "bytes", name: "sig", type: "bytes" }
|
|
143
147
|
],
|
|
@@ -349,10 +353,10 @@ async function initSDK2(params) {
|
|
|
349
353
|
sdkInitialized = true;
|
|
350
354
|
return result;
|
|
351
355
|
}
|
|
352
|
-
async function createEncryptedAmountInput(relayer, contractAddress,
|
|
356
|
+
async function createEncryptedAmountInput(relayer, contractAddress, callerAddress, amount) {
|
|
353
357
|
const normalizedContract = (0, import_viem2.getAddress)(contractAddress);
|
|
354
|
-
const
|
|
355
|
-
const encrypted = await relayer.createEncryptedInput(normalizedContract,
|
|
358
|
+
const normalizedCaller = (0, import_viem2.getAddress)(callerAddress);
|
|
359
|
+
const encrypted = await relayer.createEncryptedInput(normalizedContract, normalizedCaller).add64(amount).encrypt();
|
|
356
360
|
const handle = typeof encrypted.handles[0] === "string" ? encrypted.handles[0] : (0, import_viem2.toHex)(encrypted.handles[0]);
|
|
357
361
|
const inputProof = typeof encrypted.inputProof === "string" ? encrypted.inputProof : (0, import_viem2.toHex)(encrypted.inputProof);
|
|
358
362
|
return {
|
package/dist/index.mjs
CHANGED
|
@@ -85,7 +85,11 @@ var confidentialTokenAbi = [
|
|
|
85
85
|
name: "p",
|
|
86
86
|
type: "tuple"
|
|
87
87
|
},
|
|
88
|
-
{
|
|
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
|
],
|
|
@@ -297,10 +301,10 @@ async function initSDK2(params) {
|
|
|
297
301
|
sdkInitialized = true;
|
|
298
302
|
return result;
|
|
299
303
|
}
|
|
300
|
-
async function createEncryptedAmountInput(relayer, contractAddress,
|
|
304
|
+
async function createEncryptedAmountInput(relayer, contractAddress, callerAddress, amount) {
|
|
301
305
|
const normalizedContract = getAddress(contractAddress);
|
|
302
|
-
const
|
|
303
|
-
const encrypted = await relayer.createEncryptedInput(normalizedContract,
|
|
306
|
+
const normalizedCaller = getAddress(callerAddress);
|
|
307
|
+
const encrypted = await relayer.createEncryptedInput(normalizedContract, normalizedCaller).add64(amount).encrypt();
|
|
304
308
|
const handle = typeof encrypted.handles[0] === "string" ? encrypted.handles[0] : toHex2(encrypted.handles[0]);
|
|
305
309
|
const inputProof = typeof encrypted.inputProof === "string" ? encrypted.inputProof : toHex2(encrypted.inputProof);
|
|
306
310
|
return {
|