@x402api/agent-wallet-core 0.1.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.
- package/README.md +12 -0
- package/dist/balances.d.ts +32 -0
- package/dist/balances.d.ts.map +1 -0
- package/dist/balances.js +278 -0
- package/dist/balances.js.map +1 -0
- package/dist/errors.d.ts +15 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +73 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/notifications.d.ts +71 -0
- package/dist/notifications.d.ts.map +1 -0
- package/dist/notifications.js +209 -0
- package/dist/notifications.js.map +1 -0
- package/dist/payment/attempt-store.d.ts +49 -0
- package/dist/payment/attempt-store.d.ts.map +1 -0
- package/dist/payment/attempt-store.js +283 -0
- package/dist/payment/attempt-store.js.map +1 -0
- package/dist/payment/authorize.d.ts +22 -0
- package/dist/payment/authorize.d.ts.map +1 -0
- package/dist/payment/authorize.js +386 -0
- package/dist/payment/authorize.js.map +1 -0
- package/dist/payment/contracts.d.ts +36 -0
- package/dist/payment/contracts.d.ts.map +1 -0
- package/dist/payment/contracts.js +132 -0
- package/dist/payment/contracts.js.map +1 -0
- package/dist/protocol/base.d.ts +78 -0
- package/dist/protocol/base.d.ts.map +1 -0
- package/dist/protocol/base.js +459 -0
- package/dist/protocol/base.js.map +1 -0
- package/dist/protocol/external-recipient.d.ts +22 -0
- package/dist/protocol/external-recipient.d.ts.map +1 -0
- package/dist/protocol/external-recipient.js +149 -0
- package/dist/protocol/external-recipient.js.map +1 -0
- package/dist/protocol/http.d.ts +52 -0
- package/dist/protocol/http.d.ts.map +1 -0
- package/dist/protocol/http.js +283 -0
- package/dist/protocol/http.js.map +1 -0
- package/dist/protocol/solana.d.ts +147 -0
- package/dist/protocol/solana.d.ts.map +1 -0
- package/dist/protocol/solana.js +549 -0
- package/dist/protocol/solana.js.map +1 -0
- package/dist/protocol/tron.d.ts +130 -0
- package/dist/protocol/tron.d.ts.map +1 -0
- package/dist/protocol/tron.js +539 -0
- package/dist/protocol/tron.js.map +1 -0
- package/dist/storage/keystore.d.ts +51 -0
- package/dist/storage/keystore.d.ts.map +1 -0
- package/dist/storage/keystore.js +317 -0
- package/dist/storage/keystore.js.map +1 -0
- package/dist/storage/paths.d.ts +8 -0
- package/dist/storage/paths.d.ts.map +1 -0
- package/dist/storage/paths.js +22 -0
- package/dist/storage/paths.js.map +1 -0
- package/dist/storage/private-files.d.ts +8 -0
- package/dist/storage/private-files.d.ts.map +1 -0
- package/dist/storage/private-files.js +83 -0
- package/dist/storage/private-files.js.map +1 -0
- package/package.json +35 -0
package/README.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# `@x402api/agent-wallet-core`
|
|
2
|
+
|
|
3
|
+
Security-sensitive primitives for persistent local agent wallets. The package
|
|
4
|
+
owns encrypted keystores, strict x402 request contracts, supported Base,
|
|
5
|
+
Solana, and TRON payment authorization, balances, and durable attempt records.
|
|
6
|
+
|
|
7
|
+
Use the `@x402api/agent-wallet-cli` package for the supported command-line
|
|
8
|
+
surface. This library deliberately exposes no arbitrary-signing API.
|
|
9
|
+
|
|
10
|
+
The core also creates wallet-signed, subscription-scoped refill notification
|
|
11
|
+
requests. Email recipients and display content are resolved by x402api from
|
|
12
|
+
verified server-side tenant and product records.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { SupportedNetwork } from "./storage/keystore.js";
|
|
2
|
+
export declare const SOLANA_MAINNET_GENESIS_HASH = "5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d";
|
|
3
|
+
export declare const TRON_MAINNET_GENESIS_BLOCK_ID = "00000000000000001ebf88508a03865c71d452e25f4d51194196a1d22b6653dc";
|
|
4
|
+
export type RpcConfiguration = {
|
|
5
|
+
base?: string;
|
|
6
|
+
solana?: string;
|
|
7
|
+
tron?: string;
|
|
8
|
+
};
|
|
9
|
+
export type WalletBalance = {
|
|
10
|
+
version: 1;
|
|
11
|
+
network: SupportedNetwork;
|
|
12
|
+
address: string;
|
|
13
|
+
asset: string;
|
|
14
|
+
assetSymbol: "USDC" | "USDT";
|
|
15
|
+
assetAtomic: string;
|
|
16
|
+
nativeSymbol: "ETH" | "SOL" | "TRX";
|
|
17
|
+
nativeAtomic: string;
|
|
18
|
+
feeResources?: {
|
|
19
|
+
energyAvailable: string;
|
|
20
|
+
bandwidthAvailable: string;
|
|
21
|
+
};
|
|
22
|
+
checkedAt: string;
|
|
23
|
+
};
|
|
24
|
+
export declare function validateRpcUrl(value: string, label: string): string;
|
|
25
|
+
export declare function jsonRpc(endpoint: string, method: string, params: unknown[]): Promise<unknown>;
|
|
26
|
+
export declare function verifyTronMainnetRpc(endpoint: string): Promise<void>;
|
|
27
|
+
export declare function readWalletBalance(options: {
|
|
28
|
+
network: SupportedNetwork;
|
|
29
|
+
address: string;
|
|
30
|
+
rpc: RpcConfiguration;
|
|
31
|
+
}): Promise<WalletBalance>;
|
|
32
|
+
//# sourceMappingURL=balances.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"balances.d.ts","sourceRoot":"","sources":["../src/balances.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,eAAO,MAAM,2BAA2B,iDACQ,CAAC;AACjD,eAAO,MAAM,6BAA6B,qEAC0B,CAAC;AAErE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,CAAC,CAAC;IACX,OAAO,EAAE,gBAAgB,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE;QACb,eAAe,EAAE,MAAM,CAAC;QACxB,kBAAkB,EAAE,MAAM,CAAC;KAC5B,CAAC;IACF,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAuBnE;AAED,wBAAsB,OAAO,CAC3B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,OAAO,EAAE,GAChB,OAAO,CAAC,OAAO,CAAC,CA4BlB;AAkID,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAqC1E;AA+CD,wBAAsB,iBAAiB,CAAC,OAAO,EAAE;IAC/C,OAAO,EAAE,gBAAgB,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,gBAAgB,CAAC;CACvB,GAAG,OAAO,CAAC,aAAa,CAAC,CAazB"}
|
package/dist/balances.js
ADDED
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import { TronWeb } from "tronweb";
|
|
2
|
+
import { AgentWalletError } from "./errors.js";
|
|
3
|
+
import { BASE_USDC_MAINNET_CONTRACT, } from "./protocol/base.js";
|
|
4
|
+
import { SOLANA_USDT_MAINNET_MINT, } from "./protocol/solana.js";
|
|
5
|
+
import { TRON_USDT_MAINNET_CONTRACT } from "./protocol/tron.js";
|
|
6
|
+
export const SOLANA_MAINNET_GENESIS_HASH = "5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d";
|
|
7
|
+
export const TRON_MAINNET_GENESIS_BLOCK_ID = "00000000000000001ebf88508a03865c71d452e25f4d51194196a1d22b6653dc";
|
|
8
|
+
export function validateRpcUrl(value, label) {
|
|
9
|
+
let url;
|
|
10
|
+
try {
|
|
11
|
+
url = new URL(value);
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
14
|
+
throw new AgentWalletError("rpc_not_configured", `${label} RPC URL is invalid`, {
|
|
15
|
+
cause: error,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
const local = ["localhost", "127.0.0.1", "::1"].includes(url.hostname);
|
|
19
|
+
if ((!local && url.protocol !== "https:") ||
|
|
20
|
+
(local && !["http:", "https:"].includes(url.protocol)) ||
|
|
21
|
+
url.username ||
|
|
22
|
+
url.password ||
|
|
23
|
+
url.hash) {
|
|
24
|
+
throw new AgentWalletError("rpc_not_configured", `${label} RPC URL must be credential-free HTTPS (HTTP is allowed only for localhost)`);
|
|
25
|
+
}
|
|
26
|
+
return url.toString();
|
|
27
|
+
}
|
|
28
|
+
export async function jsonRpc(endpoint, method, params) {
|
|
29
|
+
const controller = new AbortController();
|
|
30
|
+
const timeout = setTimeout(() => controller.abort(), 15_000);
|
|
31
|
+
try {
|
|
32
|
+
const response = await fetch(endpoint, {
|
|
33
|
+
method: "POST",
|
|
34
|
+
headers: { "Content-Type": "application/json" },
|
|
35
|
+
body: JSON.stringify({ jsonrpc: "2.0", id: 1, method, params }),
|
|
36
|
+
redirect: "error",
|
|
37
|
+
signal: controller.signal,
|
|
38
|
+
});
|
|
39
|
+
const text = await response.text();
|
|
40
|
+
if (!response.ok || text.length > 1024 * 1024) {
|
|
41
|
+
throw new Error(`RPC returned HTTP ${response.status}`);
|
|
42
|
+
}
|
|
43
|
+
const body = JSON.parse(text);
|
|
44
|
+
if (typeof body !== "object" || body === null || !("result" in body)) {
|
|
45
|
+
throw new Error("RPC response has no result");
|
|
46
|
+
}
|
|
47
|
+
return body.result;
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
throw new AgentWalletError("rpc_unavailable", `${method} RPC request failed`, {
|
|
51
|
+
retryable: true,
|
|
52
|
+
cause: error,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
finally {
|
|
56
|
+
clearTimeout(timeout);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function hexQuantity(value, field) {
|
|
60
|
+
if (typeof value !== "string" || !/^0x(?:0|[1-9a-f][0-9a-f]*)$/i.test(value)) {
|
|
61
|
+
throw new AgentWalletError("rpc_unavailable", `${field} is not a canonical hex quantity`);
|
|
62
|
+
}
|
|
63
|
+
return BigInt(value);
|
|
64
|
+
}
|
|
65
|
+
async function baseBalance(endpoint, address) {
|
|
66
|
+
const paddedAddress = address.toLowerCase().replace(/^0x/, "").padStart(64, "0");
|
|
67
|
+
const [chainId, native, token] = await Promise.all([
|
|
68
|
+
jsonRpc(endpoint, "eth_chainId", []),
|
|
69
|
+
jsonRpc(endpoint, "eth_getBalance", [address, "latest"]),
|
|
70
|
+
jsonRpc(endpoint, "eth_call", [
|
|
71
|
+
{
|
|
72
|
+
to: BASE_USDC_MAINNET_CONTRACT,
|
|
73
|
+
data: `0x70a08231${paddedAddress}`,
|
|
74
|
+
},
|
|
75
|
+
"latest",
|
|
76
|
+
]),
|
|
77
|
+
]);
|
|
78
|
+
if (chainId !== "0x2105") {
|
|
79
|
+
throw new AgentWalletError("unsupported_network", "Base RPC is not chain ID 8453");
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
version: 1,
|
|
83
|
+
network: "eip155:8453",
|
|
84
|
+
address,
|
|
85
|
+
asset: BASE_USDC_MAINNET_CONTRACT,
|
|
86
|
+
assetSymbol: "USDC",
|
|
87
|
+
assetAtomic: hexQuantity(token, "USDC balance").toString(),
|
|
88
|
+
nativeSymbol: "ETH",
|
|
89
|
+
nativeAtomic: hexQuantity(native, "ETH balance").toString(),
|
|
90
|
+
checkedAt: new Date().toISOString(),
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
async function solanaBalance(endpoint, address) {
|
|
94
|
+
const [genesisHash, nativeResult, tokenResult] = await Promise.all([
|
|
95
|
+
jsonRpc(endpoint, "getGenesisHash", []),
|
|
96
|
+
jsonRpc(endpoint, "getBalance", [address, { commitment: "confirmed" }]),
|
|
97
|
+
jsonRpc(endpoint, "getTokenAccountsByOwner", [
|
|
98
|
+
address,
|
|
99
|
+
{ mint: SOLANA_USDT_MAINNET_MINT },
|
|
100
|
+
{ encoding: "jsonParsed", commitment: "confirmed" },
|
|
101
|
+
]),
|
|
102
|
+
]);
|
|
103
|
+
if (genesisHash !== SOLANA_MAINNET_GENESIS_HASH) {
|
|
104
|
+
throw new AgentWalletError("unsupported_network", "Solana RPC is not Mainnet Beta");
|
|
105
|
+
}
|
|
106
|
+
const native = typeof nativeResult === "object" &&
|
|
107
|
+
nativeResult !== null &&
|
|
108
|
+
"value" in nativeResult &&
|
|
109
|
+
typeof nativeResult.value === "number" &&
|
|
110
|
+
Number.isSafeInteger(nativeResult.value)
|
|
111
|
+
? BigInt(nativeResult.value)
|
|
112
|
+
: null;
|
|
113
|
+
if (native === null) {
|
|
114
|
+
throw new AgentWalletError("rpc_unavailable", "Solana RPC returned an invalid SOL balance");
|
|
115
|
+
}
|
|
116
|
+
const accounts = typeof tokenResult === "object" &&
|
|
117
|
+
tokenResult !== null &&
|
|
118
|
+
"value" in tokenResult &&
|
|
119
|
+
Array.isArray(tokenResult.value)
|
|
120
|
+
? tokenResult.value
|
|
121
|
+
: null;
|
|
122
|
+
if (accounts === null) {
|
|
123
|
+
throw new AgentWalletError("rpc_unavailable", "Solana RPC returned invalid token accounts");
|
|
124
|
+
}
|
|
125
|
+
let asset = 0n;
|
|
126
|
+
for (const account of accounts) {
|
|
127
|
+
const amount = typeof account === "object" &&
|
|
128
|
+
account !== null &&
|
|
129
|
+
"account" in account &&
|
|
130
|
+
typeof account.account === "object" &&
|
|
131
|
+
account.account !== null &&
|
|
132
|
+
"data" in account.account &&
|
|
133
|
+
typeof account.account.data === "object" &&
|
|
134
|
+
account.account.data !== null &&
|
|
135
|
+
"parsed" in account.account.data &&
|
|
136
|
+
typeof account.account.data.parsed === "object" &&
|
|
137
|
+
account.account.data.parsed !== null &&
|
|
138
|
+
"info" in account.account.data.parsed &&
|
|
139
|
+
typeof account.account.data.parsed.info === "object" &&
|
|
140
|
+
account.account.data.parsed.info !== null &&
|
|
141
|
+
"tokenAmount" in account.account.data.parsed.info &&
|
|
142
|
+
typeof account.account.data.parsed.info.tokenAmount === "object" &&
|
|
143
|
+
account.account.data.parsed.info.tokenAmount !== null &&
|
|
144
|
+
"amount" in account.account.data.parsed.info.tokenAmount
|
|
145
|
+
? account.account.data.parsed.info.tokenAmount.amount
|
|
146
|
+
: null;
|
|
147
|
+
if (typeof amount !== "string" || !/^(?:0|[1-9][0-9]*)$/.test(amount)) {
|
|
148
|
+
throw new AgentWalletError("rpc_unavailable", "Solana token amount is malformed");
|
|
149
|
+
}
|
|
150
|
+
asset += BigInt(amount);
|
|
151
|
+
}
|
|
152
|
+
return {
|
|
153
|
+
version: 1,
|
|
154
|
+
network: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
|
|
155
|
+
address,
|
|
156
|
+
asset: SOLANA_USDT_MAINNET_MINT,
|
|
157
|
+
assetSymbol: "USDT",
|
|
158
|
+
assetAtomic: asset.toString(),
|
|
159
|
+
nativeSymbol: "SOL",
|
|
160
|
+
nativeAtomic: native.toString(),
|
|
161
|
+
checkedAt: new Date().toISOString(),
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
function bigintString(value, field) {
|
|
165
|
+
try {
|
|
166
|
+
if (typeof value === "bigint")
|
|
167
|
+
return value.toString();
|
|
168
|
+
if (typeof value === "number" && Number.isSafeInteger(value) && value >= 0) {
|
|
169
|
+
return String(value);
|
|
170
|
+
}
|
|
171
|
+
if (typeof value === "string" && /^(?:0|[1-9][0-9]*)$/.test(value))
|
|
172
|
+
return value;
|
|
173
|
+
if (typeof value === "object" && value !== null && "toString" in value) {
|
|
174
|
+
const result = String(value);
|
|
175
|
+
if (/^(?:0|[1-9][0-9]*)$/.test(result))
|
|
176
|
+
return result;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
catch {
|
|
180
|
+
// Normalize to one stable error below.
|
|
181
|
+
}
|
|
182
|
+
throw new AgentWalletError("rpc_unavailable", `${field} is malformed`);
|
|
183
|
+
}
|
|
184
|
+
export async function verifyTronMainnetRpc(endpoint) {
|
|
185
|
+
const controller = new AbortController();
|
|
186
|
+
const timeout = setTimeout(() => controller.abort(), 15_000);
|
|
187
|
+
try {
|
|
188
|
+
const base = endpoint.endsWith("/") ? endpoint : `${endpoint}/`;
|
|
189
|
+
const response = await fetch(new URL("wallet/getblockbynum", base), {
|
|
190
|
+
method: "POST",
|
|
191
|
+
headers: { "Content-Type": "application/json" },
|
|
192
|
+
body: JSON.stringify({ num: 0 }),
|
|
193
|
+
redirect: "error",
|
|
194
|
+
signal: controller.signal,
|
|
195
|
+
});
|
|
196
|
+
const text = await response.text();
|
|
197
|
+
if (!response.ok || text.length > 2 * 1024 * 1024) {
|
|
198
|
+
throw new Error(`TRON RPC returned HTTP ${response.status}`);
|
|
199
|
+
}
|
|
200
|
+
const body = JSON.parse(text);
|
|
201
|
+
if (typeof body !== "object" ||
|
|
202
|
+
body === null ||
|
|
203
|
+
!("blockID" in body) ||
|
|
204
|
+
body.blockID !== TRON_MAINNET_GENESIS_BLOCK_ID) {
|
|
205
|
+
throw new AgentWalletError("unsupported_network", "TRON RPC genesis block is not Mainnet");
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
catch (error) {
|
|
209
|
+
if (error instanceof AgentWalletError)
|
|
210
|
+
throw error;
|
|
211
|
+
throw new AgentWalletError("rpc_unavailable", "TRON genesis check failed", {
|
|
212
|
+
retryable: true,
|
|
213
|
+
cause: error,
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
finally {
|
|
217
|
+
clearTimeout(timeout);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
async function tronBalance(endpoint, address) {
|
|
221
|
+
try {
|
|
222
|
+
await verifyTronMainnetRpc(endpoint);
|
|
223
|
+
const tronWeb = new TronWeb({ fullHost: endpoint });
|
|
224
|
+
const [native, contract, resources] = await Promise.all([
|
|
225
|
+
tronWeb.trx.getBalance(address),
|
|
226
|
+
tronWeb.contract().at(TRON_USDT_MAINNET_CONTRACT),
|
|
227
|
+
tronWeb.trx.getAccountResources(address),
|
|
228
|
+
]);
|
|
229
|
+
const token = await contract.balanceOf(address).call();
|
|
230
|
+
const resourceRecord = resources;
|
|
231
|
+
const energyLimit = BigInt(bigintString(resourceRecord.EnergyLimit ?? 0, "TRON energy limit"));
|
|
232
|
+
const energyUsed = BigInt(bigintString(resourceRecord.EnergyUsed ?? 0, "TRON energy used"));
|
|
233
|
+
const bandwidthLimit = BigInt(bigintString(resourceRecord.freeNetLimit ?? 0, "TRON bandwidth limit")) +
|
|
234
|
+
BigInt(bigintString(resourceRecord.NetLimit ?? 0, "TRON staked bandwidth limit"));
|
|
235
|
+
const bandwidthUsed = BigInt(bigintString(resourceRecord.freeNetUsed ?? 0, "TRON bandwidth used")) +
|
|
236
|
+
BigInt(bigintString(resourceRecord.NetUsed ?? 0, "TRON staked bandwidth used"));
|
|
237
|
+
return {
|
|
238
|
+
version: 1,
|
|
239
|
+
network: "tron:mainnet",
|
|
240
|
+
address,
|
|
241
|
+
asset: TRON_USDT_MAINNET_CONTRACT,
|
|
242
|
+
assetSymbol: "USDT",
|
|
243
|
+
assetAtomic: bigintString(token, "TRON USDT balance"),
|
|
244
|
+
nativeSymbol: "TRX",
|
|
245
|
+
nativeAtomic: bigintString(native, "TRX balance"),
|
|
246
|
+
feeResources: {
|
|
247
|
+
energyAvailable: (energyLimit > energyUsed ? energyLimit - energyUsed : 0n).toString(),
|
|
248
|
+
bandwidthAvailable: (bandwidthLimit > bandwidthUsed ? bandwidthLimit - bandwidthUsed : 0n).toString(),
|
|
249
|
+
},
|
|
250
|
+
checkedAt: new Date().toISOString(),
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
catch (error) {
|
|
254
|
+
if (error instanceof AgentWalletError)
|
|
255
|
+
throw error;
|
|
256
|
+
throw new AgentWalletError("rpc_unavailable", "TRON balance request failed", {
|
|
257
|
+
retryable: true,
|
|
258
|
+
cause: error,
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
export async function readWalletBalance(options) {
|
|
263
|
+
if (options.network === "eip155:8453") {
|
|
264
|
+
if (!options.rpc.base)
|
|
265
|
+
throw new AgentWalletError("rpc_not_configured", "Base RPC is required");
|
|
266
|
+
return baseBalance(validateRpcUrl(options.rpc.base, "Base"), options.address);
|
|
267
|
+
}
|
|
268
|
+
if (options.network === "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp") {
|
|
269
|
+
if (!options.rpc.solana) {
|
|
270
|
+
throw new AgentWalletError("rpc_not_configured", "Solana RPC is required");
|
|
271
|
+
}
|
|
272
|
+
return solanaBalance(validateRpcUrl(options.rpc.solana, "Solana"), options.address);
|
|
273
|
+
}
|
|
274
|
+
if (!options.rpc.tron)
|
|
275
|
+
throw new AgentWalletError("rpc_not_configured", "TRON RPC is required");
|
|
276
|
+
return tronBalance(validateRpcUrl(options.rpc.tron, "TRON"), options.address);
|
|
277
|
+
}
|
|
278
|
+
//# sourceMappingURL=balances.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"balances.js","sourceRoot":"","sources":["../src/balances.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EACL,0BAA0B,GAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,wBAAwB,GACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAGhE,MAAM,CAAC,MAAM,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I,gBAAgB,CAAC,iBAAiB,EAAE,6BAA6B,EAAE;YAC3E,SAAS,EAAE,IAAI;YACf,KAAK,EAAE,KAAK;SACb,CAAC,CAAC;IACL,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,OAIvC;IACC,IAAI,OAAO,CAAC,OAAO,KAAK,aAAa,EAAE,CAAC;QACtC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI;YAAE,MAAM,IAAI,gBAAgB,CAAC,oBAAoB,EAAE,sBAAsB,CAAC,CAAC;QAChG,OAAO,WAAW,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAChF,CAAC;IACD,IAAI,OAAO,CAAC,OAAO,KAAK,yCAAyC,EAAE,CAAC;QAClE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;YACxB,MAAM,IAAI,gBAAgB,CAAC,oBAAoB,EAAE,wBAAwB,CAAC,CAAC;QAC7E,CAAC;QACD,OAAO,aAAa,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IACtF,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI;QAAE,MAAM,IAAI,gBAAgB,CAAC,oBAAoB,EAAE,sBAAsB,CAAC,CAAC;IAChG,OAAO,WAAW,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;AAChF,CAAC"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const ERROR_CODES: readonly ["invalid_input", "wallet_not_found", "wallet_exists", "wallet_locked", "wallet_storage_unsafe", "password_required", "insufficient_asset_balance", "insufficient_network_fee_resources", "unsupported_network", "unsupported_asset", "unsupported_profile", "request_binding_mismatch", "payment_limit_exceeded", "attempt_already_exists", "attempt_not_found", "attempt_ambiguous", "challenge_expired", "rpc_not_configured", "rpc_unavailable", "notification_not_configured", "notification_unavailable", "payment_artifact_corrupt", "operator_confirmation_required", "operation_not_supported"];
|
|
2
|
+
export type AgentWalletErrorCode = (typeof ERROR_CODES)[number];
|
|
3
|
+
export declare class AgentWalletError extends Error {
|
|
4
|
+
readonly code: AgentWalletErrorCode;
|
|
5
|
+
readonly retryable: boolean;
|
|
6
|
+
readonly exitCode: number;
|
|
7
|
+
readonly details?: Record<string, unknown>;
|
|
8
|
+
constructor(code: AgentWalletErrorCode, message: string, options?: {
|
|
9
|
+
retryable?: boolean;
|
|
10
|
+
details?: Record<string, unknown>;
|
|
11
|
+
cause?: unknown;
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export declare function asAgentWalletError(error: unknown): AgentWalletError;
|
|
15
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,mlBAyBd,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AA6BhE,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,QAAQ,CAAC,IAAI,EAAE,oBAAoB,CAAC;IACpC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBAGzC,IAAI,EAAE,oBAAoB,EAC1B,OAAO,EAAE,MAAM,EACf,OAAO,GAAE;QACP,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAClC,KAAK,CAAC,EAAE,OAAO,CAAC;KACZ;CAST;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,CAOnE"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export const ERROR_CODES = [
|
|
2
|
+
"invalid_input",
|
|
3
|
+
"wallet_not_found",
|
|
4
|
+
"wallet_exists",
|
|
5
|
+
"wallet_locked",
|
|
6
|
+
"wallet_storage_unsafe",
|
|
7
|
+
"password_required",
|
|
8
|
+
"insufficient_asset_balance",
|
|
9
|
+
"insufficient_network_fee_resources",
|
|
10
|
+
"unsupported_network",
|
|
11
|
+
"unsupported_asset",
|
|
12
|
+
"unsupported_profile",
|
|
13
|
+
"request_binding_mismatch",
|
|
14
|
+
"payment_limit_exceeded",
|
|
15
|
+
"attempt_already_exists",
|
|
16
|
+
"attempt_not_found",
|
|
17
|
+
"attempt_ambiguous",
|
|
18
|
+
"challenge_expired",
|
|
19
|
+
"rpc_not_configured",
|
|
20
|
+
"rpc_unavailable",
|
|
21
|
+
"notification_not_configured",
|
|
22
|
+
"notification_unavailable",
|
|
23
|
+
"payment_artifact_corrupt",
|
|
24
|
+
"operator_confirmation_required",
|
|
25
|
+
"operation_not_supported",
|
|
26
|
+
];
|
|
27
|
+
const EXIT_CODES = {
|
|
28
|
+
invalid_input: 2,
|
|
29
|
+
wallet_not_found: 10,
|
|
30
|
+
wallet_exists: 11,
|
|
31
|
+
wallet_locked: 12,
|
|
32
|
+
wallet_storage_unsafe: 13,
|
|
33
|
+
password_required: 14,
|
|
34
|
+
insufficient_asset_balance: 20,
|
|
35
|
+
insufficient_network_fee_resources: 21,
|
|
36
|
+
unsupported_network: 30,
|
|
37
|
+
unsupported_asset: 31,
|
|
38
|
+
unsupported_profile: 32,
|
|
39
|
+
request_binding_mismatch: 33,
|
|
40
|
+
payment_limit_exceeded: 34,
|
|
41
|
+
attempt_already_exists: 40,
|
|
42
|
+
attempt_not_found: 41,
|
|
43
|
+
attempt_ambiguous: 42,
|
|
44
|
+
challenge_expired: 43,
|
|
45
|
+
rpc_not_configured: 50,
|
|
46
|
+
rpc_unavailable: 51,
|
|
47
|
+
notification_not_configured: 52,
|
|
48
|
+
notification_unavailable: 53,
|
|
49
|
+
payment_artifact_corrupt: 60,
|
|
50
|
+
operator_confirmation_required: 70,
|
|
51
|
+
operation_not_supported: 71,
|
|
52
|
+
};
|
|
53
|
+
export class AgentWalletError extends Error {
|
|
54
|
+
code;
|
|
55
|
+
retryable;
|
|
56
|
+
exitCode;
|
|
57
|
+
details;
|
|
58
|
+
constructor(code, message, options = {}) {
|
|
59
|
+
super(message, { cause: options.cause });
|
|
60
|
+
this.name = "AgentWalletError";
|
|
61
|
+
this.code = code;
|
|
62
|
+
this.retryable = options.retryable ?? false;
|
|
63
|
+
this.exitCode = EXIT_CODES[code];
|
|
64
|
+
if (options.details !== undefined)
|
|
65
|
+
this.details = options.details;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
export function asAgentWalletError(error) {
|
|
69
|
+
if (error instanceof AgentWalletError)
|
|
70
|
+
return error;
|
|
71
|
+
return new AgentWalletError("invalid_input", error instanceof Error ? error.message : "unexpected wallet error", { cause: error });
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,eAAe;IACf,kBAAkB;IAClB,eAAe;IACf,eAAe;IACf,uBAAuB;IACvB,mBAAmB;IACnB,4BAA4B;IAC5B,oCAAoC;IACpC,qBAAqB;IACrB,mBAAmB;IACnB,qBAAqB;IACrB,0BAA0B;IAC1B,wBAAwB;IACxB,wBAAwB;IACxB,mBAAmB;IACnB,mBAAmB;IACnB,mBAAmB;IACnB,oBAAo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AAC,CAAC;QACjC,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS;YAAE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IACpE,CAAC;CACF;AAED,MAAM,UAAU,kBAAkB,CAAC,KAAc;IAC/C,IAAI,KAAK,YAAY,gBAAgB;QAAE,OAAO,KAAK,CAAC;IACpD,OAAO,IAAI,gBAAgB,CACzB,eAAe,EACf,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,yBAAyB,EAClE,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from "./balances.js";
|
|
2
|
+
export * from "./errors.js";
|
|
3
|
+
export * from "./notifications.js";
|
|
4
|
+
export * from "./payment/attempt-store.js";
|
|
5
|
+
export * from "./payment/authorize.js";
|
|
6
|
+
export * from "./payment/contracts.js";
|
|
7
|
+
export * from "./protocol/base.js";
|
|
8
|
+
export * from "./protocol/external-recipient.js";
|
|
9
|
+
export * from "./protocol/http.js";
|
|
10
|
+
export * from "./protocol/solana.js";
|
|
11
|
+
export * from "./protocol/tron.js";
|
|
12
|
+
export * from "./storage/keystore.js";
|
|
13
|
+
export * from "./storage/paths.js";
|
|
14
|
+
export * from "./storage/private-files.js";
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kCAAkC,CAAC;AACjD,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from "./balances.js";
|
|
2
|
+
export * from "./errors.js";
|
|
3
|
+
export * from "./notifications.js";
|
|
4
|
+
export * from "./payment/attempt-store.js";
|
|
5
|
+
export * from "./payment/authorize.js";
|
|
6
|
+
export * from "./payment/contracts.js";
|
|
7
|
+
export * from "./protocol/base.js";
|
|
8
|
+
export * from "./protocol/external-recipient.js";
|
|
9
|
+
export * from "./protocol/http.js";
|
|
10
|
+
export * from "./protocol/solana.js";
|
|
11
|
+
export * from "./protocol/tron.js";
|
|
12
|
+
export * from "./storage/keystore.js";
|
|
13
|
+
export * from "./storage/paths.js";
|
|
14
|
+
export * from "./storage/private-files.js";
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kCAAkC,CAAC;AACjD,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { type RpcConfiguration, type WalletBalance } from "./balances.js";
|
|
2
|
+
import { type UnlockedWallet } from "./storage/keystore.js";
|
|
3
|
+
export type RefillReason = "low_balance" | "renewal";
|
|
4
|
+
export type RefillNotificationIntent = {
|
|
5
|
+
version: 1;
|
|
6
|
+
kind: "x402api.refill-notification.v1";
|
|
7
|
+
audience: string;
|
|
8
|
+
subscriptionReference: string;
|
|
9
|
+
wallet: {
|
|
10
|
+
network: string;
|
|
11
|
+
address: string;
|
|
12
|
+
};
|
|
13
|
+
balance: {
|
|
14
|
+
asset: string;
|
|
15
|
+
assetSymbol: "USDC" | "USDT";
|
|
16
|
+
currentAtomic: string;
|
|
17
|
+
targetAtomic: string;
|
|
18
|
+
refillAtomic: string;
|
|
19
|
+
};
|
|
20
|
+
renewBy: string;
|
|
21
|
+
reason: RefillReason;
|
|
22
|
+
createdAt: string;
|
|
23
|
+
expiresAt: string;
|
|
24
|
+
nonce: string;
|
|
25
|
+
};
|
|
26
|
+
export type SignedRefillNotification = {
|
|
27
|
+
version: 1;
|
|
28
|
+
intent: RefillNotificationIntent;
|
|
29
|
+
signature: {
|
|
30
|
+
scheme: "eip191" | "ed25519" | "tron-message-v2";
|
|
31
|
+
value: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export type RefillNotificationResult = {
|
|
35
|
+
version: 1;
|
|
36
|
+
status: "accepted" | "deduplicated" | "not_required";
|
|
37
|
+
notificationId?: string;
|
|
38
|
+
wallet: string;
|
|
39
|
+
network: string;
|
|
40
|
+
address: string;
|
|
41
|
+
asset: string;
|
|
42
|
+
assetSymbol: "USDC" | "USDT";
|
|
43
|
+
currentBalanceAtomic: string;
|
|
44
|
+
targetBalanceAtomic: string;
|
|
45
|
+
refillAmountAtomic: string;
|
|
46
|
+
renewBy: string;
|
|
47
|
+
subscriptionReference: string;
|
|
48
|
+
};
|
|
49
|
+
export declare function validateNotificationUrl(value: string): string;
|
|
50
|
+
export declare function createSignedRefillNotification(options: {
|
|
51
|
+
wallet: UnlockedWallet;
|
|
52
|
+
balance: WalletBalance;
|
|
53
|
+
notificationUrl: string;
|
|
54
|
+
subscriptionReference: string;
|
|
55
|
+
targetBalanceAtomic: string;
|
|
56
|
+
renewBy: string;
|
|
57
|
+
reason: RefillReason;
|
|
58
|
+
now?: number;
|
|
59
|
+
}): Promise<SignedRefillNotification>;
|
|
60
|
+
export declare function requestRefillNotification(options: {
|
|
61
|
+
walletsDirectory: string;
|
|
62
|
+
wallet: string;
|
|
63
|
+
passphrase: string;
|
|
64
|
+
rpc: RpcConfiguration;
|
|
65
|
+
notificationUrl: string;
|
|
66
|
+
subscriptionReference: string;
|
|
67
|
+
targetBalanceAtomic: string;
|
|
68
|
+
renewBy: string;
|
|
69
|
+
reason: RefillReason;
|
|
70
|
+
}): Promise<RefillNotificationResult>;
|
|
71
|
+
//# sourceMappingURL=notifications.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../src/notifications.ts"],"names":[],"mappings":"AAMA,OAAO,EAAqB,KAAK,gBAAgB,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAG7F,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE1E,MAAM,MAAM,YAAY,GAAG,aAAa,GAAG,SAAS,CAAC;AAErD,MAAM,MAAM,wBAAwB,GAAG;IACrC,OAAO,EAAE,CAAC,CAAC;IACX,IAAI,EAAE,gCAAgC,CAAC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,MAAM,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,OAAO,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;QAC7B,aAAa,EAAE,MAAM,CAAC;QACtB,YAAY,EAAE,MAAM,CAAC;QACrB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,YAAY,CAAC;IACrB,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