@atv-eth/x402-sdk 1.1.0 → 1.1.1
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/index.d.ts +248 -256
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -1,275 +1,267 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @atv-eth/x402-sdk
|
|
3
|
-
*
|
|
2
|
+
* @atv-eth/x402-sdk Types
|
|
3
|
+
* Auto-generated from OpenAPI spec
|
|
4
|
+
* Total endpoints: 1383
|
|
4
5
|
*/
|
|
5
6
|
|
|
6
|
-
export interface
|
|
7
|
-
|
|
8
|
-
baseUrl?: string;
|
|
9
|
-
/** Wallet private key for payments and SIWE authentication */
|
|
10
|
-
privateKey?: string;
|
|
11
|
-
/** API key for prepaid credits (alternative to x402) */
|
|
7
|
+
export interface ATVClient {
|
|
8
|
+
baseUrl: string;
|
|
12
9
|
apiKey?: string;
|
|
10
|
+
|
|
11
|
+
// Core methods
|
|
12
|
+
get<T>(path: string, params?: Record<string, string>): Promise<T>;
|
|
13
|
+
post<T>(path: string, body?: any): Promise<T>;
|
|
14
|
+
|
|
15
|
+
// Health
|
|
16
|
+
health(): Promise<HealthResponse>;
|
|
17
|
+
sourcesHealth(): Promise<SourcesHealthResponse>;
|
|
13
18
|
}
|
|
14
19
|
|
|
15
|
-
export interface
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
requestsPerMinute: number;
|
|
21
|
-
dailyLimit: number;
|
|
22
|
-
};
|
|
20
|
+
export interface HealthResponse {
|
|
21
|
+
status: 'healthy' | 'unhealthy';
|
|
22
|
+
version: string;
|
|
23
|
+
uptime: number;
|
|
24
|
+
timestamp: string;
|
|
23
25
|
}
|
|
24
26
|
|
|
25
|
-
export interface
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
createdAt?: string;
|
|
31
|
-
usage?: {
|
|
32
|
-
requests: number;
|
|
33
|
-
lastReset: number;
|
|
34
|
-
};
|
|
35
|
-
rateLimits?: {
|
|
36
|
-
requestsPerMinute: number;
|
|
37
|
-
dailyLimit: number;
|
|
38
|
-
};
|
|
39
|
-
message?: string;
|
|
27
|
+
export interface SourcesHealthResponse {
|
|
28
|
+
healthy: number;
|
|
29
|
+
total: number;
|
|
30
|
+
percentage: string;
|
|
31
|
+
sources: Record<string, SourceHealth>;
|
|
40
32
|
}
|
|
41
33
|
|
|
42
|
-
export interface
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
dailyLimit: number;
|
|
50
|
-
};
|
|
51
|
-
session: {
|
|
52
|
-
createdAt: string;
|
|
53
|
-
expiresAt: string;
|
|
54
|
-
};
|
|
55
|
-
usage: {
|
|
56
|
-
requests: number;
|
|
57
|
-
lastReset: number;
|
|
58
|
-
};
|
|
34
|
+
export interface SourceHealth {
|
|
35
|
+
name: string;
|
|
36
|
+
healthy: boolean;
|
|
37
|
+
demoted: boolean;
|
|
38
|
+
requestCount: number;
|
|
39
|
+
errorCount: number;
|
|
40
|
+
avgLatencyMs: number;
|
|
59
41
|
}
|
|
60
42
|
|
|
61
|
-
export interface
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
};
|
|
71
|
-
tier: string;
|
|
43
|
+
export interface PriceResponse {
|
|
44
|
+
token: string;
|
|
45
|
+
symbol: string;
|
|
46
|
+
price: number;
|
|
47
|
+
change24h?: number;
|
|
48
|
+
source: string;
|
|
49
|
+
latencyMs: number;
|
|
50
|
+
cached: boolean;
|
|
51
|
+
timestamp: string;
|
|
72
52
|
}
|
|
73
53
|
|
|
74
|
-
export interface
|
|
54
|
+
export interface ENSResponse {
|
|
75
55
|
name: string;
|
|
76
|
-
address
|
|
77
|
-
avatar?: string;
|
|
56
|
+
address?: string;
|
|
78
57
|
records?: Record<string, string>;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export interface SocialStats {
|
|
84
|
-
followers: number;
|
|
85
|
-
following: number;
|
|
86
|
-
mutualCount?: number;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export interface BalanceResponse {
|
|
90
|
-
address: string;
|
|
91
|
-
balance: string;
|
|
92
|
-
balanceFormatted: string;
|
|
93
|
-
chain: string;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export interface DiscoveryResponse {
|
|
97
|
-
version: string;
|
|
98
|
-
endpoints: Record<string, any>;
|
|
99
|
-
freeEndpoints?: string[];
|
|
58
|
+
avatar?: string;
|
|
59
|
+
timestamp: string;
|
|
100
60
|
}
|
|
101
61
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
62
|
+
// Endpoint paths (for autocomplete)
|
|
63
|
+
export type EndpointPath =
|
|
64
|
+
| '/.well-known/x402'
|
|
65
|
+
| '/api/'
|
|
66
|
+
| '/api/1inch'
|
|
67
|
+
| '/api/aave'
|
|
68
|
+
| '/api/abi/{address}'
|
|
69
|
+
| '/api/active-users'
|
|
70
|
+
| '/api/address/age/{address}'
|
|
71
|
+
| '/api/address/batch/type'
|
|
72
|
+
| '/api/address/batch/validate'
|
|
73
|
+
| '/api/address/checksum/{address}'
|
|
74
|
+
| '/api/address/code/{address}'
|
|
75
|
+
| '/api/address/iscontract/{address}'
|
|
76
|
+
| '/api/address/type/{address}'
|
|
77
|
+
| '/api/address/validate/{address}'
|
|
78
|
+
| '/api/age/{address}'
|
|
79
|
+
| '/api/aggregator/'
|
|
80
|
+
| '/api/aggregator/1inch'
|
|
81
|
+
| '/api/aggregator/bebop'
|
|
82
|
+
| '/api/aggregator/chain/{chain}'
|
|
83
|
+
| '/api/aggregator/cowswap'
|
|
84
|
+
| '/api/aggregator/jupiter'
|
|
85
|
+
| '/api/aggregator/kyberswap'
|
|
86
|
+
| '/api/aggregator/matcha'
|
|
87
|
+
| '/api/aggregator/odos'
|
|
88
|
+
| '/api/aggregator/openocean'
|
|
89
|
+
| '/api/aggregator/paraswap'
|
|
90
|
+
| '/api/aggregator/socket'
|
|
91
|
+
| '/api/aggregators'
|
|
92
|
+
| '/api/ai'
|
|
93
|
+
| '/api/airdrops'
|
|
94
|
+
| '/api/alchemy/balances/{address}'
|
|
95
|
+
| '/api/alchemy/collection/{contract}'
|
|
96
|
+
| '/api/alchemy/contracts/{address}'
|
|
97
|
+
| '/api/alchemy/floor/{contract}'
|
|
98
|
+
| '/api/alchemy/holders/{contract}'
|
|
99
|
+
| '/api/alchemy/nft/{contract}/{tokenId}'
|
|
100
|
+
| '/api/alchemy/nfts/{address}'
|
|
101
|
+
| '/api/alchemy/owners/{contract}'
|
|
102
|
+
| '/api/alchemy/sales/{contract}'
|
|
103
|
+
| '/api/alchemy/spam/{contract}'
|
|
104
|
+
| '/api/alchemy/token/{contract}'
|
|
105
|
+
| '/api/alchemy/transfers/{address}'
|
|
106
|
+
| '/api/analytics'
|
|
107
|
+
| '/api/analytics/endpoints'
|
|
108
|
+
| '/api/analytics/slow'
|
|
109
|
+
| '/api/analytics/unused'
|
|
110
|
+
| '/api/arbitrum'
|
|
111
|
+
| '/api/arbitrum/status'
|
|
112
|
+
| '/api/atv'
|
|
113
|
+
| '/api/auth/logout'
|
|
114
|
+
| '/api/auth/me'
|
|
115
|
+
| '/api/auth/nonce'
|
|
116
|
+
| '/api/auth/session'
|
|
117
|
+
| '/api/auth/verify'
|
|
118
|
+
| '/api/avalanche'
|
|
119
|
+
| '/api/avalanche/status'
|
|
120
|
+
| '/api/avatar/{name}'
|
|
121
|
+
| '/api/badges/{name}'
|
|
122
|
+
| '/api/balance/{address}'
|
|
123
|
+
| '/api/balancer'
|
|
124
|
+
| '/api/base'
|
|
125
|
+
| '/api/base/status'
|
|
126
|
+
| '/api/batch/arbitrum'
|
|
127
|
+
| '/api/batch/base'
|
|
128
|
+
| '/api/batch/defi'
|
|
129
|
+
| '/api/batch/ens'
|
|
130
|
+
| '/api/batch/ethereum'
|
|
131
|
+
| '/api/batch/market'
|
|
132
|
+
| '/api/batch/optimism'
|
|
133
|
+
| '/api/batch/polygon'
|
|
134
|
+
| '/api/bitcoin/24hrprice'
|
|
135
|
+
| '/api/bitcoin/24hrtransactioncount'
|
|
136
|
+
| '/api/bitcoin/all'
|
|
137
|
+
| '/api/bitcoin/avgtxsize'
|
|
138
|
+
| '/api/bitcoin/avgtxvalue'
|
|
139
|
+
| '/api/bitcoin/bcperblock'
|
|
140
|
+
| '/api/bitcoin/blockcount'
|
|
141
|
+
| '/api/bitcoin/difficulty'
|
|
142
|
+
| '/api/bitcoin/eta'
|
|
143
|
+
| '/api/bitcoin/hashrate'
|
|
144
|
+
| '/api/bitcoin/interval'
|
|
145
|
+
| '/api/bitcoin/latesthash'
|
|
146
|
+
| '/api/bitcoin/marketcap'
|
|
147
|
+
| '/api/bitcoin/stats'
|
|
148
|
+
| '/api/bitcoin/ticker'
|
|
149
|
+
| '/api/bitcoin/totalbc'
|
|
150
|
+
| '/api/block'
|
|
151
|
+
| '/api/block/latest'
|
|
152
|
+
| '/api/block/multichain'
|
|
153
|
+
| '/api/block/{number}'
|
|
154
|
+
| '/api/blur'
|
|
155
|
+
| '/api/blur/stats'
|
|
156
|
+
| '/api/bridge/'
|
|
157
|
+
| '/api/bridge/across'
|
|
158
|
+
| '/api/bridge/activity/{address}'
|
|
159
|
+
| '/api/bridge/arbitrum-base'
|
|
160
|
+
| '/api/bridge/cbridge'
|
|
161
|
+
| '/api/bridge/chain/{chain}'
|
|
162
|
+
| '/api/bridge/ethereum-arbitrum'
|
|
163
|
+
| '/api/bridge/ethereum-base'
|
|
164
|
+
| '/api/bridge/ethereum-optimism'
|
|
165
|
+
| '/api/bridge/ethereum-polygon'
|
|
166
|
+
| '/api/bridge/hop'
|
|
167
|
+
| '/api/bridge/large-txs'
|
|
168
|
+
| '/api/bridge/layerzero'
|
|
169
|
+
| '/api/bridge/multichain'
|
|
170
|
+
| '/api/bridge/stargate'
|
|
171
|
+
| '/api/bridge/stats/{timestamp}'
|
|
172
|
+
| '/api/bridge/synapse'
|
|
173
|
+
| '/api/bridge/top'
|
|
174
|
+
| '/api/bridge/wormhole'
|
|
175
|
+
| '/api/bridge/{id}'
|
|
176
|
+
| '/api/bridges'
|
|
177
|
+
| '/api/bridges/across'
|
|
178
|
+
| '/api/bridges/activity/{address}'
|
|
179
|
+
| '/api/bridges/chain/{chain}'
|
|
180
|
+
| '/api/bridges/ethereum-arbitrum'
|
|
181
|
+
| '/api/bridges/ethereum-base'
|
|
182
|
+
| '/api/bridges/ethereum-optimism'
|
|
183
|
+
| '/api/bridges/ethereum-polygon'
|
|
184
|
+
| '/api/bridges/hop'
|
|
185
|
+
| '/api/bridges/large-txs'
|
|
186
|
+
| '/api/bridges/stargate'
|
|
187
|
+
| '/api/bridges/stats/{timestamp}'
|
|
188
|
+
| '/api/bridges/synapse'
|
|
189
|
+
| '/api/bridges/top'
|
|
190
|
+
| '/api/bridges/wormhole'
|
|
191
|
+
| '/api/bridges/{id}'
|
|
192
|
+
| '/api/bsc'
|
|
193
|
+
| '/api/bsc/status'
|
|
194
|
+
| '/api/btc'
|
|
195
|
+
| '/api/btc-dominance'
|
|
196
|
+
| '/api/busd'
|
|
197
|
+
| '/api/cache/clear'
|
|
198
|
+
| '/api/cache/reset-stats'
|
|
199
|
+
| '/api/cache/stats'
|
|
200
|
+
| '/api/casts/{identifier}'
|
|
201
|
+
| '/api/categories'
|
|
202
|
+
| '/api/category/bridges'
|
|
203
|
+
| '/api/category/derivatives'
|
|
204
|
+
| '/api/category/dex'
|
|
205
|
+
| '/api/category/lending'
|
|
206
|
+
| '/api/category/staking'
|
|
207
|
+
| '/api/category/{name}'
|
|
208
|
+
| '/api/celo'
|
|
209
|
+
| '/api/cex-vs-dex'
|
|
210
|
+
| '/api/cex/volumes'
|
|
211
|
+
| '/api/cex/{exchange}'
|
|
212
|
+
| '/api/chain/algorand/stats'
|
|
213
|
+
| '/api/chain/aptos/stats'
|
|
214
|
+
| '/api/chain/arbitrum'
|
|
215
|
+
| '/api/chain/arbitrum/stats'
|
|
216
|
+
| '/api/chain/aurora/stats'
|
|
217
|
+
| '/api/chain/avalanche'
|
|
218
|
+
| '/api/chain/avalanche/stats'
|
|
219
|
+
| '/api/chain/base'
|
|
220
|
+
| '/api/chain/base/stats'
|
|
221
|
+
| '/api/chain/blast/stats'
|
|
222
|
+
| '/api/chain/boba/stats'
|
|
223
|
+
| '/api/chain/bsc'
|
|
224
|
+
| '/api/chain/bsc/stats'
|
|
225
|
+
| '/api/chain/cardano/stats'
|
|
226
|
+
| '/api/chain/celo/stats'
|
|
227
|
+
| '/api/chain/cosmos/stats'
|
|
228
|
+
| '/api/chain/cronos/stats'
|
|
229
|
+
| '/api/chain/ethereum'
|
|
230
|
+
| '/api/chain/ethereum/stats'
|
|
231
|
+
| '/api/chain/fantom'
|
|
232
|
+
| '/api/chain/fantom/stats'
|
|
233
|
+
| '/api/chain/fees'
|
|
234
|
+
| '/api/chain/gas'
|
|
235
|
+
| '/api/chain/gas/{chain}'
|
|
236
|
+
| '/api/chain/gnosis/stats'
|
|
237
|
+
| '/api/chain/harmony/stats'
|
|
238
|
+
| '/api/chain/injective/stats'
|
|
239
|
+
| '/api/chain/kava/stats'
|
|
240
|
+
| '/api/chain/klaytn/stats'
|
|
241
|
+
| '/api/chain/l2/fees'
|
|
242
|
+
| '/api/chain/l2/overview'
|
|
243
|
+
| '/api/chain/linea/stats'
|
|
244
|
+
| '/api/chain/mantle/stats'
|
|
245
|
+
| '/api/chain/mode/stats'
|
|
246
|
+
| '/api/chain/near/stats'
|
|
247
|
+
| '/api/chain/optimism'
|
|
248
|
+
| '/api/chain/optimism/stats'
|
|
249
|
+
| '/api/chain/overview'
|
|
250
|
+
| '/api/chain/polygon'
|
|
251
|
+
| '/api/chain/polygon/stats'
|
|
252
|
+
| '/api/chain/rank/{rank}'
|
|
253
|
+
| '/api/chain/revenue'
|
|
254
|
+
| '/api/chain/scroll/stats'
|
|
255
|
+
| '/api/chain/solana'
|
|
256
|
+
| '/api/chain/solana/stats'
|
|
257
|
+
| '/api/chain/sui/stats'
|
|
258
|
+
| '/api/chain/ton/stats'
|
|
259
|
+
| '/api/chain/tron/stats'
|
|
260
|
+
| '/api/chain/zksync/stats'
|
|
261
|
+
| '/api/chain/{chain}/balance/{address}'
|
|
262
|
+
| '/api/chain/{chain}/block/latest'
|
|
263
|
+
| '/api/chain/{chain}/block/{number}'
|
|
264
|
+
| string; // ... and 1183 more
|
|
274
265
|
|
|
275
|
-
export
|
|
266
|
+
export function createClient(options: { baseUrl?: string; apiKey?: string }): ATVClient;
|
|
267
|
+
export default createClient;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atv-eth/x402-sdk",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.1.1",
|
|
4
|
+
"description": "TypeScript SDK for ATV x402 Web3 Identity API - 1383 endpoints",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.mjs",
|
|
7
7
|
"types": "index.d.ts",
|