@zkproofport-ai/sdk 0.2.6 → 0.2.8
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/README.md +3 -18
- package/dist/constants.d.ts +0 -4
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +0 -4
- package/dist/constants.js.map +1 -1
- package/dist/flow.d.ts +5 -6
- package/dist/flow.d.ts.map +1 -1
- package/dist/flow.js +14 -39
- package/dist/flow.js.map +1 -1
- package/dist/index.d.ts +2 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -4
- package/dist/index.js.map +1 -1
- package/dist/prove.d.ts +4 -6
- package/dist/prove.d.ts.map +1 -1
- package/dist/prove.js +17 -13
- package/dist/prove.js.map +1 -1
- package/dist/session.d.ts +2 -2
- package/dist/session.js +2 -2
- package/dist/types.d.ts +0 -32
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/cdp.d.ts +0 -142
- package/dist/cdp.d.ts.map +0 -1
- package/dist/cdp.js +0 -78
- package/dist/cdp.js.map +0 -1
- package/dist/payment.d.ts +0 -17
- package/dist/payment.d.ts.map +0 -1
- package/dist/payment.js +0 -121
- package/dist/payment.js.map +0 -1
package/README.md
CHANGED
|
@@ -342,23 +342,8 @@ interface ProofportSigner {
|
|
|
342
342
|
// Create signer from ethers private key
|
|
343
343
|
function fromPrivateKey(key: string, provider?: ethers.Provider): ProofportSigner;
|
|
344
344
|
|
|
345
|
-
// Create signer from
|
|
346
|
-
|
|
347
|
-
constructor(wallet: {
|
|
348
|
-
getAddress(): string | Promise<string>;
|
|
349
|
-
signMessage(message: Uint8Array | string): Promise<string>;
|
|
350
|
-
signTypedData(domain: Record<string, unknown>, types: Record<string, Array<{ name: string; type: string }>>, message: Record<string, unknown>): Promise<string>;
|
|
351
|
-
sendTransaction?(tx: { to: string; data: string; value?: bigint }): Promise<{ hash: string; wait(): Promise<{ status: number | null }> }>;
|
|
352
|
-
});
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
// Wrap external wallet (WalletConnect, MetaMask, Privy, etc.)
|
|
356
|
-
function fromExternalWallet(wallet: {
|
|
357
|
-
getAddress(): string | Promise<string>;
|
|
358
|
-
signMessage(message: Uint8Array): Promise<string>;
|
|
359
|
-
signTypedData(domain: any, types: any, message: any): Promise<string>;
|
|
360
|
-
sendTransaction?(tx: any): Promise<{ hash: string; wait(): Promise<any> }>;
|
|
361
|
-
}): ProofportSigner;
|
|
345
|
+
// Create signer from ethers Wallet
|
|
346
|
+
function fromSigner(signer: ethers.Signer): ProofportSigner;
|
|
362
347
|
```
|
|
363
348
|
|
|
364
349
|
**Proof Parameters:**
|
|
@@ -393,7 +378,7 @@ interface ProofResult {
|
|
|
393
378
|
} | null;
|
|
394
379
|
timing: {
|
|
395
380
|
totalMs: number;
|
|
396
|
-
|
|
381
|
+
|
|
397
382
|
inputBuildMs?: number;
|
|
398
383
|
proveMs?: number;
|
|
399
384
|
};
|
package/dist/constants.d.ts
CHANGED
|
@@ -6,10 +6,6 @@ export declare const CIRCUITS: Record<string, {
|
|
|
6
6
|
}>;
|
|
7
7
|
export declare const COINBASE_ATTESTER_CONTRACT = "0x357458739F90461b99789350868CD7CF330Dd7EE";
|
|
8
8
|
export declare const AUTHORIZED_SIGNERS: string[];
|
|
9
|
-
export declare const USDC_ADDRESSES: {
|
|
10
|
-
readonly 'base-sepolia': "0x036CbD53842c5426634e7929541eC2318f3dCF7e";
|
|
11
|
-
readonly base: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
|
|
12
|
-
};
|
|
13
9
|
export declare const DEFAULT_EAS_GRAPHQL = "https://base.easscan.org/graphql";
|
|
14
10
|
export declare const DEFAULT_EAS_RPC = "https://mainnet.base.org";
|
|
15
11
|
export declare const RAW_TX_PADDED_LENGTH = 300;
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAeA,CAAC;AAEF,eAAO,MAAM,0BAA0B,+CAA+C,CAAC;AAEvF,eAAO,MAAM,kBAAkB,UAK9B,CAAC;AAEF,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAeA,CAAC;AAEF,eAAO,MAAM,0BAA0B,+CAA+C,CAAC;AAEvF,eAAO,MAAM,kBAAkB,UAK9B,CAAC;AAEF,eAAO,MAAM,mBAAmB,qCAAqC,CAAC;AACtE,eAAO,MAAM,eAAe,6BAA6B,CAAC;AAE1D,eAAO,MAAM,oBAAoB,MAAM,CAAC;AACxC,eAAO,MAAM,sBAAsB,IAAI,CAAC;AACxC,eAAO,MAAM,uBAAuB,KAAK,CAAC"}
|
package/dist/constants.js
CHANGED
|
@@ -21,10 +21,6 @@ export const AUTHORIZED_SIGNERS = [
|
|
|
21
21
|
'0x88fe64ea2e121f49bb77abea6c0a45e93638c3c5',
|
|
22
22
|
'0x44ace9abb148e8412ac4492e9a1ae6bd88226803',
|
|
23
23
|
];
|
|
24
|
-
export const USDC_ADDRESSES = {
|
|
25
|
-
'base-sepolia': '0x036CbD53842c5426634e7929541eC2318f3dCF7e',
|
|
26
|
-
'base': '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
|
|
27
|
-
};
|
|
28
24
|
export const DEFAULT_EAS_GRAPHQL = 'https://base.easscan.org/graphql';
|
|
29
25
|
export const DEFAULT_EAS_RPC = 'https://mainnet.base.org';
|
|
30
26
|
export const RAW_TX_PADDED_LENGTH = 300;
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,QAAQ,GAKhB;IACH,oBAAoB,EAAE;QACpB,WAAW,EAAE,cAAc;QAC3B,WAAW,EAAE,oEAAoE;QACjF,gBAAgB,EAAE,YAAY;KAC/B;IACD,4BAA4B,EAAE;QAC5B,WAAW,EAAE,kBAAkB;QAC/B,WAAW,EAAE,oEAAoE;QACjF,gBAAgB,EAAE,YAAY;KAC/B;IACD,uBAAuB,EAAE;QACvB,WAAW,EAAE,aAAa;QAC1B,SAAS,EAAE,MAAM;KAClB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,4CAA4C,CAAC;AAEvF,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,4CAA4C;IAC5C,4CAA4C;IAC5C,4CAA4C;IAC5C,4CAA4C;CAC7C,CAAC;AAEF,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,QAAQ,GAKhB;IACH,oBAAoB,EAAE;QACpB,WAAW,EAAE,cAAc;QAC3B,WAAW,EAAE,oEAAoE;QACjF,gBAAgB,EAAE,YAAY;KAC/B;IACD,4BAA4B,EAAE;QAC5B,WAAW,EAAE,kBAAkB;QAC/B,WAAW,EAAE,oEAAoE;QACjF,gBAAgB,EAAE,YAAY;KAC/B;IACD,uBAAuB,EAAE;QACvB,WAAW,EAAE,aAAa;QAC1B,SAAS,EAAE,MAAM;KAClB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,4CAA4C,CAAC;AAEvF,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,4CAA4C;IAC5C,4CAA4C;IAC5C,4CAA4C;IAC5C,4CAA4C;CAC7C,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,kCAAkC,CAAC;AACtE,MAAM,CAAC,MAAM,eAAe,GAAG,0BAA0B,CAAC;AAE1D,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CAAC;AACxC,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC;AACxC,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,CAAC"}
|
package/dist/flow.d.ts
CHANGED
|
@@ -4,21 +4,20 @@ export interface FlowCallbacks {
|
|
|
4
4
|
onStep?: (step: StepResult) => void;
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
|
-
* Generate a ZK proof end-to-end
|
|
7
|
+
* Generate a ZK proof end-to-end.
|
|
8
8
|
*
|
|
9
9
|
* Automatically detects E2E encryption: if the server returns a TEE public key
|
|
10
|
-
* in the
|
|
10
|
+
* in the challenge response (TEE mode = nitro), inputs are encrypted with
|
|
11
11
|
* the TEE's attested X25519 public key. Otherwise (TEE disabled), inputs are
|
|
12
12
|
* sent in plaintext.
|
|
13
13
|
*
|
|
14
|
-
* @param config - Server URL
|
|
15
|
-
* @param signers - ProofportSigner for attestation (required)
|
|
14
|
+
* @param config - Server URL
|
|
15
|
+
* @param signers - ProofportSigner for attestation (required)
|
|
16
16
|
* @param params - Circuit name, scope, and optional country params
|
|
17
17
|
* @param callbacks - Optional callbacks for step progress
|
|
18
|
-
* @returns ProofResult with proof, publicInputs,
|
|
18
|
+
* @returns ProofResult with proof, publicInputs, and attestation info
|
|
19
19
|
*/
|
|
20
20
|
export declare function generateProof(config: ClientConfig, signers: {
|
|
21
21
|
attestation: ProofportSigner;
|
|
22
|
-
payment?: ProofportSigner;
|
|
23
22
|
}, params: ProofParams, callbacks?: FlowCallbacks): Promise<ProofResult>;
|
|
24
23
|
//# sourceMappingURL=flow.d.ts.map
|
package/dist/flow.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow.d.ts","sourceRoot":"","sources":["../src/flow.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,YAAY,EAEZ,WAAW,EACX,WAAW,EACX,UAAU,
|
|
1
|
+
{"version":3,"file":"flow.d.ts","sourceRoot":"","sources":["../src/flow.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,YAAY,EAEZ,WAAW,EACX,WAAW,EACX,UAAU,EACX,MAAM,YAAY,CAAC;AAOpB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAInD,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;CACrC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE;IAAE,WAAW,EAAE,eAAe,CAAA;CAAE,EACzC,MAAM,EAAE,WAAW,EACnB,SAAS,CAAC,EAAE,aAAa,GACxB,OAAO,CAAC,WAAW,CAAC,CAmGtB"}
|
package/dist/flow.js
CHANGED
|
@@ -3,28 +3,26 @@ import { CIRCUIT_NAME_MAP } from './types.js';
|
|
|
3
3
|
import { requestChallenge } from './session.js';
|
|
4
4
|
import { prepareInputs, computeSignalHash } from './inputs.js';
|
|
5
5
|
import { prepareOidcPayload } from './oidc-inputs.js';
|
|
6
|
-
import { makePayment } from './payment.js';
|
|
7
6
|
import { submitProof, submitEncryptedProof } from './prove.js';
|
|
8
|
-
import { CIRCUITS
|
|
7
|
+
import { CIRCUITS } from './constants.js';
|
|
9
8
|
import { encryptForTee } from './tee.js';
|
|
10
9
|
/**
|
|
11
|
-
* Generate a ZK proof end-to-end
|
|
10
|
+
* Generate a ZK proof end-to-end.
|
|
12
11
|
*
|
|
13
12
|
* Automatically detects E2E encryption: if the server returns a TEE public key
|
|
14
|
-
* in the
|
|
13
|
+
* in the challenge response (TEE mode = nitro), inputs are encrypted with
|
|
15
14
|
* the TEE's attested X25519 public key. Otherwise (TEE disabled), inputs are
|
|
16
15
|
* sent in plaintext.
|
|
17
16
|
*
|
|
18
|
-
* @param config - Server URL
|
|
19
|
-
* @param signers - ProofportSigner for attestation (required)
|
|
17
|
+
* @param config - Server URL
|
|
18
|
+
* @param signers - ProofportSigner for attestation (required)
|
|
20
19
|
* @param params - Circuit name, scope, and optional country params
|
|
21
20
|
* @param callbacks - Optional callbacks for step progress
|
|
22
|
-
* @returns ProofResult with proof, publicInputs,
|
|
21
|
+
* @returns ProofResult with proof, publicInputs, and attestation info
|
|
23
22
|
*/
|
|
24
23
|
export async function generateProof(config, signers, params, callbacks) {
|
|
25
24
|
const circuitId = CIRCUIT_NAME_MAP[params.circuit];
|
|
26
25
|
const scope = params.scope || 'proofport';
|
|
27
|
-
const paymentSigner = signers.payment || signers.attestation;
|
|
28
26
|
const isOidc = CIRCUITS[circuitId]?.inputType === 'oidc';
|
|
29
27
|
const steps = [];
|
|
30
28
|
function recordStep(step, name, data, startTime) {
|
|
@@ -67,31 +65,12 @@ export async function generateProof(config, signers, params, callbacks) {
|
|
|
67
65
|
oidcPayload = await prepareOidcPayload({ jwt: params.jwt, scope, provider: params.provider });
|
|
68
66
|
recordStep(2, 'Prepare Inputs (OIDC)', { payloadFields: Object.keys(oidcPayload).length }, t2);
|
|
69
67
|
}
|
|
70
|
-
// Step 3: Request
|
|
68
|
+
// Step 3: Request challenge (server returns nonce + TEE key if available)
|
|
71
69
|
let t = Date.now();
|
|
72
70
|
const challenge = await requestChallenge(config, params.circuit);
|
|
73
71
|
const isE2E = !!challenge.teePublicKey;
|
|
74
72
|
recordStep(3, 'Request Challenge', { nonce: challenge.nonce, e2e: isE2E, keyId: challenge.teePublicKey?.keyId ?? null }, t);
|
|
75
|
-
// Step 4:
|
|
76
|
-
t = Date.now();
|
|
77
|
-
let paymentTxHash = '';
|
|
78
|
-
if (challenge.requiresPayment === false) {
|
|
79
|
-
recordStep(4, 'Make Payment', { skipped: true, reason: 'payment_disabled' }, t);
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
const network = challenge.payment.network;
|
|
83
|
-
const paymentInfo = {
|
|
84
|
-
nonce: challenge.nonce,
|
|
85
|
-
recipient: challenge.payment.payTo,
|
|
86
|
-
amount: parseInt(challenge.payment.maxAmountRequired),
|
|
87
|
-
asset: USDC_ADDRESSES[network],
|
|
88
|
-
network: challenge.payment.network,
|
|
89
|
-
instruction: challenge.payment.description,
|
|
90
|
-
};
|
|
91
|
-
paymentTxHash = await makePayment(paymentSigner, paymentInfo, config.facilitatorUrl || challenge.facilitatorUrl, config.facilitatorHeaders);
|
|
92
|
-
recordStep(4, 'Make Payment', { txHash: paymentTxHash }, t);
|
|
93
|
-
}
|
|
94
|
-
// Step 5: Submit proof (encrypted or plaintext based on TEE availability)
|
|
73
|
+
// Step 4: Submit proof (encrypted or plaintext based on TEE availability)
|
|
95
74
|
t = Date.now();
|
|
96
75
|
let proveResponse;
|
|
97
76
|
if (isE2E) {
|
|
@@ -101,36 +80,32 @@ export async function generateProof(config, signers, params, callbacks) {
|
|
|
101
80
|
proveResponse = await submitEncryptedProof(config, {
|
|
102
81
|
circuit: params.circuit,
|
|
103
82
|
encryptedPayload,
|
|
104
|
-
|
|
105
|
-
paymentNonce: challenge.nonce,
|
|
83
|
+
nonce: challenge.nonce,
|
|
106
84
|
});
|
|
107
|
-
recordStep(
|
|
85
|
+
recordStep(4, 'Generate Proof (E2E Encrypted)', proveResponse, t);
|
|
108
86
|
}
|
|
109
87
|
else if (isOidc) {
|
|
110
88
|
// OIDC plaintext path: send payload (JWT + JWKS) — server relays to prover, prover validates + builds inputs
|
|
111
89
|
proveResponse = await submitProof(config, {
|
|
112
90
|
circuit: params.circuit,
|
|
113
91
|
inputs: oidcPayload,
|
|
114
|
-
|
|
115
|
-
paymentNonce: challenge.nonce,
|
|
92
|
+
nonce: challenge.nonce,
|
|
116
93
|
});
|
|
117
|
-
recordStep(
|
|
94
|
+
recordStep(4, 'Generate Proof (OIDC)', proveResponse, t);
|
|
118
95
|
}
|
|
119
96
|
else {
|
|
120
97
|
// Coinbase plaintext path: send pre-computed inputs (TEE disabled / local dev)
|
|
121
98
|
proveResponse = await submitProof(config, {
|
|
122
99
|
circuit: params.circuit,
|
|
123
100
|
inputs: easInputs,
|
|
124
|
-
|
|
125
|
-
paymentNonce: challenge.nonce,
|
|
101
|
+
nonce: challenge.nonce,
|
|
126
102
|
});
|
|
127
|
-
recordStep(
|
|
103
|
+
recordStep(4, 'Generate Proof', proveResponse, t);
|
|
128
104
|
}
|
|
129
105
|
return {
|
|
130
106
|
proof: proveResponse.proof,
|
|
131
107
|
publicInputs: proveResponse.publicInputs,
|
|
132
108
|
proofWithInputs: proveResponse.proofWithInputs,
|
|
133
|
-
paymentTxHash,
|
|
134
109
|
attestation: proveResponse.attestation,
|
|
135
110
|
timing: proveResponse.timing,
|
|
136
111
|
verification: proveResponse.verification,
|
package/dist/flow.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow.js","sourceRoot":"","sources":["../src/flow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"flow.js","sourceRoot":"","sources":["../src/flow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQhC,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EAAE,WAAW,EAAE,oBAAoB,E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AAC,KAAK;SACvB,CAAC,CAAC;QACH,UAAU,CAAC,CAAC,EAAE,uBAAuB,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC;IAC3D,CAAC;SAAM,CAAC;QACN,+EAA+E;QAC/E,aAAa,GAAG,MAAM,WAAW,CAAC,MAAM,EAAE;YACxC,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,MAAM,EAAE,SAAU;YAClB,KAAK,EAAE,SAAS,CAAC,KAAK;SACvB,CAAC,CAAC;QACH,UAAU,CAAC,CAAC,EAAE,gBAAgB,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC;IACpD,CAAC;IAED,OAAO;QACL,KAAK,EAAE,aAAa,CAAC,KAAK;QAC1B,YAAY,EAAE,aAAa,CAAC,YAAY;QACxC,eAAe,EAAE,aAAa,CAAC,eAAe;QAC9C,WAAW,EAAE,aAAa,CAAC,WAAW;QACtC,MAAM,EAAE,aAAa,CAAC,MAAM;QAC5B,YAAY,EAAE,aAAa,CAAC,YAAY;KACzC,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
export type { ClientConfig, CircuitName, CircuitId,
|
|
1
|
+
export type { ClientConfig, CircuitName, CircuitId, ChallengeResponse, ProveInputs, ProveRequest, ProveResponse, VerifyResult, EASAttestation, AttestationData, ProofParams, ProofResult, StepResult, } from './types.js';
|
|
2
2
|
export { CIRCUIT_NAME_MAP, CIRCUIT_ID_MAP } from './types.js';
|
|
3
|
-
export { CIRCUITS, COINBASE_ATTESTER_CONTRACT, AUTHORIZED_SIGNERS,
|
|
3
|
+
export { CIRCUITS, COINBASE_ATTESTER_CONTRACT, AUTHORIZED_SIGNERS, } from './constants.js';
|
|
4
4
|
export { createConfig } from './config.js';
|
|
5
5
|
export { generateProof } from './flow.js';
|
|
6
6
|
export type { FlowCallbacks } from './flow.js';
|
|
7
7
|
export { requestChallenge, createSession } from './session.js';
|
|
8
|
-
export { makePayment } from './payment.js';
|
|
9
8
|
export { submitProof, submitEncryptedProof } from './prove.js';
|
|
10
9
|
export { verifyProof } from './verify.js';
|
|
11
10
|
export { prepareInputs, computeSignalHash, computeScope, computeNullifier, } from './inputs.js';
|
|
@@ -13,8 +12,6 @@ export { prepareOidcInputs, prepareOidcPayload } from './oidc-inputs.js';
|
|
|
13
12
|
export type { OidcCircuitInputs, OidcProvePayload, PrepareOidcParams } from './oidc-inputs.js';
|
|
14
13
|
export type { ProofportSigner } from './signer.js';
|
|
15
14
|
export { EthersWalletSigner, fromEthersWallet, fromPrivateKey } from './signer.js';
|
|
16
|
-
export { CdpWalletSigner, fromExternalWallet } from './cdp.js';
|
|
17
|
-
export type { ExternalWallet } from './cdp.js';
|
|
18
15
|
export { extractDomainFromPublicInputs, extractScopeFromPublicInputs, extractNullifierFromPublicInputs, } from './extract.js';
|
|
19
16
|
export { fetchAttestation, getSignerAddress, } from './attestation.js';
|
|
20
17
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,YAAY,EACZ,WAAW,EACX,SAAS,EACT,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,YAAY,EACZ,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,cAAc,EACd,eAAe,EACf,WAAW,EACX,WAAW,EACX,UAAU,GACX,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAG9D,OAAO,EACL,QAAQ,EACR,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG/C,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACzE,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAG/F,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGnF,OAAO,EACL,6BAA6B,EAC7B,4BAA4B,EAC5B,gCAAgC,GACjC,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
export { CIRCUIT_NAME_MAP, CIRCUIT_ID_MAP } from './types.js';
|
|
2
2
|
// Constants
|
|
3
|
-
export { CIRCUITS, COINBASE_ATTESTER_CONTRACT, AUTHORIZED_SIGNERS,
|
|
3
|
+
export { CIRCUITS, COINBASE_ATTESTER_CONTRACT, AUTHORIZED_SIGNERS, } from './constants.js';
|
|
4
4
|
// Configuration
|
|
5
5
|
export { createConfig } from './config.js';
|
|
6
6
|
// Flow (main entry point)
|
|
7
7
|
export { generateProof } from './flow.js';
|
|
8
8
|
// Individual steps (for step-by-step usage)
|
|
9
9
|
export { requestChallenge, createSession } from './session.js';
|
|
10
|
-
export { makePayment } from './payment.js';
|
|
11
10
|
export { submitProof, submitEncryptedProof } from './prove.js';
|
|
12
11
|
export { verifyProof } from './verify.js';
|
|
13
12
|
// Input computation (customer-facing helpers)
|
|
@@ -15,8 +14,6 @@ export { prepareInputs, computeSignalHash, computeScope, computeNullifier, } fro
|
|
|
15
14
|
// OIDC: SDK fetches JWKS, TEE validates JWT + builds circuit inputs
|
|
16
15
|
export { prepareOidcInputs, prepareOidcPayload } from './oidc-inputs.js';
|
|
17
16
|
export { EthersWalletSigner, fromEthersWallet, fromPrivateKey } from './signer.js';
|
|
18
|
-
// CDP (Coinbase Developer Platform) signer
|
|
19
|
-
export { CdpWalletSigner, fromExternalWallet } from './cdp.js';
|
|
20
17
|
// Extraction helpers (parse publicInputs from proof results)
|
|
21
18
|
export { extractDomainFromPublicInputs, extractScopeFromPublicInputs, extractNullifierFromPublicInputs, } from './extract.js';
|
|
22
19
|
// Attestation (customer-facing helpers)
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE9D,YAAY;AACZ,OAAO,EACL,QAAQ,EACR,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AAExB,gBAAgB;AAChB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,0BAA0B;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG1C,4CAA4C;AAC5C,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,8CAA8C;AAC9C,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAErB,oEAAoE;AACpE,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAKzE,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEnF,6DAA6D;AAC7D,OAAO,EACL,6BAA6B,EAC7B,4BAA4B,EAC5B,gCAAgC,GACjC,MAAM,cAAc,CAAC;AAEtB,wCAAwC;AACxC,OAAO,EACL,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC"}
|
package/dist/prove.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ClientConfig, CircuitName, ProveInputs, ProveResponse } from './types.js';
|
|
2
2
|
import type { EncryptedEnvelope } from './tee.js';
|
|
3
3
|
/**
|
|
4
|
-
* Submit proof generation
|
|
5
|
-
* POST /api/v1/prove
|
|
4
|
+
* Submit proof generation request.
|
|
5
|
+
* POST /api/v1/prove
|
|
6
6
|
*
|
|
7
7
|
* The `inputs` field accepts either:
|
|
8
8
|
* - `ProveInputs` (EAS coinbase path)
|
|
@@ -11,8 +11,7 @@ import type { EncryptedEnvelope } from './tee.js';
|
|
|
11
11
|
export declare function submitProof(config: ClientConfig, request: {
|
|
12
12
|
circuit: CircuitName;
|
|
13
13
|
inputs?: ProveInputs | Record<string, unknown>;
|
|
14
|
-
|
|
15
|
-
paymentNonce: string;
|
|
14
|
+
nonce?: string;
|
|
16
15
|
}): Promise<ProveResponse>;
|
|
17
16
|
/**
|
|
18
17
|
* Submit an E2E encrypted proof request.
|
|
@@ -21,7 +20,6 @@ export declare function submitProof(config: ClientConfig, request: {
|
|
|
21
20
|
export declare function submitEncryptedProof(config: ClientConfig, request: {
|
|
22
21
|
circuit: CircuitName;
|
|
23
22
|
encryptedPayload: EncryptedEnvelope;
|
|
24
|
-
|
|
25
|
-
paymentNonce: string;
|
|
23
|
+
nonce?: string;
|
|
26
24
|
}): Promise<ProveResponse>;
|
|
27
25
|
//# sourceMappingURL=prove.d.ts.map
|
package/dist/prove.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prove.d.ts","sourceRoot":"","sources":["../src/prove.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACxF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAC/B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE;IACP,OAAO,EAAE,WAAW,CAAC;IACrB,MAAM,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/C,
|
|
1
|
+
{"version":3,"file":"prove.d.ts","sourceRoot":"","sources":["../src/prove.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACxF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAC/B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE;IACP,OAAO,EAAE,WAAW,CAAC;IACrB,MAAM,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GACA,OAAO,CAAC,aAAa,CAAC,CAwBxB;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE;IACP,OAAO,EAAE,WAAW,CAAC;IACrB,gBAAgB,EAAE,iBAAiB,CAAC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GACA,OAAO,CAAC,aAAa,CAAC,CA4BxB"}
|
package/dist/prove.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Submit proof generation
|
|
3
|
-
* POST /api/v1/prove
|
|
2
|
+
* Submit proof generation request.
|
|
3
|
+
* POST /api/v1/prove
|
|
4
4
|
*
|
|
5
5
|
* The `inputs` field accepts either:
|
|
6
6
|
* - `ProveInputs` (EAS coinbase path)
|
|
@@ -12,13 +12,15 @@ export async function submitProof(config, request) {
|
|
|
12
12
|
circuit: request.circuit,
|
|
13
13
|
inputs: request.inputs,
|
|
14
14
|
};
|
|
15
|
+
const headers = {
|
|
16
|
+
'Content-Type': 'application/json',
|
|
17
|
+
};
|
|
18
|
+
if (request.nonce) {
|
|
19
|
+
headers['X-Payment-Nonce'] = request.nonce;
|
|
20
|
+
}
|
|
15
21
|
const response = await fetch(url, {
|
|
16
22
|
method: 'POST',
|
|
17
|
-
headers
|
|
18
|
-
'Content-Type': 'application/json',
|
|
19
|
-
'X-Payment-TX': request.paymentTxHash,
|
|
20
|
-
'X-Payment-Nonce': request.paymentNonce,
|
|
21
|
-
},
|
|
23
|
+
headers,
|
|
22
24
|
body: JSON.stringify(body),
|
|
23
25
|
});
|
|
24
26
|
if (!response.ok) {
|
|
@@ -33,13 +35,15 @@ export async function submitProof(config, request) {
|
|
|
33
35
|
*/
|
|
34
36
|
export async function submitEncryptedProof(config, request) {
|
|
35
37
|
const url = `${config.baseUrl}/api/v1/prove`;
|
|
38
|
+
const headers = {
|
|
39
|
+
'Content-Type': 'application/json',
|
|
40
|
+
};
|
|
41
|
+
if (request.nonce) {
|
|
42
|
+
headers['X-Payment-Nonce'] = request.nonce;
|
|
43
|
+
}
|
|
36
44
|
const response = await fetch(url, {
|
|
37
45
|
method: 'POST',
|
|
38
|
-
headers
|
|
39
|
-
'Content-Type': 'application/json',
|
|
40
|
-
'X-Payment-TX': request.paymentTxHash,
|
|
41
|
-
'X-Payment-Nonce': request.paymentNonce,
|
|
42
|
-
},
|
|
46
|
+
headers,
|
|
43
47
|
body: JSON.stringify({
|
|
44
48
|
circuit: request.circuit,
|
|
45
49
|
encrypted_payload: request.encryptedPayload,
|
|
@@ -48,7 +52,7 @@ export async function submitEncryptedProof(config, request) {
|
|
|
48
52
|
if (!response.ok) {
|
|
49
53
|
const error = await response.json().catch(() => ({ message: `HTTP ${response.status}` }));
|
|
50
54
|
if (response.status === 409) {
|
|
51
|
-
throw new Error('TEE key rotated. Retry with a new
|
|
55
|
+
throw new Error('TEE key rotated. Retry with a new challenge to get the updated key.');
|
|
52
56
|
}
|
|
53
57
|
throw new Error(`Proof generation failed: ${JSON.stringify(error)}`);
|
|
54
58
|
}
|
package/dist/prove.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prove.js","sourceRoot":"","sources":["../src/prove.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,MAAoB,EACpB,
|
|
1
|
+
{"version":3,"file":"prove.js","sourceRoot":"","sources":["../src/prove.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,MAAoB,EACpB,OAIC;IAED,MAAM,GAAG,GAAG,GAAG,MAAM,CAAC,OAAO,eAAe,CAAC;IAC7C,MAAM,IAAI,GAA4B;QACpC,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAC;IACF,MAAM,OAAO,GAA2B;QACtC,cAAc,EAAE,kBAAkB;KACnC,CAAC;IACF,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,OAAO,CAAC,iBAAiB,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC;IAC7C,CAAC;IACD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,E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,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC;QAE1F,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YAC5B,MAAM,IAAI,KAAK,CAAC,qEAAqE,CAAC,CAAC;QACzF,CAAC;QAED,MAAM,IAAI,KAAK,CAAC,4BAA4B,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACvE,CAAC;IAED,OAAO,QAAQ,CAAC,IAAI,EAA4B,CAAC;AACnD,CAAC"}
|
package/dist/session.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ClientConfig, CircuitName, ChallengeResponse, ProveInputs } from './types.js';
|
|
2
2
|
/**
|
|
3
|
-
* Request a
|
|
4
|
-
* POST /api/v1/prove without
|
|
3
|
+
* Request a challenge from the server.
|
|
4
|
+
* POST /api/v1/prove without proof headers → server returns nonce + TEE key info.
|
|
5
5
|
*/
|
|
6
6
|
export declare function requestChallenge(config: ClientConfig, circuit: CircuitName, inputs?: ProveInputs): Promise<ChallengeResponse>;
|
|
7
7
|
export { requestChallenge as createSession };
|
package/dist/session.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Request a
|
|
3
|
-
* POST /api/v1/prove without
|
|
2
|
+
* Request a challenge from the server.
|
|
3
|
+
* POST /api/v1/prove without proof headers → server returns nonce + TEE key info.
|
|
4
4
|
*/
|
|
5
5
|
export async function requestChallenge(config, circuit, inputs) {
|
|
6
6
|
const url = `${config.baseUrl}/api/v1/prove`;
|
package/dist/types.d.ts
CHANGED
|
@@ -9,41 +9,11 @@ export declare const CIRCUIT_ID_MAP: Record<CircuitId, CircuitName>;
|
|
|
9
9
|
export interface ClientConfig {
|
|
10
10
|
/** proofport-ai server URL (e.g. https://stg-ai.zkproofport.app) */
|
|
11
11
|
baseUrl: string;
|
|
12
|
-
/** x402 facilitator URL for payment settlement */
|
|
13
|
-
facilitatorUrl?: string;
|
|
14
|
-
/** Optional headers for facilitator auth (e.g., CDP Bearer token) */
|
|
15
|
-
facilitatorHeaders?: Record<string, string>;
|
|
16
|
-
}
|
|
17
|
-
export interface PaymentInfo {
|
|
18
|
-
nonce: string;
|
|
19
|
-
recipient: string;
|
|
20
|
-
amount: number;
|
|
21
|
-
asset: string;
|
|
22
|
-
network: string;
|
|
23
|
-
instruction: string;
|
|
24
|
-
}
|
|
25
|
-
export interface PaymentRequirements {
|
|
26
|
-
scheme: string;
|
|
27
|
-
network: string;
|
|
28
|
-
maxAmountRequired: string;
|
|
29
|
-
resource: string;
|
|
30
|
-
description: string;
|
|
31
|
-
mimeType: string;
|
|
32
|
-
payTo: string;
|
|
33
|
-
extra: {
|
|
34
|
-
name: string;
|
|
35
|
-
version: string;
|
|
36
|
-
nonce: string;
|
|
37
|
-
};
|
|
38
12
|
}
|
|
39
13
|
export interface ChallengeResponse {
|
|
40
14
|
error: string;
|
|
41
15
|
message: string;
|
|
42
16
|
nonce: string;
|
|
43
|
-
/** false when server PAYMENT_MODE=disabled — skip payment step entirely */
|
|
44
|
-
requiresPayment?: boolean;
|
|
45
|
-
payment: PaymentRequirements;
|
|
46
|
-
facilitatorUrl?: string;
|
|
47
17
|
teePublicKey?: {
|
|
48
18
|
publicKey: string;
|
|
49
19
|
keyId: string;
|
|
@@ -99,7 +69,6 @@ export interface ProveResponse {
|
|
|
99
69
|
} | null;
|
|
100
70
|
timing: {
|
|
101
71
|
totalMs: number;
|
|
102
|
-
paymentVerifyMs?: number;
|
|
103
72
|
inputBuildMs?: number;
|
|
104
73
|
proveMs?: number;
|
|
105
74
|
};
|
|
@@ -144,7 +113,6 @@ export interface ProofResult {
|
|
|
144
113
|
proof: string;
|
|
145
114
|
publicInputs: string;
|
|
146
115
|
proofWithInputs: string;
|
|
147
|
-
paymentTxHash: string;
|
|
148
116
|
attestation: ProveResponse['attestation'];
|
|
149
117
|
timing: ProveResponse['timing'];
|
|
150
118
|
verification: ProveResponse['verification'];
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,uCAAuC;AACvC,MAAM,MAAM,WAAW,GAAG,cAAc,GAAG,kBAAkB,GAAG,aAAa,CAAC;AAE9E,uDAAuD;AACvD,MAAM,MAAM,SAAS,GAAG,sBAAsB,GAAG,8BAA8B,GAAG,yBAAyB,CAAC;AAE5G,0DAA0D;AAC1D,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,WAAW,EAAE,SAAS,CAI3D,CAAC;AAEF,+DAA+D;AAC/D,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,SAAS,EAAE,WAAW,CAIzD,CAAC;AAIF,MAAM,WAAW,YAAY;IAC3B,oEAAoE;IACpE,OAAO,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,uCAAuC;AACvC,MAAM,MAAM,WAAW,GAAG,cAAc,GAAG,kBAAkB,GAAG,aAAa,CAAC;AAE9E,uDAAuD;AACvD,MAAM,MAAM,SAAS,GAAG,sBAAsB,GAAG,8BAA8B,GAAG,yBAAyB,CAAC;AAE5G,0DAA0D;AAC1D,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,WAAW,EAAE,SAAS,CAI3D,CAAC;AAEF,+DAA+D;AAC/D,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,SAAS,EAAE,WAAW,CAIzD,CAAC;AAIF,MAAM,WAAW,YAAY;IAC3B,oEAAoE;IACpE,OAAO,EAAE,MAAM,CAAC;CACjB;AAID,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,mB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AAC,EAAE,QAAQ,GAAG,WAAW,CAAC;CACnC;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;IAC1C,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChC,YAAY,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;CAC7C;AAID,MAAM,WAAW,UAAU,CAAC,CAAC,GAAG,OAAO;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,CAAC,CAAC;IACR,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
package/package.json
CHANGED
package/dist/cdp.d.ts
DELETED
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import type { ProofportSigner } from './signer.js';
|
|
2
|
-
/**
|
|
3
|
-
* Adapter interface for CDP wallet-like objects (or any external wallet).
|
|
4
|
-
*
|
|
5
|
-
* Pass any object that satisfies these method signatures — CDP MPC wallets,
|
|
6
|
-
* viem wallets, Privy embedded wallets, etc. — and wrap it with
|
|
7
|
-
* `CdpWalletSigner` or `fromExternalWallet()` to get a `ProofportSigner`.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```typescript
|
|
11
|
-
* // With @coinbase/cdp-sdk
|
|
12
|
-
* import { CdpClient } from '@coinbase/cdp-sdk';
|
|
13
|
-
* import { CdpWalletSigner } from '@zkproofport-ai/sdk';
|
|
14
|
-
*
|
|
15
|
-
* const cdp = new CdpClient();
|
|
16
|
-
* const wallet = await cdp.evm.getOrCreateWallet({ networkId: 'base' });
|
|
17
|
-
* const account = await wallet.getDefaultAddress();
|
|
18
|
-
*
|
|
19
|
-
* const signer = new CdpWalletSigner({
|
|
20
|
-
* getAddress: () => account.getId(),
|
|
21
|
-
* signMessage: (msg) => account.signPayload({ payload: Buffer.from(msg).toString('hex') }).then(r => r.signature),
|
|
22
|
-
* signTypedData: (domain, types, message) => account.signTypedData({ domain, types, message }),
|
|
23
|
-
* sendTransaction: async (tx) => {
|
|
24
|
-
* const result = await account.sendTransaction(tx);
|
|
25
|
-
* return { hash: result.transactionHash, wait: async () => ({ status: 1 }) };
|
|
26
|
-
* },
|
|
27
|
-
* });
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
export interface ExternalWallet {
|
|
31
|
-
/**
|
|
32
|
-
* Returns the wallet's Ethereum address.
|
|
33
|
-
* May be synchronous or asynchronous depending on the provider.
|
|
34
|
-
*/
|
|
35
|
-
getAddress(): string | Promise<string>;
|
|
36
|
-
/**
|
|
37
|
-
* Signs a raw message (personal_sign style).
|
|
38
|
-
* Accepts either a Uint8Array of raw bytes or a pre-encoded string.
|
|
39
|
-
*/
|
|
40
|
-
signMessage(message: Uint8Array | string): Promise<string>;
|
|
41
|
-
/**
|
|
42
|
-
* Signs EIP-712 typed data.
|
|
43
|
-
* Compatible with ethers v6 `signTypedData` and viem `signTypedData` call shapes.
|
|
44
|
-
*/
|
|
45
|
-
signTypedData(domain: Record<string, unknown>, types: Record<string, Array<{
|
|
46
|
-
name: string;
|
|
47
|
-
type: string;
|
|
48
|
-
}>>, message: Record<string, unknown>): Promise<string>;
|
|
49
|
-
/**
|
|
50
|
-
* Sends a transaction and returns the hash plus a `wait()` helper.
|
|
51
|
-
* Optional — omit if the wallet is used only for signing (e.g., attestation signer).
|
|
52
|
-
* If omitted and `sendTransaction` is called on the signer, an error is thrown at runtime.
|
|
53
|
-
*/
|
|
54
|
-
sendTransaction?(tx: {
|
|
55
|
-
to: string;
|
|
56
|
-
data: string;
|
|
57
|
-
value?: bigint;
|
|
58
|
-
}): Promise<{
|
|
59
|
-
hash: string;
|
|
60
|
-
wait(): Promise<{
|
|
61
|
-
status: number | null;
|
|
62
|
-
}>;
|
|
63
|
-
}>;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Adapter that bridges any `ExternalWallet`-compatible object to the
|
|
67
|
-
* `ProofportSigner` interface. No additional npm dependencies required —
|
|
68
|
-
* the caller brings their own wallet implementation.
|
|
69
|
-
*
|
|
70
|
-
* @example
|
|
71
|
-
* ```typescript
|
|
72
|
-
* import { CdpWalletSigner } from '@zkproofport-ai/sdk';
|
|
73
|
-
*
|
|
74
|
-
* // Wrap any CDP / external wallet
|
|
75
|
-
* const signer = new CdpWalletSigner(myExternalWallet);
|
|
76
|
-
*
|
|
77
|
-
* // Use as attestation signer
|
|
78
|
-
* const client = new ProofportClient({ ... }, { attestation: signer });
|
|
79
|
-
* ```
|
|
80
|
-
*/
|
|
81
|
-
export declare class CdpWalletSigner implements ProofportSigner {
|
|
82
|
-
private readonly wallet;
|
|
83
|
-
constructor(wallet: ExternalWallet);
|
|
84
|
-
/** Returns the wallet address, resolving async providers transparently. */
|
|
85
|
-
getAddress(): string | Promise<string>;
|
|
86
|
-
/**
|
|
87
|
-
* Signs a raw byte message.
|
|
88
|
-
* Passes the Uint8Array directly to the underlying wallet; the wallet is
|
|
89
|
-
* responsible for any encoding (e.g., personal_sign prefix).
|
|
90
|
-
*/
|
|
91
|
-
signMessage(message: Uint8Array): Promise<string>;
|
|
92
|
-
/**
|
|
93
|
-
* Signs EIP-712 typed data.
|
|
94
|
-
* The strict `ProofportSigner` domain shape is widened to
|
|
95
|
-
* `Record<string, unknown>` when forwarded so any external wallet
|
|
96
|
-
* implementation can accept it without type conflicts.
|
|
97
|
-
*/
|
|
98
|
-
signTypedData(domain: {
|
|
99
|
-
name: string;
|
|
100
|
-
version: string;
|
|
101
|
-
chainId: number;
|
|
102
|
-
verifyingContract: string;
|
|
103
|
-
}, types: Record<string, Array<{
|
|
104
|
-
name: string;
|
|
105
|
-
type: string;
|
|
106
|
-
}>>, message: Record<string, unknown>): Promise<string>;
|
|
107
|
-
/**
|
|
108
|
-
* Sends a transaction via the underlying wallet.
|
|
109
|
-
* Throws a descriptive error if the wrapped wallet did not provide
|
|
110
|
-
* a `sendTransaction` method (e.g., signing-only attestation wallets).
|
|
111
|
-
*/
|
|
112
|
-
sendTransaction(tx: {
|
|
113
|
-
to: string;
|
|
114
|
-
data: string;
|
|
115
|
-
value?: bigint;
|
|
116
|
-
}): Promise<{
|
|
117
|
-
hash: string;
|
|
118
|
-
wait(): Promise<{
|
|
119
|
-
status: number | null;
|
|
120
|
-
}>;
|
|
121
|
-
}>;
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Convenience factory — equivalent to `new CdpWalletSigner(wallet)`.
|
|
125
|
-
*
|
|
126
|
-
* Useful for returning a `ProofportSigner` without exposing the concrete
|
|
127
|
-
* `CdpWalletSigner` class to callers.
|
|
128
|
-
*
|
|
129
|
-
* @example
|
|
130
|
-
* ```typescript
|
|
131
|
-
* import { fromExternalWallet } from '@zkproofport-ai/sdk';
|
|
132
|
-
*
|
|
133
|
-
* const signer = fromExternalWallet({
|
|
134
|
-
* getAddress: () => '0xYourAddress',
|
|
135
|
-
* signMessage: (msg) => myWallet.sign(msg),
|
|
136
|
-
* signTypedData: (domain, types, message) =>
|
|
137
|
-
* myWallet.signTypedData({ domain, types, message }),
|
|
138
|
-
* });
|
|
139
|
-
* ```
|
|
140
|
-
*/
|
|
141
|
-
export declare function fromExternalWallet(wallet: ExternalWallet): ProofportSigner;
|
|
142
|
-
//# sourceMappingURL=cdp.d.ts.map
|
package/dist/cdp.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cdp.d.ts","sourceRoot":"","sources":["../src/cdp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,UAAU,IAAI,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEvC;;;OAGG;IACH,WAAW,CAAC,OAAO,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EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,EAC5D,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,OAAO,CAAC,MAAM,CAAC;IAIlB;;;;OAIG;IACG,eAAe,CAAC,EAAE,EAAE;QACxB,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,IAAI,OAAO,CAAC;YAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;SAAE,CAAC,CAAA;KAAE,CAAC;CAU1E;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,cAAc,GAAG,eAAe,CAE1E"}
|
package/dist/cdp.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Adapter that bridges any `ExternalWallet`-compatible object to the
|
|
3
|
-
* `ProofportSigner` interface. No additional npm dependencies required —
|
|
4
|
-
* the caller brings their own wallet implementation.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```typescript
|
|
8
|
-
* import { CdpWalletSigner } from '@zkproofport-ai/sdk';
|
|
9
|
-
*
|
|
10
|
-
* // Wrap any CDP / external wallet
|
|
11
|
-
* const signer = new CdpWalletSigner(myExternalWallet);
|
|
12
|
-
*
|
|
13
|
-
* // Use as attestation signer
|
|
14
|
-
* const client = new ProofportClient({ ... }, { attestation: signer });
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
export class CdpWalletSigner {
|
|
18
|
-
wallet;
|
|
19
|
-
constructor(wallet) {
|
|
20
|
-
this.wallet = wallet;
|
|
21
|
-
}
|
|
22
|
-
/** Returns the wallet address, resolving async providers transparently. */
|
|
23
|
-
getAddress() {
|
|
24
|
-
return this.wallet.getAddress();
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Signs a raw byte message.
|
|
28
|
-
* Passes the Uint8Array directly to the underlying wallet; the wallet is
|
|
29
|
-
* responsible for any encoding (e.g., personal_sign prefix).
|
|
30
|
-
*/
|
|
31
|
-
async signMessage(message) {
|
|
32
|
-
return this.wallet.signMessage(message);
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Signs EIP-712 typed data.
|
|
36
|
-
* The strict `ProofportSigner` domain shape is widened to
|
|
37
|
-
* `Record<string, unknown>` when forwarded so any external wallet
|
|
38
|
-
* implementation can accept it without type conflicts.
|
|
39
|
-
*/
|
|
40
|
-
async signTypedData(domain, types, message) {
|
|
41
|
-
return this.wallet.signTypedData(domain, types, message);
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Sends a transaction via the underlying wallet.
|
|
45
|
-
* Throws a descriptive error if the wrapped wallet did not provide
|
|
46
|
-
* a `sendTransaction` method (e.g., signing-only attestation wallets).
|
|
47
|
-
*/
|
|
48
|
-
async sendTransaction(tx) {
|
|
49
|
-
if (typeof this.wallet.sendTransaction !== 'function') {
|
|
50
|
-
throw new Error('CdpWalletSigner: the wrapped wallet does not implement sendTransaction. ' +
|
|
51
|
-
'Provide a sendTransaction method on the ExternalWallet object, or use a ' +
|
|
52
|
-
'different signer for payment transactions.');
|
|
53
|
-
}
|
|
54
|
-
return this.wallet.sendTransaction(tx);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Convenience factory — equivalent to `new CdpWalletSigner(wallet)`.
|
|
59
|
-
*
|
|
60
|
-
* Useful for returning a `ProofportSigner` without exposing the concrete
|
|
61
|
-
* `CdpWalletSigner` class to callers.
|
|
62
|
-
*
|
|
63
|
-
* @example
|
|
64
|
-
* ```typescript
|
|
65
|
-
* import { fromExternalWallet } from '@zkproofport-ai/sdk';
|
|
66
|
-
*
|
|
67
|
-
* const signer = fromExternalWallet({
|
|
68
|
-
* getAddress: () => '0xYourAddress',
|
|
69
|
-
* signMessage: (msg) => myWallet.sign(msg),
|
|
70
|
-
* signTypedData: (domain, types, message) =>
|
|
71
|
-
* myWallet.signTypedData({ domain, types, message }),
|
|
72
|
-
* });
|
|
73
|
-
* ```
|
|
74
|
-
*/
|
|
75
|
-
export function fromExternalWallet(wallet) {
|
|
76
|
-
return new CdpWalletSigner(wallet);
|
|
77
|
-
}
|
|
78
|
-
//# sourceMappingURL=cdp.js.map
|
package/dist/cdp.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cdp.js","sourceRoot":"","sources":["../src/cdp.ts"],"names":[],"mappings":"AAiEA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,eAAe;IACT,MAAM,CAAiB;IAExC,YAAY,MAAsB;QAChC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,2EAA2E;IAC3E,UAAU;QACR,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;IAClC,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,WAAW,CAAC,OAAmB;QACnC,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,aAAa,CACjB,MAKC,EACD,KAA4D,EAC5D,OAAgC;QAEhC,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,MAAiC,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACtF,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,eAAe,CAAC,EAIrB;QACC,IAAI,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,KAAK,UAAU,EAAE,CAAC;YACtD,MAAM,IAAI,KAAK,CACb,0EAA0E;gBACxE,0EAA0E;gBAC1E,4CAA4C,CAC/C,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;IACzC,CAAC;CACF;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAsB;IACvD,OAAO,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC;AACrC,CAAC"}
|
package/dist/payment.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { PaymentInfo } from './types.js';
|
|
2
|
-
import type { ProofportSigner } from './signer.js';
|
|
3
|
-
/**
|
|
4
|
-
* Make payment for a proof session via x402 protocol.
|
|
5
|
-
*
|
|
6
|
-
* Uses EIP-3009 TransferWithAuthorization signed by the client,
|
|
7
|
-
* settled via x402 facilitator (facilitator pays gas).
|
|
8
|
-
* Works on both Base Sepolia (testnet) and Base (mainnet).
|
|
9
|
-
*
|
|
10
|
-
* @param signer - ProofportSigner (ethers, CDP MPC, or any implementation)
|
|
11
|
-
* @param payment - PaymentInfo from session or 402 response
|
|
12
|
-
* @param facilitatorUrl - Optional x402 facilitator URL (defaults to https://x402.dexter.cash)
|
|
13
|
-
* @param facilitatorHeaders - Optional headers for facilitator auth (e.g., CDP Bearer token)
|
|
14
|
-
* @returns Transaction hash
|
|
15
|
-
*/
|
|
16
|
-
export declare function makePayment(signer: ProofportSigner, payment: PaymentInfo, facilitatorUrl?: string, facilitatorHeaders?: Record<string, string>): Promise<string>;
|
|
17
|
-
//# sourceMappingURL=payment.d.ts.map
|
package/dist/payment.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"payment.d.ts","sourceRoot":"","sources":["../src/payment.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAenD;;;;;;;;;;;;GAYG;AACH,wBAAsB,WAAW,CAC/B,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,WAAW,EACpB,cAAc,CAAC,EAAE,MAAM,EACvB,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC1C,OAAO,CAAC,MAAM,CAAC,CA6GjB"}
|
package/dist/payment.js
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { ethers } from 'ethers';
|
|
2
|
-
const DEFAULT_X402_FACILITATOR = 'https://x402.dexter.cash';
|
|
3
|
-
const CHAIN_IDS = {
|
|
4
|
-
'base-sepolia': 84532,
|
|
5
|
-
'base': 8453,
|
|
6
|
-
};
|
|
7
|
-
// EIP-712 domain names per USDC contract (queried via name() on-chain)
|
|
8
|
-
const USDC_DOMAIN_NAMES = {
|
|
9
|
-
'base-sepolia': 'USDC',
|
|
10
|
-
'base': 'USD Coin',
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Make payment for a proof session via x402 protocol.
|
|
14
|
-
*
|
|
15
|
-
* Uses EIP-3009 TransferWithAuthorization signed by the client,
|
|
16
|
-
* settled via x402 facilitator (facilitator pays gas).
|
|
17
|
-
* Works on both Base Sepolia (testnet) and Base (mainnet).
|
|
18
|
-
*
|
|
19
|
-
* @param signer - ProofportSigner (ethers, CDP MPC, or any implementation)
|
|
20
|
-
* @param payment - PaymentInfo from session or 402 response
|
|
21
|
-
* @param facilitatorUrl - Optional x402 facilitator URL (defaults to https://x402.dexter.cash)
|
|
22
|
-
* @param facilitatorHeaders - Optional headers for facilitator auth (e.g., CDP Bearer token)
|
|
23
|
-
* @returns Transaction hash
|
|
24
|
-
*/
|
|
25
|
-
export async function makePayment(signer, payment, facilitatorUrl, facilitatorHeaders) {
|
|
26
|
-
const facilitator = facilitatorUrl || DEFAULT_X402_FACILITATOR;
|
|
27
|
-
const network = payment.network;
|
|
28
|
-
const chainId = CHAIN_IDS[network];
|
|
29
|
-
if (!chainId) {
|
|
30
|
-
throw new Error(`Unsupported network: ${network}`);
|
|
31
|
-
}
|
|
32
|
-
// Pad nonce to bytes32 (EIP-3009 requires bytes32 nonce)
|
|
33
|
-
const nonce = ethers.zeroPadValue(payment.nonce, 32);
|
|
34
|
-
// Validity window
|
|
35
|
-
const validAfter = 0;
|
|
36
|
-
const validBefore = Math.floor(Date.now() / 1000) + 3600; // 1 hour
|
|
37
|
-
// EIP-712 domain for USDC (domain name differs between testnet and mainnet)
|
|
38
|
-
const domain = {
|
|
39
|
-
name: USDC_DOMAIN_NAMES[network] || 'USD Coin',
|
|
40
|
-
version: '2',
|
|
41
|
-
chainId,
|
|
42
|
-
verifyingContract: payment.asset,
|
|
43
|
-
};
|
|
44
|
-
const types = {
|
|
45
|
-
TransferWithAuthorization: [
|
|
46
|
-
{ name: 'from', type: 'address' },
|
|
47
|
-
{ name: 'to', type: 'address' },
|
|
48
|
-
{ name: 'value', type: 'uint256' },
|
|
49
|
-
{ name: 'validAfter', type: 'uint256' },
|
|
50
|
-
{ name: 'validBefore', type: 'uint256' },
|
|
51
|
-
{ name: 'nonce', type: 'bytes32' },
|
|
52
|
-
],
|
|
53
|
-
};
|
|
54
|
-
const from = await signer.getAddress();
|
|
55
|
-
const message = {
|
|
56
|
-
from,
|
|
57
|
-
to: payment.recipient,
|
|
58
|
-
value: payment.amount,
|
|
59
|
-
validAfter,
|
|
60
|
-
validBefore,
|
|
61
|
-
nonce,
|
|
62
|
-
};
|
|
63
|
-
// Sign EIP-712 TransferWithAuthorization
|
|
64
|
-
const signature = await signer.signTypedData(domain, types, message);
|
|
65
|
-
// Settle via x402 facilitator (facilitator pays gas)
|
|
66
|
-
const settlePayload = {
|
|
67
|
-
x402Version: 1,
|
|
68
|
-
scheme: 'exact',
|
|
69
|
-
network,
|
|
70
|
-
paymentPayload: {
|
|
71
|
-
x402Version: 1,
|
|
72
|
-
scheme: 'exact',
|
|
73
|
-
network,
|
|
74
|
-
payload: {
|
|
75
|
-
signature,
|
|
76
|
-
authorization: {
|
|
77
|
-
from,
|
|
78
|
-
to: payment.recipient,
|
|
79
|
-
value: String(payment.amount),
|
|
80
|
-
validAfter: String(validAfter),
|
|
81
|
-
validBefore: String(validBefore),
|
|
82
|
-
nonce,
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
paymentRequirements: {
|
|
87
|
-
scheme: 'exact',
|
|
88
|
-
network,
|
|
89
|
-
maxAmountRequired: String(payment.amount),
|
|
90
|
-
asset: payment.asset,
|
|
91
|
-
resource: `${payment.recipient}/proof`,
|
|
92
|
-
description: 'ZK proof generation payment',
|
|
93
|
-
mimeType: 'application/json',
|
|
94
|
-
payTo: payment.recipient,
|
|
95
|
-
extra: {
|
|
96
|
-
name: USDC_DOMAIN_NAMES[network] || 'USD Coin',
|
|
97
|
-
version: '2',
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
};
|
|
101
|
-
const settleResponse = await fetch(`${facilitator}/settle`, {
|
|
102
|
-
method: 'POST',
|
|
103
|
-
headers: { 'Content-Type': 'application/json', ...facilitatorHeaders },
|
|
104
|
-
body: JSON.stringify(settlePayload),
|
|
105
|
-
});
|
|
106
|
-
if (!settleResponse.ok) {
|
|
107
|
-
const error = await settleResponse.text();
|
|
108
|
-
throw new Error(`x402 facilitator settle failed: ${error}`);
|
|
109
|
-
}
|
|
110
|
-
const settleResult = (await settleResponse.json());
|
|
111
|
-
// Check for error reason FIRST — facilitator may return a dummy txHash alongside an error
|
|
112
|
-
if (settleResult.errorReason) {
|
|
113
|
-
throw new Error(`x402 settle failed: ${settleResult.errorReason}`);
|
|
114
|
-
}
|
|
115
|
-
const txHash = settleResult.txHash || settleResult.transaction?.hash || settleResult.transaction;
|
|
116
|
-
if (!txHash) {
|
|
117
|
-
throw new Error(`x402 settle failed: no transaction hash`);
|
|
118
|
-
}
|
|
119
|
-
return txHash;
|
|
120
|
-
}
|
|
121
|
-
//# sourceMappingURL=payment.js.map
|
package/dist/payment.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"payment.js","sourceRoot":"","sources":["../src/payment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIh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