@ar.io/sdk 1.2.2 → 2.0.0-alpha.10
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/README.md +148 -60
- package/bundles/web.bundle.min.js +132 -331
- package/lib/cjs/common/ant.js +147 -206
- package/lib/cjs/common/contracts/ao-process.js +1 -1
- package/lib/cjs/common/http.js +1 -2
- package/lib/cjs/common/index.js +0 -5
- package/lib/cjs/common/io.js +39 -31
- package/lib/cjs/common/logger.js +31 -19
- package/lib/cjs/types.js +0 -1
- package/lib/cjs/utils/arweave.js +1 -15
- package/lib/cjs/utils/http-client.js +1 -1
- package/lib/cjs/utils/index.js +1 -2
- package/lib/cjs/utils/{graphql/processes.js → processes.js} +35 -10
- package/lib/cjs/version.js +1 -1
- package/lib/esm/common/ant.js +144 -203
- package/lib/esm/common/contracts/ao-process.js +2 -2
- package/lib/esm/common/http.js +2 -3
- package/lib/esm/common/index.js +0 -5
- package/lib/esm/common/io.js +39 -28
- package/lib/esm/common/logger.js +29 -14
- package/lib/esm/types.js +0 -1
- package/lib/esm/utils/arweave.js +0 -12
- package/lib/esm/utils/http-client.js +2 -2
- package/lib/esm/utils/index.js +1 -2
- package/lib/esm/utils/{graphql/processes.js → processes.js} +33 -9
- package/lib/esm/version.js +1 -1
- package/lib/types/common/ant.d.ts +53 -175
- package/lib/types/common/contracts/ao-process.d.ts +2 -2
- package/lib/types/common/http.d.ts +3 -2
- package/lib/types/common/index.d.ts +0 -4
- package/lib/types/common/io.d.ts +5 -4
- package/lib/types/common/logger.d.ts +10 -3
- package/lib/types/common.d.ts +1 -145
- package/lib/types/io.d.ts +28 -3
- package/lib/types/types.d.ts +0 -1
- package/lib/types/utils/arweave.d.ts +0 -5
- package/lib/types/utils/http-client.d.ts +2 -2
- package/lib/types/utils/index.d.ts +1 -2
- package/lib/types/utils/{graphql/processes.d.ts → processes.d.ts} +4 -1
- package/lib/types/version.d.ts +1 -1
- package/package.json +8 -13
- package/lib/cjs/arns-service.js +0 -2
- package/lib/cjs/common/ant-ao.js +0 -297
- package/lib/cjs/common/ar-io.js +0 -741
- package/lib/cjs/common/contracts/remote-contract.js +0 -55
- package/lib/cjs/common/contracts/warp-contract.js +0 -176
- package/lib/cjs/common/warp.js +0 -25
- package/lib/cjs/utils/graphql/index.js +0 -34
- package/lib/cjs/utils/graphql/smartweave.js +0 -309
- package/lib/cjs/utils/smartweave.js +0 -58
- package/lib/esm/arns-service.js +0 -1
- package/lib/esm/common/ant-ao.js +0 -292
- package/lib/esm/common/ar-io.js +0 -735
- package/lib/esm/common/contracts/remote-contract.js +0 -51
- package/lib/esm/common/contracts/warp-contract.js +0 -172
- package/lib/esm/common/warp.js +0 -22
- package/lib/esm/utils/graphql/index.js +0 -18
- package/lib/esm/utils/graphql/smartweave.js +0 -303
- package/lib/esm/utils/smartweave.js +0 -50
- package/lib/types/arns-service.d.ts +0 -23
- package/lib/types/common/ant-ao.d.ts +0 -194
- package/lib/types/common/ar-io.d.ts +0 -551
- package/lib/types/common/contracts/remote-contract.d.ts +0 -38
- package/lib/types/common/contracts/warp-contract.d.ts +0 -43
- package/lib/types/common/warp.d.ts +0 -1
- package/lib/types/utils/graphql/index.d.ts +0 -18
- package/lib/types/utils/graphql/smartweave.d.ts +0 -47
- package/lib/types/utils/smartweave.d.ts +0 -41
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export interface ILogger {
|
|
2
|
+
setLogLevel: (level: 'info' | 'debug' | 'error' | 'warn' | 'none') => void;
|
|
3
|
+
info: (message: string, ...args: unknown[]) => void;
|
|
4
|
+
warn: (message: string, ...args: unknown[]) => void;
|
|
5
|
+
error: (message: string, ...args: unknown[]) => void;
|
|
6
|
+
debug: (message: string, ...args: unknown[]) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare class Logger implements ILogger {
|
|
3
9
|
private logger;
|
|
4
10
|
private silent;
|
|
11
|
+
static default: Logger;
|
|
5
12
|
constructor({ level, }?: {
|
|
6
13
|
level?: 'info' | 'debug' | 'error' | 'warn' | 'none';
|
|
7
14
|
});
|
|
@@ -9,5 +16,5 @@ export declare class DefaultLogger implements Logger {
|
|
|
9
16
|
warn(message: string, ...args: unknown[]): void;
|
|
10
17
|
error(message: string, ...args: unknown[]): void;
|
|
11
18
|
debug(message: string, ...args: unknown[]): void;
|
|
12
|
-
setLogLevel(level:
|
|
19
|
+
setLogLevel(level: 'info' | 'debug' | 'error' | 'warn' | 'none'): void;
|
|
13
20
|
}
|
package/lib/types/common.d.ts
CHANGED
|
@@ -17,9 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import { dryrun, message, monitor, result, results, spawn, unmonitor } from '@permaweb/aoconnect';
|
|
19
19
|
import { ArconnectSigner, ArweaveSigner } from 'arbundles';
|
|
20
|
-
import {
|
|
21
|
-
import { RemoteContract, WarpContract } from './common/index.js';
|
|
22
|
-
import { ANTRecord, ANTState, AllowedProtocols, ArIOState, ArNSAuctionData, ArNSNameData, ArNSReservedNameData, DENOMINATIONS, EpochDistributionData, Gateway, GatewayConnectionSettings, GatewayMetadata, GatewayStakingSettings, IOContractInteractionsWithIOFees, Observations, RegistrationType, WeightedObserver } from './contract-state.js';
|
|
20
|
+
import { AllowedProtocols, GatewayConnectionSettings, GatewayMetadata, GatewayStakingSettings } from './contract-state.js';
|
|
23
21
|
import { mIOToken } from './token.js';
|
|
24
22
|
export type BlockHeight = number;
|
|
25
23
|
export type SortKey = string;
|
|
@@ -27,7 +25,6 @@ export type Timestamp = number;
|
|
|
27
25
|
export type WalletAddress = string;
|
|
28
26
|
export type TransactionId = string;
|
|
29
27
|
export type ProcessId = string;
|
|
30
|
-
export type DataProtocolTransaction = Pick<GQLNodeInterface, 'id' | 'tags' | 'data'>;
|
|
31
28
|
export type ContractSigner = ArweaveSigner | ArconnectSigner;
|
|
32
29
|
export type WithSigner<T = NonNullable<unknown>> = {
|
|
33
30
|
signer: ContractSigner;
|
|
@@ -35,21 +32,6 @@ export type WithSigner<T = NonNullable<unknown>> = {
|
|
|
35
32
|
export type OptionalSigner<T = NonNullable<unknown>> = {
|
|
36
33
|
signer?: ContractSigner | undefined;
|
|
37
34
|
} & T;
|
|
38
|
-
export type ContractConfiguration<T = NonNullable<unknown>> = {
|
|
39
|
-
contract?: WarpContract<T> | RemoteContract<T>;
|
|
40
|
-
} | {
|
|
41
|
-
contractTxId?: string;
|
|
42
|
-
};
|
|
43
|
-
export type EvaluationOptions = {
|
|
44
|
-
evalTo?: {
|
|
45
|
-
sortKey: SortKey;
|
|
46
|
-
} | {
|
|
47
|
-
blockHeight: BlockHeight;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
export type EvaluationParameters<T = NonNullable<unknown>> = {
|
|
51
|
-
evaluationOptions?: EvaluationOptions | Record<string, never> | undefined;
|
|
52
|
-
} & T;
|
|
53
35
|
export type ReadParameters<Input> = {
|
|
54
36
|
functionName: string;
|
|
55
37
|
inputs?: Input;
|
|
@@ -61,89 +43,9 @@ export type WriteOptions = {
|
|
|
61
43
|
}[];
|
|
62
44
|
};
|
|
63
45
|
export type WriteParameters<Input> = WithSigner<Required<ReadParameters<Input>>>;
|
|
64
|
-
export interface BaseContract<T> {
|
|
65
|
-
getState(params: EvaluationParameters): Promise<T>;
|
|
66
|
-
}
|
|
67
|
-
export interface ReadContract {
|
|
68
|
-
readInteraction<Input, State>({ functionName, inputs, evaluationOptions, }: EvaluationParameters<ReadParameters<Input>>): Promise<State>;
|
|
69
|
-
}
|
|
70
|
-
export interface WriteContract {
|
|
71
|
-
writeInteraction<Input>({ functionName, inputs }: WriteParameters<Input>, options?: WriteOptions): Promise<WriteInteractionResult>;
|
|
72
|
-
}
|
|
73
|
-
export interface ArIOReadContract extends BaseContract<ArIOState> {
|
|
74
|
-
getGateway({ address, evaluationOptions, }: EvaluationParameters<{
|
|
75
|
-
address: WalletAddress;
|
|
76
|
-
}>): Promise<Gateway | undefined>;
|
|
77
|
-
getGateways(params?: EvaluationParameters): Promise<Record<WalletAddress, Gateway> | Record<string, never>>;
|
|
78
|
-
getBalance(params: {
|
|
79
|
-
address: WalletAddress;
|
|
80
|
-
} & EvaluationOptions): Promise<number>;
|
|
81
|
-
getBalances(params?: EvaluationParameters): Promise<Record<WalletAddress, number> | Record<string, never>>;
|
|
82
|
-
getArNSRecord({ domain, evaluationOptions, }: EvaluationParameters<{
|
|
83
|
-
domain: string;
|
|
84
|
-
}>): Promise<ArNSNameData | undefined>;
|
|
85
|
-
getArNSRecords(params?: EvaluationParameters): Promise<Record<string, ArNSNameData> | Record<string, never>>;
|
|
86
|
-
getArNSReservedNames(params?: EvaluationParameters): Promise<Record<string, ArNSReservedNameData> | Record<string, never>>;
|
|
87
|
-
getArNSReservedName({ domain, evaluationOptions, }: EvaluationParameters<{
|
|
88
|
-
domain: string;
|
|
89
|
-
}>): Promise<ArNSReservedNameData | undefined>;
|
|
90
|
-
getEpoch({ blockHeight, evaluationOptions, }: EvaluationParameters<{
|
|
91
|
-
blockHeight: number;
|
|
92
|
-
}>): Promise<EpochDistributionData>;
|
|
93
|
-
getCurrentEpoch(params?: EvaluationParameters): Promise<EpochDistributionData>;
|
|
94
|
-
getPrescribedObservers(params?: EvaluationParameters): Promise<WeightedObserver[]>;
|
|
95
|
-
getObservations(params?: EvaluationParameters): Promise<Observations>;
|
|
96
|
-
getDistributions(params?: EvaluationParameters): Promise<EpochDistributionData>;
|
|
97
|
-
getAuctions(params?: EvaluationParameters): Promise<Record<string, ArNSAuctionData>>;
|
|
98
|
-
getAuction({ domain, type, evaluationOptions, }: EvaluationParameters<{
|
|
99
|
-
domain: string;
|
|
100
|
-
type?: RegistrationType;
|
|
101
|
-
}>): Promise<ArNSAuctionData>;
|
|
102
|
-
getPriceForInteraction({ interactionName, payload, evaluationOptions, }: EvaluationParameters<{
|
|
103
|
-
interactionName: IOContractInteractionsWithIOFees;
|
|
104
|
-
payload: object;
|
|
105
|
-
}>): Promise<number>;
|
|
106
|
-
}
|
|
107
|
-
export interface ArIOWriteContract extends ArIOReadContract {
|
|
108
|
-
transfer({ target, qty, denomination, }: {
|
|
109
|
-
target: WalletAddress;
|
|
110
|
-
qty: number;
|
|
111
|
-
denomination: DENOMINATIONS;
|
|
112
|
-
}, options?: WriteOptions): Promise<WriteInteractionResult>;
|
|
113
|
-
joinNetwork({ qty, allowDelegatedStaking, delegateRewardShareRatio, fqdn, label, minDelegatedStake, note, port, properties, protocol, autoStake, observerWallet, }: JoinNetworkParams, options?: WriteOptions): Promise<WriteInteractionResult>;
|
|
114
|
-
updateGatewaySettings({ allowDelegatedStaking, delegateRewardShareRatio, fqdn, label, minDelegatedStake, note, port, properties, protocol, autoStake, observerWallet, }: UpdateGatewaySettingsParams, options?: WriteOptions): Promise<WriteInteractionResult>;
|
|
115
|
-
increaseOperatorStake(params: {
|
|
116
|
-
qty: number | mIOToken;
|
|
117
|
-
}, options?: WriteOptions): Promise<WriteInteractionResult>;
|
|
118
|
-
decreaseOperatorStake(params: {
|
|
119
|
-
qty: number | mIOToken;
|
|
120
|
-
}, options?: WriteOptions): Promise<WriteInteractionResult>;
|
|
121
|
-
increaseDelegateStake(params: {
|
|
122
|
-
target: WalletAddress;
|
|
123
|
-
qty: number | mIOToken;
|
|
124
|
-
}, options?: WriteOptions): Promise<WriteInteractionResult>;
|
|
125
|
-
decreaseDelegateStake(params: {
|
|
126
|
-
target: WalletAddress;
|
|
127
|
-
qty: number | mIOToken;
|
|
128
|
-
}, options?: WriteOptions): Promise<WriteInteractionResult>;
|
|
129
|
-
saveObservations(params: {
|
|
130
|
-
reportTxId: TransactionId;
|
|
131
|
-
failedGateways: WalletAddress[];
|
|
132
|
-
}, options?: WriteOptions): Promise<WriteInteractionResult>;
|
|
133
|
-
extendLease(params: {
|
|
134
|
-
domain: string;
|
|
135
|
-
years: number;
|
|
136
|
-
}, options?: WriteOptions): Promise<WriteInteractionResult>;
|
|
137
|
-
increaseUndernameLimit(params: {
|
|
138
|
-
domain: string;
|
|
139
|
-
qty: number;
|
|
140
|
-
}, options?: WriteOptions): Promise<WriteInteractionResult>;
|
|
141
|
-
}
|
|
142
46
|
export type AoMessageResult = {
|
|
143
47
|
id: string;
|
|
144
48
|
};
|
|
145
|
-
export type SmartWeaveInteractionResult = Transaction;
|
|
146
|
-
export type WriteInteractionResult = SmartWeaveInteractionResult;
|
|
147
49
|
type Overwrite<T, U> = {
|
|
148
50
|
[K in keyof T]: K extends keyof U ? U[K] : T[K];
|
|
149
51
|
};
|
|
@@ -170,52 +72,6 @@ export type AtLeastOne<T, U = {
|
|
|
170
72
|
[K in keyof T]-?: Record<K, T[K]>;
|
|
171
73
|
}> = Partial<T> & U[keyof U];
|
|
172
74
|
export type UpdateGatewaySettingsParams = AtLeastOne<UpdateGatewaySettingsParamsBase>;
|
|
173
|
-
export interface ANTReadContract extends BaseContract<ANTState> {
|
|
174
|
-
getRecord({ domain, evaluationOptions, }: EvaluationParameters<{
|
|
175
|
-
domain: string;
|
|
176
|
-
}>): Promise<ANTRecord>;
|
|
177
|
-
getRecords(params?: EvaluationParameters): Promise<Record<string, ANTRecord>>;
|
|
178
|
-
getOwner(params?: EvaluationParameters): Promise<string>;
|
|
179
|
-
getControllers(params?: EvaluationParameters): Promise<string[]>;
|
|
180
|
-
getTicker(params?: EvaluationParameters): Promise<string>;
|
|
181
|
-
getName(params?: EvaluationParameters): Promise<string>;
|
|
182
|
-
getBalance({ address, evaluationOptions, }: EvaluationParameters<{
|
|
183
|
-
address: string;
|
|
184
|
-
}>): Promise<number>;
|
|
185
|
-
getBalances(params?: EvaluationParameters): Promise<Record<string, number>>;
|
|
186
|
-
}
|
|
187
|
-
export interface ANTWriteContract {
|
|
188
|
-
transfer({ target, }: {
|
|
189
|
-
target: WalletAddress;
|
|
190
|
-
}, options?: WriteOptions): Promise<WriteInteractionResult>;
|
|
191
|
-
setController({ controller, }: {
|
|
192
|
-
controller: WalletAddress;
|
|
193
|
-
}, options?: WriteOptions): Promise<WriteInteractionResult>;
|
|
194
|
-
removeController({ controller, }: {
|
|
195
|
-
controller: WalletAddress;
|
|
196
|
-
}, options?: WriteOptions): Promise<WriteInteractionResult>;
|
|
197
|
-
setRecord({ subDomain, transactionId, ttlSeconds, }: {
|
|
198
|
-
subDomain: string;
|
|
199
|
-
transactionId: string;
|
|
200
|
-
ttlSeconds: number;
|
|
201
|
-
}, options?: WriteOptions): Promise<WriteInteractionResult>;
|
|
202
|
-
removeRecord({ subDomain, }: {
|
|
203
|
-
subDomain: string;
|
|
204
|
-
}, options?: WriteOptions): Promise<WriteInteractionResult>;
|
|
205
|
-
setTicker({ ticker }: {
|
|
206
|
-
ticker: string;
|
|
207
|
-
}, options?: WriteOptions): Promise<WriteInteractionResult>;
|
|
208
|
-
setName({ name }: {
|
|
209
|
-
name: string;
|
|
210
|
-
}, options?: WriteOptions): Promise<WriteInteractionResult>;
|
|
211
|
-
}
|
|
212
|
-
export interface Logger {
|
|
213
|
-
setLogLevel: (level: string) => void;
|
|
214
|
-
info: (message: string, ...args: unknown[]) => void;
|
|
215
|
-
warn: (message: string, ...args: unknown[]) => void;
|
|
216
|
-
error: (message: string, ...args: unknown[]) => void;
|
|
217
|
-
debug: (message: string, ...args: unknown[]) => void;
|
|
218
|
-
}
|
|
219
75
|
export interface HTTPClient {
|
|
220
76
|
get<I, K>({ endpoint, signal, headers, allowedStatuses, params, }: {
|
|
221
77
|
endpoint: string;
|
package/lib/types/io.d.ts
CHANGED
|
@@ -25,6 +25,20 @@ export declare function isProcessIdConfiguration(config: object): config is {
|
|
|
25
25
|
processId: string;
|
|
26
26
|
};
|
|
27
27
|
export declare function isLeasedArNSRecord(record: AoArNSNameData): record is AoArNSLeaseData;
|
|
28
|
+
export type PaginationParams = {
|
|
29
|
+
cursor?: string;
|
|
30
|
+
limit?: number;
|
|
31
|
+
sortBy?: string;
|
|
32
|
+
sortOrder?: 'asc' | 'desc';
|
|
33
|
+
};
|
|
34
|
+
export type PaginationResult<T> = {
|
|
35
|
+
items: T[];
|
|
36
|
+
nextCursor: string | undefined;
|
|
37
|
+
totalItems: number;
|
|
38
|
+
sortBy: keyof T;
|
|
39
|
+
sortOrder: 'asc' | 'desc';
|
|
40
|
+
hasMore: boolean;
|
|
41
|
+
};
|
|
28
42
|
export type ProcessConfiguration = {
|
|
29
43
|
process?: AOProcess;
|
|
30
44
|
} | {
|
|
@@ -66,15 +80,15 @@ export interface AoIORead {
|
|
|
66
80
|
getGateway({ address, }: {
|
|
67
81
|
address: WalletAddress;
|
|
68
82
|
}): Promise<AoGateway | undefined>;
|
|
69
|
-
getGateways(): Promise<
|
|
83
|
+
getGateways(params?: PaginationParams): Promise<PaginationResult<AoGatewayWithAddress>>;
|
|
70
84
|
getBalance(params: {
|
|
71
85
|
address: WalletAddress;
|
|
72
86
|
}): Promise<number>;
|
|
73
|
-
getBalances(): Promise<
|
|
87
|
+
getBalances(params?: PaginationParams): Promise<PaginationResult<AoBalanceWithAddress>>;
|
|
74
88
|
getArNSRecord({ name, }: {
|
|
75
89
|
name: string;
|
|
76
90
|
}): Promise<AoArNSNameData | undefined>;
|
|
77
|
-
getArNSRecords(): Promise<
|
|
91
|
+
getArNSRecords(params?: PaginationParams): Promise<PaginationResult<AoArNSNameDataWithName>>;
|
|
78
92
|
getArNSReservedNames(): Promise<Record<string, AoArNSReservedNameData> | Record<string, never>>;
|
|
79
93
|
getArNSReservedName({ name, }: {
|
|
80
94
|
name: string;
|
|
@@ -102,6 +116,7 @@ export interface AoIOWrite extends AoIORead {
|
|
|
102
116
|
observerAddress: string;
|
|
103
117
|
operatorStake: number | mIOToken;
|
|
104
118
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
119
|
+
leaveNetwork(options?: WriteOptions): Promise<AoMessageResult>;
|
|
105
120
|
updateGatewaySettings({ allowDelegatedStaking, delegateRewardShareRatio, fqdn, label, minDelegatedStake, note, port, properties, protocol, autoStake, observerAddress, }: Omit<UpdateGatewaySettingsParams, 'observerWallet'> & {
|
|
106
121
|
observerAddress?: WalletAddress;
|
|
107
122
|
}, options?: WriteOptions): Promise<AoMessageResult>;
|
|
@@ -200,6 +215,9 @@ export interface AoIOState {
|
|
|
200
215
|
export type AoEpochIndex = number;
|
|
201
216
|
export type AoArNSReservedNameData = ArNSReservedNameData;
|
|
202
217
|
export type AoArNSNameData = AoArNSPermabuyData | AoArNSLeaseData;
|
|
218
|
+
export type AoArNSNameDataWithName = AoArNSNameData & {
|
|
219
|
+
name: string;
|
|
220
|
+
};
|
|
203
221
|
export type AoArNSBaseNameData = {
|
|
204
222
|
processId: ProcessId;
|
|
205
223
|
startTimestamp: number;
|
|
@@ -258,6 +276,13 @@ export type AoGateway = {
|
|
|
258
276
|
operatorStake: number;
|
|
259
277
|
status: 'joined' | 'leaving';
|
|
260
278
|
};
|
|
279
|
+
export type AoBalanceWithAddress = {
|
|
280
|
+
address: WalletAddress;
|
|
281
|
+
balance: number;
|
|
282
|
+
};
|
|
283
|
+
export type AoGatewayWithAddress = AoGateway & {
|
|
284
|
+
gatewayAddress: WalletAddress;
|
|
285
|
+
};
|
|
261
286
|
export type AoANTState = {
|
|
262
287
|
Name: string;
|
|
263
288
|
Ticker: string;
|
package/lib/types/types.d.ts
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 './arns-service.js';
|
|
18
17
|
export * from './contract-state.js';
|
|
19
18
|
export * from './common.js';
|
|
20
19
|
export * from './token.js';
|
|
@@ -14,11 +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
|
-
import { Tag, Transaction } from 'warp-contracts';
|
|
18
17
|
import { BlockHeight } from '../common.js';
|
|
19
18
|
export declare const validateArweaveId: (id: string) => boolean;
|
|
20
19
|
export declare function isBlockHeight(height: string | number): height is BlockHeight;
|
|
21
|
-
export declare const isTransaction: (tx: object) => tx is Transaction;
|
|
22
|
-
export declare function tagsToObject(tags: Tag[]): {
|
|
23
|
-
[x: string]: string;
|
|
24
|
-
};
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
18
18
|
import { IAxiosRetryConfig } from 'axios-retry';
|
|
19
|
-
import {
|
|
19
|
+
import { ILogger } from '../common/logger.js';
|
|
20
20
|
export interface AxiosInstanceParameters {
|
|
21
21
|
axiosConfig?: Omit<AxiosRequestConfig, 'validateStatus'>;
|
|
22
22
|
retryConfig?: IAxiosRetryConfig;
|
|
23
|
-
logger?:
|
|
23
|
+
logger?: ILogger;
|
|
24
24
|
}
|
|
25
25
|
export declare const createAxiosInstance: ({ axiosConfig, logger, retryConfig, }?: AxiosInstanceParameters) => AxiosInstance;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
16
|
*/
|
|
17
17
|
import { EventEmitter } from 'eventemitter3';
|
|
18
|
-
import { AoIORead, ProcessId, WalletAddress } from '
|
|
18
|
+
import { AoArNSNameData, AoIORead, ProcessId, WalletAddress } from '../types.js';
|
|
19
19
|
export declare const getANTProcessesOwnedByWallet: ({ address, contract, }: {
|
|
20
20
|
address: WalletAddress;
|
|
21
21
|
contract?: AoIORead;
|
|
@@ -33,3 +33,6 @@ export declare class ArNSEventEmitter extends EventEmitter {
|
|
|
33
33
|
address: WalletAddress;
|
|
34
34
|
}): Promise<void>;
|
|
35
35
|
}
|
|
36
|
+
export declare const fetchAllArNSRecords: ({ contract, }: {
|
|
37
|
+
contract?: AoIORead;
|
|
38
|
+
}) => Promise<Record<string, AoArNSNameData>>;
|
package/lib/types/version.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ar.io/sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-alpha.10",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/ar-io/ar-io-sdk.git"
|
|
@@ -33,8 +33,6 @@
|
|
|
33
33
|
"arweave",
|
|
34
34
|
"ar",
|
|
35
35
|
"blockchain",
|
|
36
|
-
"warp",
|
|
37
|
-
"contracts",
|
|
38
36
|
"ar.io",
|
|
39
37
|
"ao"
|
|
40
38
|
],
|
|
@@ -51,8 +49,8 @@
|
|
|
51
49
|
"types": "./lib/types/node/index.d.ts"
|
|
52
50
|
},
|
|
53
51
|
"./web": {
|
|
54
|
-
"import": "./
|
|
55
|
-
"require": "./
|
|
52
|
+
"import": "./lib/esm/web/index.js",
|
|
53
|
+
"require": "./lib/cjs/web/index.js",
|
|
56
54
|
"types": "./lib/types/web/index.d.ts",
|
|
57
55
|
"browser": "./bundles/web.bundle.min.js"
|
|
58
56
|
}
|
|
@@ -67,19 +65,17 @@
|
|
|
67
65
|
"lint:fix": "eslint src --fix",
|
|
68
66
|
"format": "prettier --check .",
|
|
69
67
|
"format:fix": "prettier --write .",
|
|
70
|
-
"test": "yarn test:unit && yarn test:
|
|
68
|
+
"test": "yarn test:unit && yarn test:e2e",
|
|
71
69
|
"test:cjs": "cd ./tests/e2e/cjs && yarn && yarn test",
|
|
72
70
|
"test:esm": "cd ./tests/e2e/esm && yarn && yarn test",
|
|
73
71
|
"test:web": "cd ./tests/e2e/web && yarn && yarn test",
|
|
74
72
|
"test:unit": "jest --config=jest.config.mjs",
|
|
75
73
|
"test:link": "yarn build && yarn link",
|
|
76
74
|
"test:e2e": "yarn test:link && yarn test:cjs && yarn test:esm && yarn test:web",
|
|
77
|
-
"test:integration": "jest --config=jest.integration.config.mjs --runInBand",
|
|
78
|
-
"test:docker": "docker-compose up --exit-code-from test-runner --build",
|
|
79
75
|
"prepare": "husky install",
|
|
80
76
|
"example:esm": "cd examples/esm && yarn && node index.mjs",
|
|
81
|
-
"example:cjs": "cd examples/cjs && yarn && node index.cjs",
|
|
82
|
-
"example:web": "yarn build:web && http-server --port 8080 --host -o examples/web"
|
|
77
|
+
"example:cjs": "yarn test:link && cd examples/cjs && yarn && node index.cjs",
|
|
78
|
+
"example:web": "yarn test:link && build:web && http-server --port 8080 --host -o examples/web"
|
|
83
79
|
},
|
|
84
80
|
"devDependencies": {
|
|
85
81
|
"@commitlint/cli": "^17.1.2",
|
|
@@ -119,7 +115,7 @@
|
|
|
119
115
|
"ts-jest": "^29.1.2",
|
|
120
116
|
"ts-node": "^10.9.1",
|
|
121
117
|
"typescript": "^5.1.6",
|
|
122
|
-
"
|
|
118
|
+
"vite-plugin-node-polyfills": "^0.22.0"
|
|
123
119
|
},
|
|
124
120
|
"dependencies": {
|
|
125
121
|
"@permaweb/aoconnect": "^0.0.55",
|
|
@@ -127,10 +123,9 @@
|
|
|
127
123
|
"arweave": "1.14.4",
|
|
128
124
|
"axios": "1.7.2",
|
|
129
125
|
"axios-retry": "^4.3.0",
|
|
130
|
-
"bunyan": "^1.8.15",
|
|
131
126
|
"eventemitter3": "^5.0.1",
|
|
132
127
|
"plimit-lit": "^3.0.1",
|
|
133
|
-
"
|
|
128
|
+
"winston": "^3.13.0"
|
|
134
129
|
},
|
|
135
130
|
"lint-staged": {
|
|
136
131
|
"**/*.{ts,js,mjs,cjs,md,json}": [
|
package/lib/cjs/arns-service.js
DELETED