@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.
- package/bundles/web.bundle.min.js +60 -60
- package/lib/cjs/version.js +1 -1
- package/lib/esm/version.js +1 -1
- package/lib/types/common/io.d.ts +4 -4
- package/lib/types/common.d.ts +1 -0
- package/lib/types/io.d.ts +28 -19
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
package/lib/cjs/version.js
CHANGED
package/lib/esm/version.js
CHANGED
package/lib/types/common/io.d.ts
CHANGED
|
@@ -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 {
|
|
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<
|
|
50
|
-
getArNSRecords(): Promise<Record<string,
|
|
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;
|
package/lib/types/common.d.ts
CHANGED
|
@@ -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:
|
|
33
|
+
blockHeight: BlockHeight;
|
|
34
34
|
} | {
|
|
35
|
-
epochIndex:
|
|
35
|
+
epochIndex: AoEpochIndex;
|
|
36
36
|
} | {
|
|
37
|
-
timestamp:
|
|
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<
|
|
67
|
-
getArNSRecords(): Promise<Record<string,
|
|
68
|
-
getArNSReservedNames(): Promise<Record<string,
|
|
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<
|
|
125
|
-
Epochs: Record<
|
|
126
|
-
NameRegistry:
|
|
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:
|
|
134
|
-
startHeight:
|
|
142
|
+
epochIndex: AoEpochIndex;
|
|
143
|
+
startHeight: BlockHeight;
|
|
135
144
|
observations: EpochObservations;
|
|
136
145
|
prescribedObservers: WeightedObserver[];
|
|
137
|
-
startTimestamp:
|
|
138
|
-
endTimestamp:
|
|
139
|
-
distributionTimestamp:
|
|
146
|
+
startTimestamp: Timestamp;
|
|
147
|
+
endTimestamp: Timestamp;
|
|
148
|
+
distributionTimestamp: Timestamp;
|
|
140
149
|
distributions: {
|
|
141
150
|
rewards: Record<WalletAddress, number>;
|
|
142
|
-
distributedTimestamp:
|
|
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:
|
|
163
|
-
endTimestamp:
|
|
171
|
+
startTimestamp: Timestamp;
|
|
172
|
+
endTimestamp: Timestamp;
|
|
164
173
|
observerAddress: WalletAddress;
|
|
165
174
|
operatorStake: number;
|
|
166
175
|
status: 'joined' | 'leaving';
|
package/lib/types/version.d.ts
CHANGED