@wtflabs/x402-fetch 0.0.1-beta.1 → 0.0.1-beta.11
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 +4 -4
- package/dist/cjs/index.d.ts +5 -5
- package/dist/cjs/index.js +41 -14648
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.d.mts +5 -5
- package/dist/esm/index.mjs +34 -14659
- package/dist/esm/index.mjs.map +1 -1
- package/package.json +15 -15
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ The authorization type is automatically selected based on the server's payment r
|
|
|
15
15
|
## Installation
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
npm install x402-fetch
|
|
18
|
+
npm install @wtflabs/x402-fetch
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
## Quick Start
|
|
@@ -23,7 +23,7 @@ npm install x402-fetch
|
|
|
23
23
|
```typescript
|
|
24
24
|
import { createWalletClient, http } from "viem";
|
|
25
25
|
import { privateKeyToAccount } from "viem/accounts";
|
|
26
|
-
import { wrapFetchWithPayment } from "x402-fetch";
|
|
26
|
+
import { wrapFetchWithPayment } from "@wtflabs/x402-fetch";
|
|
27
27
|
import { baseSepolia } from "viem/chains";
|
|
28
28
|
|
|
29
29
|
// Create a wallet client
|
|
@@ -50,7 +50,7 @@ const data = await response.json();
|
|
|
50
50
|
x402-fetch 现在支持灵活的多 EVM 链配置!使用新的 `createEvmSigner` API:
|
|
51
51
|
|
|
52
52
|
```typescript
|
|
53
|
-
import { createEvmSigner, wrapFetchWithPayment } from 'x402-fetch';
|
|
53
|
+
import { createEvmSigner, wrapFetchWithPayment } from '@wtflabs/x402-fetch';
|
|
54
54
|
|
|
55
55
|
// 方式 1:使用链名称
|
|
56
56
|
const bscSigner = createEvmSigner('bsc', '0xYourPrivateKey');
|
|
@@ -103,7 +103,7 @@ A wrapped fetch function that automatically handles 402 responses by:
|
|
|
103
103
|
import { config } from "dotenv";
|
|
104
104
|
import { createWalletClient, http } from "viem";
|
|
105
105
|
import { privateKeyToAccount } from "viem/accounts";
|
|
106
|
-
import { wrapFetchWithPayment } from "x402-fetch";
|
|
106
|
+
import { wrapFetchWithPayment } from "@wtflabs/x402-fetch";
|
|
107
107
|
import { baseSepolia } from "viem/chains";
|
|
108
108
|
|
|
109
109
|
config();
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Signer, MultiNetworkSigner, X402Config } from 'x402/types';
|
|
2
|
-
export { ConnectedClient, EvmChainConfig, MultiNetworkSigner, Signer, X402Config, createConnectedClient, createSigner, withChain } from 'x402/types';
|
|
3
|
-
import { PaymentRequirementsSelector } from 'x402/client';
|
|
4
|
-
export { PaymentRequirementsSelector } from 'x402/client';
|
|
5
|
-
export { decodeXPaymentResponse } from 'x402/shared';
|
|
1
|
+
import { Signer, MultiNetworkSigner, X402Config } from '@wtflabs/x402/types';
|
|
2
|
+
export { ConnectedClient, EvmChainConfig, MultiNetworkSigner, Signer, X402Config, createConnectedClient, createSigner, withChain } from '@wtflabs/x402/types';
|
|
3
|
+
import { PaymentRequirementsSelector } from '@wtflabs/x402/client';
|
|
4
|
+
export { PaymentRequirementsSelector } from '@wtflabs/x402/client';
|
|
5
|
+
export { decodeXPaymentResponse } from '@wtflabs/x402/shared';
|
|
6
6
|
export { Chain, Hex } from 'viem';
|
|
7
7
|
|
|
8
8
|
/**
|