@ar.io/sdk 2.3.0-alpha.1 → 2.3.0-alpha.3
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/README.md +6 -4
- package/bundles/web.bundle.min.js +4 -4
- package/lib/cjs/common/ant.js +14 -7
- package/lib/cjs/io.js +0 -6
- package/lib/cjs/version.js +1 -1
- package/lib/esm/common/ant.js +14 -7
- package/lib/esm/io.js +0 -6
- package/lib/esm/version.js +1 -1
- package/lib/types/common/ant.d.ts +8 -8
- package/lib/types/common/io.d.ts +2 -0
- package/lib/types/io.d.ts +10 -11
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
package/lib/cjs/common/ant.js
CHANGED
|
@@ -196,8 +196,9 @@ class AoANTWriteable extends AoANTReadable {
|
|
|
196
196
|
* ant.transfer({ target: "fGht8v4STuwPnTck1zFVkQqJh5K9q9Zik4Y5-5dV7nk" });
|
|
197
197
|
* ```
|
|
198
198
|
*/
|
|
199
|
-
async transfer({ target }) {
|
|
199
|
+
async transfer({ target }, options) {
|
|
200
200
|
const tags = [
|
|
201
|
+
...(options?.tags ?? []),
|
|
201
202
|
{ name: 'Action', value: 'Transfer' },
|
|
202
203
|
{ name: 'Recipient', value: target },
|
|
203
204
|
];
|
|
@@ -214,8 +215,9 @@ class AoANTWriteable extends AoANTReadable {
|
|
|
214
215
|
* ant.setController({ controller: "fGht8v4STuwPnTck1zFVkQqJh5K9q9Zik4Y5-5dV7nk" });
|
|
215
216
|
* ```
|
|
216
217
|
*/
|
|
217
|
-
async addController({ controller, }) {
|
|
218
|
+
async addController({ controller, }, options) {
|
|
218
219
|
const tags = [
|
|
220
|
+
...(options?.tags ?? []),
|
|
219
221
|
{ name: 'Action', value: 'Add-Controller' },
|
|
220
222
|
{ name: 'Controller', value: controller },
|
|
221
223
|
];
|
|
@@ -232,8 +234,9 @@ class AoANTWriteable extends AoANTReadable {
|
|
|
232
234
|
* ant.removeController({ controller: "fGht8v4STuwPnTck1zFVkQqJh5K9q9Zik4Y5-5dV7nk" });
|
|
233
235
|
* ```
|
|
234
236
|
*/
|
|
235
|
-
async removeController({ controller, }) {
|
|
237
|
+
async removeController({ controller, }, options) {
|
|
236
238
|
const tags = [
|
|
239
|
+
...(options?.tags ?? []),
|
|
237
240
|
{ name: 'Action', value: 'Remove-Controller' },
|
|
238
241
|
{ name: 'Controller', value: controller },
|
|
239
242
|
];
|
|
@@ -252,9 +255,10 @@ class AoANTWriteable extends AoANTReadable {
|
|
|
252
255
|
* ant.setController({ controller: "fGht8v4STuwPnTck1zFVkQqJh5K9q9Zik4Y5-5dV7nk" });
|
|
253
256
|
* ```
|
|
254
257
|
*/
|
|
255
|
-
async setRecord({ undername, transactionId, ttlSeconds, }) {
|
|
258
|
+
async setRecord({ undername, transactionId, ttlSeconds, }, options) {
|
|
256
259
|
return this.process.send({
|
|
257
260
|
tags: [
|
|
261
|
+
...(options?.tags ?? []),
|
|
258
262
|
{ name: 'Action', value: 'Set-Record' },
|
|
259
263
|
{ name: 'Sub-Domain', value: undername },
|
|
260
264
|
{ name: 'Transaction-Id', value: transactionId },
|
|
@@ -271,9 +275,10 @@ class AoANTWriteable extends AoANTReadable {
|
|
|
271
275
|
* ant.removeRecord({ subDomain: "shorts" });
|
|
272
276
|
* ```
|
|
273
277
|
*/
|
|
274
|
-
async removeRecord({ undername, }) {
|
|
278
|
+
async removeRecord({ undername, }, options) {
|
|
275
279
|
return this.process.send({
|
|
276
280
|
tags: [
|
|
281
|
+
...(options?.tags ?? []),
|
|
277
282
|
{ name: 'Action', value: 'Remove-Record' },
|
|
278
283
|
{ name: 'Sub-Domain', value: undername },
|
|
279
284
|
],
|
|
@@ -288,9 +293,10 @@ class AoANTWriteable extends AoANTReadable {
|
|
|
288
293
|
* ant.setTicker({ ticker: "KAPOW" });
|
|
289
294
|
* ```
|
|
290
295
|
*/
|
|
291
|
-
async setTicker({ ticker }) {
|
|
296
|
+
async setTicker({ ticker }, options) {
|
|
292
297
|
return this.process.send({
|
|
293
298
|
tags: [
|
|
299
|
+
...(options?.tags ?? []),
|
|
294
300
|
{ name: 'Action', value: 'Set-Ticker' },
|
|
295
301
|
{ name: 'Ticker', value: ticker },
|
|
296
302
|
],
|
|
@@ -305,9 +311,10 @@ class AoANTWriteable extends AoANTReadable {
|
|
|
305
311
|
* ant.setName({ name: "ships at sea" });
|
|
306
312
|
* ```
|
|
307
313
|
*/
|
|
308
|
-
async setName({ name }) {
|
|
314
|
+
async setName({ name }, options) {
|
|
309
315
|
return this.process.send({
|
|
310
316
|
tags: [
|
|
317
|
+
...(options?.tags ?? []),
|
|
311
318
|
{ name: 'Action', value: 'Set-Name' },
|
|
312
319
|
{ name: 'Name', value: name },
|
|
313
320
|
],
|
package/lib/cjs/io.js
CHANGED
|
@@ -2,12 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isLeasedArNSRecord = exports.isProcessIdConfiguration = exports.isProcessConfiguration = void 0;
|
|
4
4
|
const arweave_js_1 = require("./utils/arweave.js");
|
|
5
|
-
const nameLengthArray = [
|
|
6
|
-
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
|
|
7
|
-
23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
|
|
8
|
-
42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
|
|
9
|
-
];
|
|
10
|
-
const leaseLengthArray = [1, 2, 3, 4, 5];
|
|
11
5
|
// Typeguard functions
|
|
12
6
|
function isProcessConfiguration(config) {
|
|
13
7
|
return 'process' in config;
|
package/lib/cjs/version.js
CHANGED
package/lib/esm/common/ant.js
CHANGED
|
@@ -191,8 +191,9 @@ export class AoANTWriteable extends AoANTReadable {
|
|
|
191
191
|
* ant.transfer({ target: "fGht8v4STuwPnTck1zFVkQqJh5K9q9Zik4Y5-5dV7nk" });
|
|
192
192
|
* ```
|
|
193
193
|
*/
|
|
194
|
-
async transfer({ target }) {
|
|
194
|
+
async transfer({ target }, options) {
|
|
195
195
|
const tags = [
|
|
196
|
+
...(options?.tags ?? []),
|
|
196
197
|
{ name: 'Action', value: 'Transfer' },
|
|
197
198
|
{ name: 'Recipient', value: target },
|
|
198
199
|
];
|
|
@@ -209,8 +210,9 @@ export class AoANTWriteable extends AoANTReadable {
|
|
|
209
210
|
* ant.setController({ controller: "fGht8v4STuwPnTck1zFVkQqJh5K9q9Zik4Y5-5dV7nk" });
|
|
210
211
|
* ```
|
|
211
212
|
*/
|
|
212
|
-
async addController({ controller, }) {
|
|
213
|
+
async addController({ controller, }, options) {
|
|
213
214
|
const tags = [
|
|
215
|
+
...(options?.tags ?? []),
|
|
214
216
|
{ name: 'Action', value: 'Add-Controller' },
|
|
215
217
|
{ name: 'Controller', value: controller },
|
|
216
218
|
];
|
|
@@ -227,8 +229,9 @@ export class AoANTWriteable extends AoANTReadable {
|
|
|
227
229
|
* ant.removeController({ controller: "fGht8v4STuwPnTck1zFVkQqJh5K9q9Zik4Y5-5dV7nk" });
|
|
228
230
|
* ```
|
|
229
231
|
*/
|
|
230
|
-
async removeController({ controller, }) {
|
|
232
|
+
async removeController({ controller, }, options) {
|
|
231
233
|
const tags = [
|
|
234
|
+
...(options?.tags ?? []),
|
|
232
235
|
{ name: 'Action', value: 'Remove-Controller' },
|
|
233
236
|
{ name: 'Controller', value: controller },
|
|
234
237
|
];
|
|
@@ -247,9 +250,10 @@ export class AoANTWriteable extends AoANTReadable {
|
|
|
247
250
|
* ant.setController({ controller: "fGht8v4STuwPnTck1zFVkQqJh5K9q9Zik4Y5-5dV7nk" });
|
|
248
251
|
* ```
|
|
249
252
|
*/
|
|
250
|
-
async setRecord({ undername, transactionId, ttlSeconds, }) {
|
|
253
|
+
async setRecord({ undername, transactionId, ttlSeconds, }, options) {
|
|
251
254
|
return this.process.send({
|
|
252
255
|
tags: [
|
|
256
|
+
...(options?.tags ?? []),
|
|
253
257
|
{ name: 'Action', value: 'Set-Record' },
|
|
254
258
|
{ name: 'Sub-Domain', value: undername },
|
|
255
259
|
{ name: 'Transaction-Id', value: transactionId },
|
|
@@ -266,9 +270,10 @@ export class AoANTWriteable extends AoANTReadable {
|
|
|
266
270
|
* ant.removeRecord({ subDomain: "shorts" });
|
|
267
271
|
* ```
|
|
268
272
|
*/
|
|
269
|
-
async removeRecord({ undername, }) {
|
|
273
|
+
async removeRecord({ undername, }, options) {
|
|
270
274
|
return this.process.send({
|
|
271
275
|
tags: [
|
|
276
|
+
...(options?.tags ?? []),
|
|
272
277
|
{ name: 'Action', value: 'Remove-Record' },
|
|
273
278
|
{ name: 'Sub-Domain', value: undername },
|
|
274
279
|
],
|
|
@@ -283,9 +288,10 @@ export class AoANTWriteable extends AoANTReadable {
|
|
|
283
288
|
* ant.setTicker({ ticker: "KAPOW" });
|
|
284
289
|
* ```
|
|
285
290
|
*/
|
|
286
|
-
async setTicker({ ticker }) {
|
|
291
|
+
async setTicker({ ticker }, options) {
|
|
287
292
|
return this.process.send({
|
|
288
293
|
tags: [
|
|
294
|
+
...(options?.tags ?? []),
|
|
289
295
|
{ name: 'Action', value: 'Set-Ticker' },
|
|
290
296
|
{ name: 'Ticker', value: ticker },
|
|
291
297
|
],
|
|
@@ -300,9 +306,10 @@ export class AoANTWriteable extends AoANTReadable {
|
|
|
300
306
|
* ant.setName({ name: "ships at sea" });
|
|
301
307
|
* ```
|
|
302
308
|
*/
|
|
303
|
-
async setName({ name }) {
|
|
309
|
+
async setName({ name }, options) {
|
|
304
310
|
return this.process.send({
|
|
305
311
|
tags: [
|
|
312
|
+
...(options?.tags ?? []),
|
|
306
313
|
{ name: 'Action', value: 'Set-Name' },
|
|
307
314
|
{ name: 'Name', value: name },
|
|
308
315
|
],
|
package/lib/esm/io.js
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import { validateArweaveId } from './utils/arweave.js';
|
|
2
|
-
const nameLengthArray = [
|
|
3
|
-
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
|
|
4
|
-
23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
|
|
5
|
-
42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
|
|
6
|
-
];
|
|
7
|
-
const leaseLengthArray = [1, 2, 3, 4, 5];
|
|
8
2
|
// Typeguard functions
|
|
9
3
|
export function isProcessConfiguration(config) {
|
|
10
4
|
return 'process' in config;
|
package/lib/esm/version.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { AoANTRead, AoANTRecord, AoANTState, AoANTWrite, AoMessageResult, ProcessConfiguration, WalletAddress, WithSigner } from '../types.js';
|
|
16
|
+
import { AoANTRead, AoANTRecord, AoANTState, AoANTWrite, AoMessageResult, ProcessConfiguration, WalletAddress, WithSigner, WriteOptions } from '../types.js';
|
|
17
17
|
import { AOProcess } from './index.js';
|
|
18
18
|
export declare class ANT {
|
|
19
19
|
static init(config: Required<ProcessConfiguration> & {
|
|
@@ -124,7 +124,7 @@ export declare class AoANTWriteable extends AoANTReadable implements AoANTWrite
|
|
|
124
124
|
*/
|
|
125
125
|
transfer({ target }: {
|
|
126
126
|
target: string;
|
|
127
|
-
}): Promise<AoMessageResult>;
|
|
127
|
+
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
128
128
|
/**
|
|
129
129
|
* @param controller @type {string} The address of the account you want to set as a controller.
|
|
130
130
|
* @returns {Promise<AoMessageResult>} The result of the interaction.
|
|
@@ -135,7 +135,7 @@ export declare class AoANTWriteable extends AoANTReadable implements AoANTWrite
|
|
|
135
135
|
*/
|
|
136
136
|
addController({ controller, }: {
|
|
137
137
|
controller: string;
|
|
138
|
-
}): Promise<AoMessageResult>;
|
|
138
|
+
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
139
139
|
/**
|
|
140
140
|
* @param controller @type {string} The address of the account you want to remove from the controllers list
|
|
141
141
|
* @returns {Promise<AoMessageResult>} The result of the interaction.
|
|
@@ -146,7 +146,7 @@ export declare class AoANTWriteable extends AoANTReadable implements AoANTWrite
|
|
|
146
146
|
*/
|
|
147
147
|
removeController({ controller, }: {
|
|
148
148
|
controller: string;
|
|
149
|
-
}): Promise<AoMessageResult>;
|
|
149
|
+
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
150
150
|
/**
|
|
151
151
|
* @param undername @type {string} The record you want to set the transactionId and ttlSeconds of.
|
|
152
152
|
* @param transactionId @type {string} The transactionId of the record.
|
|
@@ -161,7 +161,7 @@ export declare class AoANTWriteable extends AoANTReadable implements AoANTWrite
|
|
|
161
161
|
undername: string;
|
|
162
162
|
transactionId: string;
|
|
163
163
|
ttlSeconds: number;
|
|
164
|
-
}): Promise<AoMessageResult>;
|
|
164
|
+
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
165
165
|
/**
|
|
166
166
|
* @param undername @type {string} The record you want to remove.
|
|
167
167
|
* @returns {Promise<AoMessageResult>} The result of the interaction.
|
|
@@ -172,7 +172,7 @@ export declare class AoANTWriteable extends AoANTReadable implements AoANTWrite
|
|
|
172
172
|
*/
|
|
173
173
|
removeRecord({ undername, }: {
|
|
174
174
|
undername: string;
|
|
175
|
-
}): Promise<AoMessageResult>;
|
|
175
|
+
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
176
176
|
/**
|
|
177
177
|
* @param ticker @type {string} Sets the ANT Ticker.
|
|
178
178
|
* @returns {Promise<AoMessageResult>} The result of the interaction.
|
|
@@ -183,7 +183,7 @@ export declare class AoANTWriteable extends AoANTReadable implements AoANTWrite
|
|
|
183
183
|
*/
|
|
184
184
|
setTicker({ ticker }: {
|
|
185
185
|
ticker: string;
|
|
186
|
-
}): Promise<AoMessageResult>;
|
|
186
|
+
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
187
187
|
/**
|
|
188
188
|
* @param name @type {string} Sets the Name of the ANT.
|
|
189
189
|
* @returns {Promise<AoMessageResult>} The result of the interaction.
|
|
@@ -194,5 +194,5 @@ export declare class AoANTWriteable extends AoANTReadable implements AoANTWrite
|
|
|
194
194
|
*/
|
|
195
195
|
setName({ name }: {
|
|
196
196
|
name: string;
|
|
197
|
-
}): Promise<AoMessageResult>;
|
|
197
|
+
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
198
198
|
}
|
package/lib/types/common/io.d.ts
CHANGED
|
@@ -46,6 +46,8 @@ export declare class IOReadable implements AoIORead {
|
|
|
46
46
|
Ticker: string;
|
|
47
47
|
Logo: string;
|
|
48
48
|
Denomination: number;
|
|
49
|
+
Handlers: string[];
|
|
50
|
+
LastTickedEpochIndex: number;
|
|
49
51
|
}>;
|
|
50
52
|
getTokenSupply(): Promise<number>;
|
|
51
53
|
getEpochSettings(params?: EpochInput): Promise<AoEpochSettings>;
|
package/lib/types/io.d.ts
CHANGED
|
@@ -41,10 +41,8 @@ export type EpochInput = {
|
|
|
41
41
|
timestamp: Timestamp;
|
|
42
42
|
} | undefined;
|
|
43
43
|
export type AoBalances = Record<WalletAddress, number>;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
export type AoRegistrationFees = Record<(typeof nameLengthArray)[number], {
|
|
47
|
-
lease: Record<(typeof leaseLengthArray)[number], number>;
|
|
44
|
+
export type AoRegistrationFees = Record<number, {
|
|
45
|
+
lease: Record<number, number>;
|
|
48
46
|
permabuy: number;
|
|
49
47
|
}>;
|
|
50
48
|
export type AoObservations = Record<number, AoEpochObservationData>;
|
|
@@ -230,6 +228,8 @@ export interface AoIORead {
|
|
|
230
228
|
Name: string;
|
|
231
229
|
Logo: string;
|
|
232
230
|
Denomination: number;
|
|
231
|
+
Handlers: string[];
|
|
232
|
+
LastTickedEpochIndex: number;
|
|
233
233
|
}>;
|
|
234
234
|
getTokenSupply(): Promise<number>;
|
|
235
235
|
getEpochSettings(params?: EpochInput): Promise<AoEpochSettings>;
|
|
@@ -333,24 +333,24 @@ export interface AoANTWrite extends AoANTRead {
|
|
|
333
333
|
}): Promise<AoMessageResult>;
|
|
334
334
|
addController({ controller, }: {
|
|
335
335
|
controller: WalletAddress;
|
|
336
|
-
}): Promise<AoMessageResult>;
|
|
336
|
+
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
337
337
|
removeController({ controller, }: {
|
|
338
338
|
controller: WalletAddress;
|
|
339
|
-
}): Promise<AoMessageResult>;
|
|
339
|
+
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
340
340
|
setRecord({ undername, transactionId, ttlSeconds, }: {
|
|
341
341
|
undername: string;
|
|
342
342
|
transactionId: string;
|
|
343
343
|
ttlSeconds: number;
|
|
344
|
-
}): Promise<AoMessageResult>;
|
|
344
|
+
}, options: any): Promise<AoMessageResult>;
|
|
345
345
|
removeRecord({ undername }: {
|
|
346
346
|
undername: string;
|
|
347
|
-
}): Promise<AoMessageResult>;
|
|
347
|
+
}, options: any): Promise<AoMessageResult>;
|
|
348
348
|
setTicker({ ticker }: {
|
|
349
349
|
ticker: any;
|
|
350
|
-
}): Promise<AoMessageResult>;
|
|
350
|
+
}, options: any): Promise<AoMessageResult>;
|
|
351
351
|
setName({ name }: {
|
|
352
352
|
name: any;
|
|
353
|
-
}): Promise<AoMessageResult>;
|
|
353
|
+
}, options: any): Promise<AoMessageResult>;
|
|
354
354
|
}
|
|
355
355
|
export interface AoANTRegistryRead {
|
|
356
356
|
accessControlList(params: {
|
|
@@ -372,4 +372,3 @@ export declare function isProcessIdConfiguration(config: object): config is {
|
|
|
372
372
|
processId: string;
|
|
373
373
|
};
|
|
374
374
|
export declare function isLeasedArNSRecord(record: AoArNSNameData): record is AoArNSLeaseData;
|
|
375
|
-
export {};
|
package/lib/types/version.d.ts
CHANGED