@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.
@@ -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<Record<string, AoArNSReservedNameData> | Record<string, never>>;
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
+ }[];
@@ -13,4 +13,4 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export declare const version = "2.5.0-alpha.3";
16
+ export declare const version = "2.5.0-alpha.5";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ar.io/sdk",
3
- "version": "2.5.0-alpha.4",
3
+ "version": "2.5.0-alpha.6",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/ar-io/ar-io-sdk.git"