@ar.io/sdk 3.12.0-beta.1 → 3.12.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/bundles/web.bundle.min.js +167 -170
- package/lib/cjs/common/index.js +0 -2
- package/lib/cjs/version.js +1 -1
- package/lib/esm/common/index.js +0 -2
- package/lib/esm/version.js +1 -1
- package/lib/types/common/index.d.ts +0 -1
- package/lib/types/version.d.ts +1 -1
- package/package.json +2 -1
- package/lib/cjs/common/wayfinder/gateways/network.js +0 -48
- package/lib/cjs/common/wayfinder/gateways/simple-cache.js +0 -35
- package/lib/cjs/common/wayfinder/gateways/static.js +0 -13
- package/lib/cjs/common/wayfinder/index.js +0 -47
- package/lib/cjs/common/wayfinder/routing/strategies/ping.js +0 -72
- package/lib/cjs/common/wayfinder/routing/strategies/random.js +0 -13
- package/lib/cjs/common/wayfinder/routing/strategies/round-robin.js +0 -42
- package/lib/cjs/common/wayfinder/routing/strategies/static.js +0 -29
- package/lib/cjs/common/wayfinder/verification/strategies/data-root-verifier.js +0 -139
- package/lib/cjs/common/wayfinder/verification/strategies/hash-verifier.js +0 -50
- package/lib/cjs/common/wayfinder/verification/trusted.js +0 -106
- package/lib/cjs/common/wayfinder/wayfinder.js +0 -735
- package/lib/cjs/types/wayfinder.js +0 -3
- package/lib/esm/common/wayfinder/gateways/network.js +0 -44
- package/lib/esm/common/wayfinder/gateways/simple-cache.js +0 -31
- package/lib/esm/common/wayfinder/gateways/static.js +0 -9
- package/lib/esm/common/wayfinder/index.js +0 -31
- package/lib/esm/common/wayfinder/routing/strategies/ping.js +0 -68
- package/lib/esm/common/wayfinder/routing/strategies/random.js +0 -9
- package/lib/esm/common/wayfinder/routing/strategies/round-robin.js +0 -38
- package/lib/esm/common/wayfinder/routing/strategies/static.js +0 -25
- package/lib/esm/common/wayfinder/verification/strategies/data-root-verifier.js +0 -130
- package/lib/esm/common/wayfinder/verification/strategies/hash-verifier.js +0 -46
- package/lib/esm/common/wayfinder/verification/trusted.js +0 -102
- package/lib/esm/common/wayfinder/wayfinder.js +0 -723
- package/lib/esm/types/wayfinder.js +0 -2
- package/lib/types/common/wayfinder/gateways/network.d.ts +0 -33
- package/lib/types/common/wayfinder/gateways/simple-cache.d.ts +0 -31
- package/lib/types/common/wayfinder/gateways/static.d.ts +0 -23
- package/lib/types/common/wayfinder/index.d.ts +0 -26
- package/lib/types/common/wayfinder/routing/strategies/ping.d.ts +0 -27
- package/lib/types/common/wayfinder/routing/strategies/random.d.ts +0 -21
- package/lib/types/common/wayfinder/routing/strategies/round-robin.d.ts +0 -29
- package/lib/types/common/wayfinder/routing/strategies/static.d.ts +0 -29
- package/lib/types/common/wayfinder/verification/strategies/data-root-verifier.d.ts +0 -31
- package/lib/types/common/wayfinder/verification/strategies/hash-verifier.d.ts +0 -27
- package/lib/types/common/wayfinder/verification/trusted.d.ts +0 -51
- package/lib/types/common/wayfinder/wayfinder.d.ts +0 -299
- package/lib/types/types/wayfinder.d.ts +0 -66
|
@@ -1,66 +0,0 @@
|
|
|
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 { Readable } from 'stream';
|
|
17
|
-
export interface RoutingStrategy {
|
|
18
|
-
selectGateway: ({ gateways }: {
|
|
19
|
-
gateways: URL[];
|
|
20
|
-
}) => Promise<URL>;
|
|
21
|
-
}
|
|
22
|
-
export interface GatewaysProvider {
|
|
23
|
-
getGateways: () => Promise<URL[]>;
|
|
24
|
-
}
|
|
25
|
-
export interface DataVerificationStrategy {
|
|
26
|
-
/**
|
|
27
|
-
* Verifies the provided data for a given txId
|
|
28
|
-
*
|
|
29
|
-
* Depending on the implementation, the hash can be the computed data root of a transaction, the digest of the data, or some other hash of the data.
|
|
30
|
-
*
|
|
31
|
-
* The interface is intended to be vague in order to support various degrees of verification.
|
|
32
|
-
*
|
|
33
|
-
* @param data - The data to verify
|
|
34
|
-
* @param txId - The txId of the data
|
|
35
|
-
* @returns the hash of the data
|
|
36
|
-
*/
|
|
37
|
-
verifyData: ({ data, txId, }: {
|
|
38
|
-
data: Buffer | Readable | ReadableStream;
|
|
39
|
-
txId: string;
|
|
40
|
-
}) => Promise<void>;
|
|
41
|
-
}
|
|
42
|
-
export interface DataHashProvider {
|
|
43
|
-
/**
|
|
44
|
-
* Returns a hash for the provided txId using the specified algorithm.
|
|
45
|
-
*
|
|
46
|
-
* @param txId - The txId of the data
|
|
47
|
-
* @returns the hash of the data
|
|
48
|
-
*/
|
|
49
|
-
getHash: ({ txId, }: {
|
|
50
|
-
txId: string;
|
|
51
|
-
}) => Promise<{
|
|
52
|
-
hash: string;
|
|
53
|
-
algorithm: 'sha256';
|
|
54
|
-
}>;
|
|
55
|
-
}
|
|
56
|
-
export interface DataRootProvider {
|
|
57
|
-
/**
|
|
58
|
-
* Returns the data root for the provided txId
|
|
59
|
-
*
|
|
60
|
-
* @param txId - The txId of the data
|
|
61
|
-
* @returns the data root of the data
|
|
62
|
-
*/
|
|
63
|
-
getDataRoot: ({ txId }: {
|
|
64
|
-
txId: string;
|
|
65
|
-
}) => Promise<string>;
|
|
66
|
-
}
|