@chaoslabs/ai-sdk 0.0.6 → 0.0.7

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.
@@ -1,157 +0,0 @@
1
- /**
2
- * Swap tokens on a decentralized exchange.
3
- * @example "Swap 1 ETH for USDC"
4
- */
5
- export declare const PRIMITIVE_SWAP = "swap";
6
- /**
7
- * Supply assets to a lending protocol.
8
- * @example "Supply 1000 USDC to Aave"
9
- */
10
- export declare const PRIMITIVE_SUPPLY = "supply";
11
- /**
12
- * Withdraw supplied assets from a lending protocol.
13
- * @example "Withdraw my USDC from Compound"
14
- */
15
- export declare const PRIMITIVE_WITHDRAW = "withdraw";
16
- /**
17
- * Borrow assets from a lending protocol.
18
- * @example "Borrow 500 DAI from Aave"
19
- */
20
- export declare const PRIMITIVE_BORROW = "borrow";
21
- /**
22
- * Repay borrowed assets to a lending protocol.
23
- * @example "Repay my DAI debt on Compound"
24
- */
25
- export declare const PRIMITIVE_REPAY = "repay";
26
- /**
27
- * Stake tokens for rewards or governance.
28
- * @example "Stake 10 ETH with Lido"
29
- */
30
- export declare const PRIMITIVE_STAKE = "stake";
31
- /**
32
- * Unstake previously staked tokens.
33
- * @example "Unstake my stETH"
34
- */
35
- export declare const PRIMITIVE_UNSTAKE = "unstake";
36
- /**
37
- * Claim accrued rewards from protocols.
38
- * @example "Claim my Aave rewards"
39
- */
40
- export declare const PRIMITIVE_CLAIM = "claim";
41
- /**
42
- * Bridge assets between chains.
43
- * @example "Bridge 100 USDC to Arbitrum"
44
- */
45
- export declare const PRIMITIVE_BRIDGE = "bridge";
46
- /**
47
- * Provide liquidity to a pool.
48
- * @example "Add liquidity to ETH-USDC pool"
49
- */
50
- export declare const PRIMITIVE_ADD_LIQUIDITY = "add_liquidity";
51
- /**
52
- * Remove liquidity from a pool.
53
- * @example "Remove liquidity from my ETH-USDC position"
54
- */
55
- export declare const PRIMITIVE_REMOVE_LIQUIDITY = "remove_liquidity";
56
- /**
57
- * Open a perpetual futures position.
58
- * @example "Open 2x long ETH position"
59
- */
60
- export declare const PRIMITIVE_OPEN_POSITION = "open_position";
61
- /**
62
- * Close a perpetual futures position.
63
- * @example "Close my ETH long"
64
- */
65
- export declare const PRIMITIVE_CLOSE_POSITION = "close_position";
66
- /**
67
- * Deposit into a vault strategy.
68
- * @example "Deposit 1000 USDC into Yearn"
69
- */
70
- export declare const PRIMITIVE_DEPOSIT = "deposit";
71
- /**
72
- * Mint stablecoins or synthetic assets.
73
- * @example "Mint 1000 DAI from my ETH collateral"
74
- */
75
- export declare const PRIMITIVE_MINT = "mint";
76
- /**
77
- * Burn or repay minted assets.
78
- * @example "Burn 500 DAI to reduce my debt"
79
- */
80
- export declare const PRIMITIVE_BURN = "burn";
81
- /**
82
- * Restake assets for additional yield.
83
- * @example "Restake my stETH on EigenLayer"
84
- */
85
- export declare const PRIMITIVE_RESTAKE = "restake";
86
- /**
87
- * Approve token spending.
88
- * @example "Approve USDC for Uniswap"
89
- */
90
- export declare const PRIMITIVE_APPROVE = "approve";
91
- /**
92
- * Transfer tokens to another address.
93
- * @example "Send 100 USDC to 0x..."
94
- */
95
- export declare const PRIMITIVE_TRANSFER = "transfer";
96
- /**
97
- * Wrap native tokens (e.g., ETH to WETH).
98
- * @example "Wrap 1 ETH to WETH"
99
- */
100
- export declare const PRIMITIVE_WRAP = "wrap";
101
- /**
102
- * Unwrap wrapped tokens (e.g., WETH to ETH).
103
- * @example "Unwrap 1 WETH to ETH"
104
- */
105
- export declare const PRIMITIVE_UNWRAP = "unwrap";
106
- /**
107
- * All DeFi primitive types as a union type.
108
- */
109
- export type PrimitiveType = typeof PRIMITIVE_SWAP | typeof PRIMITIVE_SUPPLY | typeof PRIMITIVE_WITHDRAW | typeof PRIMITIVE_BORROW | typeof PRIMITIVE_REPAY | typeof PRIMITIVE_STAKE | typeof PRIMITIVE_UNSTAKE | typeof PRIMITIVE_CLAIM | typeof PRIMITIVE_BRIDGE | typeof PRIMITIVE_ADD_LIQUIDITY | typeof PRIMITIVE_REMOVE_LIQUIDITY | typeof PRIMITIVE_OPEN_POSITION | typeof PRIMITIVE_CLOSE_POSITION | typeof PRIMITIVE_DEPOSIT | typeof PRIMITIVE_MINT | typeof PRIMITIVE_BURN | typeof PRIMITIVE_RESTAKE | typeof PRIMITIVE_APPROVE | typeof PRIMITIVE_TRANSFER | typeof PRIMITIVE_WRAP | typeof PRIMITIVE_UNWRAP;
110
- /**
111
- * All primitive type constants for iteration.
112
- */
113
- export declare const ALL_PRIMITIVES: PrimitiveType[];
114
- /**
115
- * Lending-related primitives.
116
- */
117
- export declare const LENDING_PRIMITIVES: PrimitiveType[];
118
- /**
119
- * Trading-related primitives.
120
- */
121
- export declare const TRADING_PRIMITIVES: PrimitiveType[];
122
- /**
123
- * Staking-related primitives.
124
- */
125
- export declare const STAKING_PRIMITIVES: PrimitiveType[];
126
- /**
127
- * Liquidity-related primitives.
128
- */
129
- export declare const LIQUIDITY_PRIMITIVES: PrimitiveType[];
130
- /**
131
- * Transfer-related primitives.
132
- */
133
- export declare const TRANSFER_PRIMITIVES: PrimitiveType[];
134
- /**
135
- * Check if a primitive type is valid.
136
- */
137
- export declare function isValidPrimitive(primitive: string): primitive is PrimitiveType;
138
- /**
139
- * Check if a primitive is a lending operation.
140
- */
141
- export declare function isLendingPrimitive(primitive: string): boolean;
142
- /**
143
- * Check if a primitive is a trading operation.
144
- */
145
- export declare function isTradingPrimitive(primitive: string): boolean;
146
- /**
147
- * Check if a primitive is a staking operation.
148
- */
149
- export declare function isStakingPrimitive(primitive: string): boolean;
150
- /**
151
- * Check if a primitive is a liquidity operation.
152
- */
153
- export declare function isLiquidityPrimitive(primitive: string): boolean;
154
- /**
155
- * Check if a primitive is a transfer operation.
156
- */
157
- export declare function isTransferPrimitive(primitive: string): boolean;
@@ -1,220 +0,0 @@
1
- // Chaos AI SDK - Primitive Constants
2
- //
3
- // Constants for all DeFi primitive types supported by the SDK.
4
- // Use these when checking primitive types in TransactionActionBlocks.
5
- // ============================================================================
6
- // Primitive Type Constants
7
- // ============================================================================
8
- /**
9
- * Swap tokens on a decentralized exchange.
10
- * @example "Swap 1 ETH for USDC"
11
- */
12
- export const PRIMITIVE_SWAP = 'swap';
13
- /**
14
- * Supply assets to a lending protocol.
15
- * @example "Supply 1000 USDC to Aave"
16
- */
17
- export const PRIMITIVE_SUPPLY = 'supply';
18
- /**
19
- * Withdraw supplied assets from a lending protocol.
20
- * @example "Withdraw my USDC from Compound"
21
- */
22
- export const PRIMITIVE_WITHDRAW = 'withdraw';
23
- /**
24
- * Borrow assets from a lending protocol.
25
- * @example "Borrow 500 DAI from Aave"
26
- */
27
- export const PRIMITIVE_BORROW = 'borrow';
28
- /**
29
- * Repay borrowed assets to a lending protocol.
30
- * @example "Repay my DAI debt on Compound"
31
- */
32
- export const PRIMITIVE_REPAY = 'repay';
33
- /**
34
- * Stake tokens for rewards or governance.
35
- * @example "Stake 10 ETH with Lido"
36
- */
37
- export const PRIMITIVE_STAKE = 'stake';
38
- /**
39
- * Unstake previously staked tokens.
40
- * @example "Unstake my stETH"
41
- */
42
- export const PRIMITIVE_UNSTAKE = 'unstake';
43
- /**
44
- * Claim accrued rewards from protocols.
45
- * @example "Claim my Aave rewards"
46
- */
47
- export const PRIMITIVE_CLAIM = 'claim';
48
- /**
49
- * Bridge assets between chains.
50
- * @example "Bridge 100 USDC to Arbitrum"
51
- */
52
- export const PRIMITIVE_BRIDGE = 'bridge';
53
- /**
54
- * Provide liquidity to a pool.
55
- * @example "Add liquidity to ETH-USDC pool"
56
- */
57
- export const PRIMITIVE_ADD_LIQUIDITY = 'add_liquidity';
58
- /**
59
- * Remove liquidity from a pool.
60
- * @example "Remove liquidity from my ETH-USDC position"
61
- */
62
- export const PRIMITIVE_REMOVE_LIQUIDITY = 'remove_liquidity';
63
- /**
64
- * Open a perpetual futures position.
65
- * @example "Open 2x long ETH position"
66
- */
67
- export const PRIMITIVE_OPEN_POSITION = 'open_position';
68
- /**
69
- * Close a perpetual futures position.
70
- * @example "Close my ETH long"
71
- */
72
- export const PRIMITIVE_CLOSE_POSITION = 'close_position';
73
- /**
74
- * Deposit into a vault strategy.
75
- * @example "Deposit 1000 USDC into Yearn"
76
- */
77
- export const PRIMITIVE_DEPOSIT = 'deposit';
78
- /**
79
- * Mint stablecoins or synthetic assets.
80
- * @example "Mint 1000 DAI from my ETH collateral"
81
- */
82
- export const PRIMITIVE_MINT = 'mint';
83
- /**
84
- * Burn or repay minted assets.
85
- * @example "Burn 500 DAI to reduce my debt"
86
- */
87
- export const PRIMITIVE_BURN = 'burn';
88
- /**
89
- * Restake assets for additional yield.
90
- * @example "Restake my stETH on EigenLayer"
91
- */
92
- export const PRIMITIVE_RESTAKE = 'restake';
93
- /**
94
- * Approve token spending.
95
- * @example "Approve USDC for Uniswap"
96
- */
97
- export const PRIMITIVE_APPROVE = 'approve';
98
- /**
99
- * Transfer tokens to another address.
100
- * @example "Send 100 USDC to 0x..."
101
- */
102
- export const PRIMITIVE_TRANSFER = 'transfer';
103
- /**
104
- * Wrap native tokens (e.g., ETH to WETH).
105
- * @example "Wrap 1 ETH to WETH"
106
- */
107
- export const PRIMITIVE_WRAP = 'wrap';
108
- /**
109
- * Unwrap wrapped tokens (e.g., WETH to ETH).
110
- * @example "Unwrap 1 WETH to ETH"
111
- */
112
- export const PRIMITIVE_UNWRAP = 'unwrap';
113
- /**
114
- * All primitive type constants for iteration.
115
- */
116
- export const ALL_PRIMITIVES = [
117
- PRIMITIVE_SWAP,
118
- PRIMITIVE_SUPPLY,
119
- PRIMITIVE_WITHDRAW,
120
- PRIMITIVE_BORROW,
121
- PRIMITIVE_REPAY,
122
- PRIMITIVE_STAKE,
123
- PRIMITIVE_UNSTAKE,
124
- PRIMITIVE_CLAIM,
125
- PRIMITIVE_BRIDGE,
126
- PRIMITIVE_ADD_LIQUIDITY,
127
- PRIMITIVE_REMOVE_LIQUIDITY,
128
- PRIMITIVE_OPEN_POSITION,
129
- PRIMITIVE_CLOSE_POSITION,
130
- PRIMITIVE_DEPOSIT,
131
- PRIMITIVE_MINT,
132
- PRIMITIVE_BURN,
133
- PRIMITIVE_RESTAKE,
134
- PRIMITIVE_APPROVE,
135
- PRIMITIVE_TRANSFER,
136
- PRIMITIVE_WRAP,
137
- PRIMITIVE_UNWRAP,
138
- ];
139
- /**
140
- * Lending-related primitives.
141
- */
142
- export const LENDING_PRIMITIVES = [
143
- PRIMITIVE_SUPPLY,
144
- PRIMITIVE_WITHDRAW,
145
- PRIMITIVE_BORROW,
146
- PRIMITIVE_REPAY,
147
- ];
148
- /**
149
- * Trading-related primitives.
150
- */
151
- export const TRADING_PRIMITIVES = [
152
- PRIMITIVE_SWAP,
153
- PRIMITIVE_OPEN_POSITION,
154
- PRIMITIVE_CLOSE_POSITION,
155
- ];
156
- /**
157
- * Staking-related primitives.
158
- */
159
- export const STAKING_PRIMITIVES = [
160
- PRIMITIVE_STAKE,
161
- PRIMITIVE_UNSTAKE,
162
- PRIMITIVE_RESTAKE,
163
- PRIMITIVE_CLAIM,
164
- ];
165
- /**
166
- * Liquidity-related primitives.
167
- */
168
- export const LIQUIDITY_PRIMITIVES = [
169
- PRIMITIVE_ADD_LIQUIDITY,
170
- PRIMITIVE_REMOVE_LIQUIDITY,
171
- PRIMITIVE_DEPOSIT,
172
- ];
173
- /**
174
- * Transfer-related primitives.
175
- */
176
- export const TRANSFER_PRIMITIVES = [
177
- PRIMITIVE_BRIDGE,
178
- PRIMITIVE_TRANSFER,
179
- PRIMITIVE_WRAP,
180
- PRIMITIVE_UNWRAP,
181
- ];
182
- // ============================================================================
183
- // Primitive Helpers
184
- // ============================================================================
185
- /**
186
- * Check if a primitive type is valid.
187
- */
188
- export function isValidPrimitive(primitive) {
189
- return ALL_PRIMITIVES.includes(primitive);
190
- }
191
- /**
192
- * Check if a primitive is a lending operation.
193
- */
194
- export function isLendingPrimitive(primitive) {
195
- return LENDING_PRIMITIVES.includes(primitive);
196
- }
197
- /**
198
- * Check if a primitive is a trading operation.
199
- */
200
- export function isTradingPrimitive(primitive) {
201
- return TRADING_PRIMITIVES.includes(primitive);
202
- }
203
- /**
204
- * Check if a primitive is a staking operation.
205
- */
206
- export function isStakingPrimitive(primitive) {
207
- return STAKING_PRIMITIVES.includes(primitive);
208
- }
209
- /**
210
- * Check if a primitive is a liquidity operation.
211
- */
212
- export function isLiquidityPrimitive(primitive) {
213
- return LIQUIDITY_PRIMITIVES.includes(primitive);
214
- }
215
- /**
216
- * Check if a primitive is a transfer operation.
217
- */
218
- export function isTransferPrimitive(primitive) {
219
- return TRANSFER_PRIMITIVES.includes(primitive);
220
- }