@@ -419,3 +419,6 @@ import { Network, SchemePaymentRequiredContext, SchemeNetworkServer, SchemeServerHooks, PaymentRequirements, DeepReadonly, PaymentPayload, MoneyParser, Price, AssetAmount, SupportedKind } from '@x402/core/types'; | ||
| * Injects batched-specific fields into the payment requirements returned to | ||
| * the client (receiverAuthorizer, withdrawDelay, EIP-712 domain info). | ||
| * the client (receiverAuthorizer, withdrawDelay). Asset metadata (name, | ||
| * version, assetTransferMethod) is left untouched — it is already set by | ||
| * `parsePrice` or supplied explicitly by the caller, and is not re-derived | ||
| * from the default-asset registry here so unlisted networks keep working. | ||
| * | ||
@@ -479,9 +482,11 @@ * @param paymentRequirements - Base payment requirements from the middleware. | ||
| * Creates a {@link BatchSettlementChannelManager} pre-configured with this scheme's | ||
| * receiver, default token for the given network, and the provided facilitator. | ||
| * receiver, a token for the given network, and the provided facilitator. | ||
| * | ||
| * @param facilitator - Facilitator client for submitting onchain claims/settlements. | ||
| * @param network - CAIP-2 network identifier (e.g. `"eip155:84532"`). | ||
| * @param token - Explicit token address to use. Falls back to the network's | ||
| * default asset (from the registry) when omitted. | ||
| * @returns A ready-to-use channel manager. | ||
| */ | ||
| createChannelManager(facilitator: FacilitatorClient, network: Network): BatchSettlementChannelManager; | ||
| createChannelManager(facilitator: FacilitatorClient, network: Network, token?: `0x${string}`): BatchSettlementChannelManager; | ||
| /** | ||
@@ -488,0 +493,0 @@ * Parses a human-readable money string (e.g. `"$1.50"`) into a decimal number. |
@@ -419,3 +419,6 @@ import { Network, SchemePaymentRequiredContext, SchemeNetworkServer, SchemeServerHooks, PaymentRequirements, DeepReadonly, PaymentPayload, MoneyParser, Price, AssetAmount, SupportedKind } from '@x402/core/types'; | ||
| * Injects batched-specific fields into the payment requirements returned to | ||
| * the client (receiverAuthorizer, withdrawDelay, EIP-712 domain info). | ||
| * the client (receiverAuthorizer, withdrawDelay). Asset metadata (name, | ||
| * version, assetTransferMethod) is left untouched — it is already set by | ||
| * `parsePrice` or supplied explicitly by the caller, and is not re-derived | ||
| * from the default-asset registry here so unlisted networks keep working. | ||
| * | ||
@@ -479,9 +482,11 @@ * @param paymentRequirements - Base payment requirements from the middleware. | ||
| * Creates a {@link BatchSettlementChannelManager} pre-configured with this scheme's | ||
| * receiver, default token for the given network, and the provided facilitator. | ||
| * receiver, a token for the given network, and the provided facilitator. | ||
| * | ||
| * @param facilitator - Facilitator client for submitting onchain claims/settlements. | ||
| * @param network - CAIP-2 network identifier (e.g. `"eip155:84532"`). | ||
| * @param token - Explicit token address to use. Falls back to the network's | ||
| * default asset (from the registry) when omitted. | ||
| * @returns A ready-to-use channel manager. | ||
| */ | ||
| createChannelManager(facilitator: FacilitatorClient, network: Network): BatchSettlementChannelManager; | ||
| createChannelManager(facilitator: FacilitatorClient, network: Network, token?: `0x${string}`): BatchSettlementChannelManager; | ||
| /** | ||
@@ -488,0 +493,0 @@ * Parses a human-readable money string (e.g. `"$1.50"`) into a decimal number. |
@@ -1541,3 +1541,6 @@ import { | ||
| * Injects batched-specific fields into the payment requirements returned to | ||
| * the client (receiverAuthorizer, withdrawDelay, EIP-712 domain info). | ||
| * the client (receiverAuthorizer, withdrawDelay). Asset metadata (name, | ||
| * version, assetTransferMethod) is left untouched — it is already set by | ||
| * `parsePrice` or supplied explicitly by the caller, and is not re-derived | ||
| * from the default-asset registry here so unlisted networks keep working. | ||
| * | ||
@@ -1555,3 +1558,2 @@ * @param paymentRequirements - Base payment requirements from the middleware. | ||
| void _extensionKeys; | ||
| const assetInfo = getDefaultAsset(paymentRequirements.network); | ||
| const receiverAuthorizer = this.receiverAuthorizerSigner?.address ?? (typeof supportedKind.extra?.receiverAuthorizer === "string" ? supportedKind.extra.receiverAuthorizer : void 0); | ||
@@ -1566,6 +1568,3 @@ if (!receiverAuthorizer || getAddress2(receiverAuthorizer) === "0x0000000000000000000000000000000000000000") { | ||
| receiverAuthorizer: getAddress2(receiverAuthorizer), | ||
| withdrawDelay: this.withdrawDelay, | ||
| name: assetInfo.name, | ||
| version: assetInfo.version, | ||
| assetTransferMethod: paymentRequirements.extra?.assetTransferMethod ?? assetInfo.assetTransferMethod | ||
| withdrawDelay: this.withdrawDelay | ||
| } | ||
@@ -1633,10 +1632,12 @@ }; | ||
| * Creates a {@link BatchSettlementChannelManager} pre-configured with this scheme's | ||
| * receiver, default token for the given network, and the provided facilitator. | ||
| * receiver, a token for the given network, and the provided facilitator. | ||
| * | ||
| * @param facilitator - Facilitator client for submitting onchain claims/settlements. | ||
| * @param network - CAIP-2 network identifier (e.g. `"eip155:84532"`). | ||
| * @param token - Explicit token address to use. Falls back to the network's | ||
| * default asset (from the registry) when omitted. | ||
| * @returns A ready-to-use channel manager. | ||
| */ | ||
| createChannelManager(facilitator, network) { | ||
| const token = getDefaultAsset(network).address; | ||
| createChannelManager(facilitator, network, token) { | ||
| const resolvedToken = token ?? getDefaultAsset(network).address; | ||
| return new BatchSettlementChannelManager({ | ||
@@ -1646,3 +1647,3 @@ scheme: this, | ||
| receiver: this.receiverAddress, | ||
| token, | ||
| token: resolvedToken, | ||
| network | ||
@@ -1673,2 +1674,3 @@ }); | ||
| const tokenAmount = convertToTokenAmount(numberToDecimalString(amount), assetInfo.decimals); | ||
| const includeEip712Domain = !assetInfo.assetTransferMethod || assetInfo.supportsEip2612; | ||
| return { | ||
@@ -1678,4 +1680,9 @@ amount: tokenAmount, | ||
| extra: { | ||
| name: assetInfo.name, | ||
| version: assetInfo.version | ||
| ...includeEip712Domain && { | ||
| name: assetInfo.name, | ||
| version: assetInfo.version | ||
| }, | ||
| ...assetInfo.assetTransferMethod && { | ||
| assetTransferMethod: assetInfo.assetTransferMethod | ||
| } | ||
| } | ||
@@ -1682,0 +1689,0 @@ }; |
+2
-2
| { | ||
| "name": "@x402/evm", | ||
| "version": "2.19.0", | ||
| "version": "2.20.0", | ||
| "main": "./dist/cjs/index.js", | ||
@@ -38,3 +38,3 @@ "module": "./dist/esm/index.js", | ||
| "zod": "^3.24.2", | ||
| "@x402/core": "~2.19.0" | ||
| "@x402/core": "~2.20.0" | ||
| }, | ||
@@ -41,0 +41,0 @@ "exports": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
3829074
0.09%29626
0.06%+ Added
- Removed
Updated