wallet-agent-ai-radix 1.0.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/LICENSE +13 -0
- package/README.md +284 -0
- package/dist/agent.d.ts +2 -0
- package/dist/agent.d.ts.map +1 -0
- package/dist/agent.js +158 -0
- package/dist/agent.js.map +1 -0
- package/dist/cli/derive.d.ts +5 -0
- package/dist/cli/derive.d.ts.map +1 -0
- package/dist/cli/derive.js +78 -0
- package/dist/cli/derive.js.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +32 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/init.d.ts +2 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +171 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/recover.d.ts +2 -0
- package/dist/cli/recover.d.ts.map +1 -0
- package/dist/cli/recover.js +112 -0
- package/dist/cli/recover.js.map +1 -0
- package/dist/cli/unlock.d.ts +3 -0
- package/dist/cli/unlock.d.ts.map +1 -0
- package/dist/cli/unlock.js +70 -0
- package/dist/cli/unlock.js.map +1 -0
- package/dist/core/AGGRClient.d.ts +19 -0
- package/dist/core/AGGRClient.d.ts.map +1 -0
- package/dist/core/AGGRClient.js +103 -0
- package/dist/core/AGGRClient.js.map +1 -0
- package/dist/core/AgentWallet.d.ts +64 -0
- package/dist/core/AgentWallet.d.ts.map +1 -0
- package/dist/core/AgentWallet.js +658 -0
- package/dist/core/AgentWallet.js.map +1 -0
- package/dist/core/RadixClient.d.ts +15 -0
- package/dist/core/RadixClient.d.ts.map +1 -0
- package/dist/core/RadixClient.js +112 -0
- package/dist/core/RadixClient.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/keystore/Keystore.d.ts +17 -0
- package/dist/keystore/Keystore.d.ts.map +1 -0
- package/dist/keystore/Keystore.js +97 -0
- package/dist/keystore/Keystore.js.map +1 -0
- package/dist/tools/LangChainTools.d.ts +19 -0
- package/dist/tools/LangChainTools.d.ts.map +1 -0
- package/dist/tools/LangChainTools.js +613 -0
- package/dist/tools/LangChainTools.js.map +1 -0
- package/dist/types/index.d.ts +104 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +6 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +44 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
export declare const DEFAULT_ASSETS: readonly ["XRD", "HUSDC", "HUSDT", "HWBTC", "HETH"];
|
|
2
|
+
export type DefaultAsset = typeof DEFAULT_ASSETS[number];
|
|
3
|
+
export type SupportedAsset = string;
|
|
4
|
+
export type NetworkType = "mainnet" | "stokenet" | "localnet";
|
|
5
|
+
export interface AgentWalletConfig {
|
|
6
|
+
componentAddress: string;
|
|
7
|
+
badgeLocalId?: string;
|
|
8
|
+
ownerBadgeAddress?: string;
|
|
9
|
+
notarizerAddress: string;
|
|
10
|
+
badgeResourceAddress: string;
|
|
11
|
+
privateKey?: string;
|
|
12
|
+
network: NetworkType;
|
|
13
|
+
aggrConfig?: AGGRConfig;
|
|
14
|
+
onLowFunds?: (warnings: string[]) => void;
|
|
15
|
+
onTransferApproved?: (details: {
|
|
16
|
+
to: string;
|
|
17
|
+
amount: string;
|
|
18
|
+
asset: string;
|
|
19
|
+
reason: string;
|
|
20
|
+
}) => void;
|
|
21
|
+
onTransferRejected?: (details: {
|
|
22
|
+
to: string;
|
|
23
|
+
amount: string;
|
|
24
|
+
asset: string;
|
|
25
|
+
reason: string;
|
|
26
|
+
}) => void;
|
|
27
|
+
}
|
|
28
|
+
export interface AGGRConfig {
|
|
29
|
+
endpoint: string;
|
|
30
|
+
partnerId: string;
|
|
31
|
+
timeoutMs?: number;
|
|
32
|
+
mockMode?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface TransferParams {
|
|
35
|
+
to: string;
|
|
36
|
+
amount: number;
|
|
37
|
+
asset: SupportedAsset;
|
|
38
|
+
reason: string;
|
|
39
|
+
}
|
|
40
|
+
export interface SwapParams {
|
|
41
|
+
fromAsset: SupportedAsset;
|
|
42
|
+
toAsset: SupportedAsset;
|
|
43
|
+
amount: number;
|
|
44
|
+
maxSlippage: number;
|
|
45
|
+
reason: string;
|
|
46
|
+
}
|
|
47
|
+
export interface ConditionalOrder {
|
|
48
|
+
type: "buy" | "sell";
|
|
49
|
+
asset: SupportedAsset;
|
|
50
|
+
againstAsset: SupportedAsset;
|
|
51
|
+
amount: number;
|
|
52
|
+
triggerPrice: number;
|
|
53
|
+
condition: "above" | "below";
|
|
54
|
+
maxSlippage: number;
|
|
55
|
+
}
|
|
56
|
+
export interface TransferResult {
|
|
57
|
+
txId: string;
|
|
58
|
+
amount: number;
|
|
59
|
+
asset: SupportedAsset;
|
|
60
|
+
to: string;
|
|
61
|
+
reason: string;
|
|
62
|
+
timestamp: Date;
|
|
63
|
+
success: boolean;
|
|
64
|
+
}
|
|
65
|
+
export interface SwapResult {
|
|
66
|
+
txId: string;
|
|
67
|
+
fromAsset: SupportedAsset;
|
|
68
|
+
toAsset: SupportedAsset;
|
|
69
|
+
amountIn: number;
|
|
70
|
+
amountOut: number;
|
|
71
|
+
executedPrice: number;
|
|
72
|
+
reason: string;
|
|
73
|
+
timestamp: Date;
|
|
74
|
+
success: boolean;
|
|
75
|
+
}
|
|
76
|
+
export interface BalanceResult {
|
|
77
|
+
balances: {
|
|
78
|
+
[key in SupportedAsset]?: number;
|
|
79
|
+
};
|
|
80
|
+
componentAddress: string;
|
|
81
|
+
timestamp: Date;
|
|
82
|
+
}
|
|
83
|
+
export interface AssetPrice {
|
|
84
|
+
asset: SupportedAsset;
|
|
85
|
+
priceInUSDC: number;
|
|
86
|
+
timestamp: Date;
|
|
87
|
+
}
|
|
88
|
+
export interface NetworkConfig {
|
|
89
|
+
gatewayUrl: string;
|
|
90
|
+
networkId: number;
|
|
91
|
+
}
|
|
92
|
+
export interface AssetAddresses {
|
|
93
|
+
XRD: string;
|
|
94
|
+
HUSDC: string;
|
|
95
|
+
HWBTC: string;
|
|
96
|
+
HETH: string;
|
|
97
|
+
HUSDT: string;
|
|
98
|
+
}
|
|
99
|
+
export interface CustomAssetAddresses {
|
|
100
|
+
mainnet?: string;
|
|
101
|
+
stokenet?: string;
|
|
102
|
+
localnet?: string;
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,cAAc,qDAAsD,CAAC;AAClF,MAAM,MAAM,YAAY,GAAG,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC;AACzD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC;AAEpC,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAG9D,MAAM,WAAW,iBAAiB;IAEhC,gBAAgB,EAAE,MAAM,CAAC;IAEzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,oBAAoB,EAAE,MAAM,CAAC;IAE7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,WAAW,CAAC;IAErB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC1C,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACtG,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE;QAAE,E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,CAAC;IAC1B,OAAO,EAAE,cAAc,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,IAAI,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB;AAGD,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE;SACP,GAAG,IAAI,cAAc,CAAC,CAAC,EAAE,MAAM;KACjC,CAAC;IACF,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,IAAI,CAAC;CACjB;AAGD,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,cAAc,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,IAAI,CAAC;CACjB;AAGD,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAGD,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;AAAA,oCAAoC;AACvB,QAAA,cAAc,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAU,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "wallet-agent-ai-radix",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Programmable wallet for AI agents on Radix network",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc",
|
|
9
|
+
"dev": "ts-node src/index.ts",
|
|
10
|
+
"agent": "tsx src/agent.ts"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"radix",
|
|
14
|
+
"wallet",
|
|
15
|
+
"ai-agent",
|
|
16
|
+
"web3"
|
|
17
|
+
],
|
|
18
|
+
"license": "GPL-3.0",
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@types/node": "^25.6.0",
|
|
21
|
+
"ts-node": "^10.9.2",
|
|
22
|
+
"tsx": "^4.22.0"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@langchain/core": "^1.1.46",
|
|
26
|
+
"@langchain/groq": "^1.2.0",
|
|
27
|
+
"@langchain/langgraph": "^1.3.0",
|
|
28
|
+
"@noble/ed25519": "^3.1.0",
|
|
29
|
+
"@noble/hashes": "^2.2.0",
|
|
30
|
+
"@radixdlt/radix-engine-toolkit": "^1.0.6",
|
|
31
|
+
"@scure/bip39": "^2.2.0",
|
|
32
|
+
"dotenv": "^17.4.2",
|
|
33
|
+
"langchain": "^1.4.0",
|
|
34
|
+
"typescript": "^6.0.3"
|
|
35
|
+
},
|
|
36
|
+
"bin": {
|
|
37
|
+
"agent-wallet": "dist/cli/index.js"
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"dist/",
|
|
41
|
+
"README.md",
|
|
42
|
+
"LICENSE"
|
|
43
|
+
]
|
|
44
|
+
}
|