@xona-labs/xpay 0.2.24 → 0.2.26
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/CHANGELOG.md +101 -78
- package/README.md +71 -69
- package/SKILL.md +22 -22
- package/dist/agenc/api.d.ts +8 -8
- package/dist/agenc/api.js +11 -11
- package/dist/agenc/hire.d.ts +4 -4
- package/dist/agenc/hire.js +17 -17
- package/dist/agenc/price.d.ts +1 -1
- package/dist/agenc/price.js +1 -1
- package/dist/biometric/index.d.ts +3 -3
- package/dist/biometric/index.js +6 -6
- package/dist/cli/accounts.d.ts +1 -1
- package/dist/cli/accounts.js +1 -1
- package/dist/cli/agenc.d.ts +2 -2
- package/dist/cli/agenc.js +4 -4
- package/dist/cli/balance.d.ts +1 -1
- package/dist/cli/balance.js +4 -4
- package/dist/cli/bento.d.ts +3 -3
- package/dist/cli/bento.js +8 -8
- package/dist/cli/bento.js.map +1 -1
- package/dist/cli/biometric.d.ts +1 -1
- package/dist/cli/biometric.js +8 -8
- package/dist/cli/common.js +6 -6
- package/dist/cli/common.js.map +1 -1
- package/dist/cli/discover.d.ts +2 -2
- package/dist/cli/discover.js +4 -4
- package/dist/cli/guardrail.d.ts +1 -1
- package/dist/cli/guardrail.js +3 -3
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.js +12 -12
- package/dist/cli/init.d.ts +1 -1
- package/dist/cli/init.js +2 -2
- package/dist/cli/magicblock.d.ts +1 -1
- package/dist/cli/magicblock.js +4 -4
- package/dist/cli/mcp-server.d.ts +2 -2
- package/dist/cli/mcp-server.d.ts.map +1 -1
- package/dist/cli/mcp-server.js +25 -22
- package/dist/cli/mcp-server.js.map +1 -1
- package/dist/cli/pay.d.ts +1 -1
- package/dist/cli/pay.js +1 -1
- package/dist/cli/report.d.ts +2 -2
- package/dist/cli/report.js +4 -4
- package/dist/cli/report.js.map +1 -1
- package/dist/cli/sana.d.ts +1 -1
- package/dist/cli/sana.js +3 -3
- package/dist/cli/shop.d.ts +1 -1
- package/dist/cli/shop.js +1 -1
- package/dist/cli/swap.d.ts +1 -1
- package/dist/cli/swap.js +3 -3
- package/dist/cli/token.d.ts +2 -2
- package/dist/cli/token.js +2 -2
- package/dist/cli/trade.d.ts +2 -2
- package/dist/cli/trade.js +8 -8
- package/dist/cli/trade.js.map +1 -1
- package/dist/cli/transfer.d.ts +1 -1
- package/dist/cli/transfer.js +1 -1
- package/dist/cli/x.d.ts +1 -1
- package/dist/cli/x.js +1 -1
- package/dist/cli/zauth.d.ts +1 -1
- package/dist/cli/zauth.js +5 -5
- package/dist/discover/cache.js +1 -1
- package/dist/discover/index.d.ts +2 -2
- package/dist/discover/index.js +6 -6
- package/dist/discover/orbitx402.d.ts +2 -2
- package/dist/discover/orbitx402.js +1 -1
- package/dist/discover/payai.js +1 -1
- package/dist/do/index.d.ts +2 -2
- package/dist/do/index.js +1 -1
- package/dist/guardrail/index.d.ts +4 -4
- package/dist/guardrail/index.js +14 -14
- package/dist/guardrail/index.js.map +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.js +2 -2
- package/dist/magicblock/client.d.ts +2 -2
- package/dist/magicblock/client.js +4 -4
- package/dist/profile/index.d.ts +3 -3
- package/dist/profile/index.js +3 -3
- package/dist/profile/storage.d.ts +1 -1
- package/dist/profile/storage.js +4 -4
- package/dist/profile/types.d.ts +6 -6
- package/dist/profile/types.js +1 -1
- package/dist/report/index.d.ts +1 -1
- package/dist/report/index.js +2 -2
- package/dist/sana/tools.js +8 -8
- package/dist/signers/raw-evm.d.ts +1 -1
- package/dist/signers/raw-evm.js +5 -5
- package/dist/signers/raw-solana.d.ts +1 -1
- package/dist/signers/raw-solana.js +4 -4
- package/dist/swap/index.d.ts +6 -6
- package/dist/swap/index.js +12 -12
- package/dist/token/index.d.ts +8 -8
- package/dist/token/index.js +14 -14
- package/dist/token/rwa.d.ts +3 -3
- package/dist/token/rwa.js +3 -3
- package/dist/tools/index.d.ts +15 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +71 -31
- package/dist/tools/index.js.map +1 -1
- package/dist/trading/discovery.d.ts +6 -6
- package/dist/trading/discovery.js +7 -7
- package/dist/trading/index.d.ts +6 -6
- package/dist/trading/index.js +13 -13
- package/dist/transfer/index.d.ts +4 -4
- package/dist/transfer/index.js +8 -8
- package/dist/types.d.ts +7 -7
- package/dist/use/index.d.ts +5 -5
- package/dist/use/index.js +20 -20
- package/dist/wallet/index.d.ts +2 -2
- package/dist/wallet/index.js +3 -3
- package/dist/x402/evm-payment.d.ts +4 -4
- package/dist/x402/evm-payment.js +6 -6
- package/dist/x402/extract.d.ts +1 -1
- package/dist/x402/extract.js +1 -1
- package/dist/x402/svm-payment.d.ts +2 -2
- package/dist/x402/svm-payment.js +2 -2
- package/dist/zauth/index.d.ts +4 -4
- package/dist/zauth/index.js +5 -5
- package/package.json +4 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/guardrail/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAuChD,MAAM,OAAO,SAAS;IACH,MAAM,CAAkB;IACxB,OAAO,GAAiB,EAAE,CAAC;IAE5C,YAAY,SAA0B,EAAE;QACtC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,KAAK,CAAC,IAA6D;QACvE,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAErD,sEAAsE;QACtE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/guardrail/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C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AACpG,CAAC;AAED,SAAS,QAAQ,CAAC,GAAW;IAC3B,IAAI,CAAC;QACH,OAAO,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAqBD,IAAI,WAAW,GAAuB,IAAI,CAAC;AAE3C,KAAK,UAAU,SAAS;IACtB,IAAI,WAAW;QAAE,OAAO,WAAW,CAAC;IACpC,6EAA6E;IAC7E,gEAAgE;IAChE,MAAM,SAAS,GAAG,iBAAiB,CAAC;IACpC,IAAI,CAAC;QACH,WAAW,GAAG,CAAC,MAAM,MAAM,CAAC,SAAS,CAAC,CAA2B,CAAC;IACpE,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,cAAc,CACtB,4EAA4E;YAC1E,kEAAkE,CACrE,CAAC;IACJ,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,SAAS,WAAW,CAAC,IAAY,EAAE,OAAe;IAChD,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAClC,IAAI,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7B,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAiB;QAClD,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @xona-labs/xpay
|
|
2
|
+
* @xona-labs/xpay - discovery + usage layer for agentic commerce.
|
|
3
3
|
*
|
|
4
4
|
* Quick start:
|
|
5
5
|
* ```ts
|
|
@@ -49,7 +49,7 @@ export { trendingTokens, newTokens, tokenPriceUsd, robinhoodHoldings, type Disco
|
|
|
49
49
|
/** Options for {@link createXPay}. */
|
|
50
50
|
export interface XPayOptions {
|
|
51
51
|
/**
|
|
52
|
-
* A loaded profile
|
|
52
|
+
* A loaded profile - derives `networks`, `signers`, and `guardrail` from
|
|
53
53
|
* the profile's keyfile and config. Mutually exclusive with the manual
|
|
54
54
|
* `networks` + `signers` shape below.
|
|
55
55
|
*/
|
|
@@ -69,13 +69,13 @@ export interface XPay {
|
|
|
69
69
|
guardrail: Guardrail;
|
|
70
70
|
/** Find paid services across configured catalogs. */
|
|
71
71
|
discover(opts?: DiscoverOptions): Promise<Resource[]>;
|
|
72
|
-
/** Call a specific resource
|
|
72
|
+
/** Call a specific resource - handles payment + retry. */
|
|
73
73
|
use(resource: Resource, opts?: {
|
|
74
74
|
body?: unknown;
|
|
75
75
|
headers?: Record<string, string>;
|
|
76
76
|
}): Promise<UseResult>;
|
|
77
77
|
/**
|
|
78
|
-
* Call any URL that supports x402
|
|
78
|
+
* Call any URL that supports x402 - even one not in the catalog. Probes the
|
|
79
79
|
* URL, follows the 402 challenge, settles, retries.
|
|
80
80
|
*/
|
|
81
81
|
useByUrl(url: string, opts?: {
|
|
@@ -92,7 +92,7 @@ export interface XPay {
|
|
|
92
92
|
/**
|
|
93
93
|
* Direct token transfer (no x402). Subject to the same guardrail.
|
|
94
94
|
* Solana: USDC, USDT, wSOL, BONK, JUP, PYTH, or any mint address.
|
|
95
|
-
* EVM: the network's stablecoin only
|
|
95
|
+
* EVM: the network's stablecoin only - USDC, or USDT0 on Stable.
|
|
96
96
|
* Pass private:true for MagicBlock PER privacy (Solana only).
|
|
97
97
|
*/
|
|
98
98
|
transfer(args: {
|
|
@@ -108,7 +108,7 @@ export interface XPay {
|
|
|
108
108
|
}): Promise<TokenInfo[]>;
|
|
109
109
|
/** List tradable RWA tokens on Solana (tokenized stocks/ETFs + USDY). Read-only, no signing. */
|
|
110
110
|
findRwaTokens(opts?: RwaFindOptions): Promise<RwaToken[]>;
|
|
111
|
-
/** Quote a swap without executing
|
|
111
|
+
/** Quote a swap without executing - no guardrail, no signing, no funds moved. */
|
|
112
112
|
swapQuote(args: {
|
|
113
113
|
amount: number;
|
|
114
114
|
from: string;
|
|
@@ -123,7 +123,7 @@ export interface XPay {
|
|
|
123
123
|
slippageBps?: number;
|
|
124
124
|
}): Promise<SwapResult>;
|
|
125
125
|
/**
|
|
126
|
-
* Quote a Robinhood Chain trade without executing
|
|
126
|
+
* Quote a Robinhood Chain trade without executing - no guardrail, no signing.
|
|
127
127
|
* `from`/`to` are "ETH" or an ERC-20 address / trending symbol (one must be ETH).
|
|
128
128
|
*/
|
|
129
129
|
tradeQuote(args: {
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @xona-labs/xpay
|
|
2
|
+
* @xona-labs/xpay - discovery + usage layer for agentic commerce.
|
|
3
3
|
*
|
|
4
4
|
* Quick start:
|
|
5
5
|
* ```ts
|
|
@@ -65,7 +65,7 @@ export function createXPay(options) {
|
|
|
65
65
|
// Bento intent firewall: thread the enable flag into the guardrail and
|
|
66
66
|
// expose the wallet key to @bentoguard/sdk, which reads it from
|
|
67
67
|
// AGENT_WALLET_PRIVATE_KEY. Bento authenticates by signing a challenge
|
|
68
|
-
// with this key
|
|
68
|
+
// with this key - there is no separate API key.
|
|
69
69
|
if (options.profile.config.bento?.enabled) {
|
|
70
70
|
guardrailConfig = { ...guardrailConfig, bento: { enabled: true } };
|
|
71
71
|
if (!process.env.AGENT_WALLET_PRIVATE_KEY) {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* and recipient on the base chain.
|
|
12
12
|
*
|
|
13
13
|
* Platform model: xpay is the integration layer. End users never need a
|
|
14
|
-
* MagicBlock account
|
|
14
|
+
* MagicBlock account - they pass private:true and xpay handles the rest.
|
|
15
15
|
* The challenge/login uses the user's own wallet key (proving transfer
|
|
16
16
|
* authorization), not a separate username/password account.
|
|
17
17
|
*
|
|
@@ -69,7 +69,7 @@ export interface InitializeMintParams {
|
|
|
69
69
|
/**
|
|
70
70
|
* Register an SPL mint with the MagicBlock ephemeral rollup.
|
|
71
71
|
* Call this once per mint from the platform operator's wallet before enabling
|
|
72
|
-
* private transfers. No auth required
|
|
72
|
+
* private transfers. No auth required - this is a permissionless setup.
|
|
73
73
|
*/
|
|
74
74
|
export declare function magicBlockInitializeMint(params: InitializeMintParams): Promise<string>;
|
|
75
75
|
export declare function magicBlockIsMintInitialized(mint: string, config?: MagicBlockConfig): Promise<boolean>;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* and recipient on the base chain.
|
|
12
12
|
*
|
|
13
13
|
* Platform model: xpay is the integration layer. End users never need a
|
|
14
|
-
* MagicBlock account
|
|
14
|
+
* MagicBlock account - they pass private:true and xpay handles the rest.
|
|
15
15
|
* The challenge/login uses the user's own wallet key (proving transfer
|
|
16
16
|
* authorization), not a separate username/password account.
|
|
17
17
|
*
|
|
@@ -101,7 +101,7 @@ export async function magicBlockPrivateTransfer(params) {
|
|
|
101
101
|
/**
|
|
102
102
|
* Register an SPL mint with the MagicBlock ephemeral rollup.
|
|
103
103
|
* Call this once per mint from the platform operator's wallet before enabling
|
|
104
|
-
* private transfers. No auth required
|
|
104
|
+
* private transfers. No auth required - this is a permissionless setup.
|
|
105
105
|
*/
|
|
106
106
|
export async function magicBlockInitializeMint(params) {
|
|
107
107
|
const api = resolveApi(params.config);
|
|
@@ -136,7 +136,7 @@ export async function magicBlockIsMintInitialized(mint, config) {
|
|
|
136
136
|
// ─── HTTP-only confirmation polling ──────────────────────────────────────────
|
|
137
137
|
/**
|
|
138
138
|
* Poll for transaction confirmation using getSignatureStatuses (pure HTTP).
|
|
139
|
-
* Never calls signatureSubscribe
|
|
139
|
+
* Never calls signatureSubscribe - safe for RPCs that don't support WebSocket.
|
|
140
140
|
* Resolves once confirmed/finalized, throws on on-chain error, times out after
|
|
141
141
|
* ~60 s and resolves anyway (balance was already deducted, tx is in flight).
|
|
142
142
|
*/
|
|
@@ -154,7 +154,7 @@ async function pollConfirmation(connection, signature, intervalMs = 2_000, maxAt
|
|
|
154
154
|
}
|
|
155
155
|
await new Promise((r) => setTimeout(r, intervalMs));
|
|
156
156
|
}
|
|
157
|
-
// Timed out
|
|
157
|
+
// Timed out - transaction was submitted, confirmation just took too long.
|
|
158
158
|
// Caller already has the sig so they can verify on-chain themselves.
|
|
159
159
|
}
|
|
160
160
|
// ─── Base58 encoding ─────────────────────────────────────────────────────────
|
package/dist/profile/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Profile API
|
|
2
|
+
* Profile API - public SDK surface for keyfile management.
|
|
3
3
|
*
|
|
4
4
|
* Programmatic usage:
|
|
5
5
|
* ```ts
|
|
@@ -25,7 +25,7 @@ export interface InitProfileOptions {
|
|
|
25
25
|
name?: string;
|
|
26
26
|
/** Use existing mnemonic (import) instead of generating one. */
|
|
27
27
|
mnemonic?: string;
|
|
28
|
-
/** Encrypt at rest. Strongly recommended
|
|
28
|
+
/** Encrypt at rest. Strongly recommended - omit only for ephemeral dev wallets. */
|
|
29
29
|
passphrase?: string;
|
|
30
30
|
/** Use workspace-local `.xpay/` instead of `~/.xpay/`. */
|
|
31
31
|
workspace?: boolean | string;
|
|
@@ -69,7 +69,7 @@ export declare function setProfileBiometric(name: string, enabled: boolean, opts
|
|
|
69
69
|
export declare function setSanaApiKey(name: string, apiKey: string, opts?: {
|
|
70
70
|
workspace?: boolean | string;
|
|
71
71
|
}): ProfileConfig;
|
|
72
|
-
/** Remove the Sana API key
|
|
72
|
+
/** Remove the Sana API key - sana_* tools will no longer be registered. */
|
|
73
73
|
export declare function clearSanaApiKey(name: string, opts?: {
|
|
74
74
|
workspace?: boolean | string;
|
|
75
75
|
}): ProfileConfig;
|
package/dist/profile/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Profile API
|
|
2
|
+
* Profile API - public SDK surface for keyfile management.
|
|
3
3
|
*
|
|
4
4
|
* Programmatic usage:
|
|
5
5
|
* ```ts
|
|
@@ -82,7 +82,7 @@ export function signersFromProfile(profile) {
|
|
|
82
82
|
// Always register a Robinhood Chain signer (same derived EVM key) so the
|
|
83
83
|
// trading tools work out of the box on any profile, even one that didn't
|
|
84
84
|
// opt "robinhood" into its `networks`. It's ETH-native with no USDC/x402
|
|
85
|
-
// surface, so this doesn't affect balances or payment routing
|
|
85
|
+
// surface, so this doesn't affect balances or payment routing - it only
|
|
86
86
|
// makes `wallet.has("robinhood")` true so `xpay trade` can sign.
|
|
87
87
|
out.robinhood ??= rawEvmSigner({
|
|
88
88
|
privateKey: keys.evm.privateKey,
|
|
@@ -141,7 +141,7 @@ export function setSanaApiKey(name, apiKey, opts = {}) {
|
|
|
141
141
|
writeConfigFile(dir, current);
|
|
142
142
|
return current;
|
|
143
143
|
}
|
|
144
|
-
/** Remove the Sana API key
|
|
144
|
+
/** Remove the Sana API key - sana_* tools will no longer be registered. */
|
|
145
145
|
export function clearSanaApiKey(name, opts = {}) {
|
|
146
146
|
const dir = profilePath(name, opts);
|
|
147
147
|
const current = readConfigFile(dir);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Profile storage
|
|
2
|
+
* Profile storage - read/write `wallet.json` + `config.json` under
|
|
3
3
|
* `~/.xpay/<name>/` (or a workspace path) with passphrase-based encryption.
|
|
4
4
|
*
|
|
5
5
|
* Encryption uses Node's built-in crypto (no new deps): scrypt → AES-256-GCM
|
package/dist/profile/storage.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Profile storage
|
|
2
|
+
* Profile storage - read/write `wallet.json` + `config.json` under
|
|
3
3
|
* `~/.xpay/<name>/` (or a workspace path) with passphrase-based encryption.
|
|
4
4
|
*
|
|
5
5
|
* Encryption uses Node's built-in crypto (no new deps): scrypt → AES-256-GCM
|
|
@@ -10,7 +10,7 @@ import { homedir } from "node:os";
|
|
|
10
10
|
import { join, resolve } from "node:path";
|
|
11
11
|
import { existsSync, mkdirSync, readFileSync, writeFileSync, readdirSync, chmodSync, statSync } from "node:fs";
|
|
12
12
|
import { randomBytes, scryptSync, createCipheriv, createDecipheriv } from "node:crypto";
|
|
13
|
-
const SCRYPT_N = 1 << 15; // 32768
|
|
13
|
+
const SCRYPT_N = 1 << 15; // 32768 - sane default, tunable.
|
|
14
14
|
const SCRYPT_R = 8;
|
|
15
15
|
const SCRYPT_P = 1;
|
|
16
16
|
const KEY_LEN = 32;
|
|
@@ -102,7 +102,7 @@ export function writeWalletFile(dir, wallet) {
|
|
|
102
102
|
ensureDir(dir);
|
|
103
103
|
const file = join(dir, "wallet.json");
|
|
104
104
|
writeFileSync(file, JSON.stringify(wallet, null, 2));
|
|
105
|
-
// 0600
|
|
105
|
+
// 0600 - readable only by the owner.
|
|
106
106
|
try {
|
|
107
107
|
chmodSync(file, 0o600);
|
|
108
108
|
}
|
|
@@ -156,7 +156,7 @@ export function unlockWalletFile(wallet, passphrase) {
|
|
|
156
156
|
if (!wallet.encrypted)
|
|
157
157
|
throw new Error("Wallet file has neither mnemonic nor encrypted payload");
|
|
158
158
|
if (!passphrase)
|
|
159
|
-
throw new Error("Wallet is encrypted
|
|
159
|
+
throw new Error("Wallet is encrypted - passphrase required");
|
|
160
160
|
return decryptMnemonic(wallet.encrypted, passphrase);
|
|
161
161
|
}
|
|
162
162
|
//# sourceMappingURL=storage.js.map
|
package/dist/profile/types.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Profile types. A profile is a named set of keys + config persisted under
|
|
3
3
|
* `~/.xpay/<name>/` (or `<workspace>/.xpay/<name>/` when workspace-local).
|
|
4
4
|
*
|
|
5
|
-
* One mnemonic derives both Solana and EVM keys
|
|
5
|
+
* One mnemonic derives both Solana and EVM keys - standard BIP-39 + BIP-44
|
|
6
6
|
* paths so the keys are recoverable in Phantom, MetaMask, Solflare, etc.
|
|
7
7
|
*/
|
|
8
8
|
export interface ProfileAddresses {
|
|
@@ -75,7 +75,7 @@ export interface ProfileConfig {
|
|
|
75
75
|
* Activate with `xpay bento enable` after registering this wallet's address
|
|
76
76
|
* at https://app.bentoguard.xyz. When enabled, every pay / transfer is
|
|
77
77
|
* screened by Bento's protect() for prompt-injection / wallet-drain intent
|
|
78
|
-
* before signing
|
|
78
|
+
* before signing - a second gate on top of the local guardrail caps.
|
|
79
79
|
* Bento authenticates with the wallet's own key, so there is no API key.
|
|
80
80
|
*/
|
|
81
81
|
bento?: {
|
|
@@ -94,7 +94,7 @@ export interface ProfileConfig {
|
|
|
94
94
|
endpoint?: string;
|
|
95
95
|
};
|
|
96
96
|
/**
|
|
97
|
-
* Native token-swap settings (Jupiter). Optional
|
|
97
|
+
* Native token-swap settings (Jupiter). Optional - swaps work keyless with
|
|
98
98
|
* sensible defaults.
|
|
99
99
|
*/
|
|
100
100
|
swap?: {
|
|
@@ -106,7 +106,7 @@ export interface ProfileConfig {
|
|
|
106
106
|
endpoint?: string;
|
|
107
107
|
};
|
|
108
108
|
/**
|
|
109
|
-
* Robinhood Chain token-trading settings (NOXA Fun / Uniswap V3). Optional
|
|
109
|
+
* Robinhood Chain token-trading settings (NOXA Fun / Uniswap V3). Optional -
|
|
110
110
|
* trades work with sensible defaults; the RPC override lives in `rpcs.robinhood`.
|
|
111
111
|
*/
|
|
112
112
|
trading?: {
|
|
@@ -115,7 +115,7 @@ export interface ProfileConfig {
|
|
|
115
115
|
};
|
|
116
116
|
/**
|
|
117
117
|
* MagicBlock Private Ephemeral Rollup integration.
|
|
118
|
-
* Platform-level config
|
|
118
|
+
* Platform-level config - set once by the xpay operator via `xpay magicblock configure`.
|
|
119
119
|
* End users never need a MagicBlock account; they just pass private:true.
|
|
120
120
|
*/
|
|
121
121
|
magicblock?: {
|
|
@@ -133,7 +133,7 @@ export interface LoadedProfile {
|
|
|
133
133
|
path: string;
|
|
134
134
|
addresses: ProfileAddresses;
|
|
135
135
|
config: ProfileConfig;
|
|
136
|
-
/** Decoded mnemonic
|
|
136
|
+
/** Decoded mnemonic - only present while the process holds the unlocked profile. */
|
|
137
137
|
mnemonic: string;
|
|
138
138
|
}
|
|
139
139
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/profile/types.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Profile types. A profile is a named set of keys + config persisted under
|
|
3
3
|
* `~/.xpay/<name>/` (or `<workspace>/.xpay/<name>/` when workspace-local).
|
|
4
4
|
*
|
|
5
|
-
* One mnemonic derives both Solana and EVM keys
|
|
5
|
+
* One mnemonic derives both Solana and EVM keys - standard BIP-39 + BIP-44
|
|
6
6
|
* paths so the keys are recoverable in Phantom, MetaMask, Solflare, etc.
|
|
7
7
|
*/
|
|
8
8
|
export {};
|
package/dist/report/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Report
|
|
2
|
+
* Report - comprehensive USDC activity report fetched from the OrbitX402 API.
|
|
3
3
|
*
|
|
4
4
|
* Replaces the old direct-RPC history module. On-chain data is fetched
|
|
5
5
|
* server-side by OrbitX402; xpay only receives the aggregated report.
|
package/dist/report/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Report
|
|
2
|
+
* Report - comprehensive USDC activity report fetched from the OrbitX402 API.
|
|
3
3
|
*
|
|
4
4
|
* Replaces the old direct-RPC history module. On-chain data is fetched
|
|
5
5
|
* server-side by OrbitX402; xpay only receives the aggregated report.
|
|
@@ -13,7 +13,7 @@ export async function fetchReport(address, opts = {}) {
|
|
|
13
13
|
const res = await fetch(url, { headers: { accept: "application/json" } });
|
|
14
14
|
if (!res.ok) {
|
|
15
15
|
const body = await res.text().catch(() => "");
|
|
16
|
-
throw new Error(`xpay report: ${res.status} ${res.statusText}${body ? `
|
|
16
|
+
throw new Error(`xpay report: ${res.status} ${res.statusText}${body ? ` - ${body}` : ""}`);
|
|
17
17
|
}
|
|
18
18
|
return res.json();
|
|
19
19
|
}
|
package/dist/sana/tools.js
CHANGED
|
@@ -21,18 +21,18 @@ export function forSana(apiKey) {
|
|
|
21
21
|
const tools = [
|
|
22
22
|
{
|
|
23
23
|
name: "sana_card",
|
|
24
|
-
description: "Sana agent wallet card
|
|
24
|
+
description: "Sana agent wallet card - card metadata: type, status, last 4 digits, expiry. " +
|
|
25
25
|
"Use this to check whether the card is active before spending.",
|
|
26
26
|
input_schema: { type: "object", properties: {} },
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
name: "sana_card_balance",
|
|
30
|
-
description: "Sana agent wallet card
|
|
30
|
+
description: "Sana agent wallet card - available spending power / credit balance on the card.",
|
|
31
31
|
input_schema: { type: "object", properties: {} },
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
name: "sana_card_deposit",
|
|
35
|
-
description: "Sana agent wallet card
|
|
35
|
+
description: "Sana agent wallet card - top up the card balance with USDC from the Sana wallet. " +
|
|
36
36
|
"Requires agent signing to be enabled on the API key.",
|
|
37
37
|
input_schema: {
|
|
38
38
|
type: "object",
|
|
@@ -44,7 +44,7 @@ export function forSana(apiKey) {
|
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
name: "sana_card_transactions",
|
|
47
|
-
description: "Sana agent wallet card
|
|
47
|
+
description: "Sana agent wallet card - card spending history, newest first.",
|
|
48
48
|
input_schema: {
|
|
49
49
|
type: "object",
|
|
50
50
|
properties: {
|
|
@@ -55,12 +55,12 @@ export function forSana(apiKey) {
|
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
name: "sana_portfolio",
|
|
58
|
-
description: "Sana wallet
|
|
58
|
+
description: "Sana wallet - total net worth in USD plus all token holdings with 24h price changes.",
|
|
59
59
|
input_schema: { type: "object", properties: {} },
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
name: "sana_price",
|
|
63
|
-
description: "Sana wallet
|
|
63
|
+
description: "Sana wallet - current USD price and 24h change for a token symbol.",
|
|
64
64
|
input_schema: {
|
|
65
65
|
type: "object",
|
|
66
66
|
properties: {
|
|
@@ -71,7 +71,7 @@ export function forSana(apiKey) {
|
|
|
71
71
|
},
|
|
72
72
|
{
|
|
73
73
|
name: "sana_swap",
|
|
74
|
-
description: "Sana wallet
|
|
74
|
+
description: "Sana wallet - swap tokens inside the Sana wallet. " +
|
|
75
75
|
"Requires agent signing enabled on the API key.",
|
|
76
76
|
input_schema: {
|
|
77
77
|
type: "object",
|
|
@@ -85,7 +85,7 @@ export function forSana(apiKey) {
|
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
87
|
name: "sana_notifications",
|
|
88
|
-
description: "Sana wallet
|
|
88
|
+
description: "Sana wallet - recent wallet activity feed and notifications.",
|
|
89
89
|
input_schema: { type: "object", properties: {} },
|
|
90
90
|
},
|
|
91
91
|
];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Raw EVM signer
|
|
2
|
+
* Raw EVM signer - works for Base, Ethereum, Arbitrum, Optimism, and other
|
|
3
3
|
* EIP-155 chains. Holds a hex private key via `ethers.Wallet`.
|
|
4
4
|
*/
|
|
5
5
|
import type { Network, Signer } from "../types.js";
|
package/dist/signers/raw-evm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Raw EVM signer
|
|
2
|
+
* Raw EVM signer - works for Base, Ethereum, Arbitrum, Optimism, and other
|
|
3
3
|
* EIP-155 chains. Holds a hex private key via `ethers.Wallet`.
|
|
4
4
|
*/
|
|
5
5
|
import { Contract, JsonRpcProvider, Wallet, getBytes, hashMessage } from "ethers";
|
|
@@ -9,7 +9,7 @@ const NATIVE_TOKEN = {
|
|
|
9
9
|
arbitrum: { symbol: "ETH", name: "Ether" },
|
|
10
10
|
optimism: { symbol: "ETH", name: "Ether" },
|
|
11
11
|
robinhood: { symbol: "ETH", name: "Ether" },
|
|
12
|
-
// Stable's gas coin is USDT itself, at 18 decimals
|
|
12
|
+
// Stable's gas coin is USDT itself, at 18 decimals - the ERC-20 USDT0 below
|
|
13
13
|
// is a different token with 6 decimals. Distinct symbols keep them apart in
|
|
14
14
|
// the balance view.
|
|
15
15
|
stable: { symbol: "USDT", name: "Tether USD (gas)" },
|
|
@@ -40,18 +40,18 @@ const KNOWN_ERC20S = {
|
|
|
40
40
|
{ symbol: "OP", name: "Optimism", contract: "0x4200000000000000000000000000000000000042", decimals: 18 },
|
|
41
41
|
],
|
|
42
42
|
// Robinhood Chain (Arbitrum Orbit L2, chain 4663) is ETH-native; no canonical
|
|
43
|
-
// USDC exists there yet, so no USDC entry
|
|
43
|
+
// USDC exists there yet, so no USDC entry - `balance()` reports 0 by design.
|
|
44
44
|
robinhood: [
|
|
45
45
|
{ symbol: "WETH", name: "Wrapped Ether", contract: "0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73", decimals: 18 },
|
|
46
46
|
],
|
|
47
|
-
// Stable (chain 988). USDT0 is the LayerZero OFT that x402 settles in
|
|
47
|
+
// Stable (chain 988). USDT0 is the LayerZero OFT that x402 settles in - 6
|
|
48
48
|
// decimals as an ERC-20, verified on-chain via decimals()/symbol().
|
|
49
49
|
stable: [
|
|
50
50
|
{ symbol: "USDT0", name: "USDT0", contract: "0x779Ded0c9e1022225f8E0630b35a9b54bE713736", decimals: 6 },
|
|
51
51
|
],
|
|
52
52
|
};
|
|
53
53
|
/**
|
|
54
|
-
* The stablecoin x402 settles in on each network
|
|
54
|
+
* The stablecoin x402 settles in on each network - what `balance()` reports and
|
|
55
55
|
* what payment routing compares a price against. USDC everywhere except Stable,
|
|
56
56
|
* which settles USDT0. All are 6 decimals, so the `/ 1_000_000` below holds.
|
|
57
57
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Raw Solana signer
|
|
2
|
+
* Raw Solana signer - for tests, server-side agents, and other scenarios where
|
|
3
3
|
* you hold a Solana keypair directly.
|
|
4
4
|
*
|
|
5
5
|
* Production wallets should prefer Privy or Phantom signers.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Raw Solana signer
|
|
2
|
+
* Raw Solana signer - for tests, server-side agents, and other scenarios where
|
|
3
3
|
* you hold a Solana keypair directly.
|
|
4
4
|
*
|
|
5
5
|
* Production wallets should prefer Privy or Phantom signers.
|
|
@@ -39,7 +39,7 @@ export function rawSolanaSigner(opts) {
|
|
|
39
39
|
* `useByUrl()` can use `@x402/svm` for canonical x402 SVM v2 payloads.
|
|
40
40
|
*/
|
|
41
41
|
async getKitSigner() {
|
|
42
|
-
// Dynamic import
|
|
42
|
+
// Dynamic import - keeps @solana/signers off the hot path for users
|
|
43
43
|
// who never call useByUrl against an SVM endpoint.
|
|
44
44
|
const { createKeyPairSignerFromBytes } = await import("@solana/signers");
|
|
45
45
|
return createKeyPairSignerFromBytes(keypair.secretKey);
|
|
@@ -71,7 +71,7 @@ export function rawSolanaSigner(opts) {
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
catch { /* skip */ }
|
|
74
|
-
// All SPL token accounts
|
|
74
|
+
// All SPL token accounts - both the classic token program AND
|
|
75
75
|
// Token-2022 (newer mints, e.g. pump.fun tokens, live there and were
|
|
76
76
|
// previously invisible to balance).
|
|
77
77
|
for (const programId of [TOKEN_PROGRAM_ID, TOKEN_2022_PROGRAM_ID]) {
|
|
@@ -119,7 +119,7 @@ export function rawSolanaSigner(opts) {
|
|
|
119
119
|
},
|
|
120
120
|
};
|
|
121
121
|
}
|
|
122
|
-
/** Minimal Base58 decode
|
|
122
|
+
/** Minimal Base58 decode - avoids pulling in bs58 just for this. */
|
|
123
123
|
function decodeBase58(s) {
|
|
124
124
|
const ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
|
|
125
125
|
const map = new Map();
|
package/dist/swap/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Native Solana token swap
|
|
2
|
+
* Native Solana token swap - Jupiter Swap API v2 (order → sign → execute).
|
|
3
3
|
*
|
|
4
4
|
* Swaps happen inside the user's own xpay wallet (funds never leave it), but
|
|
5
5
|
* a swap is irreversible and puts wallet value at risk, so it runs through
|
|
6
|
-
* the same guardrail as payments and transfers
|
|
6
|
+
* the same guardrail as payments and transfers - enforced *before* signing.
|
|
7
7
|
*
|
|
8
8
|
* Jupiter's meta-aggregator picks the router (metis / jupiterz / dflow /
|
|
9
|
-
* okx), returns an unsigned v0 transaction, and lands it via POST /execute
|
|
9
|
+
* okx), returns an unsigned v0 transaction, and lands it via POST /execute -
|
|
10
10
|
* no RPC broadcast on our side.
|
|
11
11
|
*
|
|
12
12
|
* Complements the Sana-hosted `sana_swap` (API-key wallet): this path is
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
import type { Wallet } from "../wallet/index.js";
|
|
16
16
|
import type { Guardrail } from "../guardrail/index.js";
|
|
17
17
|
import { type TokenInfo } from "../token/index.js";
|
|
18
|
-
/** Swap settings
|
|
18
|
+
/** Swap settings - profile `config.swap`, overridable per call / via env. */
|
|
19
19
|
export interface SwapConfig {
|
|
20
20
|
/** Max slippage in bps (50 = 0.5%). Unset → Jupiter dynamic slippage. */
|
|
21
21
|
slippageBps?: number;
|
|
@@ -52,7 +52,7 @@ export interface SwapQuote {
|
|
|
52
52
|
router: string;
|
|
53
53
|
/** Effective slippage for this order (Jupiter dynamic unless overridden). */
|
|
54
54
|
slippageBps?: number;
|
|
55
|
-
/** True when the output token is not Jupiter-verified
|
|
55
|
+
/** True when the output token is not Jupiter-verified - relay this warning. */
|
|
56
56
|
outputUnverified: boolean;
|
|
57
57
|
}
|
|
58
58
|
export interface SwapResult extends SwapQuote {
|
|
@@ -62,7 +62,7 @@ export interface SwapResult extends SwapQuote {
|
|
|
62
62
|
totalInAmount?: number;
|
|
63
63
|
totalOutAmount?: number;
|
|
64
64
|
}
|
|
65
|
-
/** Quote a swap without executing
|
|
65
|
+
/** Quote a swap without executing - no guardrail, no signing, no funds moved. */
|
|
66
66
|
export declare function swapQuote(args: Omit<SwapArgs, "guardrail">): Promise<SwapQuote>;
|
|
67
67
|
/** Execute a swap inside the wallet. Guardrail runs before signing. */
|
|
68
68
|
export declare function swap(args: SwapArgs): Promise<SwapResult>;
|
package/dist/swap/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Native Solana token swap
|
|
2
|
+
* Native Solana token swap - Jupiter Swap API v2 (order → sign → execute).
|
|
3
3
|
*
|
|
4
4
|
* Swaps happen inside the user's own xpay wallet (funds never leave it), but
|
|
5
5
|
* a swap is irreversible and puts wallet value at risk, so it runs through
|
|
6
|
-
* the same guardrail as payments and transfers
|
|
6
|
+
* the same guardrail as payments and transfers - enforced *before* signing.
|
|
7
7
|
*
|
|
8
8
|
* Jupiter's meta-aggregator picks the router (metis / jupiterz / dflow /
|
|
9
|
-
* okx), returns an unsigned v0 transaction, and lands it via POST /execute
|
|
9
|
+
* okx), returns an unsigned v0 transaction, and lands it via POST /execute -
|
|
10
10
|
* no RPC broadcast on our side.
|
|
11
11
|
*
|
|
12
12
|
* Complements the Sana-hosted `sana_swap` (API-key wallet): this path is
|
|
@@ -16,7 +16,7 @@ import { PublicKey, VersionedTransaction } from "@solana/web3.js";
|
|
|
16
16
|
import { jupiterFetch, resolveTradeToken, NATIVE_SOL_MINT, } from "../token/index.js";
|
|
17
17
|
import { solUsdPrice } from "../agenc/price.js";
|
|
18
18
|
const DEFAULT_ENDPOINT = "https://api.jup.ag";
|
|
19
|
-
/** Quote a swap without executing
|
|
19
|
+
/** Quote a swap without executing - no guardrail, no signing, no funds moved. */
|
|
20
20
|
export async function swapQuote(args) {
|
|
21
21
|
const prepared = await prepare(args);
|
|
22
22
|
return prepared.quote;
|
|
@@ -26,7 +26,7 @@ export async function swap(args) {
|
|
|
26
26
|
// A quote's transaction embeds a recent blockhash, so always build a fresh
|
|
27
27
|
// order here rather than reusing one from an earlier swapQuote() display.
|
|
28
28
|
const { quote, order, signer, apiOpts } = await prepare(args);
|
|
29
|
-
// Guardrail *before* signing
|
|
29
|
+
// Guardrail *before* signing - same security boundary as pay/transfer.
|
|
30
30
|
const requirement = {
|
|
31
31
|
asset: quote.from.mint,
|
|
32
32
|
payTo: quote.to.mint,
|
|
@@ -46,7 +46,7 @@ export async function swap(args) {
|
|
|
46
46
|
accepts: [requirement],
|
|
47
47
|
};
|
|
48
48
|
await args.guardrail.check({ resource, requirement });
|
|
49
|
-
// Partial-sign the v0 transaction. The signer never exposes its Keypair
|
|
49
|
+
// Partial-sign the v0 transaction. The signer never exposes its Keypair -
|
|
50
50
|
// sign the serialized message and attach the signature (same pattern as
|
|
51
51
|
// the native-SOL transfer). Do NOT use tx.sign(): it needs a Keypair, and
|
|
52
52
|
// JupiterZ orders may get a market-maker co-signature at /execute, so only
|
|
@@ -64,9 +64,9 @@ export async function swap(args) {
|
|
|
64
64
|
}));
|
|
65
65
|
if (exec.status !== "Success") {
|
|
66
66
|
const landed = exec.signature
|
|
67
|
-
? ` The transaction may have landed and reverted
|
|
67
|
+
? ` The transaction may have landed and reverted - check https://solscan.io/tx/${exec.signature}`
|
|
68
68
|
: "";
|
|
69
|
-
throw new Error(`xpay.swap: execution failed (code ${exec.code ?? "?"})
|
|
69
|
+
throw new Error(`xpay.swap: execution failed (code ${exec.code ?? "?"}) - ${exec.error ?? "unknown error"}.${landed}`);
|
|
70
70
|
}
|
|
71
71
|
return {
|
|
72
72
|
...quote,
|
|
@@ -81,7 +81,7 @@ async function prepare(args) {
|
|
|
81
81
|
throw new Error("xpay.swap: amount must be a positive number");
|
|
82
82
|
}
|
|
83
83
|
if (!args.wallet.has("solana")) {
|
|
84
|
-
throw new Error("xpay.swap: swaps are Solana-only
|
|
84
|
+
throw new Error("xpay.swap: swaps are Solana-only - no Solana signer is configured");
|
|
85
85
|
}
|
|
86
86
|
const signer = args.wallet.signer("solana");
|
|
87
87
|
const apiOpts = {
|
|
@@ -115,7 +115,7 @@ async function prepare(args) {
|
|
|
115
115
|
// 2 = wallet lacks SOL for fees; 3 = wallet lacked SOL so Jupiter tried
|
|
116
116
|
// the gasless route, which has a ~$5 minimum. A top-level `error` with no
|
|
117
117
|
// code ("Failed to get quotes") notably happens when slippageBps is set
|
|
118
|
-
// on the keyless tier
|
|
118
|
+
// on the keyless tier - dynamic slippage (omitting it) works.
|
|
119
119
|
let reason;
|
|
120
120
|
if (order.errorCode === 1) {
|
|
121
121
|
reason = `insufficient ${from.symbol} balance in the wallet`;
|
|
@@ -126,10 +126,10 @@ async function prepare(args) {
|
|
|
126
126
|
else if (order.errorCode === 3) {
|
|
127
127
|
reason =
|
|
128
128
|
"swap is below the gasless route's ~$5 minimum. Jupiter routes gasless when the " +
|
|
129
|
-
"wallet lacks SOL for fees
|
|
129
|
+
"wallet lacks SOL for fees - fund the wallet with SOL, or swap a larger amount";
|
|
130
130
|
}
|
|
131
131
|
else if (order.error && slippageBps !== undefined) {
|
|
132
|
-
reason = `${order.error}
|
|
132
|
+
reason = `${order.error} - try again without an explicit slippage (Jupiter picks dynamic slippage)`;
|
|
133
133
|
}
|
|
134
134
|
else {
|
|
135
135
|
reason = order.errorMessage ?? order.error ?? "Jupiter could not build a swap transaction";
|