@ar.io/sdk 2.1.0-alpha.8 → 2.1.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.
@@ -82,7 +82,7 @@ class AoANTReadable {
82
82
  return record;
83
83
  }
84
84
  /**
85
- * @returns {Promise<Record<string, ANTRecord>>} All the undernames managed by the ANT.
85
+ * @returns {Promise<Record<string, AoANTRecord>>} All the undernames managed by the ANT.
86
86
  * @example
87
87
  * Get the current records
88
88
  * ```ts
@@ -394,11 +394,11 @@ class IOWriteable extends IOReadable {
394
394
  },
395
395
  {
396
396
  name: 'Allow-Delegated-Staking',
397
- value: allowDelegatedStaking.toString(),
397
+ value: allowDelegatedStaking?.toString(),
398
398
  },
399
399
  {
400
400
  name: 'Delegate-Reward-Share-Ratio',
401
- value: delegateRewardShareRatio.toString(),
401
+ value: delegateRewardShareRatio?.toString(),
402
402
  },
403
403
  {
404
404
  name: 'FQDN',
@@ -410,7 +410,7 @@ class IOWriteable extends IOReadable {
410
410
  },
411
411
  {
412
412
  name: 'Min-Delegated-Stake',
413
- value: minDelegatedStake.valueOf().toString(),
413
+ value: minDelegatedStake?.valueOf().toString(),
414
414
  },
415
415
  {
416
416
  name: 'Note',
@@ -418,7 +418,7 @@ class IOWriteable extends IOReadable {
418
418
  },
419
419
  {
420
420
  name: 'Port',
421
- value: port.toString(),
421
+ value: port?.toString(),
422
422
  },
423
423
  {
424
424
  name: 'Properties',
@@ -430,7 +430,7 @@ class IOWriteable extends IOReadable {
430
430
  },
431
431
  {
432
432
  name: 'Auto-Stake',
433
- value: autoStake.toString(),
433
+ value: autoStake?.toString(),
434
434
  },
435
435
  {
436
436
  name: 'Observer-Address',
package/lib/cjs/io.js CHANGED
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isLeasedArNSRecord = exports.isProcessIdConfiguration = exports.isProcessConfiguration = void 0;
4
4
  const arweave_js_1 = require("./utils/arweave.js");
5
+ // Typeguard functions
5
6
  function isProcessConfiguration(config) {
6
7
  return 'process' in config;
7
8
  }
@@ -13,6 +14,6 @@ function isProcessIdConfiguration(config) {
13
14
  }
14
15
  exports.isProcessIdConfiguration = isProcessIdConfiguration;
15
16
  function isLeasedArNSRecord(record) {
16
- return record.type === 'lease' && record.endTimestamp !== undefined;
17
+ return record.type === 'lease';
17
18
  }
18
19
  exports.isLeasedArNSRecord = isLeasedArNSRecord;
package/lib/cjs/types.js CHANGED
@@ -30,7 +30,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
30
30
  * You should have received a copy of the GNU Affero General Public License
31
31
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
32
32
  */
33
- __exportStar(require("./contract-state.js"), exports);
34
33
  __exportStar(require("./common.js"), exports);
35
34
  __exportStar(require("./token.js"), exports);
36
35
  __exportStar(require("./io.js"), exports);
@@ -18,4 +18,4 @@
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
19
  exports.version = void 0;
20
20
  // AUTOMATICALLY GENERATED FILE - DO NOT TOUCH
21
- exports.version = '2.1.0-alpha.8';
21
+ exports.version = '2.1.0';
@@ -78,7 +78,7 @@ export class AoANTReadable {
78
78
  return record;
79
79
  }
80
80
  /**
81
- * @returns {Promise<Record<string, ANTRecord>>} All the undernames managed by the ANT.
81
+ * @returns {Promise<Record<string, AoANTRecord>>} All the undernames managed by the ANT.
82
82
  * @example
83
83
  * Get the current records
84
84
  * ```ts
@@ -389,11 +389,11 @@ export class IOWriteable extends IOReadable {
389
389
  },
390
390
  {
391
391
  name: 'Allow-Delegated-Staking',
392
- value: allowDelegatedStaking.toString(),
392
+ value: allowDelegatedStaking?.toString(),
393
393
  },
394
394
  {
395
395
  name: 'Delegate-Reward-Share-Ratio',
396
- value: delegateRewardShareRatio.toString(),
396
+ value: delegateRewardShareRatio?.toString(),
397
397
  },
398
398
  {
399
399
  name: 'FQDN',
@@ -405,7 +405,7 @@ export class IOWriteable extends IOReadable {
405
405
  },
406
406
  {
407
407
  name: 'Min-Delegated-Stake',
408
- value: minDelegatedStake.valueOf().toString(),
408
+ value: minDelegatedStake?.valueOf().toString(),
409
409
  },
410
410
  {
411
411
  name: 'Note',
@@ -413,7 +413,7 @@ export class IOWriteable extends IOReadable {
413
413
  },
414
414
  {
415
415
  name: 'Port',
416
- value: port.toString(),
416
+ value: port?.toString(),
417
417
  },
418
418
  {
419
419
  name: 'Properties',
@@ -425,7 +425,7 @@ export class IOWriteable extends IOReadable {
425
425
  },
426
426
  {
427
427
  name: 'Auto-Stake',
428
- value: autoStake.toString(),
428
+ value: autoStake?.toString(),
429
429
  },
430
430
  {
431
431
  name: 'Observer-Address',
package/lib/esm/io.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { validateArweaveId } from './utils/arweave.js';
2
+ // Typeguard functions
2
3
  export function isProcessConfiguration(config) {
3
4
  return 'process' in config;
4
5
  }
@@ -8,5 +9,5 @@ export function isProcessIdConfiguration(config) {
8
9
  validateArweaveId(config.processId) === true);
9
10
  }
10
11
  export function isLeasedArNSRecord(record) {
11
- return record.type === 'lease' && record.endTimestamp !== undefined;
12
+ return record.type === 'lease';
12
13
  }
package/lib/esm/types.js CHANGED
@@ -14,7 +14,6 @@
14
14
  * You should have received a copy of the GNU Affero General Public License
15
15
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  */
17
- export * from './contract-state.js';
18
17
  export * from './common.js';
19
18
  export * from './token.js';
20
19
  export * from './io.js';
@@ -15,4 +15,4 @@
15
15
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  */
17
17
  // AUTOMATICALLY GENERATED FILE - DO NOT TOUCH
18
- export const version = '2.1.0-alpha.8';
18
+ export const version = '2.1.0';
@@ -14,7 +14,7 @@
14
14
  * You should have received a copy of the GNU Affero General Public License
15
15
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  */
17
- import { ANTRecord, AoANTRead, AoANTState, AoANTWrite, AoMessageResult, ProcessConfiguration, WalletAddress, WithSigner } from '../types.js';
17
+ import { AoANTRead, AoANTRecord, AoANTState, AoANTWrite, AoMessageResult, ProcessConfiguration, WalletAddress, WithSigner } from '../types.js';
18
18
  import { AOProcess } from './index.js';
19
19
  export declare class ANT {
20
20
  static init(config: Required<ProcessConfiguration> & {
@@ -44,16 +44,16 @@ export declare class AoANTReadable implements AoANTRead {
44
44
  */
45
45
  getRecord({ undername }: {
46
46
  undername: string;
47
- }): Promise<ANTRecord>;
47
+ }): Promise<AoANTRecord>;
48
48
  /**
49
- * @returns {Promise<Record<string, ANTRecord>>} All the undernames managed by the ANT.
49
+ * @returns {Promise<Record<string, AoANTRecord>>} All the undernames managed by the ANT.
50
50
  * @example
51
51
  * Get the current records
52
52
  * ```ts
53
53
  * ant.getRecords();
54
54
  * ````
55
55
  */
56
- getRecords(): Promise<Record<string, ANTRecord>>;
56
+ getRecords(): Promise<Record<string, AoANTRecord>>;
57
57
  /**
58
58
  * @returns {Promise<string>} The owner of the ANT.
59
59
  * @example
@@ -15,10 +15,9 @@
15
15
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  */
17
17
  import Arweave from 'arweave';
18
- import { ArNSReservedNameData, EpochDistributionData, EpochObservations, WeightedObserver } from '../contract-state.js';
19
18
  import { AoArNSNameData, AoEpochData, AoEpochSettings, AoGateway, AoIORead, AoIOWrite, EpochInput } from '../io.js';
20
19
  import { mIOToken } from '../token.js';
21
- import { AoArNSNameDataWithName, AoBalanceWithAddress, AoGatewayWithAddress, AoMessageResult, ContractSigner, JoinNetworkParams, PaginationParams, PaginationResult, ProcessConfiguration, TransactionId, UpdateGatewaySettingsParams, WalletAddress, WithSigner, WriteOptions } from '../types.js';
20
+ import { AoArNSNameDataWithName, AoArNSReservedNameData, AoBalanceWithAddress, AoEpochDistributionData, AoEpochObservationData, AoGatewayWithAddress, AoJoinNetworkParams, AoMessageResult, AoUpdateGatewaySettingsParams, AoWeightedObserver, ContractSigner, PaginationParams, PaginationResult, ProcessConfiguration, TransactionId, WalletAddress, WithSigner, WriteOptions } from '../types.js';
22
21
  import { AOProcess } from './contracts/ao-process.js';
23
22
  export declare class IO {
24
23
  static init(): AoIORead;
@@ -56,10 +55,10 @@ export declare class IOReadable implements AoIORead {
56
55
  name: string;
57
56
  }): Promise<AoArNSNameData | undefined>;
58
57
  getArNSRecords(pageParams?: PaginationParams): Promise<PaginationResult<AoArNSNameDataWithName>>;
59
- getArNSReservedNames(): Promise<Record<string, ArNSReservedNameData> | Record<string, never>>;
58
+ getArNSReservedNames(): Promise<Record<string, AoArNSReservedNameData> | Record<string, never>>;
60
59
  getArNSReservedName({ name, }: {
61
60
  name: string;
62
- }): Promise<ArNSReservedNameData | undefined>;
61
+ }): Promise<AoArNSReservedNameData | undefined>;
63
62
  getBalance({ address }: {
64
63
  address: WalletAddress;
65
64
  }): Promise<number>;
@@ -69,10 +68,10 @@ export declare class IOReadable implements AoIORead {
69
68
  }): Promise<AoGateway | undefined>;
70
69
  getGateways(pageParams?: PaginationParams): Promise<PaginationResult<AoGatewayWithAddress>>;
71
70
  getCurrentEpoch(): Promise<AoEpochData>;
72
- getPrescribedObservers(epoch?: EpochInput): Promise<WeightedObserver[]>;
71
+ getPrescribedObservers(epoch?: EpochInput): Promise<AoWeightedObserver[]>;
73
72
  getPrescribedNames(epoch?: EpochInput): Promise<string[]>;
74
- getObservations(epoch?: EpochInput): Promise<EpochObservations>;
75
- getDistributions(epoch?: EpochInput): Promise<EpochDistributionData>;
73
+ getObservations(epoch?: EpochInput): Promise<AoEpochObservationData>;
74
+ getDistributions(epoch?: EpochInput): Promise<AoEpochDistributionData>;
76
75
  getTokenCost(params: {
77
76
  intent: 'Buy-Record';
78
77
  purchaseType: 'permabuy' | 'lease';
@@ -102,12 +101,9 @@ export declare class IOWriteable extends IOReadable implements AoIOWrite {
102
101
  target: string;
103
102
  qty: number | mIOToken;
104
103
  }, options?: WriteOptions): Promise<AoMessageResult>;
105
- joinNetwork({ operatorStake, allowDelegatedStaking, delegateRewardShareRatio, fqdn, label, minDelegatedStake, note, port, properties, protocol, autoStake, observerAddress, }: Omit<JoinNetworkParams, 'observerWallet' | 'qty'> & {
106
- observerAddress: string;
107
- operatorStake: number | mIOToken;
108
- }, options?: WriteOptions): Promise<AoMessageResult>;
104
+ joinNetwork({ operatorStake, allowDelegatedStaking, delegateRewardShareRatio, fqdn, label, minDelegatedStake, note, port, properties, protocol, autoStake, observerAddress, }: AoJoinNetworkParams, options?: WriteOptions): Promise<AoMessageResult>;
109
105
  leaveNetwork(options?: WriteOptions): Promise<AoMessageResult>;
110
- updateGatewaySettings({ allowDelegatedStaking, delegateRewardShareRatio, fqdn, label, minDelegatedStake, note, port, properties, protocol, autoStake, observerAddress, }: UpdateGatewaySettingsParams, options?: WriteOptions): Promise<AoMessageResult>;
106
+ updateGatewaySettings({ allowDelegatedStaking, delegateRewardShareRatio, fqdn, label, minDelegatedStake, note, port, properties, protocol, autoStake, observerAddress, }: AoUpdateGatewaySettingsParams, options?: WriteOptions): Promise<AoMessageResult>;
111
107
  delegateStake(params: {
112
108
  target: string;
113
109
  stakeQty: number | mIOToken;
@@ -17,8 +17,6 @@
17
17
  */
18
18
  import { dryrun, message, monitor, result, results, spawn, unmonitor } from '@permaweb/aoconnect';
19
19
  import { Signer } from 'arbundles';
20
- import { AllowedProtocols, GatewayConnectionSettings, GatewayMetadata, GatewayStakingSettings } from './contract-state.js';
21
- import { mIOToken } from './token.js';
22
20
  export type BlockHeight = number;
23
21
  export type SortKey = string;
24
22
  export type Timestamp = number;
@@ -46,29 +44,9 @@ export type WriteParameters<Input> = WithSigner<Required<ReadParameters<Input>>>
46
44
  export type AoMessageResult = {
47
45
  id: string;
48
46
  };
49
- type Overwrite<T, U> = {
50
- [K in keyof T]: K extends keyof U ? U[K] : T[K];
51
- };
52
- export type JoinNetworkParams = Overwrite<GatewayConnectionSettings & GatewayStakingSettings & GatewayMetadata, {
53
- minDelegatedStake: number | mIOToken;
54
- }>;
55
- export type UpdateGatewaySettingsParamsBase = {
56
- allowDelegatedStaking?: boolean;
57
- delegateRewardShareRatio?: number;
58
- fqdn?: string;
59
- label?: string;
60
- minDelegatedStake?: number | mIOToken;
61
- note?: string;
62
- port?: number;
63
- properties?: string;
64
- protocol?: AllowedProtocols;
65
- autoStake?: boolean;
66
- observerAddress?: WalletAddress;
67
- };
68
47
  export type AtLeastOne<T, U = {
69
48
  [K in keyof T]-?: Record<K, T[K]>;
70
49
  }> = Partial<T> & U[keyof U];
71
- export type UpdateGatewaySettingsParams = AtLeastOne<UpdateGatewaySettingsParamsBase>;
72
50
  export interface HTTPClient {
73
51
  get<I, K>({ endpoint, signal, headers, allowedStatuses, params, }: {
74
52
  endpoint: string;
@@ -87,4 +65,3 @@ export interface AoClient {
87
65
  unmonitor: typeof unmonitor;
88
66
  dryrun: typeof dryrun;
89
67
  }
90
- export {};
package/lib/types/io.d.ts CHANGED
@@ -15,16 +15,8 @@
15
15
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  */
17
17
  import { AOProcess } from './common/index.js';
18
- import { ANTRecord, ArNSReservedNameData, EpochDistributionData, EpochObservations, GatewayDelegate, GatewaySettings, RegistrationType, VaultData, WeightedObserver } from './contract-state.js';
19
- import { AoSigner, mIOToken } from './token.js';
20
- import { AoMessageResult, BlockHeight, JoinNetworkParams, ProcessId, Timestamp, TransactionId, UpdateGatewaySettingsParams, WalletAddress, WriteOptions } from './types.js';
21
- export declare function isProcessConfiguration(config: object): config is {
22
- process: AOProcess;
23
- };
24
- export declare function isProcessIdConfiguration(config: object): config is {
25
- processId: string;
26
- };
27
- export declare function isLeasedArNSRecord(record: AoArNSNameData): record is AoArNSLeaseData;
18
+ import { mIOToken } from './token.js';
19
+ import { AoMessageResult, AoSigner, AtLeastOne, BlockHeight, ProcessId, Timestamp, TransactionId, WalletAddress, WriteOptions } from './types.js';
28
20
  export type PaginationParams = {
29
21
  cursor?: string;
30
22
  limit?: number;
@@ -49,6 +41,156 @@ export type EpochInput = {
49
41
  } | {
50
42
  timestamp: Timestamp;
51
43
  } | undefined;
44
+ export type AoBalances = Record<WalletAddress, number>;
45
+ export type AoFees = Record<string, number>;
46
+ export type AoObservations = Record<number, AoEpochObservationData>;
47
+ export type AoEpochIndex = number;
48
+ export interface AoIOState {
49
+ GatewayRegistry: Record<WalletAddress, AoGateway>;
50
+ Epochs: Record<AoEpochIndex, AoEpochData>;
51
+ NameRegistry: {
52
+ records: Record<string, AoArNSNameData>;
53
+ reserved: Record<string, AoArNSReservedNameData>;
54
+ };
55
+ Balances: Record<WalletAddress, number>;
56
+ Vaults: Record<WalletAddress, AoVaultData>;
57
+ Ticker: string;
58
+ Name: string;
59
+ Logo: string;
60
+ }
61
+ export type AoEpochObservationData = {
62
+ failureSummaries: Record<WalletAddress, WalletAddress[]>;
63
+ reports: Record<WalletAddress, TransactionId>;
64
+ };
65
+ export type AoVaultData = {
66
+ balance: number;
67
+ locked: number;
68
+ endTimestamp: Timestamp;
69
+ };
70
+ export type AoEpochDistributionData = {
71
+ rewards: Record<WalletAddress, number>;
72
+ distributedTimestamp: Timestamp;
73
+ totalDistributedRewards: number;
74
+ totalEligibleRewards: number;
75
+ };
76
+ export type AoArNSReservedNameData = {
77
+ target?: string;
78
+ endTimestamp?: number;
79
+ };
80
+ export type AoArNSNameData = AoArNSPermabuyData | AoArNSLeaseData;
81
+ export type AoArNSNameDataWithName = AoArNSNameData & {
82
+ name: string;
83
+ };
84
+ export type AoArNSBaseNameData = {
85
+ processId: ProcessId;
86
+ startTimestamp: number;
87
+ type: 'lease' | 'permabuy';
88
+ undernameLimit: number;
89
+ purchasePrice: number;
90
+ };
91
+ export type AoArNSPermabuyData = AoArNSBaseNameData & {
92
+ type: 'permabuy';
93
+ };
94
+ export type AoArNSLeaseData = AoArNSBaseNameData & {
95
+ type: 'lease';
96
+ endTimestamp: Timestamp;
97
+ };
98
+ export type AoEpochSettings = {
99
+ epochZeroStartTimestamp: Timestamp;
100
+ durationMs: number;
101
+ prescribedNameCount: number;
102
+ rewardPercentage: number;
103
+ maxObservers: number;
104
+ distributionDelayMs: number;
105
+ };
106
+ export type AoEpochData = {
107
+ epochIndex: AoEpochIndex;
108
+ startHeight: BlockHeight;
109
+ observations: AoObservations;
110
+ prescribedObservers: AoWeightedObserver[];
111
+ startTimestamp: Timestamp;
112
+ endTimestamp: Timestamp;
113
+ distributionTimestamp: Timestamp;
114
+ distributions: AoEpochDistributionData;
115
+ };
116
+ export type AoGateway = {
117
+ settings: AoGatewaySettings;
118
+ stats: AoGatewayStats;
119
+ delegates: Record<WalletAddress, AoGatewayDelegate>;
120
+ totalDelegatedStake: number;
121
+ vaults: Record<WalletAddress, AoVaultData>;
122
+ startTimestamp: Timestamp;
123
+ endTimestamp: Timestamp;
124
+ observerAddress: WalletAddress;
125
+ operatorStake: number;
126
+ status: 'joined' | 'leaving';
127
+ weights: AoGatewayWeights;
128
+ };
129
+ export type AoGatewayStats = {
130
+ passedConsecutiveEpochs: number;
131
+ failedConsecutiveEpochs: number;
132
+ totalEpochParticipationCount: number;
133
+ passedEpochCount: number;
134
+ failedEpochCount: number;
135
+ observedEpochCount: number;
136
+ prescribedEpochCount: number;
137
+ };
138
+ export type AoWeightedObserver = {
139
+ gatewayAddress: WalletAddress;
140
+ observerAddress: WalletAddress;
141
+ stake: number;
142
+ startTimestamp: number;
143
+ } & AoGatewayWeights;
144
+ export type AoGatewayWeights = {
145
+ stakeWeight: number;
146
+ tenureWeight: number;
147
+ gatewayRewardRatioWeight: number;
148
+ observerRewardRatioWeight: number;
149
+ compositeWeight: number;
150
+ normalizedCompositeWeight: number;
151
+ };
152
+ export type AoGatewayWithAddress = AoGateway & {
153
+ gatewayAddress: WalletAddress;
154
+ };
155
+ export type AoGatewayDelegate = {
156
+ delegatedStake: number;
157
+ startTimestamp: Timestamp;
158
+ vaults: Record<WalletAddress, AoVaultData>;
159
+ };
160
+ export type AoGatewaySettings = {
161
+ allowDelegatedStaking: boolean;
162
+ delegateRewardShareRatio: number;
163
+ minDelegatedStake: number;
164
+ autoStake: boolean;
165
+ label: string;
166
+ note: string;
167
+ properties: string;
168
+ fqdn: string;
169
+ port: number;
170
+ protocol: 'https';
171
+ };
172
+ export type AoBalanceWithAddress = {
173
+ address: WalletAddress;
174
+ balance: number;
175
+ };
176
+ export type AoANTState = {
177
+ Name: string;
178
+ Ticker: string;
179
+ Denomination: number;
180
+ Owner: WalletAddress;
181
+ Controllers: WalletAddress[];
182
+ Records: Record<string, AoANTRecord>;
183
+ Balances: Record<WalletAddress, number>;
184
+ Logo: string;
185
+ TotalSupply: number;
186
+ Initialized: boolean;
187
+ };
188
+ export type AoANTRecord = {
189
+ transactionId: string;
190
+ ttlSeconds: number;
191
+ };
192
+ export type AoJoinNetworkParams = Pick<AoGateway, 'operatorStake' | 'observerAddress'> & Partial<AoGatewaySettings>;
193
+ export type AoUpdateGatewaySettingsParams = AtLeastOne<AoJoinNetworkParams>;
52
194
  export interface AOContract {
53
195
  read<K>({ tags, retries, }: {
54
196
  tags?: {
@@ -93,13 +235,13 @@ export interface AoIORead {
93
235
  getArNSReservedNames(): Promise<Record<string, AoArNSReservedNameData> | Record<string, never>>;
94
236
  getArNSReservedName({ name, }: {
95
237
  name: string;
96
- }): Promise<ArNSReservedNameData | undefined>;
238
+ }): Promise<AoArNSReservedNameData | undefined>;
97
239
  getEpoch(epoch?: EpochInput): Promise<AoEpochData>;
98
240
  getCurrentEpoch(): Promise<AoEpochData>;
99
- getPrescribedObservers(epoch?: EpochInput): Promise<WeightedObserver[]>;
241
+ getPrescribedObservers(epoch?: EpochInput): Promise<AoWeightedObserver[]>;
100
242
  getPrescribedNames(epoch?: EpochInput): Promise<string[]>;
101
- getObservations(epoch?: EpochInput): Promise<EpochObservations>;
102
- getDistributions(epoch?: EpochInput): Promise<EpochDistributionData>;
243
+ getObservations(epoch?: EpochInput): Promise<AoEpochObservationData>;
244
+ getDistributions(epoch?: EpochInput): Promise<AoEpochDistributionData>;
103
245
  getTokenCost({ intent, purchaseType, years, name, quantity, }: {
104
246
  intent: 'Buy-Record' | 'Extend-Lease' | 'Increase-Undername-Limit';
105
247
  purchaseType?: 'permabuy' | 'lease';
@@ -113,12 +255,9 @@ export interface AoIOWrite extends AoIORead {
113
255
  target: WalletAddress;
114
256
  qty: number;
115
257
  }, options?: WriteOptions): Promise<AoMessageResult>;
116
- joinNetwork({ operatorStake, allowDelegatedStaking, delegateRewardShareRatio, fqdn, label, minDelegatedStake, note, port, properties, protocol, autoStake, observerAddress, }: Omit<JoinNetworkParams, 'observerWallet' | 'qty'> & {
117
- observerAddress: string;
118
- operatorStake: number | mIOToken;
119
- }, options?: WriteOptions): Promise<AoMessageResult>;
258
+ joinNetwork({ operatorStake, allowDelegatedStaking, delegateRewardShareRatio, fqdn, label, minDelegatedStake, note, port, properties, protocol, autoStake, observerAddress, }: AoJoinNetworkParams, options?: WriteOptions): Promise<AoMessageResult>;
120
259
  leaveNetwork(options?: WriteOptions): Promise<AoMessageResult>;
121
- updateGatewaySettings({ allowDelegatedStaking, delegateRewardShareRatio, fqdn, label, minDelegatedStake, note, port, properties, protocol, autoStake, observerAddress, }: UpdateGatewaySettingsParams, options?: WriteOptions): Promise<AoMessageResult>;
260
+ updateGatewaySettings({ allowDelegatedStaking, delegateRewardShareRatio, fqdn, label, minDelegatedStake, note, port, properties, protocol, autoStake, observerAddress, }: AoUpdateGatewaySettingsParams, options?: WriteOptions): Promise<AoMessageResult>;
122
261
  increaseOperatorStake(params: {
123
262
  increaseQty: number | mIOToken;
124
263
  }, options?: WriteOptions): Promise<AoMessageResult>;
@@ -163,8 +302,8 @@ export interface AoANTRead {
163
302
  }>;
164
303
  getRecord({ undername }: {
165
304
  undername: any;
166
- }): Promise<ANTRecord | undefined>;
167
- getRecords(): Promise<Record<string, ANTRecord>>;
305
+ }): Promise<AoANTRecord | undefined>;
306
+ getRecords(): Promise<Record<string, AoANTRecord>>;
168
307
  getOwner(): Promise<WalletAddress>;
169
308
  getControllers(): Promise<WalletAddress[]>;
170
309
  getTicker(): Promise<string>;
@@ -212,108 +351,10 @@ export interface AoANTRegistryWrite extends AoANTRegistryRead {
212
351
  processId: string;
213
352
  }): Promise<AoMessageResult>;
214
353
  }
215
- export interface AoIOState {
216
- GatewayRegistry: Record<WalletAddress, AoGateway>;
217
- Epochs: Record<AoEpochIndex, AoEpochData>;
218
- NameRegistry: {
219
- records: Record<string, AoArNSNameData>;
220
- reserved: Record<string, AoArNSReservedNameData>;
221
- };
222
- Balances: Record<WalletAddress, number>;
223
- Vaults: Record<WalletAddress, VaultData>;
224
- Ticker: string;
225
- Name: string;
226
- Logo: string;
227
- }
228
- export type AoEpochIndex = number;
229
- export type AoArNSReservedNameData = ArNSReservedNameData;
230
- export type AoArNSNameData = AoArNSPermabuyData | AoArNSLeaseData;
231
- export type AoArNSNameDataWithName = AoArNSNameData & {
232
- name: string;
233
- };
234
- export type AoArNSBaseNameData = {
235
- processId: ProcessId;
236
- startTimestamp: number;
237
- type: RegistrationType;
238
- undernameLimit: number;
239
- purchasePrice: number;
240
- };
241
- export type AoArNSPermabuyData = AoArNSBaseNameData & {
242
- type: 'permabuy';
243
- };
244
- export type AoArNSLeaseData = AoArNSBaseNameData & {
245
- type: 'lease';
246
- endTimestamp: number;
247
- };
248
- export type AoEpochSettings = {
249
- epochZeroStartTimestamp: Timestamp;
250
- durationMs: number;
251
- prescribedNameCount: number;
252
- rewardPercentage: number;
253
- maxObservers: number;
254
- distributionDelayMs: number;
255
- };
256
- export type AoEpochData = {
257
- epochIndex: AoEpochIndex;
258
- startHeight: BlockHeight;
259
- observations: EpochObservations;
260
- prescribedObservers: WeightedObserver[];
261
- startTimestamp: Timestamp;
262
- endTimestamp: Timestamp;
263
- distributionTimestamp: Timestamp;
264
- distributions: {
265
- rewards: Record<WalletAddress, number>;
266
- distributedTimestamp: Timestamp;
267
- totalDistributedRewards: number;
268
- totalEligibleRewards: number;
269
- };
270
- };
271
- export type AoGatewayStats = {
272
- passedConsecutiveEpochs: number;
273
- failedConsecutiveEpochs: number;
274
- totalEpochCount: number;
275
- passedEpochCount: number;
276
- failedEpochCount: number;
277
- observedEpochCount: number;
278
- prescribedEpochCount: number;
279
- };
280
- export type AoGatewayWeights = {
281
- compositeWeight: number;
282
- gatewayRewardRatioWeight: number;
283
- tenureWeight: number;
284
- observerRewardRatioWeight: number;
285
- normalizedCompositeWeight: number;
286
- stakeWeight: number;
287
- };
288
- export type AoGateway = {
289
- settings: GatewaySettings;
290
- stats: AoGatewayStats;
291
- delegates: Record<WalletAddress, GatewayDelegate>;
292
- totalDelegatedStake: number;
293
- vaults: Record<WalletAddress, VaultData>;
294
- startTimestamp: Timestamp;
295
- endTimestamp: Timestamp;
296
- observerAddress: WalletAddress;
297
- operatorStake: number;
298
- status: 'joined' | 'leaving';
299
- weights: AoGatewayWeights;
300
- };
301
- export type AoBalanceWithAddress = {
302
- address: WalletAddress;
303
- balance: number;
304
- };
305
- export type AoGatewayWithAddress = AoGateway & {
306
- gatewayAddress: WalletAddress;
354
+ export declare function isProcessConfiguration(config: object): config is {
355
+ process: AOProcess;
307
356
  };
308
- export type AoANTState = {
309
- Name: string;
310
- Ticker: string;
311
- Denomination: number;
312
- Owner: WalletAddress;
313
- Controllers: WalletAddress[];
314
- Records: Record<string, ANTRecord>;
315
- Balances: Record<WalletAddress, number>;
316
- Logo: string;
317
- TotalSupply: number;
318
- Initialized: boolean;
357
+ export declare function isProcessIdConfiguration(config: object): config is {
358
+ processId: string;
319
359
  };
360
+ export declare function isLeasedArNSRecord(record: AoArNSNameData): record is AoArNSLeaseData;
@@ -14,7 +14,6 @@
14
14
  * You should have received a copy of the GNU Affero General Public License
15
15
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  */
17
- export * from './contract-state.js';
18
17
  export * from './common.js';
19
18
  export * from './token.js';
20
19
  export * from './io.js';
@@ -1,12 +1,18 @@
1
- import { ANTState } from '../contract-state.js';
2
- import { AoClient, AoSigner, ContractSigner } from '../types.js';
1
+ import { AoANTRecord, AoClient, AoSigner, ContractSigner, WalletAddress } from '../types.js';
3
2
  export declare function spawnANT({ signer, module, luaCodeTxId, ao, scheduler, state, stateContractTxId, antRegistryId, }: {
4
3
  signer: AoSigner;
5
4
  module?: string;
6
5
  luaCodeTxId?: string;
7
6
  ao?: AoClient;
8
7
  scheduler?: string;
9
- state?: ANTState;
8
+ state?: {
9
+ owner: WalletAddress;
10
+ controllers: WalletAddress[];
11
+ name: string;
12
+ ticker: string;
13
+ records: Record<string, AoANTRecord>;
14
+ balances: Record<WalletAddress, number>;
15
+ };
10
16
  stateContractTxId?: string;
11
17
  antRegistryId?: string;
12
18
  }): Promise<string>;
@@ -14,4 +14,4 @@
14
14
  * You should have received a copy of the GNU Affero General Public License
15
15
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  */
17
- export declare const version = "2.1.0-alpha.7";
17
+ export declare const version = "2.1.0-alpha.10";