@armory-sh/client-ethers 0.2.28 → 0.2.30
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 +30 -9
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -15,36 +15,56 @@ bun add @armory-sh/client-hooks # optional preference/logger hooks
|
|
|
15
15
|
|
|
16
16
|
Armory enables HTTP API payments via EIP-3009 `transferWithAuthorization`. Let your users pay with USDC directly from their wallet—no credit cards, no middlemen, no gas for payers.
|
|
17
17
|
|
|
18
|
-
##
|
|
18
|
+
## API Reference
|
|
19
|
+
|
|
20
|
+
### Client Creation
|
|
19
21
|
|
|
20
22
|
```typescript
|
|
21
23
|
import {
|
|
22
|
-
// Client Creation
|
|
23
24
|
createX402Client,
|
|
24
25
|
createX402Transport,
|
|
25
26
|
|
|
26
|
-
//
|
|
27
|
+
// Types
|
|
28
|
+
type X402Client,
|
|
29
|
+
type X402ClientConfig,
|
|
30
|
+
type X402TransportConfig,
|
|
31
|
+
} from '@armory-sh/client-ethers';
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Protocol Detection & Parsing
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
import {
|
|
27
38
|
detectX402Version,
|
|
28
39
|
parsePaymentRequired,
|
|
40
|
+
} from '@armory-sh/client-ethers';
|
|
41
|
+
```
|
|
29
42
|
|
|
30
|
-
|
|
43
|
+
### Signing Functions
|
|
44
|
+
|
|
45
|
+
```typescript
|
|
46
|
+
import {
|
|
31
47
|
signPayment,
|
|
32
48
|
signEIP3009,
|
|
33
49
|
recoverEIP3009Signer,
|
|
34
50
|
|
|
35
51
|
// Types
|
|
36
|
-
type X402Client,
|
|
37
|
-
type X402ClientConfig,
|
|
38
|
-
type X402TransportConfig,
|
|
39
52
|
type SignPaymentOptions,
|
|
53
|
+
} from '@armory-sh/client-ethers';
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Error Classes
|
|
40
57
|
|
|
41
|
-
|
|
58
|
+
```typescript
|
|
59
|
+
import {
|
|
42
60
|
X402ClientError,
|
|
43
61
|
SigningError,
|
|
44
62
|
PaymentError,
|
|
45
63
|
} from '@armory-sh/client-ethers';
|
|
46
64
|
```
|
|
47
65
|
|
|
66
|
+
---
|
|
67
|
+
|
|
48
68
|
## Quick Start
|
|
49
69
|
|
|
50
70
|
```typescript
|
|
@@ -70,7 +90,7 @@ import { PaymentPreference, Logger } from '@armory-sh/client-hooks'
|
|
|
70
90
|
const client = createX402Client({
|
|
71
91
|
signer,
|
|
72
92
|
hooks: [
|
|
73
|
-
PaymentPreference.chain(['base', '
|
|
93
|
+
PaymentPreference.chain(['base', 'ethereum', 'skale-base']),
|
|
74
94
|
PaymentPreference.token(['USDT', 'USDC', 'WBTC']),
|
|
75
95
|
PaymentPreference.cheapest(),
|
|
76
96
|
Logger.console(),
|
|
@@ -101,6 +121,7 @@ const client = createX402Client({
|
|
|
101
121
|
| Base Sepolia | 84532 |
|
|
102
122
|
| SKALE Base | 1187947933 |
|
|
103
123
|
| SKALE Base Sepolia | 324705682 |
|
|
124
|
+
| Ethereum Sepolia | 11155111 |
|
|
104
125
|
|
|
105
126
|
## License
|
|
106
127
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@armory-sh/client-ethers",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.30",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Sawyer Cutler <sawyer@dirtroad.dev>",
|
|
6
6
|
"keywords": [
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"directory": "packages/client-ethers"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@armory-sh/base": "0.2.
|
|
50
|
+
"@armory-sh/base": "0.2.31",
|
|
51
51
|
"ethers": "6.16.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|