@ar.io/sdk 2.5.0-alpha.4 → 2.5.0-alpha.6
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/bundles/web.bundle.min.js +64 -64
- package/lib/cjs/common/io.js +88 -72
- package/lib/cjs/utils/ao.js +4 -0
- package/lib/cjs/utils/arweave.js +11 -1
- package/lib/cjs/version.js +1 -1
- package/lib/esm/common/io.js +89 -73
- package/lib/esm/utils/ao.js +4 -0
- package/lib/esm/utils/arweave.js +9 -0
- package/lib/esm/version.js +1 -1
- package/lib/types/common/io.d.ts +18 -3
- package/lib/types/types/common.d.ts +10 -0
- package/lib/types/types/io.d.ts +22 -15
- package/lib/types/utils/arweave.d.ts +5 -0
- 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, AtLeastOne, BlockHeight, ProcessId, Timestamp, TransactionId, WalletAddress, WriteOptions } from './index.js';
|
|
17
|
+
import { AoMessageResult, AoPrimaryName, AoPrimaryNameRequest, 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;
|
|
@@ -46,19 +46,6 @@ export type AoRegistrationFees = Record<number, {
|
|
|
46
46
|
permabuy: number;
|
|
47
47
|
}>;
|
|
48
48
|
export type AoEpochIndex = number;
|
|
49
|
-
export interface AoIOState {
|
|
50
|
-
GatewayRegistry: Record<WalletAddress, AoGateway>;
|
|
51
|
-
Epochs: Record<AoEpochIndex, AoEpochData>;
|
|
52
|
-
NameRegistry: {
|
|
53
|
-
records: Record<string, AoArNSNameData>;
|
|
54
|
-
reserved: Record<string, AoArNSReservedNameData>;
|
|
55
|
-
};
|
|
56
|
-
Balances: Record<WalletAddress, number>;
|
|
57
|
-
Vaults: Record<WalletAddress, AoVaultData>;
|
|
58
|
-
Ticker: string;
|
|
59
|
-
Name: string;
|
|
60
|
-
Logo: string;
|
|
61
|
-
}
|
|
62
49
|
export type AoEpochObservationData = {
|
|
63
50
|
failureSummaries: Record<WalletAddress, WalletAddress[]>;
|
|
64
51
|
reports: Record<WalletAddress, TransactionId>;
|
|
@@ -92,6 +79,9 @@ export type AoArNSNameData = AoArNSPermabuyData | AoArNSLeaseData;
|
|
|
92
79
|
export type AoArNSNameDataWithName = AoArNSNameData & {
|
|
93
80
|
name: string;
|
|
94
81
|
};
|
|
82
|
+
export type AoArNSReservedNameDataWithName = AoArNSReservedNameData & {
|
|
83
|
+
name: string;
|
|
84
|
+
};
|
|
95
85
|
export type AoArNSBaseNameData = {
|
|
96
86
|
processId: ProcessId;
|
|
97
87
|
startTimestamp: number;
|
|
@@ -281,7 +271,7 @@ export interface AoIORead {
|
|
|
281
271
|
name: string;
|
|
282
272
|
}): Promise<AoArNSNameData | undefined>;
|
|
283
273
|
getArNSRecords(params?: PaginationParams<AoArNSNameDataWithName>): Promise<PaginationResult<AoArNSNameDataWithName>>;
|
|
284
|
-
getArNSReservedNames(): Promise<
|
|
274
|
+
getArNSReservedNames(params?: PaginationParams<AoArNSReservedNameDataWithName>): Promise<PaginationResult<AoArNSReservedNameDataWithName>>;
|
|
285
275
|
getArNSReservedName({ name, }: {
|
|
286
276
|
name: string;
|
|
287
277
|
}): Promise<AoArNSReservedNameData | undefined>;
|
|
@@ -316,6 +306,20 @@ export interface AoIORead {
|
|
|
316
306
|
address: WalletAddress;
|
|
317
307
|
vaultId: string;
|
|
318
308
|
}): Promise<AoVaultData>;
|
|
309
|
+
getPrimaryNameRequest(params: {
|
|
310
|
+
initiator: WalletAddress;
|
|
311
|
+
} | {
|
|
312
|
+
name: string;
|
|
313
|
+
}): Promise<AoMessageResult>;
|
|
314
|
+
getPrimaryNameRequests(params: PaginationParams<AoPrimaryNameRequest> & {
|
|
315
|
+
initiator?: WalletAddress;
|
|
316
|
+
}): Promise<PaginationResult<AoPrimaryNameRequest>>;
|
|
317
|
+
getPrimaryName(params: {
|
|
318
|
+
address: WalletAddress;
|
|
319
|
+
} | {
|
|
320
|
+
name: string;
|
|
321
|
+
}): Promise<AoPrimaryName>;
|
|
322
|
+
getPrimaryNames(params?: PaginationParams<AoPrimaryName>): Promise<PaginationResult<AoPrimaryName>>;
|
|
319
323
|
}
|
|
320
324
|
export interface AoIOWrite extends AoIORead {
|
|
321
325
|
transfer({ target, qty, }: {
|
|
@@ -376,6 +380,9 @@ export interface AoIOWrite extends AoIORead {
|
|
|
376
380
|
type?: 'lease' | 'permabuy';
|
|
377
381
|
years?: number;
|
|
378
382
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
383
|
+
requestPrimaryName(params: {
|
|
384
|
+
name: string;
|
|
385
|
+
}): Promise<AoMessageResult>;
|
|
379
386
|
}
|
|
380
387
|
export declare function isProcessConfiguration(config: object): config is {
|
|
381
388
|
process: AOProcess;
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import Arweave from 'arweave';
|
|
17
17
|
import { BlockHeight, Timestamp } from '../types/common.js';
|
|
18
|
+
import { PaginationParams } from '../types/io.js';
|
|
18
19
|
export declare const validateArweaveId: (id: string) => boolean;
|
|
19
20
|
export declare function isBlockHeight(height: string | number): height is BlockHeight;
|
|
20
21
|
export declare const pruneTags: (tags: {
|
|
@@ -25,3 +26,7 @@ export declare const pruneTags: (tags: {
|
|
|
25
26
|
value: string;
|
|
26
27
|
}[];
|
|
27
28
|
export declare const getCurrentBlockUnixTimestampMs: (arweave: Arweave) => Promise<Timestamp>;
|
|
29
|
+
export declare const paginationParamsToTags: <T>(params?: PaginationParams<T>) => {
|
|
30
|
+
name: string;
|
|
31
|
+
value: string;
|
|
32
|
+
}[];
|
package/lib/types/version.d.ts
CHANGED