@ar.io/sdk 2.5.0-alpha.5 → 2.5.0-alpha.7

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.
@@ -145,9 +145,9 @@ export declare const AntStateSchema: z.ZodObject<{
145
145
  export type AoANTState = z.infer<typeof AntStateSchema>;
146
146
  export declare const AntReadHandlers: readonly ["balance", "balances", "totalSupply", "info", "controllers", "record", "records", "state"];
147
147
  export type AoANTReadHandler = (typeof AntReadHandlers)[number];
148
- export declare const AntWriteHandlers: readonly ["evolve", "_eval", "_default", "transfer", "addController", "removeController", "setRecord", "removeRecord", "setName", "setTicker", "setDescription", "setKeywords", "initializeState", "releaseName", "reassignName"];
148
+ export declare const AntWriteHandlers: readonly ["evolve", "_eval", "_default", "transfer", "addController", "removeController", "setRecord", "removeRecord", "setName", "setTicker", "setDescription", "setKeywords", "setLogo", "initializeState", "releaseName", "reassignName"];
149
149
  export type AoANTWriteHandler = (typeof AntWriteHandlers)[number];
150
- export declare const AntHandlerNames: ("balance" | "balances" | "totalSupply" | "info" | "controllers" | "record" | "records" | "state" | "evolve" | "_eval" | "_default" | "transfer" | "addController" | "removeController" | "setRecord" | "removeRecord" | "setName" | "setTicker" | "setDescription" | "setKeywords" | "initializeState" | "releaseName" | "reassignName")[];
150
+ export declare const AntHandlerNames: ("balance" | "balances" | "totalSupply" | "info" | "controllers" | "record" | "records" | "state" | "evolve" | "_eval" | "_default" | "transfer" | "addController" | "removeController" | "setRecord" | "removeRecord" | "setName" | "setTicker" | "setDescription" | "setKeywords" | "setLogo" | "initializeState" | "releaseName" | "reassignName")[];
151
151
  export type AoANTHandler = AoANTWriteHandler | AoANTReadHandler;
152
152
  export declare const AntHandlersSchema: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>;
153
153
  export declare const AntInfoSchema: z.ZodObject<{
@@ -240,6 +240,9 @@ export interface AoANTWrite extends AoANTRead {
240
240
  setName({ name }: {
241
241
  name: string;
242
242
  }, options?: WriteOptions): Promise<AoMessageResult>;
243
+ setLogo({ txId }: {
244
+ txId: string;
245
+ }, options?: WriteOptions): Promise<AoMessageResult>;
243
246
  releaseName({ name, ioProcessId }: {
244
247
  name: string;
245
248
  ioProcessId: string;
@@ -44,6 +44,16 @@ export type WriteParameters<Input> = WithSigner<Required<ReadParameters<Input>>>
44
44
  export type AoMessageResult = {
45
45
  id: string;
46
46
  };
47
+ export type AoPrimaryNameRequest = {
48
+ name: string;
49
+ startTimestamp: Timestamp;
50
+ endTimestamp: Timestamp;
51
+ };
52
+ export type AoPrimaryName = {
53
+ owner: WalletAddress;
54
+ name: string;
55
+ startTimestamp: Timestamp;
56
+ };
47
57
  export type AtLeastOne<T, U = {
48
58
  [K in keyof T]-?: Record<K, T[K]>;
49
59
  }> = Partial<T> & U[keyof U];
@@ -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.4";
16
+ export declare const version = "2.5.0-alpha.6";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ar.io/sdk",
3
- "version": "2.5.0-alpha.5",
3
+ "version": "2.5.0-alpha.7",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/ar-io/ar-io-sdk.git"