@ar.io/sdk 3.10.0 → 3.11.0-alpha.1
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 +66 -125
- package/bundles/web.bundle.min.js +130 -125
- package/lib/cjs/cli/options.js +12 -0
- package/lib/cjs/cli/utils.js +32 -10
- package/lib/cjs/common/ant-versions.js +5 -5
- package/lib/cjs/common/index.js +2 -0
- package/lib/cjs/common/io.js +64 -1
- package/lib/cjs/common/turbo.js +208 -0
- package/lib/cjs/common/wayfinder/gateways.js +75 -0
- package/lib/cjs/common/wayfinder/index.js +36 -0
- package/lib/cjs/common/wayfinder/routers/fixed.js +14 -0
- package/lib/cjs/common/wayfinder/routers/fixed.test.js +14 -0
- package/lib/cjs/common/wayfinder/routers/priority.js +38 -0
- package/lib/cjs/common/wayfinder/routers/priority.test.js +155 -0
- package/lib/cjs/common/wayfinder/routers/random.js +23 -0
- package/lib/cjs/common/wayfinder/routers/random.test.js +104 -0
- package/lib/cjs/common/wayfinder/routers/simple-cache.js +25 -0
- package/lib/cjs/common/wayfinder/routers/simple-cache.test.js +41 -0
- package/lib/cjs/common/wayfinder/wayfinder.js +167 -0
- package/lib/cjs/common/wayfinder/wayfinder.test.js +253 -0
- package/lib/cjs/types/ant.js +12 -1
- package/lib/cjs/types/index.js +1 -0
- package/lib/cjs/types/io.js +1 -1
- package/lib/cjs/types/wayfinder.js +2 -0
- package/lib/cjs/utils/ao.js +5 -0
- package/lib/cjs/utils/random.js +30 -0
- package/lib/cjs/utils/url.js +28 -0
- package/lib/cjs/utils/url.test.js +24 -0
- package/lib/cjs/utils/utils.test.js +8 -8
- package/lib/cjs/version.js +1 -1
- package/lib/cjs/web/index.js +3 -1
- package/lib/esm/cli/options.js +12 -0
- package/lib/esm/cli/utils.js +31 -10
- package/lib/esm/common/ant-versions.js +5 -5
- package/lib/esm/common/index.js +2 -0
- package/lib/esm/common/io.js +64 -1
- package/lib/esm/common/turbo.js +200 -0
- package/lib/esm/common/wayfinder/gateways.js +69 -0
- package/lib/esm/common/wayfinder/index.js +20 -0
- package/lib/esm/common/wayfinder/routers/fixed.js +10 -0
- package/lib/esm/common/wayfinder/routers/fixed.test.js +12 -0
- package/lib/esm/common/wayfinder/routers/priority.js +34 -0
- package/lib/esm/common/wayfinder/routers/priority.test.js +153 -0
- package/lib/esm/common/wayfinder/routers/random.js +19 -0
- package/lib/esm/common/wayfinder/routers/random.test.js +102 -0
- package/lib/esm/common/wayfinder/routers/simple-cache.js +21 -0
- package/lib/esm/common/wayfinder/routers/simple-cache.test.js +39 -0
- package/lib/esm/common/wayfinder/wayfinder.js +161 -0
- package/lib/esm/common/wayfinder/wayfinder.test.js +248 -0
- package/lib/esm/types/ant.js +11 -0
- package/lib/esm/types/index.js +1 -0
- package/lib/esm/types/io.js +1 -1
- package/lib/esm/types/wayfinder.js +1 -0
- package/lib/esm/utils/ao.js +5 -0
- package/lib/esm/utils/random.js +26 -0
- package/lib/esm/utils/url.js +24 -0
- package/lib/esm/utils/url.test.js +19 -0
- package/lib/esm/utils/utils.test.js +1 -1
- package/lib/esm/version.js +1 -1
- package/lib/esm/web/index.js +1 -1
- package/lib/types/cli/commands/antCommands.d.ts +3 -3
- package/lib/types/cli/commands/arnsPurchaseCommands.d.ts +1 -1
- package/lib/types/cli/commands/gatewayWriteCommands.d.ts +9 -9
- package/lib/types/cli/commands/readCommands.d.ts +1 -0
- package/lib/types/cli/commands/transfer.d.ts +3 -3
- package/lib/types/cli/options.d.ts +9 -0
- package/lib/types/cli/types.d.ts +3 -0
- package/lib/types/cli/utils.d.ts +4 -0
- package/lib/types/common/ant-versions.d.ts +3 -6
- package/lib/types/common/index.d.ts +1 -0
- package/lib/types/common/io.d.ts +9 -7
- package/lib/types/common/turbo.d.ts +62 -0
- package/lib/types/common/wayfinder/gateways.d.ts +44 -0
- package/lib/types/common/wayfinder/index.d.ts +19 -0
- package/lib/types/common/wayfinder/routers/fixed.d.ts +24 -0
- package/lib/types/common/wayfinder/routers/fixed.test.d.ts +1 -0
- package/lib/types/common/wayfinder/routers/priority.d.ts +33 -0
- package/lib/types/common/wayfinder/routers/priority.test.d.ts +1 -0
- package/lib/types/common/wayfinder/routers/random.d.ts +27 -0
- package/lib/types/common/wayfinder/routers/random.test.d.ts +1 -0
- package/lib/types/common/wayfinder/routers/simple-cache.d.ts +28 -0
- package/lib/types/common/wayfinder/routers/simple-cache.test.d.ts +1 -0
- package/lib/types/common/wayfinder/wayfinder.d.ts +113 -0
- package/lib/types/common/wayfinder/wayfinder.test.d.ts +1 -0
- package/lib/types/types/ant.d.ts +53 -1
- package/lib/types/types/common.d.ts +7 -2
- package/lib/types/types/index.d.ts +1 -0
- package/lib/types/types/io.d.ts +7 -5
- package/lib/types/types/wayfinder.d.ts +19 -0
- package/lib/types/utils/ao.d.ts +1 -12
- package/lib/types/utils/random.d.ts +7 -0
- package/lib/types/utils/url.d.ts +19 -0
- package/lib/types/utils/url.test.d.ts +1 -0
- package/lib/types/version.d.ts +1 -1
- package/lib/types/web/index.d.ts +1 -1
- package/package.json +5 -3
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { WayfinderRouter } from '../../types/wayfinder.js';
|
|
17
|
+
type AnyFunction = (...args: [string, ...unknown[]]) => unknown;
|
|
18
|
+
type WayfinderHttpClient<T extends AnyFunction> = T;
|
|
19
|
+
export declare const arnsRegex: RegExp;
|
|
20
|
+
export declare const txIdRegex: RegExp;
|
|
21
|
+
/**
|
|
22
|
+
* Core function to resolve a wayfinder url against a target gateway
|
|
23
|
+
* @param originalUrl - the wayfinder url to resolve
|
|
24
|
+
* @param targetGateway - the target gateway to resolve the url against
|
|
25
|
+
* @returns the resolved url that can be used to make a request
|
|
26
|
+
*/
|
|
27
|
+
export declare const resolveWayfinderUrl: ({ originalUrl, targetGateway, }: {
|
|
28
|
+
originalUrl: string | URL;
|
|
29
|
+
targetGateway: string | URL;
|
|
30
|
+
}) => URL;
|
|
31
|
+
/**
|
|
32
|
+
* Creates a wrapped http client that supports ar:// protocol
|
|
33
|
+
*
|
|
34
|
+
* This function leverages a Proxy to intercept calls to the http client
|
|
35
|
+
* and redirects them to the target gateway using the resolveUrl function url.
|
|
36
|
+
* It also supports the http client methods like get(), post(), put(), delete(), etc.
|
|
37
|
+
*
|
|
38
|
+
* Any URLs provided that are not wayfinder urls will be returned as is.
|
|
39
|
+
*
|
|
40
|
+
* @param httpClient - the http client to wrap (e.g. axios, fetch, got, etc.)
|
|
41
|
+
* @param resolveUrl - the function to construct the redirect url for ar:// requests
|
|
42
|
+
* @returns a wrapped http client that supports ar:// protocol
|
|
43
|
+
*/
|
|
44
|
+
export declare const createWayfinderClient: <T extends AnyFunction>({ httpClient, resolveUrl, }: {
|
|
45
|
+
httpClient: T;
|
|
46
|
+
resolveUrl: (params: {
|
|
47
|
+
originalUrl: string | URL;
|
|
48
|
+
}) => Promise<URL>;
|
|
49
|
+
}) => WayfinderHttpClient<T>;
|
|
50
|
+
/**
|
|
51
|
+
* The main class for the wayfinder
|
|
52
|
+
* @param router - the router to use for requests
|
|
53
|
+
* @param httpClient - the http client to use for requests
|
|
54
|
+
* @param blocklist - the blocklist of gateways to avoid
|
|
55
|
+
*/
|
|
56
|
+
export declare class Wayfinder<T extends AnyFunction> {
|
|
57
|
+
/**
|
|
58
|
+
* The router to use for requests
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* const wayfinder = new Wayfinder({
|
|
62
|
+
* router: new RandomGatewayRouter({ ario: ARIO.mainnet() }),
|
|
63
|
+
* });
|
|
64
|
+
*/
|
|
65
|
+
readonly router: WayfinderRouter;
|
|
66
|
+
/**
|
|
67
|
+
* The http client to use for requests
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* const wayfinder = new Wayfinder({
|
|
71
|
+
* router: new RandomGatewayRouter({ ario: ARIO.mainnet() }),
|
|
72
|
+
* httpClient: axios,
|
|
73
|
+
* });
|
|
74
|
+
*/
|
|
75
|
+
readonly httpClient: T;
|
|
76
|
+
/**
|
|
77
|
+
* The function that resolves the redirect url for ar:// requests to a target gateway
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* const wayfinder = new Wayfinder({
|
|
81
|
+
* router: new RandomGatewayRouter({ ario: ARIO.mainnet() }),
|
|
82
|
+
* httpClient: axios,
|
|
83
|
+
* });
|
|
84
|
+
*
|
|
85
|
+
* const redirectUrl = await wayfinder.resolveUrl({ originalUrl: 'ar://example' });
|
|
86
|
+
*/
|
|
87
|
+
readonly resolveUrl: (params: {
|
|
88
|
+
originalUrl: string;
|
|
89
|
+
}) => Promise<URL>;
|
|
90
|
+
/**
|
|
91
|
+
* A wrapped http client that supports ar:// protocol
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* const { request: wayfind } = new Wayfinder({
|
|
95
|
+
* router: new RandomGatewayRouter({ ario: ARIO.mainnet() }),
|
|
96
|
+
* httpClient: axios,
|
|
97
|
+
* });;
|
|
98
|
+
*
|
|
99
|
+
* TODO: consider a top level function that supports wayfinder routing under the hood
|
|
100
|
+
* const response = await wayfind('ar://', {
|
|
101
|
+
* method: 'POST',
|
|
102
|
+
* data: {
|
|
103
|
+
* name: 'John Doe',
|
|
104
|
+
* },
|
|
105
|
+
* })
|
|
106
|
+
*/
|
|
107
|
+
readonly request: WayfinderHttpClient<T>;
|
|
108
|
+
constructor({ router, httpClient, }: {
|
|
109
|
+
router: WayfinderRouter;
|
|
110
|
+
httpClient: T;
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/types/types/ant.d.ts
CHANGED
|
@@ -127,11 +127,63 @@ export declare const AntStateSchema: z.ZodObject<{
|
|
|
127
127
|
Initialized: boolean;
|
|
128
128
|
}>;
|
|
129
129
|
export type AoANTState = z.infer<typeof AntStateSchema>;
|
|
130
|
+
export declare const SpawnANTStateSchema: z.ZodObject<{
|
|
131
|
+
name: z.ZodString;
|
|
132
|
+
ticker: z.ZodString;
|
|
133
|
+
description: z.ZodString;
|
|
134
|
+
keywords: z.ZodArray<z.ZodString, "many">;
|
|
135
|
+
owner: z.ZodString;
|
|
136
|
+
controllers: z.ZodArray<z.ZodString, "many">;
|
|
137
|
+
records: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
138
|
+
transactionId: z.ZodEffects<z.ZodString, string, string>;
|
|
139
|
+
ttlSeconds: z.ZodNumber;
|
|
140
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
141
|
+
}, "strip", z.ZodTypeAny, {
|
|
142
|
+
transactionId: string;
|
|
143
|
+
ttlSeconds: number;
|
|
144
|
+
priority?: number | undefined;
|
|
145
|
+
}, {
|
|
146
|
+
transactionId: string;
|
|
147
|
+
ttlSeconds: number;
|
|
148
|
+
priority?: number | undefined;
|
|
149
|
+
}>>;
|
|
150
|
+
balances: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
151
|
+
logo: z.ZodEffects<z.ZodString, string, string>;
|
|
152
|
+
}, "strip", z.ZodTypeAny, {
|
|
153
|
+
description: string;
|
|
154
|
+
name: string;
|
|
155
|
+
ticker: string;
|
|
156
|
+
keywords: string[];
|
|
157
|
+
owner: string;
|
|
158
|
+
controllers: string[];
|
|
159
|
+
records: Record<string, {
|
|
160
|
+
transactionId: string;
|
|
161
|
+
ttlSeconds: number;
|
|
162
|
+
priority?: number | undefined;
|
|
163
|
+
}>;
|
|
164
|
+
balances: Record<string, number>;
|
|
165
|
+
logo: string;
|
|
166
|
+
}, {
|
|
167
|
+
description: string;
|
|
168
|
+
name: string;
|
|
169
|
+
ticker: string;
|
|
170
|
+
keywords: string[];
|
|
171
|
+
owner: string;
|
|
172
|
+
controllers: string[];
|
|
173
|
+
records: Record<string, {
|
|
174
|
+
transactionId: string;
|
|
175
|
+
ttlSeconds: number;
|
|
176
|
+
priority?: number | undefined;
|
|
177
|
+
}>;
|
|
178
|
+
balances: Record<string, number>;
|
|
179
|
+
logo: string;
|
|
180
|
+
}>;
|
|
181
|
+
export type SpawnANTState = z.infer<typeof SpawnANTStateSchema>;
|
|
130
182
|
export declare const AntReadHandlers: readonly ["balance", "balances", "totalSupply", "info", "controllers", "record", "records", "state"];
|
|
131
183
|
export type AoANTReadHandler = (typeof AntReadHandlers)[number];
|
|
132
184
|
export declare const AntWriteHandlers: readonly ["_eval", "_default", "transfer", "addController", "removeController", "setRecord", "removeRecord", "setName", "setTicker", "setDescription", "setKeywords", "setLogo", "initializeState", "releaseName", "reassignName", "approvePrimaryName", "removePrimaryNames"];
|
|
133
185
|
export type AoANTWriteHandler = (typeof AntWriteHandlers)[number];
|
|
134
|
-
export declare const AntHandlerNames: ("
|
|
186
|
+
export declare const AntHandlerNames: ("controllers" | "records" | "balances" | "balance" | "totalSupply" | "info" | "record" | "state" | "_eval" | "_default" | "transfer" | "addController" | "removeController" | "setRecord" | "removeRecord" | "setName" | "setTicker" | "setDescription" | "setKeywords" | "setLogo" | "initializeState" | "releaseName" | "reassignName" | "approvePrimaryName" | "removePrimaryNames")[];
|
|
135
187
|
export type AoANTHandler = AoANTWriteHandler | AoANTReadHandler;
|
|
136
188
|
export declare const AntHandlersSchema: z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>;
|
|
137
189
|
export declare const AntInfoSchema: z.ZodObject<{
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { Signer } from '@dha-team/arbundles';
|
|
16
|
+
import { ArconnectSigner, ArweaveSigner, EthereumSigner, InjectedEthereumSigner, Signer } from '@dha-team/arbundles';
|
|
17
17
|
import { dryrun, message, monitor, result, results, spawn, unmonitor } from '@permaweb/aoconnect';
|
|
18
18
|
import Arweave from 'arweave';
|
|
19
19
|
import { AoSigner } from './token.js';
|
|
@@ -26,6 +26,10 @@ export type ProcessId = string;
|
|
|
26
26
|
export type OptionalArweave<T = NonNullable<unknown>> = {
|
|
27
27
|
arweave?: Arweave;
|
|
28
28
|
} & T;
|
|
29
|
+
export type OptionalPaymentUrl<T = NonNullable<unknown>> = {
|
|
30
|
+
paymentUrl?: string;
|
|
31
|
+
} & T;
|
|
32
|
+
export type TurboArNSSigner = EthereumSigner | InjectedEthereumSigner | ArweaveSigner | ArconnectSigner | Window['arweaveWallet'];
|
|
29
33
|
export type ContractSigner = Signer | Window['arweaveWallet'] | AoSigner;
|
|
30
34
|
export type WithSigner<T = NonNullable<unknown>> = {
|
|
31
35
|
signer: ContractSigner;
|
|
@@ -44,8 +48,9 @@ export type WriteOptions = {
|
|
|
44
48
|
}[];
|
|
45
49
|
};
|
|
46
50
|
export type WriteParameters<Input> = WithSigner<Required<ReadParameters<Input>>>;
|
|
47
|
-
export type AoMessageResult = {
|
|
51
|
+
export type AoMessageResult<T = Record<string, string | number | boolean | null>> = {
|
|
48
52
|
id: string;
|
|
53
|
+
result?: T;
|
|
49
54
|
};
|
|
50
55
|
export type AoPrimaryNameRequest = {
|
|
51
56
|
name: string;
|
package/lib/types/types/io.d.ts
CHANGED
|
@@ -310,7 +310,7 @@ export type AoTokenCostParams = {
|
|
|
310
310
|
quantity?: number;
|
|
311
311
|
fromAddress?: WalletAddress;
|
|
312
312
|
};
|
|
313
|
-
export declare const fundFromOptions: readonly ["balance", "stakes", "any"];
|
|
313
|
+
export declare const fundFromOptions: readonly ["balance", "stakes", "any", "turbo"];
|
|
314
314
|
export type FundFrom = (typeof fundFromOptions)[number];
|
|
315
315
|
export declare const isValidFundFrom: (fundFrom: string) => fundFrom is FundFrom;
|
|
316
316
|
export type AoGetCostDetailsParams = AoTokenCostParams & {
|
|
@@ -338,6 +338,7 @@ export type CostDetailsResult = {
|
|
|
338
338
|
basePrice: number;
|
|
339
339
|
};
|
|
340
340
|
fundingPlan?: AoFundingPlan;
|
|
341
|
+
wincQty?: string;
|
|
341
342
|
};
|
|
342
343
|
export type AoGetVaultParams = {
|
|
343
344
|
address: WalletAddress;
|
|
@@ -420,6 +421,7 @@ export type DemandFactorSettings = {
|
|
|
420
421
|
criteria: string;
|
|
421
422
|
};
|
|
422
423
|
export interface AoARIORead {
|
|
424
|
+
process: AOProcess;
|
|
423
425
|
getInfo(): Promise<{
|
|
424
426
|
Ticker: string;
|
|
425
427
|
Name: string;
|
|
@@ -523,10 +525,10 @@ export interface AoARIOWrite extends AoARIORead {
|
|
|
523
525
|
reportTxId: TransactionId;
|
|
524
526
|
failedGateways: WalletAddress[];
|
|
525
527
|
}>;
|
|
526
|
-
buyRecord: AoWriteAction<AoBuyRecordParams>;
|
|
527
|
-
upgradeRecord: AoWriteAction<AoArNSPurchaseParams>;
|
|
528
|
-
extendLease: AoWriteAction<AoExtendLeaseParams>;
|
|
529
|
-
increaseUndernameLimit: AoWriteAction<AoIncreaseUndernameLimitParams>;
|
|
528
|
+
buyRecord: AoWriteAction<AoBuyRecordParams, AoMessageResult>;
|
|
529
|
+
upgradeRecord: AoWriteAction<AoArNSPurchaseParams, AoMessageResult>;
|
|
530
|
+
extendLease: AoWriteAction<AoExtendLeaseParams, AoMessageResult>;
|
|
531
|
+
increaseUndernameLimit: AoWriteAction<AoIncreaseUndernameLimitParams, AoMessageResult>;
|
|
530
532
|
cancelWithdrawal: AoWriteAction<{
|
|
531
533
|
gatewayAddress?: WalletAddress;
|
|
532
534
|
vaultId: string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export interface WayfinderRouter {
|
|
17
|
+
readonly name: string;
|
|
18
|
+
getTargetGateway: () => Promise<URL>;
|
|
19
|
+
}
|
package/lib/types/utils/ao.d.ts
CHANGED
|
@@ -1,18 +1,7 @@
|
|
|
1
1
|
import Arweave from 'arweave';
|
|
2
2
|
import { Logger } from '../common/index.js';
|
|
3
|
-
import {
|
|
3
|
+
import { SpawnANTState } from '../types/ant.js';
|
|
4
4
|
import { AoClient, AoEpochData, AoEpochDistributed, AoSigner, ContractSigner, WalletAddress } from '../types/index.js';
|
|
5
|
-
export type SpawnANTState = {
|
|
6
|
-
owner: WalletAddress;
|
|
7
|
-
controllers: WalletAddress[];
|
|
8
|
-
name: string;
|
|
9
|
-
description: string;
|
|
10
|
-
keywords: string[];
|
|
11
|
-
ticker: string;
|
|
12
|
-
records: Record<string, AoANTRecord>;
|
|
13
|
-
balances: Record<WalletAddress, number>;
|
|
14
|
-
logo: string;
|
|
15
|
-
};
|
|
16
5
|
export type SpawnANTParams = {
|
|
17
6
|
signer: AoSigner;
|
|
18
7
|
module?: string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cryptographically secure helper for randomness, does not support seeding
|
|
3
|
+
* @param min - the minimum value
|
|
4
|
+
* @param max - the maximum value
|
|
5
|
+
* @returns a random integer between min and max
|
|
6
|
+
*/
|
|
7
|
+
export declare const randomInt: (min: number, max: number) => number;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (C) 2022-2024 Permanent Data Solutions, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export declare const urlWithSearchParams: ({ baseUrl, params, }: {
|
|
17
|
+
baseUrl: string;
|
|
18
|
+
params: Record<string, string | number | boolean | null | undefined>;
|
|
19
|
+
}) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/types/version.d.ts
CHANGED
package/lib/types/web/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export { ArweaveSigner, ArconnectSigner } from '@dha-team/arbundles';
|
|
16
|
+
export { ArweaveSigner, ArconnectSigner, InjectedEthereumSigner, EthereumSigner, } from '@dha-team/arbundles';
|
|
17
17
|
export * from '../types/index.js';
|
|
18
18
|
export * from '../common/index.js';
|
|
19
19
|
export * from '../constants.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ar.io/sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.11.0-alpha.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/ar-io/ar-io-sdk.git"
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"test:cjs": "yarn build:cjs && yarn link && cd ./tests/e2e/cjs && yarn && yarn test",
|
|
73
73
|
"test:esm": "yarn build:esm && yarn link && cd ./tests/e2e/esm && yarn && yarn test",
|
|
74
74
|
"test:web": "yarn build:esm && yarn link && cd ./tests/e2e/web && yarn && yarn test",
|
|
75
|
-
"test:unit": "node --import=./register.mjs --test --test-reporter=spec src
|
|
75
|
+
"test:unit": "node --import=./register.mjs --test --test-reporter=spec --enable-source-maps --trace-warnings 'src/**/*.test.ts'",
|
|
76
76
|
"test:link": "yarn build && yarn link",
|
|
77
77
|
"test:e2e": "yarn test:cjs && yarn test:esm && yarn test:web",
|
|
78
78
|
"test:integration": "yarn build:esm && yarn link && cd ./tests/integration && yarn && yarn test",
|
|
@@ -91,8 +91,9 @@
|
|
|
91
91
|
"@semantic-release/exec": "^6.0.3",
|
|
92
92
|
"@semantic-release/git": "^10.0.1",
|
|
93
93
|
"@semantic-release/npm": "^11.0.3",
|
|
94
|
+
"@swc/core": "^1.11.22",
|
|
94
95
|
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
|
|
95
|
-
"@types/node": "^
|
|
96
|
+
"@types/node": "^22.14.1",
|
|
96
97
|
"@types/prompts": "^2.4.9",
|
|
97
98
|
"@types/sinon": "^10.0.15",
|
|
98
99
|
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
@@ -110,6 +111,7 @@
|
|
|
110
111
|
"eslint-plugin-n": "^16.0.1",
|
|
111
112
|
"eslint-plugin-prettier": "^5.0.0",
|
|
112
113
|
"eslint-plugin-promise": "^6.1.1",
|
|
114
|
+
"got": "^12.4.7",
|
|
113
115
|
"http-server": "^14.1.1",
|
|
114
116
|
"husky": "^8.0.3",
|
|
115
117
|
"lint-staged": "^15.2.2",
|