@dexterai/x402 2.1.0 → 3.0.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.
@@ -72,6 +72,20 @@ interface EvmWallet {
72
72
  data: string;
73
73
  value?: bigint;
74
74
  }): Promise<string>;
75
+ /**
76
+ * Sign a transaction without broadcasting.
77
+ * Returns the RLP-encoded signed transaction as a hex string.
78
+ * Used by the erc20ApprovalGasSponsoring extension to hand a signed
79
+ * approval tx to the facilitator for relay.
80
+ */
81
+ signTransaction?(params: {
82
+ to: string;
83
+ data: string;
84
+ chainId: number;
85
+ gas?: bigint;
86
+ gasPrice?: bigint;
87
+ nonce?: number;
88
+ }): Promise<string>;
75
89
  }
76
90
  /**
77
91
  * Check if an object is a valid EVM wallet
@@ -122,6 +136,14 @@ declare class EvmAdapter implements ChainAdapter {
122
136
  * Wait for a transaction receipt by polling eth_getTransactionReceipt.
123
137
  */
124
138
  private waitForReceipt;
139
+ /**
140
+ * Read gas price via eth_gasPrice RPC call.
141
+ */
142
+ private readGasPrice;
143
+ /**
144
+ * Read transaction count (nonce) via eth_getTransactionCount RPC call.
145
+ */
146
+ private readNonce;
125
147
  /**
126
148
  * Calculate how much to approve based on the facilitator's approval strategy.
127
149
  * Buffered approvals reduce the number of on-chain approval txs for micropayments.
@@ -210,6 +232,8 @@ interface SignedTransaction {
210
232
  serialized: string;
211
233
  /** Transaction signature/hash if available before broadcast */
212
234
  signature?: string;
235
+ /** Protocol extensions (e.g., erc20ApprovalGasSponsoring) to attach to the payment payload */
236
+ extensions?: Record<string, unknown>;
213
237
  }
214
238
  /**
215
239
  * Chain adapter interface - each chain implements this
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dexterai/x402",
3
- "version": "2.1.0",
3
+ "version": "3.0.0",
4
4
  "description": "Full-stack x402 SDK - add paid API monetization to any endpoint. Express middleware, React hooks, Access Pass, dynamic pricing. Solana, Base, Polygon, Arbitrum, Optimism, Avalanche, SKALE.",
5
5
  "author": "Dexter",
6
6
  "license": "MIT",