@ar.io/sdk 2.0.0-alpha.2 → 2.0.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 +23 -0
- package/bundles/web.bundle.min.js +62 -62
- package/lib/cjs/common/ant.js +294 -3
- package/lib/cjs/common/contracts/ao-process.js +1 -1
- package/lib/cjs/common/http.js +1 -2
- package/lib/cjs/common/index.js +0 -1
- package/lib/cjs/common/io.js +0 -4
- package/lib/cjs/common/logger.js +4 -4
- package/lib/cjs/utils/http-client.js +1 -1
- package/lib/cjs/version.js +1 -1
- package/lib/esm/common/ant.js +290 -1
- package/lib/esm/common/contracts/ao-process.js +2 -2
- package/lib/esm/common/http.js +2 -3
- package/lib/esm/common/index.js +0 -1
- package/lib/esm/common/io.js +0 -4
- package/lib/esm/common/logger.js +3 -3
- package/lib/esm/utils/http-client.js +2 -2
- package/lib/esm/version.js +1 -1
- package/lib/types/common/ant.d.ts +176 -1
- package/lib/types/common/contracts/ao-process.d.ts +2 -2
- package/lib/types/common/http.d.ts +3 -2
- package/lib/types/common/index.d.ts +0 -1
- package/lib/types/common/logger.d.ts +10 -3
- package/lib/types/common.d.ts +0 -7
- package/lib/types/utils/http-client.d.ts +2 -2
- package/lib/types/version.d.ts +1 -1
- package/package.json +3 -3
- package/lib/cjs/common/ant-ao.js +0 -297
- package/lib/esm/common/ant-ao.js +0 -292
- package/lib/types/common/ant-ao.d.ts +0 -194
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc. All Rights Reserved.
|
|
3
|
-
*
|
|
4
|
-
* This program is free software: you can redistribute it and/or modify
|
|
5
|
-
* it under the terms of the GNU Affero General Public License as published by
|
|
6
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
7
|
-
* (at your option) any later version.
|
|
8
|
-
*
|
|
9
|
-
* This program is distributed in the hope that it will be useful,
|
|
10
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
-
* GNU Affero General Public License for more details.
|
|
13
|
-
*
|
|
14
|
-
* You should have received a copy of the GNU Affero General Public License
|
|
15
|
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
-
*/
|
|
17
|
-
import { ANTRecord } from '../contract-state.js';
|
|
18
|
-
import { AoANTRead, AoANTState, AoANTWrite, ProcessConfiguration } from '../io.js';
|
|
19
|
-
import { AoMessageResult, WalletAddress, WithSigner } from '../types.js';
|
|
20
|
-
import { AOProcess } from './contracts/ao-process.js';
|
|
21
|
-
export declare class AoANTReadable implements AoANTRead {
|
|
22
|
-
protected process: AOProcess;
|
|
23
|
-
constructor(config: Required<ProcessConfiguration>);
|
|
24
|
-
getState(): Promise<AoANTState>;
|
|
25
|
-
getInfo(): Promise<{
|
|
26
|
-
Name: string;
|
|
27
|
-
Ticker: string;
|
|
28
|
-
Denomination: number;
|
|
29
|
-
Owner: string;
|
|
30
|
-
}>;
|
|
31
|
-
/**
|
|
32
|
-
* @param undername @type {string} The domain name.
|
|
33
|
-
* @returns {Promise<ANTRecord>} The record of the undername domain.
|
|
34
|
-
* @example
|
|
35
|
-
* Get the current record
|
|
36
|
-
* ```ts
|
|
37
|
-
* ant.getRecord({ undername: "john" });
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
getRecord({ undername }: {
|
|
41
|
-
undername: string;
|
|
42
|
-
}): Promise<ANTRecord>;
|
|
43
|
-
/**
|
|
44
|
-
* @returns {Promise<Record<string, ANTRecord>>} All the undernames managed by the ANT.
|
|
45
|
-
* @example
|
|
46
|
-
* Get the current records
|
|
47
|
-
* ```ts
|
|
48
|
-
* ant.getRecords();
|
|
49
|
-
* ````
|
|
50
|
-
*/
|
|
51
|
-
getRecords(): Promise<Record<string, ANTRecord>>;
|
|
52
|
-
/**
|
|
53
|
-
* @returns {Promise<string>} The owner of the ANT.
|
|
54
|
-
* @example
|
|
55
|
-
* Get the current owner
|
|
56
|
-
* ```ts
|
|
57
|
-
* ant.getOwner();
|
|
58
|
-
* ```
|
|
59
|
-
*/
|
|
60
|
-
getOwner(): Promise<string>;
|
|
61
|
-
/**
|
|
62
|
-
* @returns {Promise<string[]>} The controllers of the ANT.
|
|
63
|
-
* @example
|
|
64
|
-
* Get the controllers of the ANT.
|
|
65
|
-
* ```ts
|
|
66
|
-
* ant.getControllers();
|
|
67
|
-
* ```
|
|
68
|
-
*/
|
|
69
|
-
getControllers(): Promise<WalletAddress[]>;
|
|
70
|
-
/**
|
|
71
|
-
* @returns {Promise<string>} The name of the ANT (not the same as ArNS name).
|
|
72
|
-
* @example
|
|
73
|
-
* Get the current name
|
|
74
|
-
* ```ts
|
|
75
|
-
* ant.getName();
|
|
76
|
-
* ```
|
|
77
|
-
*/
|
|
78
|
-
getName(): Promise<string>;
|
|
79
|
-
/**
|
|
80
|
-
* @returns {Promise<string>} The name of the ANT (not the same as ArNS name).
|
|
81
|
-
* @example
|
|
82
|
-
* The current ticker of the ANT.
|
|
83
|
-
* ```ts
|
|
84
|
-
* ant.getTicker();
|
|
85
|
-
* ```
|
|
86
|
-
*/
|
|
87
|
-
getTicker(): Promise<string>;
|
|
88
|
-
/**
|
|
89
|
-
* @returns {Promise<Record<WalletAddress, number>>} The balances of the ANT
|
|
90
|
-
* @example
|
|
91
|
-
* The current balances of the ANT.
|
|
92
|
-
* ```ts
|
|
93
|
-
* ant.getBalances();
|
|
94
|
-
* ```
|
|
95
|
-
*/
|
|
96
|
-
getBalances(): Promise<Record<string, number>>;
|
|
97
|
-
/**
|
|
98
|
-
* @param address @type {string} The address of the account you want the balance of.
|
|
99
|
-
* @returns {Promise<number>} The balance of the provided address
|
|
100
|
-
* @example
|
|
101
|
-
* The current balance of the address.
|
|
102
|
-
* ```ts
|
|
103
|
-
* ant.getBalance({ address });
|
|
104
|
-
* ```
|
|
105
|
-
*/
|
|
106
|
-
getBalance({ address }: {
|
|
107
|
-
address: string;
|
|
108
|
-
}): Promise<number>;
|
|
109
|
-
}
|
|
110
|
-
export declare class AoANTWriteable extends AoANTReadable implements AoANTWrite {
|
|
111
|
-
private signer;
|
|
112
|
-
constructor({ signer, ...config }: WithSigner<Required<ProcessConfiguration>>);
|
|
113
|
-
/**
|
|
114
|
-
* @param target @type {string} The address of the account you want to transfer the ANT to.
|
|
115
|
-
* @returns {Promise<AoMessageResult>} The result of the interaction.
|
|
116
|
-
* @example
|
|
117
|
-
* ```ts
|
|
118
|
-
* ant.transfer({ target: "fGht8v4STuwPnTck1zFVkQqJh5K9q9Zik4Y5-5dV7nk" });
|
|
119
|
-
* ```
|
|
120
|
-
*/
|
|
121
|
-
transfer({ target }: {
|
|
122
|
-
target: string;
|
|
123
|
-
}): Promise<AoMessageResult>;
|
|
124
|
-
/**
|
|
125
|
-
* @param controller @type {string} The address of the account you want to set as a controller.
|
|
126
|
-
* @returns {Promise<AoMessageResult>} The result of the interaction.
|
|
127
|
-
* @example
|
|
128
|
-
* ```ts
|
|
129
|
-
* ant.setController({ controller: "fGht8v4STuwPnTck1zFVkQqJh5K9q9Zik4Y5-5dV7nk" });
|
|
130
|
-
* ```
|
|
131
|
-
*/
|
|
132
|
-
addController({ controller, }: {
|
|
133
|
-
controller: string;
|
|
134
|
-
}): Promise<AoMessageResult>;
|
|
135
|
-
/**
|
|
136
|
-
* @param controller @type {string} The address of the account you want to remove from the controllers list
|
|
137
|
-
* @returns {Promise<AoMessageResult>} The result of the interaction.
|
|
138
|
-
* @example
|
|
139
|
-
* ```ts
|
|
140
|
-
* ant.removeController({ controller: "fGht8v4STuwPnTck1zFVkQqJh5K9q9Zik4Y5-5dV7nk" });
|
|
141
|
-
* ```
|
|
142
|
-
*/
|
|
143
|
-
removeController({ controller, }: {
|
|
144
|
-
controller: string;
|
|
145
|
-
}): Promise<AoMessageResult>;
|
|
146
|
-
/**
|
|
147
|
-
* @param undername @type {string} The record you want to set the transactionId and ttlSeconds of.
|
|
148
|
-
* @param transactionId @type {string} The transactionId of the record.
|
|
149
|
-
* @param ttlSeconds @type {number} The time to live of the record.
|
|
150
|
-
* @returns {Promise<AoMessageResult>} The result of the interaction.
|
|
151
|
-
* @example
|
|
152
|
-
* ```ts
|
|
153
|
-
* ant.setController({ controller: "fGht8v4STuwPnTck1zFVkQqJh5K9q9Zik4Y5-5dV7nk" });
|
|
154
|
-
* ```
|
|
155
|
-
*/
|
|
156
|
-
setRecord({ undername, transactionId, ttlSeconds, }: {
|
|
157
|
-
undername: string;
|
|
158
|
-
transactionId: string;
|
|
159
|
-
ttlSeconds: number;
|
|
160
|
-
}): Promise<AoMessageResult>;
|
|
161
|
-
/**
|
|
162
|
-
* @param undername @type {string} The record you want to remove.
|
|
163
|
-
* @returns {Promise<AoMessageResult>} The result of the interaction.
|
|
164
|
-
* @example
|
|
165
|
-
* ```ts
|
|
166
|
-
* ant.removeRecord({ subDomain: "shorts" });
|
|
167
|
-
* ```
|
|
168
|
-
*/
|
|
169
|
-
removeRecord({ undername, }: {
|
|
170
|
-
undername: string;
|
|
171
|
-
}): Promise<AoMessageResult>;
|
|
172
|
-
/**
|
|
173
|
-
* @param ticker @type {string} Sets the ANT Ticker.
|
|
174
|
-
* @returns {Promise<AoMessageResult>} The result of the interaction.
|
|
175
|
-
* @example
|
|
176
|
-
* ```ts
|
|
177
|
-
* ant.setTicker({ ticker: "KAPOW" });
|
|
178
|
-
* ```
|
|
179
|
-
*/
|
|
180
|
-
setTicker({ ticker }: {
|
|
181
|
-
ticker: string;
|
|
182
|
-
}): Promise<AoMessageResult>;
|
|
183
|
-
/**
|
|
184
|
-
* @param name @type {string} Sets the Name of the ANT.
|
|
185
|
-
* @returns {Promise<AoMessageResult>} The result of the interaction.
|
|
186
|
-
* @example
|
|
187
|
-
* ```ts
|
|
188
|
-
* ant.setName({ name: "ships at sea" });
|
|
189
|
-
* ```
|
|
190
|
-
*/
|
|
191
|
-
setName({ name }: {
|
|
192
|
-
name: string;
|
|
193
|
-
}): Promise<AoMessageResult>;
|
|
194
|
-
}
|