@ar.io/sdk 1.2.0-alpha.1 → 1.2.0-alpha.2

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.
@@ -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 = '1.2.0-alpha.1';
21
+ exports.version = '1.2.0-alpha.2';
@@ -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 = '1.2.0-alpha.1';
18
+ export const version = '1.2.0-alpha.2';
@@ -15,8 +15,8 @@
15
15
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  */
17
17
  import Arweave from 'arweave';
18
- import { ArNSNameData, ArNSReservedNameData, EpochDistributionData, EpochObservations, WeightedObserver } from '../contract-state.js';
19
- import { AoEpochData, AoGateway, AoIORead, AoIOWrite, EpochInput } from '../io.js';
18
+ import { ArNSReservedNameData, EpochDistributionData, EpochObservations, WeightedObserver } from '../contract-state.js';
19
+ import { AoArNSNameData, AoEpochData, AoGateway, AoIORead, AoIOWrite, EpochInput } from '../io.js';
20
20
  import { mIOToken } from '../token.js';
21
21
  import { AoMessageResult, ContractSigner, JoinNetworkParams, ProcessConfiguration, TransactionId, UpdateGatewaySettingsParams, WalletAddress, WithSigner, WriteOptions } from '../types.js';
22
22
  import { AOProcess } from './contracts/ao-process.js';
@@ -46,8 +46,8 @@ export declare class IOReadable implements AoIORead {
46
46
  getEpoch(epoch?: EpochInput): Promise<AoEpochData>;
47
47
  getArNSRecord({ name, }: {
48
48
  name: string;
49
- }): Promise<ArNSNameData | undefined>;
50
- getArNSRecords(): Promise<Record<string, ArNSNameData>>;
49
+ }): Promise<AoArNSNameData | undefined>;
50
+ getArNSRecords(): Promise<Record<string, AoArNSNameData>>;
51
51
  getArNSReservedNames(): Promise<Record<string, ArNSReservedNameData> | Record<string, never>>;
52
52
  getArNSReservedName({ name, }: {
53
53
  name: string;
@@ -22,6 +22,7 @@ import { ANTRecord, ANTState, AllowedProtocols, ArIOState, ArNSAuctionData, ArNS
22
22
  import { mIOToken } from './token.js';
23
23
  export type BlockHeight = number;
24
24
  export type SortKey = string;
25
+ export type Timestamp = number;
25
26
  export type WalletAddress = string;
26
27
  export type TransactionId = string;
27
28
  export type DataProtocolTransaction = Pick<GQLNodeInterface, 'id' | 'tags' | 'data'>;
package/lib/types/io.d.ts CHANGED
@@ -17,7 +17,7 @@
17
17
  import { AOProcess } from './common/index.js';
18
18
  import { ArNSNameData, ArNSReservedNameData, EpochDistributionData, EpochObservations, GatewayDelegate, GatewaySettings, VaultData, WeightedObserver } from './contract-state.js';
19
19
  import { mIOToken } from './token.js';
20
- import { AoMessageResult, ContractSigner, JoinNetworkParams, TransactionId, UpdateGatewaySettingsParams, WalletAddress, WriteOptions } from './types.js';
20
+ import { AoMessageResult, BlockHeight, ContractSigner, JoinNetworkParams, Timestamp, TransactionId, UpdateGatewaySettingsParams, WalletAddress, WriteOptions } from './types.js';
21
21
  export declare function isProcessConfiguration(config: object): config is {
22
22
  process: AOProcess;
23
23
  };
@@ -30,11 +30,11 @@ export type ProcessConfiguration = {
30
30
  processId?: string;
31
31
  };
32
32
  export type EpochInput = {
33
- blockHeight: number;
33
+ blockHeight: BlockHeight;
34
34
  } | {
35
- epochIndex: number;
35
+ epochIndex: AoEpochIndex;
36
36
  } | {
37
- timestamp: number;
37
+ timestamp: Timestamp;
38
38
  } | undefined;
39
39
  export interface AOContract {
40
40
  read<K>({ tags }: {
@@ -61,11 +61,11 @@ export interface AoIORead {
61
61
  address: WalletAddress;
62
62
  }): Promise<number>;
63
63
  getBalances(): Promise<Record<WalletAddress, number> | Record<string, never>>;
64
- getArNSRecord({ name }: {
64
+ getArNSRecord({ name, }: {
65
65
  name: string;
66
- }): Promise<ArNSNameData | undefined>;
67
- getArNSRecords(): Promise<Record<string, ArNSNameData> | Record<string, never>>;
68
- getArNSReservedNames(): Promise<Record<string, ArNSReservedNameData> | Record<string, never>>;
66
+ }): Promise<AoArNSNameData | undefined>;
67
+ getArNSRecords(): Promise<Record<string, AoArNSNameData> | Record<string, never>>;
68
+ getArNSReservedNames(): Promise<Record<string, AoArNSReservedNameData> | Record<string, never>>;
69
69
  getArNSReservedName({ name, }: {
70
70
  name: string;
71
71
  }): Promise<ArNSReservedNameData | undefined>;
@@ -121,25 +121,34 @@ export interface AoIOWrite extends AoIORead {
121
121
  }, options?: WriteOptions): Promise<AoMessageResult>;
122
122
  }
123
123
  export interface AoIOState {
124
- GatewayRegistry: Record<string, AoGateway>;
125
- Epochs: Record<number, AoEpochData>;
126
- NameRegistry: Record<string, ArNSNameData>;
124
+ GatewayRegistry: Record<WalletAddress, AoGateway>;
125
+ Epochs: Record<AoEpochIndex, AoEpochData>;
126
+ NameRegistry: {
127
+ records: Record<string, AoArNSNameData>;
128
+ reserved: Record<string, AoArNSReservedNameData>;
129
+ };
127
130
  Balances: Record<WalletAddress, number>;
128
131
  Vaults: Record<WalletAddress, VaultData>;
129
132
  Ticker: string;
130
133
  Name: string;
134
+ Logo: string;
131
135
  }
136
+ export type AoEpochIndex = number;
137
+ export type AoArNSReservedNameData = ArNSReservedNameData;
138
+ export type AoArNSNameData = Omit<ArNSNameData, 'contractTxId'> & {
139
+ processId: string;
140
+ };
132
141
  export type AoEpochData = {
133
- epochIndex: number;
134
- startHeight: number;
142
+ epochIndex: AoEpochIndex;
143
+ startHeight: BlockHeight;
135
144
  observations: EpochObservations;
136
145
  prescribedObservers: WeightedObserver[];
137
- startTimestamp: number;
138
- endTimestamp: number;
139
- distributionTimestamp: number;
146
+ startTimestamp: Timestamp;
147
+ endTimestamp: Timestamp;
148
+ distributionTimestamp: Timestamp;
140
149
  distributions: {
141
150
  rewards: Record<WalletAddress, number>;
142
- distributedTimestamp: number;
151
+ distributedTimestamp: Timestamp;
143
152
  totalDistributedRewards: number;
144
153
  totalEligibleRewards: number;
145
154
  };
@@ -159,8 +168,8 @@ export type AoGateway = {
159
168
  delegates: Record<WalletAddress, GatewayDelegate>;
160
169
  totalDelegatedStake: number;
161
170
  vaults: Record<WalletAddress, VaultData>;
162
- startTimestamp: number;
163
- endTimestamp: number;
171
+ startTimestamp: Timestamp;
172
+ endTimestamp: Timestamp;
164
173
  observerAddress: WalletAddress;
165
174
  operatorStake: number;
166
175
  status: 'joined' | 'leaving';
@@ -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 = "1.1.1-alpha.1";
17
+ export declare const version = "1.2.0-alpha.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ar.io/sdk",
3
- "version": "1.2.0-alpha.1",
3
+ "version": "1.2.0-alpha.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/ar-io/ar-io-sdk.git"