agentwallet-sdk 6.0.4 → 6.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.
Files changed (87) hide show
  1. package/README.md +380 -323
  2. package/dist/bridge/__tests__/solana.test.js +1 -1
  3. package/dist/bridge/__tests__/solana.test.js.map +1 -1
  4. package/dist/escrow/MutualStakeEscrow.d.ts.map +1 -1
  5. package/dist/escrow/MutualStakeEscrow.js +3 -5
  6. package/dist/escrow/MutualStakeEscrow.js.map +1 -1
  7. package/dist/identity/index.d.ts +2 -0
  8. package/dist/identity/index.d.ts.map +1 -1
  9. package/dist/identity/index.js +2 -0
  10. package/dist/identity/index.js.map +1 -1
  11. package/dist/identity/uaid.d.ts +193 -0
  12. package/dist/identity/uaid.d.ts.map +1 -0
  13. package/dist/identity/uaid.js +296 -0
  14. package/dist/identity/uaid.js.map +1 -0
  15. package/dist/index.d.ts +52 -252
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +17 -5
  18. package/dist/index.js.map +1 -1
  19. package/dist/policy/SpendingPolicy.test.js.map +1 -1
  20. package/dist/router/PaymentRouter.d.ts +79 -0
  21. package/dist/router/PaymentRouter.d.ts.map +1 -0
  22. package/dist/router/PaymentRouter.js +144 -0
  23. package/dist/router/PaymentRouter.js.map +1 -0
  24. package/dist/router/index.d.ts +3 -0
  25. package/dist/router/index.d.ts.map +1 -0
  26. package/dist/router/index.js +2 -0
  27. package/dist/router/index.js.map +1 -0
  28. package/dist/swap/SwapModule.js +1 -1
  29. package/dist/swap/SwapModule.js.map +1 -1
  30. package/dist/tokens/__tests__/decimals.test.d.ts +2 -0
  31. package/dist/tokens/__tests__/decimals.test.d.ts.map +1 -0
  32. package/dist/tokens/__tests__/decimals.test.js +107 -0
  33. package/dist/tokens/__tests__/decimals.test.js.map +1 -0
  34. package/dist/tokens/__tests__/registry.test.d.ts +2 -0
  35. package/dist/tokens/__tests__/registry.test.d.ts.map +1 -0
  36. package/dist/tokens/__tests__/registry.test.js +191 -0
  37. package/dist/tokens/__tests__/registry.test.js.map +1 -0
  38. package/dist/tokens/__tests__/transfers.test.d.ts +2 -0
  39. package/dist/tokens/__tests__/transfers.test.d.ts.map +1 -0
  40. package/dist/tokens/__tests__/transfers.test.js +103 -0
  41. package/dist/tokens/__tests__/transfers.test.js.map +1 -0
  42. package/dist/tokens/decimals.d.ts +65 -0
  43. package/dist/tokens/decimals.d.ts.map +1 -0
  44. package/dist/tokens/decimals.js +112 -0
  45. package/dist/tokens/decimals.js.map +1 -0
  46. package/dist/tokens/index.d.ts +14 -0
  47. package/dist/tokens/index.d.ts.map +1 -0
  48. package/dist/tokens/index.js +14 -0
  49. package/dist/tokens/index.js.map +1 -0
  50. package/dist/tokens/registry.d.ts +82 -0
  51. package/dist/tokens/registry.d.ts.map +1 -0
  52. package/dist/tokens/registry.js +293 -0
  53. package/dist/tokens/registry.js.map +1 -0
  54. package/dist/tokens/solana.d.ts +108 -0
  55. package/dist/tokens/solana.d.ts.map +1 -0
  56. package/dist/tokens/solana.js +306 -0
  57. package/dist/tokens/solana.js.map +1 -0
  58. package/dist/tokens/transfers.d.ts +95 -0
  59. package/dist/tokens/transfers.d.ts.map +1 -0
  60. package/dist/tokens/transfers.js +196 -0
  61. package/dist/tokens/transfers.js.map +1 -0
  62. package/dist/x402/chains/abstract/index.d.ts.map +1 -1
  63. package/dist/x402/chains/abstract/index.js.map +1 -1
  64. package/dist/x402/client.d.ts +7 -1
  65. package/dist/x402/client.d.ts.map +1 -1
  66. package/dist/x402/client.js +24 -13
  67. package/dist/x402/client.js.map +1 -1
  68. package/dist/x402/index.d.ts +1 -0
  69. package/dist/x402/index.d.ts.map +1 -1
  70. package/dist/x402/index.js +2 -0
  71. package/dist/x402/index.js.map +1 -1
  72. package/dist/x402/middleware.d.ts.map +1 -1
  73. package/dist/x402/middleware.js +0 -3
  74. package/dist/x402/middleware.js.map +1 -1
  75. package/dist/x402/multi-asset.d.ts +54 -0
  76. package/dist/x402/multi-asset.d.ts.map +1 -0
  77. package/dist/x402/multi-asset.js +123 -0
  78. package/dist/x402/multi-asset.js.map +1 -0
  79. package/package.json +12 -3
  80. package/dist/plugins/elizaos.d.ts +0 -52
  81. package/dist/plugins/elizaos.d.ts.map +0 -1
  82. package/dist/plugins/elizaos.js +0 -89
  83. package/dist/plugins/elizaos.js.map +0 -1
  84. package/dist/x402/chains/stellar/index.d.ts +0 -149
  85. package/dist/x402/chains/stellar/index.d.ts.map +0 -1
  86. package/dist/x402/chains/stellar/index.js +0 -197
  87. package/dist/x402/chains/stellar/index.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentwallet-sdk",
3
- "version": "6.0.4",
3
+ "version": "6.1.0",
4
4
  "description": "Non-custodial AI agent wallet SDK. ERC-8004 identity & reputation registries, mutual stake escrow, x402 payments, 17-chain CCTP bridging, ERC-6551 TBA, SpendingPolicy guardrails, Uniswap V3 swap. The agent holds the keys.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,7 +13,8 @@
13
13
  "clean": "rm -rf dist",
14
14
  "test": "vitest run",
15
15
  "deploy": "wrangler deploy",
16
- "preview": "wrangler dev"
16
+ "preview": "wrangler dev",
17
+ "lint": "eslint src/"
17
18
  },
18
19
  "keywords": [
19
20
  "agent-wallet",
@@ -39,7 +40,7 @@
39
40
  "license": "MIT",
40
41
  "repository": {
41
42
  "type": "git",
42
- "url": "https://github.com/agentnexus/agent-wallet-sdk"
43
+ "url": "git+https://github.com/up2itnow0822/agent-wallet-sdk.git"
43
44
  },
44
45
  "author": "AgentNexus",
45
46
  "dependencies": {
@@ -56,8 +57,16 @@
56
57
  "devDependencies": {
57
58
  "@elizaos/core": "^1.5.4",
58
59
  "@types/node": "^25.5.0",
60
+ "@typescript-eslint/eslint-plugin": "^8.57.1",
61
+ "@typescript-eslint/parser": "^8.57.1",
62
+ "eslint": "^10.1.0",
63
+ "globals": "^16.5.0",
59
64
  "typescript": "5.3.3",
60
65
  "vitest": "4.0.18",
61
66
  "wrangler": "^4.72.0"
67
+ },
68
+ "homepage": "https://github.com/up2itnow0822/agent-wallet-sdk#readme",
69
+ "bugs": {
70
+ "url": "https://github.com/up2itnow0822/agent-wallet-sdk/issues"
62
71
  }
63
72
  }
@@ -1,52 +0,0 @@
1
- /**
2
- * @elizaos/plugin-agentwallet
3
- *
4
- * ElizaOS plugin for agentwallet-sdk — non-custodial AI agent wallet with
5
- * x402 payment support, CCTP V2 cross-chain transfers, and on-chain spend limits.
6
- *
7
- * Your agent holds its own private key. No custodian. No KYC.
8
- */
9
- import type { Plugin } from '@elizaos/core';
10
- import { createWallet } from '../index.js';
11
- type AgentWallet = ReturnType<typeof createWallet>;
12
- export interface AgentWalletPluginConfig {
13
- /** Agent private key — stays in your environment, never transmitted */
14
- privateKey: `0x${string}`;
15
- /** Deployed AgentAccountV2 contract address */
16
- accountAddress: `0x${string}`;
17
- /** Chain to connect to (default: 'base') */
18
- chain?: 'base' | 'base-sepolia' | 'ethereum' | 'arbitrum' | 'polygon' | 'etherlink';
19
- /** Optional custom RPC URL */
20
- rpcUrl?: string;
21
- /** Optional daily x402 spend limit in USDC base units (default: 50 USDC = 50_000_000n) */
22
- x402DailyLimit?: bigint;
23
- }
24
- /**
25
- * Get or create the agent wallet singleton.
26
- */
27
- export declare function getAgentWallet(config: AgentWalletPluginConfig): AgentWallet;
28
- /**
29
- * Create an x402-enabled fetch function for the agent to pay APIs automatically.
30
- */
31
- export declare function createAgentFetch(config: AgentWalletPluginConfig): typeof fetch;
32
- /**
33
- * ElizaOS Plugin definition for agentwallet-sdk.
34
- *
35
- * Usage in your Eliza character config:
36
- *
37
- * ```json
38
- * {
39
- * "plugins": ["@elizaos/plugin-agentwallet"],
40
- * "settings": {
41
- * "AGENT_PRIVATE_KEY": "0x...",
42
- * "AGENT_ACCOUNT_ADDRESS": "0x...",
43
- * "AGENT_CHAIN": "base",
44
- * "X402_DAILY_LIMIT": "50000000"
45
- * }
46
- * }
47
- * ```
48
- */
49
- declare const AgentWalletPlugin: Plugin;
50
- export default AgentWalletPlugin;
51
- export { AgentWalletPlugin };
52
- //# sourceMappingURL=elizaos.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"elizaos.d.ts","sourceRoot":"","sources":["../../src/plugins/elizaos.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EACL,YAAY,EAGb,MAAM,aAAa,CAAC;AAGrB,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AAInD,MAAM,WAAW,uBAAuB;IACtC,uEAAuE;IACvE,UAAU,EAAE,KAAK,MAAM,EAAE,CAAC;IAC1B,+CAA+C;IAC/C,cAAc,EAAE,KAAK,MAAM,EAAE,CAAC;IAC9B,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,GAAG,cAAc,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,WAAW,CAAC;IACpF,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0FAA0F;IAC1F,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAID;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,uBAAuB,GAAG,WAAW,CAuB3E;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,uBAAuB,gBAK/D;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,QAAA,MAAM,iBAAiB,EAAE,MAiCxB,CAAC;AAEF,eAAe,iBAAiB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
@@ -1,89 +0,0 @@
1
- import { createWallet, createX402Fetch, } from '../index.js';
2
- import { createWalletClient, http } from 'viem';
3
- import { privateKeyToAccount } from 'viem/accounts';
4
- let walletInstance = null;
5
- /**
6
- * Get or create the agent wallet singleton.
7
- */
8
- export function getAgentWallet(config) {
9
- if (!walletInstance) {
10
- const account = privateKeyToAccount(config.privateKey);
11
- const rpcUrls = {
12
- base: 'https://mainnet.base.org',
13
- 'base-sepolia': 'https://sepolia.base.org',
14
- ethereum: 'https://eth.llamarpc.com',
15
- arbitrum: 'https://arb1.arbitrum.io/rpc',
16
- polygon: 'https://polygon-rpc.com',
17
- etherlink: 'https://node.mainnet.etherlink.com',
18
- };
19
- const chain = config.chain ?? 'base';
20
- const walletClient = createWalletClient({
21
- account,
22
- transport: http(config.rpcUrl ?? rpcUrls[chain] ?? rpcUrls.base),
23
- });
24
- walletInstance = createWallet({
25
- accountAddress: config.accountAddress,
26
- chain,
27
- walletClient,
28
- });
29
- }
30
- return walletInstance;
31
- }
32
- /**
33
- * Create an x402-enabled fetch function for the agent to pay APIs automatically.
34
- */
35
- export function createAgentFetch(config) {
36
- const wallet = getAgentWallet(config);
37
- return createX402Fetch(wallet, {
38
- globalDailyLimit: config.x402DailyLimit ?? 50000000n, // 50 USDC default
39
- });
40
- }
41
- /**
42
- * ElizaOS Plugin definition for agentwallet-sdk.
43
- *
44
- * Usage in your Eliza character config:
45
- *
46
- * ```json
47
- * {
48
- * "plugins": ["@elizaos/plugin-agentwallet"],
49
- * "settings": {
50
- * "AGENT_PRIVATE_KEY": "0x...",
51
- * "AGENT_ACCOUNT_ADDRESS": "0x...",
52
- * "AGENT_CHAIN": "base",
53
- * "X402_DAILY_LIMIT": "50000000"
54
- * }
55
- * }
56
- * ```
57
- */
58
- const AgentWalletPlugin = {
59
- name: '@elizaos/plugin-agentwallet',
60
- description: 'Non-custodial agent wallet for ElizaOS — x402 payments, CCTP cross-chain, on-chain spend limits. Agent holds its own keys.',
61
- actions: [],
62
- providers: [
63
- {
64
- name: 'agentWallet',
65
- description: 'Provides agent wallet and x402 fetch capability to the runtime',
66
- async get(runtime) {
67
- const privateKey = runtime.getSetting('AGENT_PRIVATE_KEY');
68
- const accountAddress = runtime.getSetting('AGENT_ACCOUNT_ADDRESS');
69
- const chain = (runtime.getSetting('AGENT_CHAIN') ?? 'base');
70
- const dailyLimitStr = runtime.getSetting('X402_DAILY_LIMIT');
71
- const x402DailyLimit = dailyLimitStr ? BigInt(dailyLimitStr) : 50000000n;
72
- if (!privateKey || !accountAddress) {
73
- return 'AgentWallet not configured: AGENT_PRIVATE_KEY and AGENT_ACCOUNT_ADDRESS required.';
74
- }
75
- const config = { privateKey, accountAddress, chain, x402DailyLimit };
76
- const wallet = getAgentWallet(config);
77
- const x402Fetch = createAgentFetch(config);
78
- // Expose on runtime for actions to use
79
- runtime.agentWallet = wallet;
80
- runtime.x402Fetch = x402Fetch;
81
- return `AgentWallet ready — non-custodial, keys stay local. Chain: ${chain}. x402 daily limit: ${x402DailyLimit / 1000000n} USDC.`;
82
- },
83
- },
84
- ],
85
- evaluators: [],
86
- };
87
- export default AgentWalletPlugin;
88
- export { AgentWalletPlugin };
89
- //# sourceMappingURL=elizaos.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"elizaos.js","sourceRoot":"","sources":["../../src/plugins/elizaos.ts"],"names":[],"mappings":"AASA,OAAO,EACL,YAAY,EAEZ,eAAe,GAChB,MAAM,aAAa,CAAC;AAIrB,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAepD,IAAI,cAAc,GAAuB,IAAI,CAAC;AAE9C;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,MAA+B;IAC5D,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,MAAM,OAAO,GAAG,mBAAmB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACvD,MAAM,OAAO,GAA2B;YACtC,IAAI,EAAE,0BAA0B;YAChC,cAAc,EAAE,0BAA0B;YAC1C,QAAQ,EAAE,0BAA0B;YACpC,QAAQ,EAAE,8BAA8B;YACxC,OAAO,EAAE,yBAAyB;YAClC,SAAS,EAAE,oCAAoC;SAChD,CA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AAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAW,CAAC;gBAE3E,IAAI,CAAC,UAAU,IAAI,CAAC,cAAc,EAAE,CAAC;oBACnC,OAAO,mFAAmF,CAAC;gBAC7F,CAAC;gBAED,MAAM,MAAM,GAA4B,EAAE,UAAU,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC;gBAC9F,MAAM,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;gBACtC,MAAM,SAAS,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;gBAE3C,uCAAuC;gBACtC,OAAe,CAAC,WAAW,GAAG,MAAM,CAAC;gBACrC,OAAe,CAAC,SAAS,GAAG,SAAS,CAAC;gBAEvC,OAAO,8DAA8D,KAAK,uBAAuB,cAAc,GAAG,QAAU,QAAQ,CAAC;YACvI,CAAC;SACF;KACF;IACD,UAAU,EAAE,EAAE;CACf,CAAC;AAEF,eAAe,iBAAiB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
@@ -1,149 +0,0 @@
1
- /**
2
- * Stellar x402 Payment Adapter
3
- *
4
- * Implements x402 payment protocol on Stellar network.
5
- * Stellar x402 support went live March 11, 2026.
6
- *
7
- * Chain identifiers:
8
- * - Stellar Mainnet: "stellar:pubnet"
9
- * - Stellar Testnet: "stellar:testnet"
10
- *
11
- * Key differences from EVM chains:
12
- * - Uses Ed25519 keypairs (not secp256k1)
13
- * - Transaction format: Stellar XDR (not EVM tx)
14
- * - Settlement: ~5 seconds (1 ledger close)
15
- * - Fees: ~0.00001 XLM per operation (effectively free at scale)
16
- * - USDC: Circle-issued USDC on Stellar
17
- */
18
- export declare const STELLAR_NETWORK: {
19
- readonly pubnet: {
20
- readonly horizonUrl: "https://horizon.stellar.org";
21
- readonly networkPassphrase: "Public Global Stellar Network ; September 2015";
22
- readonly chainId: "stellar:pubnet";
23
- };
24
- readonly testnet: {
25
- readonly horizonUrl: "https://horizon-testnet.stellar.org";
26
- readonly networkPassphrase: "Test SDF Network ; September 2015";
27
- readonly chainId: "stellar:testnet";
28
- };
29
- };
30
- /**
31
- * Circle USDC on Stellar (Mainnet)
32
- * Asset code: USDC
33
- * Issuer: GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN
34
- */
35
- export declare const STELLAR_USDC: {
36
- readonly pubnet: {
37
- readonly code: "USDC";
38
- readonly issuer: "GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN";
39
- };
40
- readonly testnet: {
41
- readonly code: "USDC";
42
- readonly issuer: "GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5";
43
- };
44
- };
45
- export type StellarNetwork = 'pubnet' | 'testnet';
46
- export interface StellarPaymentConfig {
47
- /** Which Stellar network to use */
48
- network?: StellarNetwork;
49
- /** x402 resource identifier (for memo) */
50
- resource?: string;
51
- /** Custom Horizon URL (overrides default) */
52
- horizonUrl?: string;
53
- }
54
- export interface StellarPaymentRequest {
55
- /** Destination Stellar account (G... address) */
56
- destination: string;
57
- /** Amount in USDC (decimal string, e.g. "0.50") */
58
- amount: string;
59
- /** Source Stellar account public key */
60
- sourcePublicKey: string;
61
- /** x402 resource path for memo */
62
- resource?: string;
63
- /** Network to use */
64
- network?: StellarNetwork;
65
- }
66
- export interface StellarPaymentResult {
67
- /** Stellar transaction hash */
68
- hash: string;
69
- /** Ledger number the transaction landed in */
70
- ledger: number;
71
- /** Successful */
72
- successful: boolean;
73
- /** Network used */
74
- network: StellarNetwork;
75
- }
76
- /**
77
- * StellarX402Adapter
78
- *
79
- * Handles x402 payment flow for Stellar network.
80
- *
81
- * Usage (with stellar-sdk):
82
- * ```typescript
83
- * import { StellarX402Adapter } from 'agentwallet-sdk/x402/stellar';
84
- * import { Keypair, Networks } from '@stellar/stellar-sdk';
85
- *
86
- * const adapter = new StellarX402Adapter({ network: 'pubnet' });
87
- * const result = await adapter.pay({
88
- * destination: 'GDESTWVX3VMLQCXPHPVLS3FMNMG2X7L5IGGQT7BQMIZXZZ4V7KBQVS',
89
- * amount: '0.50',
90
- * sourcePublicKey: keypair.publicKey(),
91
- * resource: '/api/data-endpoint',
92
- * }, keypair.secret());
93
- * ```
94
- *
95
- * Note: stellar-sdk must be installed separately:
96
- * npm install @stellar/stellar-sdk
97
- */
98
- export declare class StellarX402Adapter {
99
- private network;
100
- private horizonUrl;
101
- constructor(config?: StellarPaymentConfig);
102
- /**
103
- * Parse an x402 402 response and extract Stellar payment details.
104
- * The 402 response should include X-Payment-Chains: stellar:pubnet
105
- * and X-Payment-Amount, X-Payment-Destination headers.
106
- */
107
- parseX402Response(headers: Record<string, string>): {
108
- supported: boolean;
109
- destination?: string;
110
- amount?: string;
111
- resource?: string;
112
- };
113
- /**
114
- * Build a Stellar USDC payment transaction.
115
- *
116
- * Requires @stellar/stellar-sdk to be installed:
117
- * npm install @stellar/stellar-sdk
118
- *
119
- * Returns the XDR-encoded transaction envelope for signing and submission.
120
- */
121
- buildPaymentTransaction(request: StellarPaymentRequest): Promise<string>;
122
- /**
123
- * Submit a signed Stellar transaction to Horizon.
124
- */
125
- submitTransaction(signedXdr: string): Promise<StellarPaymentResult>;
126
- private _loadAccount;
127
- /** Chain ID for this adapter (e.g. "stellar:pubnet") */
128
- get chainId(): string;
129
- }
130
- /**
131
- * Full x402 payment flow for Stellar.
132
- * 1. Detects 402 response from API
133
- * 2. Parses Stellar payment details from headers
134
- * 3. Builds, signs, and submits Stellar USDC payment
135
- * 4. Retries the original request with payment proof
136
- *
137
- * Requires stellar-sdk: npm install @stellar/stellar-sdk
138
- */
139
- export declare function stellarX402Pay(params: {
140
- /** The 402 response headers */
141
- responseHeaders: Record<string, string>;
142
- /** Source account public key */
143
- sourcePublicKey: string;
144
- /** Signer function that takes XDR and returns signed XDR */
145
- sign: (xdr: string) => Promise<string>;
146
- /** Network to use */
147
- network?: StellarNetwork;
148
- }): Promise<StellarPaymentResult>;
149
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/x402/chains/stellar/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,eAAO,MAAM,eAAe;;;;;;;;;;;CAWlB,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,YAAY;;;;;;;;;CASf,CAAC;AAIX,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,SAAS,CAAC;AAElD,MAAM,WAAW,oBAAoB;IACnC,mCAAmC;IACnC,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,qBAAqB;IACpC,iDAAiD;IACjD,WAAW,EAAE,MAAM,CAAC;IACpB,mDAAmD;IACnD,MAAM,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,eAAe,EAAE,MAAM,CAAC;IACxB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qBAAqB;IACrB,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAED,MAAM,WAAW,oBAAoB;IACnC,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,mBAAmB;IACnB,OAAO,EAAE,cAAc,CAAC;CACzB;AAID;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,OAAO,CAAiB;IAChC,OAAO,CAAC,UAAU,CAAS;gBAEf,MAAM,GAAE,oBAAyB;IAK7C;;;;OAIG;IACH,iBAAiB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG;QAClD,SAAS,EAAE,OAAO,CAAC;QACnB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB;IAgBD;;;;;;;OAOG;IACG,uBAAuB,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC;IA6C9E;;OAEG;IACG,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;YA6B3D,YAAY;IAe1B,wDAAwD;IACxD,IAAI,OAAO,IAAI,MAAM,CAEpB;CACF;AAID;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE;IAC3C,+BAA+B;IAC/B,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,gCAAgC;IAChC,eAAe,EAAE,MAAM,CAAC;IACxB,4DAA4D;IAC5D,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACvC,qBAAqB;IACrB,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAqBhC"}
@@ -1,197 +0,0 @@
1
- /**
2
- * Stellar x402 Payment Adapter
3
- *
4
- * Implements x402 payment protocol on Stellar network.
5
- * Stellar x402 support went live March 11, 2026.
6
- *
7
- * Chain identifiers:
8
- * - Stellar Mainnet: "stellar:pubnet"
9
- * - Stellar Testnet: "stellar:testnet"
10
- *
11
- * Key differences from EVM chains:
12
- * - Uses Ed25519 keypairs (not secp256k1)
13
- * - Transaction format: Stellar XDR (not EVM tx)
14
- * - Settlement: ~5 seconds (1 ledger close)
15
- * - Fees: ~0.00001 XLM per operation (effectively free at scale)
16
- * - USDC: Circle-issued USDC on Stellar
17
- */
18
- // ─── Stellar Chain Constants ─────────────────────────────────────────────────
19
- export const STELLAR_NETWORK = {
20
- pubnet: {
21
- horizonUrl: 'https://horizon.stellar.org',
22
- networkPassphrase: 'Public Global Stellar Network ; September 2015',
23
- chainId: 'stellar:pubnet',
24
- },
25
- testnet: {
26
- horizonUrl: 'https://horizon-testnet.stellar.org',
27
- networkPassphrase: 'Test SDF Network ; September 2015',
28
- chainId: 'stellar:testnet',
29
- },
30
- };
31
- /**
32
- * Circle USDC on Stellar (Mainnet)
33
- * Asset code: USDC
34
- * Issuer: GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN
35
- */
36
- export const STELLAR_USDC = {
37
- pubnet: {
38
- code: 'USDC',
39
- issuer: 'GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN',
40
- },
41
- testnet: {
42
- code: 'USDC',
43
- issuer: 'GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5',
44
- },
45
- };
46
- // ─── Stellar x402 Payment Adapter ────────────────────────────────────────────
47
- /**
48
- * StellarX402Adapter
49
- *
50
- * Handles x402 payment flow for Stellar network.
51
- *
52
- * Usage (with stellar-sdk):
53
- * ```typescript
54
- * import { StellarX402Adapter } from 'agentwallet-sdk/x402/stellar';
55
- * import { Keypair, Networks } from '@stellar/stellar-sdk';
56
- *
57
- * const adapter = new StellarX402Adapter({ network: 'pubnet' });
58
- * const result = await adapter.pay({
59
- * destination: 'GDESTWVX3VMLQCXPHPVLS3FMNMG2X7L5IGGQT7BQMIZXZZ4V7KBQVS',
60
- * amount: '0.50',
61
- * sourcePublicKey: keypair.publicKey(),
62
- * resource: '/api/data-endpoint',
63
- * }, keypair.secret());
64
- * ```
65
- *
66
- * Note: stellar-sdk must be installed separately:
67
- * npm install @stellar/stellar-sdk
68
- */
69
- export class StellarX402Adapter {
70
- constructor(config = {}) {
71
- this.network = config.network ?? 'pubnet';
72
- this.horizonUrl = config.horizonUrl ?? STELLAR_NETWORK[this.network].horizonUrl;
73
- }
74
- /**
75
- * Parse an x402 402 response and extract Stellar payment details.
76
- * The 402 response should include X-Payment-Chains: stellar:pubnet
77
- * and X-Payment-Amount, X-Payment-Destination headers.
78
- */
79
- parseX402Response(headers) {
80
- const chains = headers['x-payment-chains'] ?? headers['X-Payment-Chains'] ?? '';
81
- const chainId = STELLAR_NETWORK[this.network].chainId;
82
- if (!chains.includes(chainId) && !chains.includes('stellar')) {
83
- return { supported: false };
84
- }
85
- return {
86
- supported: true,
87
- destination: headers['x-payment-destination'] ?? headers['X-Payment-Destination'],
88
- amount: headers['x-payment-amount'] ?? headers['X-Payment-Amount'],
89
- resource: headers['x-payment-resource'] ?? headers['X-Payment-Resource'],
90
- };
91
- }
92
- /**
93
- * Build a Stellar USDC payment transaction.
94
- *
95
- * Requires @stellar/stellar-sdk to be installed:
96
- * npm install @stellar/stellar-sdk
97
- *
98
- * Returns the XDR-encoded transaction envelope for signing and submission.
99
- */
100
- async buildPaymentTransaction(request) {
101
- let StellarSdk;
102
- try {
103
- StellarSdk = await import('@stellar/stellar-sdk');
104
- }
105
- catch {
106
- throw new Error('Stellar support requires @stellar/stellar-sdk: npm install @stellar/stellar-sdk');
107
- }
108
- const networkConfig = STELLAR_NETWORK[request.network ?? this.network];
109
- const usdcAsset = STELLAR_USDC[request.network ?? this.network];
110
- // Load source account sequence number from Horizon
111
- const account = await this._loadAccount(request.sourcePublicKey, networkConfig.horizonUrl);
112
- const stellarAccount = new StellarSdk.Account(request.sourcePublicKey, account.sequence);
113
- const asset = new StellarSdk.Asset(usdcAsset.code, usdcAsset.issuer);
114
- const memoText = request.resource
115
- ? request.resource.slice(0, 28) // Stellar memo max 28 bytes
116
- : 'x402-payment';
117
- const transaction = new StellarSdk.TransactionBuilder(stellarAccount, {
118
- fee: StellarSdk.BASE_FEE,
119
- networkPassphrase: networkConfig.networkPassphrase,
120
- })
121
- .addOperation(StellarSdk.Operation.payment({
122
- destination: request.destination,
123
- asset,
124
- amount: request.amount,
125
- }))
126
- .addMemo(StellarSdk.Memo.text(memoText))
127
- .setTimeout(300) // 5 minute window
128
- .build();
129
- return transaction.toXDR();
130
- }
131
- /**
132
- * Submit a signed Stellar transaction to Horizon.
133
- */
134
- async submitTransaction(signedXdr) {
135
- const networkConfig = STELLAR_NETWORK[this.network];
136
- const body = new URLSearchParams({ tx: signedXdr }).toString();
137
- const resp = await fetch(`${networkConfig.horizonUrl}/transactions`, {
138
- method: 'POST',
139
- headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
140
- body,
141
- });
142
- if (!resp.ok) {
143
- const err = await resp.text();
144
- throw new Error(`Stellar transaction failed: ${resp.status} ${err.slice(0, 200)}`);
145
- }
146
- const result = await resp.json();
147
- return {
148
- hash: result.hash,
149
- ledger: result.ledger,
150
- successful: result.successful ?? true,
151
- network: this.network,
152
- };
153
- }
154
- async _loadAccount(publicKey, horizonUrl) {
155
- const resp = await fetch(`${horizonUrl}/accounts/${publicKey}`);
156
- if (!resp.ok) {
157
- throw new Error(`Cannot load Stellar account ${publicKey}: ${resp.status}. ` +
158
- `Ensure the account exists and has a USDC trustline established.`);
159
- }
160
- const data = await resp.json();
161
- return { sequence: data.sequence };
162
- }
163
- /** Chain ID for this adapter (e.g. "stellar:pubnet") */
164
- get chainId() {
165
- return STELLAR_NETWORK[this.network].chainId;
166
- }
167
- }
168
- // ─── x402 Auto-Pay Helper ────────────────────────────────────────────────────
169
- /**
170
- * Full x402 payment flow for Stellar.
171
- * 1. Detects 402 response from API
172
- * 2. Parses Stellar payment details from headers
173
- * 3. Builds, signs, and submits Stellar USDC payment
174
- * 4. Retries the original request with payment proof
175
- *
176
- * Requires stellar-sdk: npm install @stellar/stellar-sdk
177
- */
178
- export async function stellarX402Pay(params) {
179
- const adapter = new StellarX402Adapter({ network: params.network ?? 'pubnet' });
180
- const details = adapter.parseX402Response(params.responseHeaders);
181
- if (!details.supported) {
182
- throw new Error('This endpoint does not support Stellar x402 payments');
183
- }
184
- if (!details.destination || !details.amount) {
185
- throw new Error('x402 response missing destination or amount headers');
186
- }
187
- const xdr = await adapter.buildPaymentTransaction({
188
- destination: details.destination,
189
- amount: details.amount,
190
- sourcePublicKey: params.sourcePublicKey,
191
- resource: details.resource,
192
- network: params.network ?? 'pubnet',
193
- });
194
- const signedXdr = await params.sign(xdr);
195
- return adapter.submitTransaction(signedXdr);
196
- }
197
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/x402/chains/stellar/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,gFAAgF;AAEhF,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,MAAM,EAAE;QACN,UAAU,EAAE,6BAA6B;QACzC,iBAAiB,EAAE,gDAAgD;QACnE,OAAO,EAAE,gBAAgB;KAC1B;IACD,OAAO,EAAE;QACP,UAAU,EAAE,qCAAqC;QACjD,iBAAiB,EAAE,mCAAmC;QACtD,OAAO,EAAE,iBAAiB;KAC3B;CACO,CAAC;AAEX;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,MAAM,EAAE;QACN,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,0DAA0D;KACnE;IACD,OAAO,EAAE;QACP,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,0DAA0D;KACnE;CACO,CAAC;AAuCX,gFAAgF;AAEhF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO,kBAAkB;IAI7B,YAAY,SAA+B,EAAE;QAC3C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,QAAQ,CAAC;QAC1C,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,IAAI,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IAClF,CAAC;IAED;;;;OAIG;IACH,iBAAiB,CAAC,OAA+B;QAM/C,MAAM,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,IAAI,OAAO,CAAC,kBA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