@ar.io/sdk 3.24.0 → 4.0.0-alpha.1

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 (169) hide show
  1. package/README.md +682 -600
  2. package/lib/esm/cli/cli.js +188 -152
  3. package/lib/esm/cli/commands/antCommands.js +23 -58
  4. package/lib/esm/cli/commands/arnsPurchaseCommands.js +48 -30
  5. package/lib/esm/cli/commands/escrowCommands.js +221 -0
  6. package/lib/esm/cli/commands/gatewayWriteCommands.js +142 -23
  7. package/lib/esm/cli/commands/pruneCommands.js +150 -0
  8. package/lib/esm/cli/commands/readCommands.js +22 -3
  9. package/lib/esm/cli/commands/transfer.js +6 -6
  10. package/lib/esm/cli/options.js +124 -58
  11. package/lib/esm/cli/utils.js +280 -174
  12. package/lib/esm/common/ant-registry.js +17 -143
  13. package/lib/esm/common/ant.js +44 -1167
  14. package/lib/esm/common/faucet.js +11 -6
  15. package/lib/esm/common/index.js +0 -4
  16. package/lib/esm/common/io.js +25 -1412
  17. package/lib/esm/constants.js +13 -19
  18. package/lib/esm/solana/ant-readable.js +724 -0
  19. package/lib/esm/solana/ant-registry-readable.js +133 -0
  20. package/lib/esm/solana/ant-registry-writeable.js +472 -0
  21. package/lib/esm/solana/ant-writeable.js +384 -0
  22. package/lib/esm/solana/ata.js +70 -0
  23. package/lib/esm/solana/canonical-message.js +128 -0
  24. package/lib/esm/solana/clusters.js +111 -0
  25. package/lib/esm/solana/constants.js +146 -0
  26. package/lib/esm/solana/delegation-math.js +112 -0
  27. package/lib/esm/solana/deserialize.js +711 -0
  28. package/lib/esm/solana/escrow.js +839 -0
  29. package/lib/{cjs/utils/json.js → esm/solana/events.js} +15 -10
  30. package/lib/esm/solana/funding-plan.js +699 -0
  31. package/lib/esm/solana/index.js +126 -0
  32. package/lib/esm/solana/instruction.js +39 -0
  33. package/lib/esm/solana/io-readable.js +2182 -0
  34. package/lib/esm/solana/io-writeable.js +3196 -0
  35. package/lib/esm/solana/json-rpc.js +90 -0
  36. package/lib/esm/solana/metadata.js +81 -0
  37. package/lib/esm/solana/mpl-core.js +192 -0
  38. package/lib/esm/solana/pda.js +332 -0
  39. package/lib/esm/solana/predict-prescribed-observers.js +110 -0
  40. package/lib/esm/solana/retry.js +117 -0
  41. package/lib/esm/solana/rpc-circuit-breaker.js +258 -0
  42. package/lib/esm/solana/send.js +372 -0
  43. package/lib/esm/solana/spawn-ant.js +224 -0
  44. package/lib/esm/solana/types.js +1 -0
  45. package/lib/esm/types/ant.js +27 -15
  46. package/lib/esm/types/io.js +8 -11
  47. package/lib/esm/utils/ant.js +0 -63
  48. package/lib/esm/utils/index.js +0 -3
  49. package/lib/esm/version.js +1 -1
  50. package/lib/types/cli/commands/antCommands.d.ts +5 -13
  51. package/lib/types/cli/commands/arnsPurchaseCommands.d.ts +33 -7
  52. package/lib/types/cli/commands/escrowCommands.d.ts +68 -0
  53. package/lib/types/cli/commands/gatewayWriteCommands.d.ts +12 -11
  54. package/lib/types/cli/commands/pruneCommands.d.ts +31 -0
  55. package/lib/types/cli/commands/readCommands.d.ts +27 -22
  56. package/lib/types/cli/commands/transfer.d.ts +9 -9
  57. package/lib/types/cli/options.d.ts +76 -21
  58. package/lib/types/cli/types.d.ts +11 -13
  59. package/lib/types/cli/utils.d.ts +71 -31
  60. package/lib/types/common/ant-registry.d.ts +49 -47
  61. package/lib/types/common/ant.d.ts +54 -539
  62. package/lib/types/common/faucet.d.ts +20 -8
  63. package/lib/types/common/index.d.ts +0 -3
  64. package/lib/types/common/io.d.ts +51 -263
  65. package/lib/types/constants.d.ts +11 -18
  66. package/lib/types/solana/ant-readable.d.ts +180 -0
  67. package/lib/types/solana/ant-registry-readable.d.ts +105 -0
  68. package/lib/types/solana/ant-registry-writeable.d.ts +249 -0
  69. package/lib/types/solana/ant-writeable.d.ts +177 -0
  70. package/lib/types/solana/ata.d.ts +44 -0
  71. package/lib/types/solana/canonical-message.d.ts +121 -0
  72. package/lib/types/solana/clusters.d.ts +109 -0
  73. package/lib/types/solana/constants.d.ts +119 -0
  74. package/lib/types/solana/delegation-math.d.ts +45 -0
  75. package/lib/types/solana/deserialize.d.ts +262 -0
  76. package/lib/types/solana/escrow.d.ts +480 -0
  77. package/lib/types/solana/events.d.ts +38 -0
  78. package/lib/types/solana/funding-plan.d.ts +225 -0
  79. package/lib/types/solana/index.d.ts +87 -0
  80. package/lib/types/solana/instruction.d.ts +39 -0
  81. package/lib/types/solana/io-readable.d.ts +499 -0
  82. package/lib/types/solana/io-writeable.d.ts +893 -0
  83. package/lib/types/solana/json-rpc.d.ts +47 -0
  84. package/lib/types/solana/metadata.d.ts +84 -0
  85. package/lib/types/solana/mpl-core.d.ts +120 -0
  86. package/lib/types/solana/pda.d.ts +95 -0
  87. package/lib/types/solana/predict-prescribed-observers.d.ts +28 -0
  88. package/lib/types/solana/retry.d.ts +62 -0
  89. package/lib/types/solana/rpc-circuit-breaker.d.ts +78 -0
  90. package/lib/types/solana/send.d.ts +94 -0
  91. package/lib/types/solana/spawn-ant.d.ts +145 -0
  92. package/lib/types/solana/types.d.ts +82 -0
  93. package/lib/types/types/ant-registry.d.ts +43 -4
  94. package/lib/types/types/ant.d.ts +114 -96
  95. package/lib/types/types/common.d.ts +18 -74
  96. package/lib/types/types/faucet.d.ts +2 -2
  97. package/lib/types/types/io.d.ts +244 -158
  98. package/lib/types/types/token.d.ts +0 -12
  99. package/lib/types/utils/ant.d.ts +1 -12
  100. package/lib/types/utils/index.d.ts +0 -3
  101. package/lib/types/version.d.ts +1 -1
  102. package/package.json +36 -33
  103. package/lib/cjs/cli/cli.js +0 -822
  104. package/lib/cjs/cli/commands/antCommands.js +0 -113
  105. package/lib/cjs/cli/commands/arnsPurchaseCommands.js +0 -212
  106. package/lib/cjs/cli/commands/gatewayWriteCommands.js +0 -210
  107. package/lib/cjs/cli/commands/readCommands.js +0 -215
  108. package/lib/cjs/cli/commands/transfer.js +0 -159
  109. package/lib/cjs/cli/options.js +0 -470
  110. package/lib/cjs/cli/types.js +0 -2
  111. package/lib/cjs/cli/utils.js +0 -639
  112. package/lib/cjs/common/ant-registry.js +0 -155
  113. package/lib/cjs/common/ant-versions.js +0 -93
  114. package/lib/cjs/common/ant.js +0 -1182
  115. package/lib/cjs/common/arweave.js +0 -27
  116. package/lib/cjs/common/contracts/ao-process.js +0 -224
  117. package/lib/cjs/common/error.js +0 -64
  118. package/lib/cjs/common/faucet.js +0 -150
  119. package/lib/cjs/common/hyperbeam/hb.js +0 -173
  120. package/lib/cjs/common/index.js +0 -42
  121. package/lib/cjs/common/io.js +0 -1423
  122. package/lib/cjs/common/logger.js +0 -83
  123. package/lib/cjs/common/loggers/winston.js +0 -68
  124. package/lib/cjs/common/marketplace.js +0 -731
  125. package/lib/cjs/common/turbo.js +0 -223
  126. package/lib/cjs/constants.js +0 -41
  127. package/lib/cjs/node/index.js +0 -39
  128. package/lib/cjs/package.json +0 -1
  129. package/lib/cjs/types/ant-registry.js +0 -2
  130. package/lib/cjs/types/ant.js +0 -168
  131. package/lib/cjs/types/common.js +0 -2
  132. package/lib/cjs/types/faucet.js +0 -2
  133. package/lib/cjs/types/index.js +0 -37
  134. package/lib/cjs/types/io.js +0 -51
  135. package/lib/cjs/types/token.js +0 -116
  136. package/lib/cjs/utils/ant.js +0 -108
  137. package/lib/cjs/utils/ao.js +0 -432
  138. package/lib/cjs/utils/arweave.js +0 -285
  139. package/lib/cjs/utils/base64.js +0 -62
  140. package/lib/cjs/utils/hash.js +0 -56
  141. package/lib/cjs/utils/index.js +0 -38
  142. package/lib/cjs/utils/processes.js +0 -173
  143. package/lib/cjs/utils/random.js +0 -30
  144. package/lib/cjs/utils/schema.js +0 -15
  145. package/lib/cjs/utils/url.js +0 -37
  146. package/lib/cjs/version.js +0 -20
  147. package/lib/cjs/web/index.js +0 -41
  148. package/lib/esm/common/ant-versions.js +0 -87
  149. package/lib/esm/common/arweave.js +0 -21
  150. package/lib/esm/common/contracts/ao-process.js +0 -220
  151. package/lib/esm/common/hyperbeam/hb.js +0 -169
  152. package/lib/esm/common/marketplace.js +0 -724
  153. package/lib/esm/common/turbo.js +0 -215
  154. package/lib/esm/node/index.js +0 -20
  155. package/lib/esm/utils/ao.js +0 -420
  156. package/lib/esm/utils/arweave.js +0 -271
  157. package/lib/esm/utils/processes.js +0 -167
  158. package/lib/esm/web/index.js +0 -20
  159. package/lib/types/common/ant-versions.d.ts +0 -39
  160. package/lib/types/common/arweave.d.ts +0 -17
  161. package/lib/types/common/contracts/ao-process.d.ts +0 -47
  162. package/lib/types/common/hyperbeam/hb.d.ts +0 -88
  163. package/lib/types/common/marketplace.d.ts +0 -568
  164. package/lib/types/common/turbo.d.ts +0 -61
  165. package/lib/types/node/index.d.ts +0 -20
  166. package/lib/types/utils/ao.d.ts +0 -80
  167. package/lib/types/utils/arweave.d.ts +0 -79
  168. package/lib/types/utils/processes.d.ts +0 -39
  169. package/lib/types/web/index.d.ts +0 -20
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { z } from 'zod';
17
- import { AoMessageResult, AoWriteAction, UpgradeAntProgressEvent, WalletAddress } from './common.js';
17
+ import { MessageResult, UpgradeAntProgressEvent, WalletAddress, WriteAction } from './common.js';
18
18
  /**
19
19
  * example error:
20
20
  * {
@@ -28,13 +28,14 @@ import { AoMessageResult, AoWriteAction, UpgradeAntProgressEvent, WalletAddress
28
28
  },
29
29
  */
30
30
  export declare const ArweaveTxIdSchema: z.ZodEffects<z.ZodString, string, string>;
31
- export declare const AOAddressSchema: z.ZodString;
31
+ export declare const WalletAddressSchema: z.ZodString;
32
32
  export declare const IntegerStringSchema: z.ZodEffects<z.ZodString, string, string>;
33
33
  export declare const AntDescriptionSchema: z.ZodString;
34
34
  export declare const AntKeywordsSchema: z.ZodArray<z.ZodString, "many">;
35
35
  export declare const AntRecordSchema: z.ZodObject<{
36
- transactionId: z.ZodEffects<z.ZodString, string, string>;
36
+ transactionId: z.ZodString;
37
37
  ttlSeconds: z.ZodNumber;
38
+ targetProtocol: z.ZodDefault<z.ZodNumber>;
38
39
  priority: z.ZodOptional<z.ZodNumber>;
39
40
  owner: z.ZodOptional<z.ZodString>;
40
41
  displayName: z.ZodOptional<z.ZodString>;
@@ -44,31 +45,34 @@ export declare const AntRecordSchema: z.ZodObject<{
44
45
  }, "strip", z.ZodTypeAny, {
45
46
  transactionId: string;
46
47
  ttlSeconds: number;
48
+ targetProtocol: number;
49
+ owner?: string | undefined;
47
50
  description?: string | undefined;
48
51
  priority?: number | undefined;
49
- owner?: string | undefined;
50
52
  displayName?: string | undefined;
51
53
  logo?: string | undefined;
52
54
  keywords?: string[] | undefined;
53
55
  }, {
54
56
  transactionId: string;
55
57
  ttlSeconds: number;
58
+ owner?: string | undefined;
56
59
  description?: string | undefined;
60
+ targetProtocol?: number | undefined;
57
61
  priority?: number | undefined;
58
- owner?: string | undefined;
59
62
  displayName?: string | undefined;
60
63
  logo?: string | undefined;
61
64
  keywords?: string[] | undefined;
62
65
  }>;
63
- export type AoANTRecord = z.infer<typeof AntRecordSchema>;
64
- export type ANTRecords = Record<string, AoANTRecord>;
65
- export type SortedANTRecord = AoANTRecord & {
66
+ export type ANTRecord = z.infer<typeof AntRecordSchema>;
67
+ export type ANTRecords = Record<string, ANTRecord>;
68
+ export type SortedANTRecord = ANTRecord & {
66
69
  index: number;
67
70
  };
68
71
  export type SortedANTRecords = Record<string, SortedANTRecord>;
69
72
  export declare const AntRecordsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
70
- transactionId: z.ZodEffects<z.ZodString, string, string>;
73
+ transactionId: z.ZodString;
71
74
  ttlSeconds: z.ZodNumber;
75
+ targetProtocol: z.ZodDefault<z.ZodNumber>;
72
76
  priority: z.ZodOptional<z.ZodNumber>;
73
77
  owner: z.ZodOptional<z.ZodString>;
74
78
  displayName: z.ZodOptional<z.ZodString>;
@@ -78,18 +82,20 @@ export declare const AntRecordsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
78
82
  }, "strip", z.ZodTypeAny, {
79
83
  transactionId: string;
80
84
  ttlSeconds: number;
85
+ targetProtocol: number;
86
+ owner?: string | undefined;
81
87
  description?: string | undefined;
82
88
  priority?: number | undefined;
83
- owner?: string | undefined;
84
89
  displayName?: string | undefined;
85
90
  logo?: string | undefined;
86
91
  keywords?: string[] | undefined;
87
92
  }, {
88
93
  transactionId: string;
89
94
  ttlSeconds: number;
95
+ owner?: string | undefined;
90
96
  description?: string | undefined;
97
+ targetProtocol?: number | undefined;
91
98
  priority?: number | undefined;
92
- owner?: string | undefined;
93
99
  displayName?: string | undefined;
94
100
  logo?: string | undefined;
95
101
  keywords?: string[] | undefined;
@@ -105,8 +111,9 @@ export declare const AntStateSchema: z.ZodObject<{
105
111
  Owner: z.ZodString;
106
112
  Controllers: z.ZodArray<z.ZodString, "many">;
107
113
  Records: z.ZodRecord<z.ZodString, z.ZodObject<{
108
- transactionId: z.ZodEffects<z.ZodString, string, string>;
114
+ transactionId: z.ZodString;
109
115
  ttlSeconds: z.ZodNumber;
116
+ targetProtocol: z.ZodDefault<z.ZodNumber>;
110
117
  priority: z.ZodOptional<z.ZodNumber>;
111
118
  owner: z.ZodOptional<z.ZodString>;
112
119
  displayName: z.ZodOptional<z.ZodString>;
@@ -116,18 +123,20 @@ export declare const AntStateSchema: z.ZodObject<{
116
123
  }, "strip", z.ZodTypeAny, {
117
124
  transactionId: string;
118
125
  ttlSeconds: number;
126
+ targetProtocol: number;
127
+ owner?: string | undefined;
119
128
  description?: string | undefined;
120
129
  priority?: number | undefined;
121
- owner?: string | undefined;
122
130
  displayName?: string | undefined;
123
131
  logo?: string | undefined;
124
132
  keywords?: string[] | undefined;
125
133
  }, {
126
134
  transactionId: string;
127
135
  ttlSeconds: number;
136
+ owner?: string | undefined;
128
137
  description?: string | undefined;
138
+ targetProtocol?: number | undefined;
129
139
  priority?: number | undefined;
130
- owner?: string | undefined;
131
140
  displayName?: string | undefined;
132
141
  logo?: string | undefined;
133
142
  keywords?: string[] | undefined;
@@ -147,9 +156,10 @@ export declare const AntStateSchema: z.ZodObject<{
147
156
  Records: Record<string, {
148
157
  transactionId: string;
149
158
  ttlSeconds: number;
159
+ targetProtocol: number;
160
+ owner?: string | undefined;
150
161
  description?: string | undefined;
151
162
  priority?: number | undefined;
152
- owner?: string | undefined;
153
163
  displayName?: string | undefined;
154
164
  logo?: string | undefined;
155
165
  keywords?: string[] | undefined;
@@ -169,9 +179,10 @@ export declare const AntStateSchema: z.ZodObject<{
169
179
  Records: Record<string, {
170
180
  transactionId: string;
171
181
  ttlSeconds: number;
182
+ owner?: string | undefined;
172
183
  description?: string | undefined;
184
+ targetProtocol?: number | undefined;
173
185
  priority?: number | undefined;
174
- owner?: string | undefined;
175
186
  displayName?: string | undefined;
176
187
  logo?: string | undefined;
177
188
  keywords?: string[] | undefined;
@@ -181,23 +192,25 @@ export declare const AntStateSchema: z.ZodObject<{
181
192
  TotalSupply: number;
182
193
  Initialized: boolean;
183
194
  }>;
184
- export type AoANTState = z.infer<typeof AntStateSchema>;
185
- export type HyperBeamANTState = {
195
+ export type ANTState = z.infer<typeof AntStateSchema>;
196
+ /**
197
+ * Lightweight ANT view for portfolio/list rendering. Carries the config fields
198
+ * plus controllers and the apex (`@`) record — everything a names table needs —
199
+ * WITHOUT the full undername record set. Produced in bulk by
200
+ * `getANTSummaries(mints)` in a handful of `getMultipleAccounts` calls; fetch
201
+ * full undernames lazily via `getRecords`/`getState` when a name is opened.
202
+ */
203
+ export type ANTSummary = {
204
+ processId: string;
186
205
  name: string;
187
206
  ticker: string;
207
+ logo: string;
188
208
  description: string;
189
209
  keywords: string[];
190
- denomination: string;
191
- owner: string;
192
- controllers: string[];
193
- records: Record<string, {
194
- transactionid: string;
195
- ttlseconds: number;
196
- }>;
197
- balances: Record<string, number>;
198
- logo: string;
199
- totalsupply: number;
200
- initialized: boolean;
210
+ owner: WalletAddress;
211
+ controllers: WalletAddress[];
212
+ /** The apex (`@`) record — the name's primary target — if set. */
213
+ apexRecord?: ANTRecord;
201
214
  };
202
215
  export declare const SpawnANTStateSchema: z.ZodObject<{
203
216
  name: z.ZodString;
@@ -207,8 +220,9 @@ export declare const SpawnANTStateSchema: z.ZodObject<{
207
220
  owner: z.ZodString;
208
221
  controllers: z.ZodArray<z.ZodString, "many">;
209
222
  records: z.ZodRecord<z.ZodString, z.ZodObject<{
210
- transactionId: z.ZodEffects<z.ZodString, string, string>;
223
+ transactionId: z.ZodString;
211
224
  ttlSeconds: z.ZodNumber;
225
+ targetProtocol: z.ZodDefault<z.ZodNumber>;
212
226
  priority: z.ZodOptional<z.ZodNumber>;
213
227
  owner: z.ZodOptional<z.ZodString>;
214
228
  displayName: z.ZodOptional<z.ZodString>;
@@ -218,18 +232,20 @@ export declare const SpawnANTStateSchema: z.ZodObject<{
218
232
  }, "strip", z.ZodTypeAny, {
219
233
  transactionId: string;
220
234
  ttlSeconds: number;
235
+ targetProtocol: number;
236
+ owner?: string | undefined;
221
237
  description?: string | undefined;
222
238
  priority?: number | undefined;
223
- owner?: string | undefined;
224
239
  displayName?: string | undefined;
225
240
  logo?: string | undefined;
226
241
  keywords?: string[] | undefined;
227
242
  }, {
228
243
  transactionId: string;
229
244
  ttlSeconds: number;
245
+ owner?: string | undefined;
230
246
  description?: string | undefined;
247
+ targetProtocol?: number | undefined;
231
248
  priority?: number | undefined;
232
- owner?: string | undefined;
233
249
  displayName?: string | undefined;
234
250
  logo?: string | undefined;
235
251
  keywords?: string[] | undefined;
@@ -237,38 +253,40 @@ export declare const SpawnANTStateSchema: z.ZodObject<{
237
253
  balances: z.ZodRecord<z.ZodString, z.ZodNumber>;
238
254
  logo: z.ZodEffects<z.ZodString, string, string>;
239
255
  }, "strip", z.ZodTypeAny, {
240
- description: string;
241
256
  owner: string;
257
+ name: string;
258
+ description: string;
242
259
  logo: string;
243
260
  keywords: string[];
244
- name: string;
245
261
  ticker: string;
246
262
  controllers: string[];
247
263
  records: Record<string, {
248
264
  transactionId: string;
249
265
  ttlSeconds: number;
266
+ targetProtocol: number;
267
+ owner?: string | undefined;
250
268
  description?: string | undefined;
251
269
  priority?: number | undefined;
252
- owner?: string | undefined;
253
270
  displayName?: string | undefined;
254
271
  logo?: string | undefined;
255
272
  keywords?: string[] | undefined;
256
273
  }>;
257
274
  balances: Record<string, number>;
258
275
  }, {
259
- description: string;
260
276
  owner: string;
277
+ name: string;
278
+ description: string;
261
279
  logo: string;
262
280
  keywords: string[];
263
- name: string;
264
281
  ticker: string;
265
282
  controllers: string[];
266
283
  records: Record<string, {
267
284
  transactionId: string;
268
285
  ttlSeconds: number;
286
+ owner?: string | undefined;
269
287
  description?: string | undefined;
288
+ targetProtocol?: number | undefined;
270
289
  priority?: number | undefined;
271
- owner?: string | undefined;
272
290
  displayName?: string | undefined;
273
291
  logo?: string | undefined;
274
292
  keywords?: string[] | undefined;
@@ -277,11 +295,11 @@ export declare const SpawnANTStateSchema: z.ZodObject<{
277
295
  }>;
278
296
  export type SpawnANTState = z.infer<typeof SpawnANTStateSchema>;
279
297
  export declare const AntReadHandlers: readonly ["balance", "balances", "totalSupply", "info", "controllers", "record", "records", "state"];
280
- export type AoANTReadHandler = (typeof AntReadHandlers)[number];
298
+ export type ANTReadHandler = (typeof AntReadHandlers)[number];
281
299
  export declare const AntWriteHandlers: readonly ["_eval", "_default", "transfer", "addController", "removeController", "setRecord", "removeRecord", "setName", "setTicker", "setDescription", "setKeywords", "setLogo", "initializeState", "releaseName", "reassignName", "approvePrimaryName", "removePrimaryNames", "transferRecordOwnership"];
282
- export type AoANTWriteHandler = (typeof AntWriteHandlers)[number];
283
- export declare const AntHandlerNames: ("controllers" | "records" | "balances" | "balance" | "totalSupply" | "info" | "record" | "state" | "_eval" | "_default" | "transfer" | "addController" | "removeController" | "setRecord" | "removeRecord" | "setName" | "setTicker" | "setDescription" | "setKeywords" | "setLogo" | "initializeState" | "releaseName" | "reassignName" | "approvePrimaryName" | "removePrimaryNames" | "transferRecordOwnership")[];
284
- export type AoANTHandler = AoANTWriteHandler | AoANTReadHandler;
300
+ export type ANTWriteHandler = (typeof AntWriteHandlers)[number];
301
+ export declare const AntHandlerNames: ("record" | "balance" | "controllers" | "records" | "balances" | "totalSupply" | "info" | "state" | "_eval" | "_default" | "transfer" | "addController" | "removeController" | "setRecord" | "removeRecord" | "setName" | "setTicker" | "setDescription" | "setKeywords" | "setLogo" | "initializeState" | "releaseName" | "reassignName" | "approvePrimaryName" | "removePrimaryNames" | "transferRecordOwnership")[];
302
+ export type ANTHandler = ANTWriteHandler | ANTReadHandler;
285
303
  export declare const AntHandlersSchema: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>;
286
304
  export declare const AntInfoSchema: z.ZodObject<{
287
305
  Name: z.ZodString;
@@ -317,22 +335,30 @@ export declare const AntInfoSchema: z.ZodObject<{
317
335
  Handlers?: string[] | undefined;
318
336
  HandlerNames?: string[] | undefined;
319
337
  }>;
320
- export type AoANTInfo = z.infer<typeof AntInfoSchema>;
338
+ export type ANTInfo = z.infer<typeof AntInfoSchema>;
321
339
  /**
322
340
  * @param state {object}
323
341
  * @returns {boolean}
324
342
  */
325
- export declare function isAoANTState(state: object): state is AoANTState;
343
+ export declare function isANTState(state: object): state is ANTState;
326
344
  export type AntReadOptions = {
327
345
  strict?: boolean;
346
+ /**
347
+ * Include per-record metadata (`displayName`/`logo`/`description`/`keywords`)
348
+ * when reading undername records. Defaults to `false` — metadata requires a
349
+ * second `getProgramAccounts` scan per ANT and is only needed in detail/edit
350
+ * views, so list reads (`getState`/`getRecords`) skip it by default. Fetch a
351
+ * single record's metadata on demand via `getRecord`.
352
+ */
353
+ includeMetadata?: boolean;
328
354
  };
329
- export interface AoANTRead {
355
+ export interface ANTRead {
330
356
  processId: string;
331
- getState(opts?: AntReadOptions): Promise<AoANTState>;
332
- getInfo(opts?: AntReadOptions): Promise<AoANTInfo>;
357
+ getState(opts?: AntReadOptions): Promise<ANTState>;
358
+ getInfo(opts?: AntReadOptions): Promise<ANTInfo>;
333
359
  getRecord({ undername }: {
334
360
  undername: string;
335
- }, opts?: AntReadOptions): Promise<AoANTRecord | undefined>;
361
+ }, opts?: AntReadOptions): Promise<ANTRecord | undefined>;
336
362
  getRecords(opts?: AntReadOptions): Promise<SortedANTRecords>;
337
363
  getOwner(opts?: AntReadOptions): Promise<WalletAddress>;
338
364
  getControllers(): Promise<WalletAddress[]>;
@@ -343,7 +369,7 @@ export interface AoANTRead {
343
369
  address: WalletAddress;
344
370
  }, opts?: AntReadOptions): Promise<number>;
345
371
  getBalances(opts?: AntReadOptions): Promise<Record<WalletAddress, number>>;
346
- getHandlers(): Promise<AoANTHandler[]>;
372
+ getHandlers(): Promise<ANTHandler[]>;
347
373
  getModuleId(opts?: {
348
374
  graphqlUrl?: string;
349
375
  retries?: number;
@@ -359,58 +385,71 @@ export interface AoANTRead {
359
385
  retries?: number;
360
386
  }): Promise<boolean>;
361
387
  }
362
- export interface AoANTWrite extends AoANTRead {
363
- transfer: AoWriteAction<{
388
+ export interface ANTWrite extends ANTRead {
389
+ /**
390
+ * Transfer ANT ownership to `target`.
391
+ *
392
+ * Note: ex-controllers are always cleared as part of the transfer. The
393
+ * Solana `ario-ant` contract clears `AntControllers` via inline reconcile,
394
+ * and the wrapped CPI also clears each ex-controller's paginated ACL
395
+ * entry in the same tx. Skipping cleanup would leave stale "I control
396
+ * this ANT" entries visible to frontends. This was an opt-in flag in
397
+ * the AO era; on Solana it is intrinsic to the transfer flow.
398
+ */
399
+ transfer: WriteAction<{
364
400
  target: WalletAddress;
365
- removeControllers?: boolean;
366
401
  }>;
367
- addController: AoWriteAction<{
402
+ addController: WriteAction<{
368
403
  controller: WalletAddress;
369
404
  }>;
370
- removeController: AoWriteAction<{
405
+ removeController: WriteAction<{
371
406
  controller: WalletAddress;
372
407
  }>;
373
- /** @deprecated Use setUndernameRecord instead for undernames, and setBaseNameRecord instead for the top level name (e.g. "@") */
374
- setRecord: AoWriteAction<AoANTSetUndernameRecordParams>;
408
+ /**
409
+ * @deprecated Use `setUndernameRecord` for undernames and
410
+ * `setBaseNameRecord` for the top-level name (`"@"`). This bridge
411
+ * accepts either shape so existing callers continue to type-check.
412
+ */
413
+ setRecord: WriteAction<ANTSetBaseNameRecordParams | ANTSetUndernameRecordParams>;
375
414
  /** @deprecated Use removeUndernameRecord instead for undernames */
376
- removeRecord: AoWriteAction<{
415
+ removeRecord: WriteAction<{
377
416
  undername: string;
378
417
  }>;
379
- setBaseNameRecord: AoWriteAction<AoANTSetBaseNameRecordParams>;
380
- setUndernameRecord: AoWriteAction<AoANTSetUndernameRecordParams>;
381
- removeUndernameRecord: AoWriteAction<{
418
+ setBaseNameRecord: WriteAction<ANTSetBaseNameRecordParams>;
419
+ setUndernameRecord: WriteAction<ANTSetUndernameRecordParams>;
420
+ removeUndernameRecord: WriteAction<{
382
421
  undername: string;
383
422
  }>;
384
- setTicker: AoWriteAction<{
423
+ setTicker: WriteAction<{
385
424
  ticker: string;
386
425
  }>;
387
- setDescription: AoWriteAction<{
426
+ setDescription: WriteAction<{
388
427
  description: string;
389
428
  }>;
390
- setKeywords: AoWriteAction<{
429
+ setKeywords: WriteAction<{
391
430
  keywords: string[];
392
431
  }>;
393
- setName: AoWriteAction<{
432
+ setName: WriteAction<{
394
433
  name: string;
395
434
  }>;
396
- setLogo: AoWriteAction<{
435
+ setLogo: WriteAction<{
397
436
  txId: string;
398
437
  }>;
399
- releaseName: AoWriteAction<{
438
+ releaseName: WriteAction<{
400
439
  name: string;
401
440
  arioProcessId: string;
402
441
  }>;
403
- reassignName: AoWriteAction<{
442
+ reassignName: WriteAction<{
404
443
  name: string;
405
444
  arioProcessId: string;
406
445
  antProcessId: string;
407
446
  }>;
408
- approvePrimaryNameRequest: AoWriteAction<{
447
+ approvePrimaryNameRequest: WriteAction<{
409
448
  name: string;
410
449
  address: string;
411
450
  arioProcessId: string;
412
451
  }>;
413
- removePrimaryNames: AoWriteAction<{
452
+ removePrimaryNames: WriteAction<{
414
453
  names: string[];
415
454
  arioProcessId: string;
416
455
  notifyOwners?: boolean;
@@ -428,20 +467,22 @@ export interface AoANTWrite extends AoANTRead {
428
467
  reassignAffiliatedNames?: true;
429
468
  })): Promise<{
430
469
  forkedProcessId: string;
431
- reassignedNames: Record<string, AoMessageResult>;
470
+ reassignedNames: Record<string, MessageResult>;
432
471
  failedReassignedNames: Record<string, {
433
472
  id?: string;
434
473
  error: Error;
435
474
  }>;
436
475
  }>;
437
- transferRecord: AoWriteAction<{
476
+ transferRecord: WriteAction<{
438
477
  undername: string;
439
478
  recipient: string;
440
479
  }>;
441
480
  }
442
- export type AoANTSetBaseNameRecordParams = {
481
+ export type ANTSetBaseNameRecordParams = {
443
482
  transactionId: string;
444
483
  ttlSeconds: number;
484
+ /** Storage protocol: 0 = Arweave, 1 = IPFS. Defaults to 0 (Arweave). */
485
+ targetProtocol?: number;
445
486
  priority?: number;
446
487
  owner?: string;
447
488
  displayName?: string;
@@ -449,29 +490,6 @@ export type AoANTSetBaseNameRecordParams = {
449
490
  description?: string;
450
491
  keywords?: string[];
451
492
  };
452
- export type AoANTSetUndernameRecordParams = AoANTSetBaseNameRecordParams & {
493
+ export type ANTSetUndernameRecordParams = ANTSetBaseNameRecordParams & {
453
494
  undername: string;
454
495
  };
455
- export interface AoANTVersionsRead {
456
- getANTVersions(): Promise<Record<string, {
457
- moduleId: string;
458
- luaSourceId?: string;
459
- notes?: string;
460
- releaseTimestamp: number;
461
- }>>;
462
- getLatestANTVersion(): Promise<{
463
- version: string;
464
- moduleId: string;
465
- luaSourceId?: string;
466
- notes?: string;
467
- releaseTimestamp: number;
468
- }>;
469
- }
470
- export interface AoANTVersionsWrite extends AoANTVersionsRead {
471
- addVersion: AoWriteAction<{
472
- version: string;
473
- moduleId: string;
474
- luaSourceId?: string;
475
- notes?: string;
476
- }>;
477
- }
@@ -13,32 +13,13 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { ArconnectSigner, ArweaveSigner, EthereumSigner, InjectedEthereumSigner, Signer } from '@dha-team/arbundles';
17
- import { dryrun, message, monitor, result, results, spawn, unmonitor } from '@permaweb/aoconnect';
18
- import Arweave from 'arweave';
19
- import { SpawnANTState } from './ant.js';
20
- import { AoArNSPurchaseParams, AoBuyRecordParams } from './io.js';
21
- import { AoSigner } from './token.js';
16
+ import { ArNSPurchaseParams, BuyRecordParams } from './io.js';
22
17
  export type BlockHeight = number;
23
18
  export type SortKey = string;
24
19
  export type Timestamp = number;
25
20
  export type WalletAddress = string;
26
21
  export type TransactionId = string;
27
22
  export type ProcessId = string;
28
- export type OptionalArweave<T = NonNullable<unknown>> = {
29
- arweave?: Arweave;
30
- } & T;
31
- export type OptionalPaymentUrl<T = NonNullable<unknown>> = {
32
- paymentUrl?: string;
33
- } & T;
34
- export type TurboArNSSigner = EthereumSigner | InjectedEthereumSigner | ArweaveSigner | ArconnectSigner | Window['arweaveWallet'];
35
- export type ContractSigner = Signer | Window['arweaveWallet'] | AoSigner;
36
- export type WithSigner<T = NonNullable<unknown>> = {
37
- signer: ContractSigner;
38
- } & T;
39
- export type OptionalSigner<T = NonNullable<unknown>> = {
40
- signer?: ContractSigner | undefined;
41
- } & T;
42
23
  export type ReadParameters<Input> = {
43
24
  functionName: string;
44
25
  inputs?: Input;
@@ -50,28 +31,32 @@ export type WriteOptions<K extends string = string, T = unknown> = {
50
31
  }[];
51
32
  onSigningProgress?: (name: K, payload: T) => void;
52
33
  };
53
- export type WriteParameters<Input> = WithSigner<Required<ReadParameters<Input>>>;
54
- export type AoMessageResult<T = Record<string, string | number | boolean | null>> = {
34
+ /**
35
+ * Result envelope shared with the legacy AO message-pump shape. Solana
36
+ * transactions surface their signature via `id` and may include a typed
37
+ * `result` payload for handlers that return structured data.
38
+ */
39
+ export type MessageResult<T = Record<string, string | number | boolean | null>> = {
55
40
  id: string;
56
41
  result?: T;
57
42
  };
58
- export type AoPrimaryNameRequest = {
43
+ export type PrimaryNameRequest = {
59
44
  name: string;
60
45
  initiator: WalletAddress;
61
46
  startTimestamp: Timestamp;
62
47
  endTimestamp: Timestamp;
63
48
  };
64
- export type AoCreatePrimaryNameRequest = {
65
- request: Omit<AoPrimaryNameRequest, 'initiator'> & {
49
+ export type CreatePrimaryNameRequest = {
50
+ request: Omit<PrimaryNameRequest, 'initiator'> & {
66
51
  initiator: WalletAddress;
67
52
  };
68
- newPrimaryName: AoPrimaryName;
53
+ newPrimaryName: PrimaryName;
69
54
  baseNameOwner: WalletAddress;
70
55
  fundingPlan: Record<string, unknown>;
71
56
  fundingResult: Record<string, unknown>;
72
57
  demandFactor: Record<string, unknown>;
73
58
  };
74
- export type AoPrimaryName = {
59
+ export type PrimaryName = {
75
60
  owner: WalletAddress;
76
61
  processId: ProcessId;
77
62
  name: string;
@@ -81,7 +66,7 @@ export type AoPrimaryName = {
81
66
  * Users are allowed one free redelegation every seven epochs. Each additional
82
67
  * redelegation increases the fee by 10%, capping at a 60% redelegation fee
83
68
  */
84
- export type AoRedelegationFeeInfo = {
69
+ export type RedelegationFeeInfo = {
85
70
  /** Percentage of redelegated stake that will be returned to the protocol on redelegation */
86
71
  redelegationFeeRate: number;
87
72
  /** Timestamp when the redelegation fee will reset to zero */
@@ -99,21 +84,12 @@ export interface HTTPClient {
99
84
  params?: object | I;
100
85
  }): Promise<K>;
101
86
  }
102
- export interface AoClient {
103
- result: typeof result;
104
- results: typeof results;
105
- message: typeof message;
106
- spawn: typeof spawn;
107
- monitor: typeof monitor;
108
- unmonitor: typeof unmonitor;
109
- dryrun: typeof dryrun;
110
- }
111
87
  export type SpawnAntProgressEvent = {
112
88
  'spawning-ant': {
113
89
  moduleId: string;
114
90
  antRegistryId: string;
115
91
  version: string | undefined;
116
- state: SpawnANTState | undefined;
92
+ state: unknown;
117
93
  };
118
94
  'verifying-state': {
119
95
  processId: ProcessId;
@@ -158,54 +134,22 @@ export type UpgradeAntProgressEvent = SpawnAntProgressEvent & {
158
134
  };
159
135
  };
160
136
  export type BuyArNSNameProgressEvents = SpawnAntProgressEvent & {
161
- 'buying-name': AoBuyRecordParams;
137
+ 'buying-name': BuyRecordParams;
162
138
  };
163
139
  export type SetPrimaryNameProgressEvents = {
164
- 'requesting-primary-name': AoArNSPurchaseParams;
140
+ 'requesting-primary-name': ArNSPurchaseParams;
165
141
  'request-already-exists': {
166
142
  name: string;
167
143
  initiator: WalletAddress;
168
144
  };
169
145
  'approving-request': {
170
- request: AoPrimaryNameRequest;
146
+ request: PrimaryNameRequest;
171
147
  name: string;
172
148
  processId: ProcessId;
173
149
  };
174
150
  };
175
- export interface AOContract {
176
- read<K>({ tags, retries, }: {
177
- tags?: {
178
- name: string;
179
- value: string;
180
- }[];
181
- retries?: number;
182
- }): Promise<K>;
183
- send<K>({ tags, data, signer, }: {
184
- tags: {
185
- name: string;
186
- value: string;
187
- }[];
188
- data: string | undefined;
189
- signer: AoSigner;
190
- }): Promise<{
191
- id: string;
192
- result?: K;
193
- }>;
194
- }
195
151
  /** utility type to ensure WriteOptions are appended to each parameter set */
196
- export type AoWriteAction<P, R = AoMessageResult, K extends string = string, L = unknown> = (params: P, options?: WriteOptions<K, L>) => Promise<R>;
197
- export type DryRunResult = {
198
- Output: any;
199
- Messages: any[];
200
- Spawns: any[];
201
- Error?: any;
202
- };
203
- export type MessageResult = {
204
- Output: any;
205
- Messages: any[];
206
- Spawns: any[];
207
- Error?: any;
208
- };
152
+ export type WriteAction<P, R = MessageResult, K extends string = string, L = unknown> = (params: P, options?: WriteOptions<K, L>) => Promise<R>;
209
153
  export type JSONValue = string | number | boolean | null | JSONValue[] | {
210
154
  [key: string]: JSONValue;
211
155
  };
@@ -13,8 +13,8 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { AoARIORead, AoARIOWrite } from './io.js';
17
- export type ARIOWithFaucet<T extends AoARIORead | AoARIOWrite> = T & {
16
+ import { ARIORead, ARIOWrite } from './io.js';
17
+ export type ARIOWithFaucet<T extends ARIORead | ARIOWrite> = T & {
18
18
  faucet: TokenFaucet;
19
19
  };
20
20
  export interface TokenFaucet {