@zkproofport-ai/sdk 0.3.0 → 0.4.0
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 +52 -134
- package/dist/actionApproval.js +1 -1
- package/dist/actionApproval.js.map +1 -1
- package/dist/attestation.d.ts +6 -1
- package/dist/attestation.d.ts.map +1 -1
- package/dist/attestation.js +41 -4
- package/dist/attestation.js.map +1 -1
- package/dist/cdp.d.ts +3 -3
- package/dist/circuits.d.ts +1 -3
- package/dist/circuits.d.ts.map +1 -1
- package/dist/circuits.js +0 -4
- package/dist/circuits.js.map +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +0 -10
- package/dist/constants.js.map +1 -1
- package/dist/extract.d.ts.map +1 -1
- package/dist/extract.js +5 -7
- package/dist/extract.js.map +1 -1
- package/dist/flow.d.ts.map +1 -1
- package/dist/flow.js +13 -14
- package/dist/flow.js.map +1 -1
- package/dist/index.d.ts +1 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -12
- package/dist/index.js.map +1 -1
- package/dist/inputs.d.ts +4 -3
- package/dist/inputs.d.ts.map +1 -1
- package/dist/inputs.js +4 -7
- package/dist/inputs.js.map +1 -1
- package/dist/payment.d.ts +7 -9
- package/dist/payment.d.ts.map +1 -1
- package/dist/payment.js +20 -43
- package/dist/payment.js.map +1 -1
- package/dist/typedAction.js +1 -1
- package/dist/typedAction.js.map +1 -1
- package/dist/types.d.ts +5 -9
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +1 -1
- package/dist/usdc.d.ts +6 -10
- package/dist/usdc.d.ts.map +1 -1
- package/dist/usdc.js +6 -11
- package/dist/usdc.js.map +1 -1
- package/dist/wallets.d.ts +8 -34
- package/dist/wallets.d.ts.map +1 -1
- package/dist/wallets.js +10 -87
- package/dist/wallets.js.map +1 -1
- package/package.json +2 -12
- package/dist/arcWallet.d.ts +0 -50
- package/dist/arcWallet.d.ts.map +0 -1
- package/dist/arcWallet.js +0 -161
- package/dist/arcWallet.js.map +0 -1
- package/dist/delegation.d.ts +0 -107
- package/dist/delegation.d.ts.map +0 -1
- package/dist/delegation.js +0 -126
- package/dist/delegation.js.map +0 -1
- package/dist/nanopayment.d.ts +0 -71
- package/dist/nanopayment.d.ts.map +0 -1
- package/dist/nanopayment.js +0 -77
- package/dist/nanopayment.js.map +0 -1
package/dist/payment.js
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
* 3. The service settles the authorization and returns the proof.
|
|
11
11
|
*
|
|
12
12
|
* The buyer signs. It never submits a transaction, so it needs no gas and no
|
|
13
|
-
* native balance on the chain it pays on -- only USDC. That holds on Base
|
|
14
|
-
*
|
|
13
|
+
* native balance on the chain it pays on -- only USDC. That holds on Base and
|
|
14
|
+
* on Ethereum alike.
|
|
15
15
|
*
|
|
16
16
|
* ## Why this file is short
|
|
17
17
|
*
|
|
@@ -31,17 +31,14 @@
|
|
|
31
31
|
* ## Which chains
|
|
32
32
|
*
|
|
33
33
|
* Any EVM chain the service offers. The v2 scheme registers as an `eip155:*`
|
|
34
|
-
* wildcard, so nothing here holds a chain list
|
|
35
|
-
*
|
|
36
|
-
* bare names are a fixed 24-chain table inside `@x402/evm` and Arc is not in
|
|
37
|
-
* it.
|
|
34
|
+
* wildcard, so nothing here holds a chain list, and the offer is CAIP-2
|
|
35
|
+
* (`eip155:84532`) rather than a bare name.
|
|
38
36
|
*/
|
|
39
|
-
import { supportsBatching } from '@circle-fin/x402-batching';
|
|
40
37
|
import { usdcSpendControls, isKnownUsdc, knownUsdc, DEFAULT_MAX_PAYMENT } from './usdc.js';
|
|
41
38
|
/**
|
|
42
39
|
* The chains a 402 answer will take payment on, in the order offered.
|
|
43
40
|
*
|
|
44
|
-
* Reading this before paying is what lets a caller choose -- "pay on
|
|
41
|
+
* Reading this before paying is what lets a caller choose -- "pay on Base" is a
|
|
45
42
|
* filter over this list, not a separate code path.
|
|
46
43
|
*/
|
|
47
44
|
export function paymentOffers(challenge) {
|
|
@@ -61,30 +58,30 @@ export function paymentOffers(challenge) {
|
|
|
61
58
|
* Sign payment for one of the offers and return the headers to retry with.
|
|
62
59
|
*
|
|
63
60
|
* `network` names the chain to pay on, as either the CAIP-2 id
|
|
64
|
-
* (`eip155:
|
|
61
|
+
* (`eip155:84532`) or the plain name (`base-sepolia`). Omitting it takes the
|
|
65
62
|
* first offer, which is the order the service listed its chains in.
|
|
66
63
|
*
|
|
67
64
|
* An unmatched name is an error listing what was offered. It is never a
|
|
68
65
|
* silent fall back to the first chain: paying on a chain the caller did not
|
|
69
66
|
* ask for spends real money in the wrong place, and the caller who typed
|
|
70
|
-
* `--network
|
|
67
|
+
* `--network base` would be told the payment succeeded.
|
|
71
68
|
*/
|
|
72
69
|
export function assertApprovedPayment(offer, approved) {
|
|
73
70
|
const extra = offer.raw.extra;
|
|
74
71
|
const isAddress = (value) => typeof value === 'string' && /^0x[0-9a-fA-F]{40}$/.test(value);
|
|
75
72
|
const sameAddress = (a, b) => isAddress(a) && isAddress(b) && a.toLowerCase() === b.toLowerCase();
|
|
76
|
-
|
|
77
|
-
//
|
|
78
|
-
//
|
|
79
|
-
//
|
|
80
|
-
const verifyingContract =
|
|
73
|
+
// Match the signing library, not an optional hint in the 402 response:
|
|
74
|
+
// exact EIP-3009 signs against the token asset. Permit2 has another domain
|
|
75
|
+
// and is not approved here, and neither is a Circle Gateway batched domain
|
|
76
|
+
// (`GatewayWalletBatched`), which this SDK does not sign.
|
|
77
|
+
const verifyingContract = offer.asset;
|
|
81
78
|
const supportedDomain = offer.raw.scheme === 'exact' && /^eip155:[1-9]\d*$/.test(offer.network) &&
|
|
82
79
|
typeof extra?.name === 'string' && extra.name.length > 0 &&
|
|
83
80
|
typeof extra?.version === 'string' && extra.version.length > 0 &&
|
|
84
81
|
(extra.assetTransferMethod === undefined || extra.assetTransferMethod === 'eip3009') &&
|
|
85
|
-
|
|
82
|
+
extra.name !== 'GatewayWalletBatched' &&
|
|
86
83
|
isAddress(verifyingContract) &&
|
|
87
|
-
(
|
|
84
|
+
(extra.verifyingContract === undefined || sameAddress(extra.verifyingContract, offer.asset));
|
|
88
85
|
if (!supportedDomain || offer.network !== approved.network || offer.raw.scheme !== approved.scheme ||
|
|
89
86
|
offer.amount !== approved.amount || !sameAddress(offer.asset, approved.asset) ||
|
|
90
87
|
!sameAddress(offer.payTo, approved.payTo) || extra?.name !== approved.extra.name ||
|
|
@@ -119,9 +116,9 @@ export async function signPayment(challenge, wallet, opts = {}) {
|
|
|
119
116
|
`. Refusing to sign: a 402 answer names the token it wants, and signing whatever it names ` +
|
|
120
117
|
`lets a service ask to be paid in anything.`);
|
|
121
118
|
}
|
|
122
|
-
// x402's top-level USD cap does not cover custom allowed assets
|
|
123
|
-
//
|
|
124
|
-
//
|
|
119
|
+
// x402's top-level USD cap does not cover custom allowed assets. Enforce
|
|
120
|
+
// the same six-decimal limit on the selected offer here, before invoking
|
|
121
|
+
// any signer, whether or not exact terms were supplied.
|
|
125
122
|
const maximum = opts.maxPayment ?? DEFAULT_MAX_PAYMENT;
|
|
126
123
|
const match = /^\$?(\d+)(?:\.(\d{1,6}))?$/.exec(maximum);
|
|
127
124
|
if (!match)
|
|
@@ -134,35 +131,15 @@ export async function signPayment(challenge, wallet, opts = {}) {
|
|
|
134
131
|
}
|
|
135
132
|
const { x402Client, x402HTTPClient } = await import('@x402/core/client');
|
|
136
133
|
const { registerExactEvmScheme } = await import('@x402/evm/exact/client');
|
|
137
|
-
|
|
138
|
-
// Spend controls stay ON. Arc's USDC is not among the library's default
|
|
139
|
-
// assets, so paying there needs the assets named -- not the control
|
|
134
|
+
// Spend controls stay ON, with the USDC assets named -- not the control
|
|
140
135
|
// disabled, which would allow any token on any chain.
|
|
141
136
|
const client = new x402Client();
|
|
142
137
|
client.setSpendControls(usdcSpendControls(opts.maxPayment));
|
|
143
|
-
// How the authorization gets signed depends on the offer.
|
|
144
|
-
//
|
|
145
|
-
// A batched offer is signed against Circle Gateway's wallet contract, not
|
|
146
|
-
// against USDC, and the two signatures are not interchangeable: registering
|
|
147
|
-
// the ordinary scheme and then the batched one leaves the ordinary one
|
|
148
|
-
// signing, which Gateway rejects as `unauthorized` -- a valid signature over
|
|
149
|
-
// the wrong thing. Circle's own way is to hand the ordinary scheme in as the
|
|
150
|
-
// fallback, so ONE composite scheme picks per offer.
|
|
151
|
-
const batched = supportsBatching(offer.raw);
|
|
152
138
|
const signer = {
|
|
153
|
-
address:
|
|
139
|
+
address: wallet.address,
|
|
154
140
|
signTypedData: wallet.signTypedData.bind(wallet),
|
|
155
141
|
};
|
|
156
|
-
|
|
157
|
-
const { ExactEvmScheme } = await import('@x402/evm/exact/client');
|
|
158
|
-
registerBatchScheme(client, {
|
|
159
|
-
signer: signer,
|
|
160
|
-
fallbackScheme: new ExactEvmScheme(wallet),
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
else {
|
|
164
|
-
registerExactEvmScheme(client, { signer: signer });
|
|
165
|
-
}
|
|
142
|
+
registerExactEvmScheme(client, { signer: signer });
|
|
166
143
|
const http = new x402HTTPClient(client);
|
|
167
144
|
const payload = await client.createPaymentPayload({
|
|
168
145
|
x402Version: 2,
|
package/dist/payment.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment.js","sourceRoot":"","sources":["../src/payment.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"payment.js","sourceRoot":"","sources":["../src/payment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAGH,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAE3F;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,SAI7B;IACC,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAA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,CAAC;IAErE,MAAM,MAAM,GAAG;QACb,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,aAAa,EAAE,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC;KACjD,CAAC;IACF,sBAAsB,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,MAAe,EAAE,CAAC,CAAC;IAC5D,MAAM,IAAI,GAAG,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC;IAExC,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC;QAChD,WAAW,EAAE,CAAC;QACd,OAAO,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC;KACZ,CAAC,CAAC;IACZ,MAAM,OAAO,GAAG,IAAI,CAAC,4BAA4B,CAAC,OAAO,CAAC,CAAC;IAE3D,OAAO;QACL,OAAO,EAAE;YACP,GAAG,OAAO;YACV,uEAAuE;YACvE,qEAAqE;YACrE,kEAAkE;YAClE,iEAAiE;YACjE,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACnE;QACD,MAAM,EAAE,KAAK,CAAC,WAAW;QACzB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,KAAK,EAAE,MAAM,CAAC,OAAO;KACtB,CAAC;AACJ,CAAC"}
|
package/dist/typedAction.js
CHANGED
|
@@ -2,7 +2,7 @@ const ADDRESS = /^0x[0-9a-fA-F]{40}$/;
|
|
|
2
2
|
/** The reason the value is not a usable action, or `null` when it is one. */
|
|
3
3
|
export function validateTypedAction(value) {
|
|
4
4
|
if (value === undefined || value === null) {
|
|
5
|
-
return 'action is required
|
|
5
|
+
return 'action is required. The circuit proves that a wallet authorised ONE EIP-712 action; there is nothing to prove without it.';
|
|
6
6
|
}
|
|
7
7
|
if (typeof value !== 'object' || Array.isArray(value)) {
|
|
8
8
|
return 'action must be an object.';
|
package/dist/typedAction.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typedAction.js","sourceRoot":"","sources":["../src/typedAction.ts"],"names":[],"mappings":"AAoBA,MAAM,OAAO,GAAG,qBAAqB,CAAC;AAEtC,6EAA6E;AAC7E,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAChD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAC1C,OAAO
|
|
1
|
+
{"version":3,"file":"typedAction.js","sourceRoot":"","sources":["../src/typedAction.ts"],"names":[],"mappings":"AAoBA,MAAM,OAAO,GAAG,qBAAqB,CAAC;AAEtC,6EAA6E;AAC7E,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAChD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAC1C,OAAO,2HAA2H,CAAC;IACrI,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACtD,OAAO,2BAA2B,CAAC;IACrC,CAAC;IACD,MAAM,CAAC,GAAG,KAA6B,CAAC;IAExC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;IACnB,IAAI,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;QAChC,OAAO,4BAA4B,CAAC;IACtC,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,mBAAmB,CAAU,EAAE,CAAC;QAClE,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACtC,OAAO,iBAAiB,CAAC,8BAA8B,CAAC;QAC1D,CAAC;IACH,CAAC;IACD,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO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AAI,CAAC,CAAC,CAAC,IAAK,CAAC,CAAC,OAAkB,CAAC,CAAC,CAAC;IACvE,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACnB,OAAO,8BAA8B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;IAC5D,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -2,8 +2,6 @@ import { PROVABLE_CIRCUIT_IDS } from './circuits.js';
|
|
|
2
2
|
import type { ActionApproval } from './actionApproval.js';
|
|
3
3
|
/** Client-friendly circuit aliases. */
|
|
4
4
|
export type CircuitName = 'coinbase_kyc' | 'coinbase_country' | 'oidc_domain'
|
|
5
|
-
/** Coinbase KYC, optionally binding the signature to one EIP-712 action. */
|
|
6
|
-
| 'arc_eligibility'
|
|
7
5
|
/** GIWA account attestation, optionally binding one EIP-712 action. */
|
|
8
6
|
| 'giwa_attestation';
|
|
9
7
|
/**
|
|
@@ -170,7 +168,7 @@ export interface ApprovedPayment {
|
|
|
170
168
|
amount: string;
|
|
171
169
|
asset: string;
|
|
172
170
|
payTo: string;
|
|
173
|
-
/** Exact EIP-3009: verifyingContract = asset.
|
|
171
|
+
/** Exact EIP-3009: verifyingContract = asset. */
|
|
174
172
|
extra: {
|
|
175
173
|
name: string;
|
|
176
174
|
version: string;
|
|
@@ -181,7 +179,7 @@ export interface ProofParams {
|
|
|
181
179
|
circuit: CircuitName;
|
|
182
180
|
/**
|
|
183
181
|
* Which chain to pay on, when the service charges. Either the CAIP-2 id
|
|
184
|
-
* (`eip155:
|
|
182
|
+
* (`eip155:84532`) or the plain name (`base-sepolia`).
|
|
185
183
|
*
|
|
186
184
|
* Omitting it takes the first chain the service offers. Naming a chain it
|
|
187
185
|
* does not offer is an error listing what it does -- never a quiet fall
|
|
@@ -202,7 +200,7 @@ export interface ProofParams {
|
|
|
202
200
|
/** OIDC provider: 'google' (default) or 'microsoft' for Microsoft 365 */
|
|
203
201
|
provider?: 'google' | 'microsoft';
|
|
204
202
|
/**
|
|
205
|
-
* Optional for
|
|
203
|
+
* Optional for giwa_attestation; rejected for every
|
|
206
204
|
* other circuit, including OIDC.
|
|
207
205
|
* A human wallet must approve these exact EIP-712 fields. generateProof throws
|
|
208
206
|
* ActionApprovalRequiredError with a resumable handle until approval is ready.
|
|
@@ -242,8 +240,6 @@ export interface StepResult<T = unknown> {
|
|
|
242
240
|
export interface PaymentWallet {
|
|
243
241
|
/** On-chain USDC owner (an EOA or an ERC-1271 smart wallet). */
|
|
244
242
|
address: `0x${string}`;
|
|
245
|
-
/** Separate Circle Gateway depositor, when it differs from the on-chain owner. */
|
|
246
|
-
gatewayAddress?: `0x${string}`;
|
|
247
243
|
signTypedData(message: {
|
|
248
244
|
domain: Record<string, unknown>;
|
|
249
245
|
types: Record<string, unknown>;
|
|
@@ -255,9 +251,9 @@ export interface PaymentWallet {
|
|
|
255
251
|
}
|
|
256
252
|
/** One chain a service will take payment on, from its 402 answer. */
|
|
257
253
|
export interface PaymentOffer {
|
|
258
|
-
/** CAIP-2, e.g. `eip155:
|
|
254
|
+
/** CAIP-2, e.g. `eip155:84532`. */
|
|
259
255
|
network: string;
|
|
260
|
-
/** The plain name, e.g. `
|
|
256
|
+
/** The plain name, e.g. `base-sepolia`. */
|
|
261
257
|
networkName: string;
|
|
262
258
|
/** Price in that chain's USDC, in the token's own units. */
|
|
263
259
|
amount: string;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,uCAAuC;AACvC,MAAM,MAAM,WAAW,GACnB,cAAc,GACd,kBAAkB,GAClB,aAAa;AACf,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","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5,6 @@ export const CIRCUIT_NAME_MAP = {
|
|
|
5
5
|
coinbase_kyc: CIRCUIT_IDS.COINBASE_ATTESTATION,
|
|
6
6
|
coinbase_country: CIRCUIT_IDS.COINBASE_COUNTRY_ATTESTATION,
|
|
7
7
|
oidc_domain: CIRCUIT_IDS.OIDC_DOMAIN_ATTESTATION,
|
|
8
|
-
arc_eligibility: CIRCUIT_IDS.ARC_ELIGIBILITY,
|
|
9
8
|
giwa_attestation: CIRCUIT_IDS.GIWA_ATTESTATION,
|
|
10
9
|
};
|
|
11
10
|
/** Map canonical circuit IDs back to client-friendly names. */
|
|
@@ -13,7 +12,6 @@ export const CIRCUIT_ID_MAP = {
|
|
|
13
12
|
[CIRCUIT_IDS.COINBASE_ATTESTATION]: 'coinbase_kyc',
|
|
14
13
|
[CIRCUIT_IDS.COINBASE_COUNTRY_ATTESTATION]: 'coinbase_country',
|
|
15
14
|
[CIRCUIT_IDS.OIDC_DOMAIN_ATTESTATION]: 'oidc_domain',
|
|
16
|
-
[CIRCUIT_IDS.ARC_ELIGIBILITY]: 'arc_eligibility',
|
|
17
15
|
[CIRCUIT_IDS.GIWA_ATTESTATION]: 'giwa_attestation',
|
|
18
16
|
};
|
|
19
17
|
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAE3E,OAAO,EAAE,WAAW,EAAwB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAE3E,OAAO,EAAE,WAAW,EAAwB,MAAM,eAAe,CAAC;AAsBlE,0DAA0D;AAC1D,MAAM,CAAC,MAAM,gBAAgB,GAAmC;IAC9D,YAAY,EAAE,WAAW,CAAC,oBAAoB;IAC9C,gBAAgB,EAAE,WAAW,CAAC,4BAA4B;IAC1D,WAAW,EAAE,WAAW,CAAC,uBAAuB;IAChD,gBAAgB,EAAE,WAAW,CAAC,gBAAgB;CAC/C,CAAC;AAEF,+DAA+D;AAC/D,MAAM,CAAC,MAAM,cAAc,GAAmC;IAC5D,CAAC,WAAW,CAAC,oBAAoB,CAAC,EAAE,cAAc;IAClD,CAAC,WAAW,CAAC,4BAA4B,CAAC,EAAE,kBAAkB;IAC9D,CAAC,WAAW,CAAC,uBAAuB,CAAC,EAAE,aAAa;IACpD,CAAC,WAAW,CAAC,gBAAgB,CAAC,EAAE,kBAAkB;CACnD,CAAC"}
|
package/dist/usdc.d.ts
CHANGED
|
@@ -9,11 +9,10 @@
|
|
|
9
9
|
* exactly that: it refuses to sign for an asset outside its own default list
|
|
10
10
|
* unless told otherwise, and refusing is the correct behaviour.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* contracts and nothing else.
|
|
12
|
+
* Naming the allowed assets explicitly, rather than `spendControls: false`,
|
|
13
|
+
* matters: turning the control off allows every token on every chain, which is
|
|
14
|
+
* how an agent ends up signing away something nobody meant to spend. This
|
|
15
|
+
* allows four specific contracts and nothing else.
|
|
17
16
|
*
|
|
18
17
|
* So yes, this duplicates the server's table in `src/payment/networks.ts` --
|
|
19
18
|
* deliberately. A shared table would mean the client trusting the server's
|
|
@@ -22,10 +21,7 @@
|
|
|
22
21
|
* ## Keeping it right
|
|
23
22
|
*
|
|
24
23
|
* Each address was read from the chain, not from memory:
|
|
25
|
-
* `decimals()` is 6 and `name()`/`symbol()` say USDC on all
|
|
26
|
-
* ERC-20 view of its native balance, checked on 2026-09-09 -- name "USDC",
|
|
27
|
-
* version "2", decimals 6, and a `DOMAIN_SEPARATOR()` that matches the hash a
|
|
28
|
-
* client computes from those values.
|
|
24
|
+
* `decimals()` is 6 and `name()`/`symbol()` say USDC on all four.
|
|
29
25
|
*/
|
|
30
26
|
/**
|
|
31
27
|
* The most this SDK will sign for in one payment, unless the caller says
|
|
@@ -38,7 +34,7 @@
|
|
|
38
34
|
*/
|
|
39
35
|
export declare const DEFAULT_MAX_PAYMENT = "$1";
|
|
40
36
|
/**
|
|
41
|
-
* The spend controls to sign under: these
|
|
37
|
+
* The spend controls to sign under: these four USDC contracts, capped.
|
|
42
38
|
*
|
|
43
39
|
* Passing an asset the offer names that is NOT in the list produces a refusal
|
|
44
40
|
* from `@x402/core` rather than a signature.
|
package/dist/usdc.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usdc.d.ts","sourceRoot":"","sources":["../src/usdc.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"usdc.d.ts","sourceRoot":"","sources":["../src/usdc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAUH;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,OAAO,CAAC;AAExC;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,CAAC,EAAE,MAAM;;;;;;EAQpD;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAGnE;AAED,yDAAyD;AACzD,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE7D"}
|
package/dist/usdc.js
CHANGED
|
@@ -9,11 +9,10 @@
|
|
|
9
9
|
* exactly that: it refuses to sign for an asset outside its own default list
|
|
10
10
|
* unless told otherwise, and refusing is the correct behaviour.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* contracts and nothing else.
|
|
12
|
+
* Naming the allowed assets explicitly, rather than `spendControls: false`,
|
|
13
|
+
* matters: turning the control off allows every token on every chain, which is
|
|
14
|
+
* how an agent ends up signing away something nobody meant to spend. This
|
|
15
|
+
* allows four specific contracts and nothing else.
|
|
17
16
|
*
|
|
18
17
|
* So yes, this duplicates the server's table in `src/payment/networks.ts` --
|
|
19
18
|
* deliberately. A shared table would mean the client trusting the server's
|
|
@@ -22,10 +21,7 @@
|
|
|
22
21
|
* ## Keeping it right
|
|
23
22
|
*
|
|
24
23
|
* Each address was read from the chain, not from memory:
|
|
25
|
-
* `decimals()` is 6 and `name()`/`symbol()` say USDC on all
|
|
26
|
-
* ERC-20 view of its native balance, checked on 2026-09-09 -- name "USDC",
|
|
27
|
-
* version "2", decimals 6, and a `DOMAIN_SEPARATOR()` that matches the hash a
|
|
28
|
-
* client computes from those values.
|
|
24
|
+
* `decimals()` is 6 and `name()`/`symbol()` say USDC on all four.
|
|
29
25
|
*/
|
|
30
26
|
/** CAIP-2 chain id → the USDC contract on it. */
|
|
31
27
|
const USDC_BY_CHAIN = {
|
|
@@ -33,7 +29,6 @@ const USDC_BY_CHAIN = {
|
|
|
33
29
|
'eip155:11155111': '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238', // Ethereum Sepolia
|
|
34
30
|
'eip155:8453': '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', // Base
|
|
35
31
|
'eip155:84532': '0x036CbD53842c5426634e7929541eC2318f3dCF7e', // Base Sepolia
|
|
36
|
-
'eip155:5042002': '0x3600000000000000000000000000000000000000', // Arc, native USDC's ERC-20 view
|
|
37
32
|
};
|
|
38
33
|
/**
|
|
39
34
|
* The most this SDK will sign for in one payment, unless the caller says
|
|
@@ -46,7 +41,7 @@ const USDC_BY_CHAIN = {
|
|
|
46
41
|
*/
|
|
47
42
|
export const DEFAULT_MAX_PAYMENT = '$1';
|
|
48
43
|
/**
|
|
49
|
-
* The spend controls to sign under: these
|
|
44
|
+
* The spend controls to sign under: these four USDC contracts, capped.
|
|
50
45
|
*
|
|
51
46
|
* Passing an asset the offer names that is NOT in the list produces a refusal
|
|
52
47
|
* from `@x402/core` rather than a signature.
|
package/dist/usdc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usdc.js","sourceRoot":"","sources":["../src/usdc.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"usdc.js","sourceRoot":"","sources":["../src/usdc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,iDAAiD;AACjD,MAAM,aAAa,GAA2B;IAC5C,UAAU,EAAE,4CAA4C,EAAa,WAAW;IAChF,iBAAiB,EAAE,4CAA4C,EAAM,mBAAmB;IACxF,aAAa,EAAE,4CAA4C,EAAU,OAAO;IAC5E,cAAc,EAAE,4CAA4C,EAAS,eAAe;CACrF,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC;AAExC;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,UAAmB;IACnD,OAAO;QACL,mBAAmB,EAAE,UAAU,IAAI,mBAAmB;QACtD,aAAa,EAAE,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;YACtE,OAAO;YACP,KAAK;SACN,CAAC,CAAC;KACJ,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,OAAe,EAAE,KAAa;IACxD,MAAM,KAAK,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;IACrC,OAAO,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC,WAAW,EAAE,CAAC;AAChE,CAAC;AAED,yDAAyD;AACzD,MAAM,UAAU,SAAS,CAAC,OAAe;IACvC,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC"}
|
package/dist/wallets.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The wallet that pays for a proof.
|
|
3
3
|
*
|
|
4
|
-
* ## One interface,
|
|
4
|
+
* ## One interface, two wallets
|
|
5
5
|
*
|
|
6
6
|
* Paying for a proof means signing one EIP-712 message -- an EIP-3009
|
|
7
7
|
* `TransferWithAuthorization` over USDC. Nothing else. No transaction, no gas,
|
|
@@ -17,22 +17,18 @@
|
|
|
17
17
|
* |---|---|---|
|
|
18
18
|
* | a raw private key | `walletFromPrivateKey` | the key |
|
|
19
19
|
* | a Coinbase CDP server wallet | `walletFromCdp` | CDP API key id + secret + wallet secret |
|
|
20
|
-
* | a Circle wallet, including on Arc | `walletFromCircle` | Circle API key + entity secret + wallet id |
|
|
21
20
|
*
|
|
22
|
-
* The chain is chosen separately, when paying. A CDP wallet can pay on
|
|
23
|
-
*
|
|
21
|
+
* The chain is chosen separately, when paying. A CDP wallet can pay on
|
|
22
|
+
* Ethereum or on Base; wallet and chain are independent, and the
|
|
24
23
|
* earlier version of this file got that wrong by baking one into the other.
|
|
25
24
|
*
|
|
26
|
-
* ## Why the CDP
|
|
25
|
+
* ## Why the CDP path is thin
|
|
27
26
|
*
|
|
28
|
-
*
|
|
27
|
+
* Coinbase ships the adapter. `@coinbase/cdp-sdk/x402` exports
|
|
29
28
|
* `fromCdpEvmAccount`, which returns exactly this interface, so the CDP path is
|
|
30
|
-
* a call to their function rather than an EIP-712 client written here.
|
|
31
|
-
* has no x402 adapter, so `walletFromCircle` is the one adapter this file
|
|
32
|
-
* really implements -- eleven lines around `signTypedData`, which is all Circle
|
|
33
|
-
* needs to participate.
|
|
29
|
+
* a call to their function rather than an EIP-712 client written here.
|
|
34
30
|
*
|
|
35
|
-
*
|
|
31
|
+
* The CDP import is lazy. Someone paying from a private key never installs it.
|
|
36
32
|
*/
|
|
37
33
|
import type { PaymentWallet } from './types.js';
|
|
38
34
|
/**
|
|
@@ -59,34 +55,12 @@ export declare function walletFromCdp(opts: {
|
|
|
59
55
|
walletSecret: string;
|
|
60
56
|
walletName?: string;
|
|
61
57
|
}): Promise<PaymentWallet>;
|
|
62
|
-
/**
|
|
63
|
-
* Pay from a Circle developer-controlled wallet -- the way to pay on Arc.
|
|
64
|
-
*
|
|
65
|
-
* Arc is Circle's chain and USDC is its gas asset, so a Circle wallet holding
|
|
66
|
-
* USDC there can pay without holding anything else. `ARC-TESTNET` is the
|
|
67
|
-
* blockchain name in Circle's own SDK types; it is not needed for signing (an
|
|
68
|
-
* authorization is chain-agnostic once the domain names the chain id) and is
|
|
69
|
-
* only used when this wallet is asked which chain it was created for.
|
|
70
|
-
*
|
|
71
|
-
* Note that Arc needs no special case in the payment path itself. Asked
|
|
72
|
-
* directly on 2026-09-09, Arc's USDC at 0x3600...0000 answers name()="USDC",
|
|
73
|
-
* version()="2", decimals()=6, and a DOMAIN_SEPARATOR() that matches what a
|
|
74
|
-
* client computes from those values -- so an Arc authorization is an ordinary
|
|
75
|
-
* USDC authorization and this wallet is an ordinary signer.
|
|
76
|
-
*/
|
|
77
|
-
export declare function walletFromCircle(opts: {
|
|
78
|
-
apiKey: string;
|
|
79
|
-
entitySecret: string;
|
|
80
|
-
walletId: string;
|
|
81
|
-
/** The wallet's address. Read from Circle when omitted. */
|
|
82
|
-
address?: string;
|
|
83
|
-
}): Promise<PaymentWallet>;
|
|
84
58
|
/**
|
|
85
59
|
* The wallet a set of environment variables describes, or an error saying
|
|
86
60
|
* which variables would have been needed.
|
|
87
61
|
*
|
|
88
62
|
* Deliberately refuses to pick when two wallets are configured, rather than
|
|
89
|
-
* preferring one. A machine holding both a
|
|
63
|
+
* preferring one. A machine holding both a private key and a CDP credential has no
|
|
90
64
|
* obvious default, and silently choosing means the money leaves an account the
|
|
91
65
|
* caller did not name.
|
|
92
66
|
*/
|
package/dist/wallets.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallets.d.ts","sourceRoot":"","sources":["../src/wallets.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"wallets.d.ts","sourceRoot":"","sources":["../src/wallets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CASrF;AAED;;;;;;;;;GASG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CAAC,aAAa,CAAC,CA+BzB;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CAAC,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,GAAG,OAAO,CAAC,aAAa,CAAC,CAmBjH;AAED,qDAAqD;AACrD,wBAAsB,SAAS,CAC7B,KAAK,EAAE,MAAM,EACb,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,GACpD,OAAO,CAAC,aAAa,CAAC,CAmBxB"}
|
package/dist/wallets.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The wallet that pays for a proof.
|
|
3
3
|
*
|
|
4
|
-
* ## One interface,
|
|
4
|
+
* ## One interface, two wallets
|
|
5
5
|
*
|
|
6
6
|
* Paying for a proof means signing one EIP-712 message -- an EIP-3009
|
|
7
7
|
* `TransferWithAuthorization` over USDC. Nothing else. No transaction, no gas,
|
|
@@ -17,24 +17,19 @@
|
|
|
17
17
|
* |---|---|---|
|
|
18
18
|
* | a raw private key | `walletFromPrivateKey` | the key |
|
|
19
19
|
* | a Coinbase CDP server wallet | `walletFromCdp` | CDP API key id + secret + wallet secret |
|
|
20
|
-
* | a Circle wallet, including on Arc | `walletFromCircle` | Circle API key + entity secret + wallet id |
|
|
21
20
|
*
|
|
22
|
-
* The chain is chosen separately, when paying. A CDP wallet can pay on
|
|
23
|
-
*
|
|
21
|
+
* The chain is chosen separately, when paying. A CDP wallet can pay on
|
|
22
|
+
* Ethereum or on Base; wallet and chain are independent, and the
|
|
24
23
|
* earlier version of this file got that wrong by baking one into the other.
|
|
25
24
|
*
|
|
26
|
-
* ## Why the CDP
|
|
25
|
+
* ## Why the CDP path is thin
|
|
27
26
|
*
|
|
28
|
-
*
|
|
27
|
+
* Coinbase ships the adapter. `@coinbase/cdp-sdk/x402` exports
|
|
29
28
|
* `fromCdpEvmAccount`, which returns exactly this interface, so the CDP path is
|
|
30
|
-
* a call to their function rather than an EIP-712 client written here.
|
|
31
|
-
* has no x402 adapter, so `walletFromCircle` is the one adapter this file
|
|
32
|
-
* really implements -- eleven lines around `signTypedData`, which is all Circle
|
|
33
|
-
* needs to participate.
|
|
29
|
+
* a call to their function rather than an EIP-712 client written here.
|
|
34
30
|
*
|
|
35
|
-
*
|
|
31
|
+
* The CDP import is lazy. Someone paying from a private key never installs it.
|
|
36
32
|
*/
|
|
37
|
-
import { walletFromArcAgent } from './arcWallet.js';
|
|
38
33
|
/**
|
|
39
34
|
* Pay from a raw private key.
|
|
40
35
|
*
|
|
@@ -91,66 +86,12 @@ export async function walletFromCdp(opts) {
|
|
|
91
86
|
describe: () => `CDP wallet ${opts.walletName ?? 'zkproofport-payer'} (${signer.address})`,
|
|
92
87
|
};
|
|
93
88
|
}
|
|
94
|
-
/**
|
|
95
|
-
* Pay from a Circle developer-controlled wallet -- the way to pay on Arc.
|
|
96
|
-
*
|
|
97
|
-
* Arc is Circle's chain and USDC is its gas asset, so a Circle wallet holding
|
|
98
|
-
* USDC there can pay without holding anything else. `ARC-TESTNET` is the
|
|
99
|
-
* blockchain name in Circle's own SDK types; it is not needed for signing (an
|
|
100
|
-
* authorization is chain-agnostic once the domain names the chain id) and is
|
|
101
|
-
* only used when this wallet is asked which chain it was created for.
|
|
102
|
-
*
|
|
103
|
-
* Note that Arc needs no special case in the payment path itself. Asked
|
|
104
|
-
* directly on 2026-09-09, Arc's USDC at 0x3600...0000 answers name()="USDC",
|
|
105
|
-
* version()="2", decimals()=6, and a DOMAIN_SEPARATOR() that matches what a
|
|
106
|
-
* client computes from those values -- so an Arc authorization is an ordinary
|
|
107
|
-
* USDC authorization and this wallet is an ordinary signer.
|
|
108
|
-
*/
|
|
109
|
-
export async function walletFromCircle(opts) {
|
|
110
|
-
let initiateDeveloperControlledWalletsClient;
|
|
111
|
-
try {
|
|
112
|
-
({ initiateDeveloperControlledWalletsClient } = (await import('@circle-fin/developer-controlled-wallets')));
|
|
113
|
-
}
|
|
114
|
-
catch (e) {
|
|
115
|
-
throw new Error(`Paying from a Circle wallet needs @circle-fin/developer-controlled-wallets installed: ` +
|
|
116
|
-
`npm i @circle-fin/developer-controlled-wallets (${e.message})`);
|
|
117
|
-
}
|
|
118
|
-
const circle = initiateDeveloperControlledWalletsClient({
|
|
119
|
-
apiKey: opts.apiKey,
|
|
120
|
-
entitySecret: opts.entitySecret,
|
|
121
|
-
});
|
|
122
|
-
let address = opts.address;
|
|
123
|
-
if (!address) {
|
|
124
|
-
const got = await circle.getWallet({ id: opts.walletId });
|
|
125
|
-
address = got.data?.wallet?.address;
|
|
126
|
-
if (!address) {
|
|
127
|
-
throw new Error(`Circle wallet ${opts.walletId} has no address; check the wallet id and the API key`);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
return {
|
|
131
|
-
address: address,
|
|
132
|
-
async signTypedData(message) {
|
|
133
|
-
const res = await circle.signTypedData({
|
|
134
|
-
walletId: opts.walletId,
|
|
135
|
-
data: JSON.stringify(message),
|
|
136
|
-
memo: 'ZKProofport proof generation fee',
|
|
137
|
-
});
|
|
138
|
-
const signature = res.data?.signature;
|
|
139
|
-
if (!signature) {
|
|
140
|
-
throw new Error(`Circle wallet ${opts.walletId} returned no signature. A wallet can only sign on a chain it was ` +
|
|
141
|
-
`created for -- check it exists on the chain named in the payment's domain.`);
|
|
142
|
-
}
|
|
143
|
-
return signature;
|
|
144
|
-
},
|
|
145
|
-
describe: () => `Circle wallet ${opts.walletId} (${address})`,
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
89
|
/**
|
|
149
90
|
* The wallet a set of environment variables describes, or an error saying
|
|
150
91
|
* which variables would have been needed.
|
|
151
92
|
*
|
|
152
93
|
* Deliberately refuses to pick when two wallets are configured, rather than
|
|
153
|
-
* preferring one. A machine holding both a
|
|
94
|
+
* preferring one. A machine holding both a private key and a CDP credential has no
|
|
154
95
|
* obvious default, and silently choosing means the money leaves an account the
|
|
155
96
|
* caller did not name.
|
|
156
97
|
*/
|
|
@@ -160,13 +101,10 @@ export async function walletFromEnv(env = process.env) {
|
|
|
160
101
|
configured.push('key');
|
|
161
102
|
if (env.CDP_API_KEY_ID)
|
|
162
103
|
configured.push('cdp');
|
|
163
|
-
if (env.CIRCLE_API_KEY)
|
|
164
|
-
configured.push('circle');
|
|
165
104
|
if (configured.length === 0) {
|
|
166
105
|
throw new Error('No payment wallet configured. Set one of:\n' +
|
|
167
106
|
' PAYMENT_PRIVATE_KEY\n' +
|
|
168
|
-
' CDP_API_KEY_ID + CDP_API_KEY_SECRET + CDP_WALLET_SECRET
|
|
169
|
-
' CIRCLE_API_KEY + CIRCLE_ENTITY_SECRET + CIRCLE_WALLET_ID');
|
|
107
|
+
' CDP_API_KEY_ID + CDP_API_KEY_SECRET + CDP_WALLET_SECRET');
|
|
170
108
|
}
|
|
171
109
|
if (configured.length > 1) {
|
|
172
110
|
throw new Error(`More than one payment wallet is configured (${configured.join(', ')}). ` +
|
|
@@ -192,23 +130,8 @@ export async function walletFor(which, env = process.env) {
|
|
|
192
130
|
walletSecret: need('CDP_WALLET_SECRET'),
|
|
193
131
|
walletName: env.CDP_WALLET_NAME,
|
|
194
132
|
});
|
|
195
|
-
case 'arc':
|
|
196
|
-
// No credentials here: Circle's CLI holds the login, and the wallet is
|
|
197
|
-
// whichever agent wallet that login has on Arc. `ARC_AGENT_WALLET` names
|
|
198
|
-
// one when an account has several.
|
|
199
|
-
return walletFromArcAgent({
|
|
200
|
-
address: env.ARC_AGENT_WALLET,
|
|
201
|
-
chain: env.ARC_CLI_CHAIN ?? undefined,
|
|
202
|
-
});
|
|
203
|
-
case 'circle':
|
|
204
|
-
return walletFromCircle({
|
|
205
|
-
apiKey: need('CIRCLE_API_KEY'),
|
|
206
|
-
entitySecret: need('CIRCLE_ENTITY_SECRET'),
|
|
207
|
-
walletId: need('CIRCLE_WALLET_ID'),
|
|
208
|
-
address: env.CIRCLE_WALLET_ADDRESS,
|
|
209
|
-
});
|
|
210
133
|
default:
|
|
211
|
-
throw new Error(`Unknown payment wallet '${which}'. Choose one of: key, cdp
|
|
134
|
+
throw new Error(`Unknown payment wallet '${which}'. Choose one of: key, cdp`);
|
|
212
135
|
}
|
|
213
136
|
}
|
|
214
137
|
//# sourceMappingURL=wallets.js.map
|