@ar.io/sdk 2.5.0-alpha.8 → 2.5.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/README.md +139 -35
- package/bundles/web.bundle.min.js +51 -51
- package/lib/cjs/common/ant.js +29 -4
- package/lib/cjs/common/io.js +59 -0
- package/lib/cjs/constants.js +1 -1
- package/lib/cjs/types/ant.js +1 -3
- package/lib/cjs/utils/ao.js +1 -27
- package/lib/cjs/version.js +1 -1
- package/lib/esm/common/ant.js +31 -6
- package/lib/esm/common/io.js +59 -0
- package/lib/esm/constants.js +1 -1
- package/lib/esm/types/ant.js +0 -2
- package/lib/esm/utils/ao.js +0 -25
- package/lib/esm/version.js +1 -1
- package/lib/types/common/ant.d.ts +15 -3
- package/lib/types/common/io.d.ts +35 -2
- package/lib/types/constants.d.ts +1 -1
- package/lib/types/types/ant.d.ts +10 -34
- package/lib/types/types/common.d.ts +10 -0
- package/lib/types/types/io.d.ts +23 -3
- package/lib/types/utils/ao.d.ts +1 -6
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
package/lib/types/types/io.d.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { AOProcess } from '../common/index.js';
|
|
17
|
-
import { AoMessageResult, AoPrimaryName, AoPrimaryNameRequest, AtLeastOne, BlockHeight, ProcessId, Timestamp, TransactionId, WalletAddress, WriteOptions } from './index.js';
|
|
17
|
+
import { AoMessageResult, AoPrimaryName, AoPrimaryNameRequest, AoRedelegationFeeInfo, AtLeastOne, BlockHeight, ProcessId, Timestamp, TransactionId, WalletAddress, WriteOptions } from './index.js';
|
|
18
18
|
import { mIOToken } from './token.js';
|
|
19
19
|
export type PaginationParams<T = Record<string, never>> = {
|
|
20
20
|
cursor?: string;
|
|
@@ -140,10 +140,8 @@ export type AoWalletVault = AoVaultData & {
|
|
|
140
140
|
};
|
|
141
141
|
export type AoGateway = {
|
|
142
142
|
settings: AoGatewaySettings;
|
|
143
|
-
delegates: AoGatewayDelegates;
|
|
144
143
|
stats: AoGatewayStats;
|
|
145
144
|
totalDelegatedStake: number;
|
|
146
|
-
vaults: Record<WalletAddress, AoVaultData>;
|
|
147
145
|
startTimestamp: Timestamp;
|
|
148
146
|
endTimestamp: Timestamp;
|
|
149
147
|
observerAddress: WalletAddress;
|
|
@@ -239,6 +237,13 @@ export type AoStakeDelegation = AoDelegationBase & {
|
|
|
239
237
|
balance: number;
|
|
240
238
|
};
|
|
241
239
|
export type AoDelegation = AoStakeDelegation | AoVaultDelegation;
|
|
240
|
+
export type AoGatewayVault = {
|
|
241
|
+
cursorId: string;
|
|
242
|
+
vaultId: TransactionId;
|
|
243
|
+
balance: number;
|
|
244
|
+
endTimestamp: Timestamp;
|
|
245
|
+
startTimestamp: Timestamp;
|
|
246
|
+
};
|
|
242
247
|
export type AoJoinNetworkParams = Pick<AoGateway, 'operatorStake' | 'observerAddress'> & Partial<AoGatewaySettings>;
|
|
243
248
|
export type AoUpdateGatewaySettingsParams = AtLeastOne<AoJoinNetworkParams>;
|
|
244
249
|
export interface AoIORead {
|
|
@@ -263,6 +268,12 @@ export interface AoIORead {
|
|
|
263
268
|
getDelegations(params: PaginationParams<AoDelegation> & {
|
|
264
269
|
address: WalletAddress;
|
|
265
270
|
}): Promise<PaginationResult<AoDelegation>>;
|
|
271
|
+
getAllowedDelegates(params: PaginationParams & {
|
|
272
|
+
address: WalletAddress;
|
|
273
|
+
}): Promise<PaginationResult<WalletAddress>>;
|
|
274
|
+
getGatewayVaults(params: PaginationParams<AoGatewayVault> & {
|
|
275
|
+
address: WalletAddress;
|
|
276
|
+
}): Promise<PaginationResult<AoGatewayVault>>;
|
|
266
277
|
getBalance(params: {
|
|
267
278
|
address: WalletAddress;
|
|
268
279
|
}): Promise<number>;
|
|
@@ -320,6 +331,9 @@ export interface AoIORead {
|
|
|
320
331
|
name: string;
|
|
321
332
|
}): Promise<AoPrimaryName>;
|
|
322
333
|
getPrimaryNames(params?: PaginationParams<AoPrimaryName>): Promise<PaginationResult<AoPrimaryName>>;
|
|
334
|
+
getRedelegationFee(params: {
|
|
335
|
+
address: WalletAddress;
|
|
336
|
+
}): Promise<AoRedelegationFeeInfo>;
|
|
323
337
|
}
|
|
324
338
|
export interface AoIOWrite extends AoIORead {
|
|
325
339
|
transfer({ target, qty, }: {
|
|
@@ -383,6 +397,12 @@ export interface AoIOWrite extends AoIORead {
|
|
|
383
397
|
requestPrimaryName(params: {
|
|
384
398
|
name: string;
|
|
385
399
|
}): Promise<AoMessageResult>;
|
|
400
|
+
redelegateStake(params: {
|
|
401
|
+
target: string;
|
|
402
|
+
source: string;
|
|
403
|
+
stakeQty: number | mIOToken;
|
|
404
|
+
vaultId?: string;
|
|
405
|
+
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
386
406
|
}
|
|
387
407
|
export declare function isProcessConfiguration(config: object): config is {
|
|
388
408
|
process: AOProcess;
|
package/lib/types/utils/ao.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Arweave from 'arweave';
|
|
2
2
|
import { Logger } from '../common/index.js';
|
|
3
|
-
import { AoANTRecord
|
|
3
|
+
import { AoANTRecord } from '../types/ant.js';
|
|
4
4
|
import { AoClient, AoSigner, ContractSigner, WalletAddress } from '../types/index.js';
|
|
5
5
|
export declare function spawnANT({ signer, module, luaCodeTxId, ao, scheduler, state, stateContractTxId, antRegistryId, logger, arweave, }: {
|
|
6
6
|
signer: AoSigner;
|
|
@@ -31,8 +31,3 @@ export declare function evolveANT({ signer, processId, luaCodeTxId, ao, logger,
|
|
|
31
31
|
}): Promise<string>;
|
|
32
32
|
export declare function isAoSigner(value: unknown): value is AoSigner;
|
|
33
33
|
export declare function createAoSigner(signer: ContractSigner): AoSigner;
|
|
34
|
-
/**
|
|
35
|
-
* @param records @type {AoANTRecordEntry[] | Record<string, AoANTRecord>} - the records returned by an ANT
|
|
36
|
-
* @returns @type {AoANTRecordEntry[]} - the alphabetically sorted records
|
|
37
|
-
*/
|
|
38
|
-
export declare function parseAntRecords(records: AoANTRecordEntry[] | Record<string, AoANTRecord>): AoANTRecordEntry[];
|
package/lib/types/version.d.ts
CHANGED