@ar.io/wayfinder-core 0.0.2-beta.0 → 0.0.3-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.
Files changed (45) hide show
  1. package/README.md +15 -1
  2. package/dist/gateways/network.d.ts +14 -12
  3. package/dist/gateways/network.d.ts.map +1 -1
  4. package/dist/gateways/network.js +1 -1
  5. package/dist/gateways/simple-cache.d.ts +14 -12
  6. package/dist/gateways/simple-cache.d.ts.map +1 -1
  7. package/dist/gateways/simple-cache.js +2 -2
  8. package/dist/gateways/static.d.ts +14 -12
  9. package/dist/gateways/static.d.ts.map +1 -1
  10. package/dist/gateways/static.js +1 -1
  11. package/dist/index.d.ts +10 -11
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +11 -12
  14. package/dist/routing/ping.d.ts +4 -5
  15. package/dist/routing/ping.d.ts.map +1 -1
  16. package/dist/routing/ping.js +19 -19
  17. package/dist/routing/preferred-with-fallback.d.ts +13 -12
  18. package/dist/routing/preferred-with-fallback.d.ts.map +1 -1
  19. package/dist/routing/preferred-with-fallback.js +12 -3
  20. package/dist/routing/random.d.ts +13 -12
  21. package/dist/routing/random.d.ts.map +1 -1
  22. package/dist/routing/random.js +1 -1
  23. package/dist/routing/round-robin.d.ts +12 -11
  24. package/dist/routing/round-robin.d.ts.map +1 -1
  25. package/dist/routing/static.d.ts +12 -11
  26. package/dist/routing/static.d.ts.map +1 -1
  27. package/dist/utils/ario.d.ts +10 -11
  28. package/dist/utils/ario.d.ts.map +1 -1
  29. package/dist/utils/ario.js +10 -11
  30. package/dist/utils/base64.d.ts +10 -11
  31. package/dist/utils/base64.d.ts.map +1 -1
  32. package/dist/utils/base64.js +10 -11
  33. package/dist/utils/hash.d.ts.map +1 -1
  34. package/dist/utils/hash.js +10 -11
  35. package/dist/utils/random.d.ts +10 -11
  36. package/dist/utils/random.d.ts.map +1 -1
  37. package/dist/utils/random.js +10 -11
  38. package/dist/verification/data-root-verifier.d.ts.map +1 -1
  39. package/dist/verification/data-root-verifier.js +10 -11
  40. package/dist/verification/hash-verifier.d.ts.map +1 -1
  41. package/dist/verification/hash-verifier.js +10 -11
  42. package/dist/wayfinder.d.ts +16 -21
  43. package/dist/wayfinder.d.ts.map +1 -1
  44. package/dist/wayfinder.js +11 -16
  45. package/package.json +8 -2
package/README.md CHANGED
@@ -174,7 +174,7 @@ Wayfinder includes verification mechanisms to ensure the integrity of retrieved
174
174
  | ------------------------------- | ---------- | ----------- | -------- | ------------------------------------------------------------------------------------------------------------ |
175
175
  | `HashVerificationStrategy` | Low | High | Low | Verifies data integrity using SHA-256 hash comparison of the returned data |
176
176
  | `DataRootVerificationStrategy` | Medium | Medium | Low | Verifies data using Arweave by computing the data root for the transaction (most useful for L1 transactions) |
177
- | `SignatureVerificationStrategy` | Medium | Medium | Medium | Verifies signature of an Arweave transaction or data item using offsets provided by trusted gateway |
177
+ | `SignatureVerificationStrategy` | Medium | Medium | Medium | Verifies signature of an Arweave transaction or data item using signature data provided by the Arweave network, or trusted gateways|
178
178
 
179
179
  ### HashVerificationStrategy
180
180
 
@@ -204,6 +204,20 @@ const wayfinder = new Wayfinder({
204
204
  });
205
205
  ```
206
206
 
207
+ ### SignatureVerificationStrategy
208
+
209
+ Verifies signatures of Arweave transactions and data items. Headers are retrieved from trusted gateways for use during verification. For a transaction, its data root is computed while streaming its data and then utilized alongside its headers for verification. For data items, the ANS-104 deep hash method of signature verification is used.
210
+
211
+ ```javascript
212
+ import { Wayfinder, SignatureVerificationStrategy } from '@ar-io/sdk';
213
+
214
+ const wayfinder = new Wayfinder({
215
+ verificationStrategy: new SignatureVerificationStrategy({
216
+ trustedGateways: ['https://permagate.io'],
217
+ }),
218
+ });
219
+ ```
220
+
207
221
  ## Monitoring and Events
208
222
 
209
223
  Wayfinder emits events during the routing and verification process, allowing you to monitor its operation.
@@ -1,19 +1,18 @@
1
1
  /**
2
2
  * WayFinder
3
- * Copyright (C) 2022-2025 Permanent Data Solutions, Inc. All Rights Reserved.
3
+ * Copyright (C) 2022-2025 Permanent Data Solutions, Inc.
4
4
  *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU Affero General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
9
8
  *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU Affero General Public License for more details.
9
+ * http://www.apache.org/licenses/LICENSE-2.0
14
10
  *
15
- * You should have received a copy of the GNU Affero General Public License
16
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
17
16
  */
18
17
  import { ARIOReadable } from '@ar.io/sdk';
19
18
  import { GatewaysProvider } from '../../types/wayfinder.js';
@@ -34,6 +33,9 @@ export declare class NetworkGatewaysProvider implements GatewaysProvider {
34
33
  filter?: (gateway: any) => boolean;
35
34
  logger?: Logger;
36
35
  });
37
- getGateways(): Promise<URL[]>;
36
+ getGateways(_params?: {
37
+ path?: string;
38
+ subdomain?: string;
39
+ }): Promise<URL[]>;
38
40
  }
39
41
  //# sourceMappingURL=network.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../src/gateways/network.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAiB,MAAM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EACxB,SAAkB,EAClB,KAAY,EACZ,MAAqC,EACrC,MAAsB,GACvB,EAAE;QACD,IAAI,EAAE,YAAY,CAAC;QACnB,MAAM,CAAC,EAAE,qBAAqB,GAAG,eAAe,GAAG,gBAAgB,CAAC;QACpE,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;QAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;QACrB,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,OAAO,CAAC;QACnC,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;IASK,WAAW,CAAC,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;CA0DnF"}
@@ -14,7 +14,7 @@ export class NetworkGatewaysProvider {
14
14
  this.filter = filter;
15
15
  this.logger = logger;
16
16
  }
17
- async getGateways() {
17
+ async getGateways(_params) {
18
18
  let cursor;
19
19
  let attempts = 0;
20
20
  const gateways = [];
@@ -1,19 +1,18 @@
1
1
  /**
2
2
  * WayFinder
3
- * Copyright (C) 2022-2025 Permanent Data Solutions, Inc. All Rights Reserved.
3
+ * Copyright (C) 2022-2025 Permanent Data Solutions, Inc.
4
4
  *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU Affero General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
9
8
  *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU Affero General Public License for more details.
9
+ * http://www.apache.org/licenses/LICENSE-2.0
14
10
  *
15
- * You should have received a copy of the GNU Affero General Public License
16
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
17
16
  */
18
17
  import { GatewaysProvider } from '../../types/wayfinder.js';
19
18
  /**
@@ -46,6 +45,9 @@ export declare class SimpleCacheGatewaysProvider implements GatewaysProvider {
46
45
  ttlSeconds?: number;
47
46
  logger?: Logger;
48
47
  });
49
- getGateways(): Promise<URL[]>;
48
+ getGateways(params?: {
49
+ path?: string;
50
+ subdomain?: string;
51
+ }): Promise<URL[]>;
50
52
  }
51
53
  //# sourceMappingURL=simple-cache.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"simple-cache.d.ts","sourceRoot":"","sources":["../../src/gateways/simple-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,MAAM,EAAiB,MAAM,iBAAiB,CAAC;AAExD,qBAAa,2BAA4B,YAAW,gBAAgB;IAClE,OAAO,CAAC,gBAAgB,CAAmB;IAC3C,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,aAAa,CAAQ;IAC7B,OAAO,CAAC,MAAM,CAAS;gBAEX,EACV,gBAAgB,EAChB,UAAoB,EAAE,SAAS;IAC/B,MAAsB,GACvB,EAAE;QACD,gBAAgB,EAAE,gBAAgB,CAAC;QACnC,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;IAQK,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;CAmCpC"}
1
+ {"version":3,"file":"simple-cache.d.ts","sourceRoot":"","sources":["../../src/gateways/simple-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,MAAM,EAAiB,MAAM,iBAAiB,CAAC;AAExD,qBAAa,2BAA4B,YAAW,gBAAgB;IAClE,OAAO,CAAC,gBAAgB,CAAmB;IAC3C,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,aAAa,CAAQ;IAC7B,OAAO,CAAC,MAAM,CAAS;gBAEX,EACV,gBAAgB,EAChB,UAAoB,EAAE,SAAS;IAC/B,MAAsB,GACvB,EAAE;QACD,gBAAgB,EAAE,gBAAgB,CAAC;QACnC,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;IAQK,WAAW,CAAC,MAAM,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;CAmClF"}
@@ -30,7 +30,7 @@ export class SimpleCacheGatewaysProvider {
30
30
  this.lastUpdated = 0;
31
31
  this.logger = logger;
32
32
  }
33
- async getGateways() {
33
+ async getGateways(params) {
34
34
  const now = Date.now();
35
35
  if (this.gatewaysCache.length === 0 ||
36
36
  now - this.lastUpdated > this.ttlSeconds * 1000) {
@@ -40,7 +40,7 @@ export class SimpleCacheGatewaysProvider {
40
40
  ttlSeconds: this.ttlSeconds,
41
41
  });
42
42
  // preserve the cache if the fetch fails
43
- const allGateways = await this.gatewaysProvider.getGateways();
43
+ const allGateways = await this.gatewaysProvider.getGateways(params);
44
44
  this.gatewaysCache = allGateways;
45
45
  this.lastUpdated = now;
46
46
  this.logger.debug('Updated gateways cache', {
@@ -1,19 +1,18 @@
1
1
  /**
2
2
  * WayFinder
3
- * Copyright (C) 2022-2025 Permanent Data Solutions, Inc. All Rights Reserved.
3
+ * Copyright (C) 2022-2025 Permanent Data Solutions, Inc.
4
4
  *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU Affero General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
9
8
  *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU Affero General Public License for more details.
9
+ * http://www.apache.org/licenses/LICENSE-2.0
14
10
  *
15
- * You should have received a copy of the GNU Affero General Public License
16
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
17
16
  */
18
17
  import { GatewaysProvider } from '../../types/wayfinder.js';
19
18
  export declare class StaticGatewaysProvider implements GatewaysProvider {
@@ -21,6 +20,9 @@ export declare class StaticGatewaysProvider implements GatewaysProvider {
21
20
  constructor({ gateways }: {
22
21
  gateways: string[];
23
22
  });
24
- getGateways(): Promise<URL[]>;
23
+ getGateways(_params?: {
24
+ path?: string;
25
+ subdomain?: string;
26
+ }): Promise<URL[]>;
25
27
  }
26
28
  //# sourceMappingURL=static.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"static.d.ts","sourceRoot":"","sources":["../../src/gateways/static.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,qBAAa,sBAAuB,YAAW,gBAAgB;IAC7D,OAAO,CAAC,QAAQ,CAAQ;gBACZ,EAAE,QAAQ,EAAE,EAAE;QAAE,QAAQ,EAAE,MAAM,EAAE,CAAA;KAAE;IAI1C,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;CAGpC"}
1
+ {"version":3,"file":"static.d.ts","sourceRoot":"","sources":["../../src/gateways/static.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,qBAAa,sBAAuB,YAAW,gBAAgB;IAC7D,OAAO,CAAC,QAAQ,CAAQ;gBACZ,EAAE,QAAQ,EAAE,EAAE;QAAE,QAAQ,EAAE,MAAM,EAAE,CAAA;KAAE;IAI1C,WAAW,CAAC,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;CAGnF"}
@@ -3,7 +3,7 @@ export class StaticGatewaysProvider {
3
3
  constructor({ gateways }) {
4
4
  this.gateways = gateways.map((g) => new URL(g));
5
5
  }
6
- async getGateways() {
6
+ async getGateways(_params) {
7
7
  return this.gateways;
8
8
  }
9
9
  }
package/dist/index.d.ts CHANGED
@@ -1,19 +1,18 @@
1
1
  /**
2
2
  * WayFinder
3
- * Copyright (C) 2022-2025 Permanent Data Solutions, Inc. All Rights Reserved.
3
+ * Copyright (C) 2022-2025 Permanent Data Solutions, Inc.
4
4
  *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU Affero General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
9
8
  *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU Affero General Public License for more details.
9
+ * http://www.apache.org/licenses/LICENSE-2.0
14
10
  *
15
- * You should have received a copy of the GNU Affero General Public License
16
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
17
16
  */
18
17
  export * from './wayfinder.js';
19
18
  export * from './routing/random.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,cAAc,gBAAgB,CAAC;AAG/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sCAAsC,CAAC;AAGrD,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AAGrC,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,cAAc,gBAAgB,CAAC;AAG/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sCAAsC,CAAC;AAGrD,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AAGrC,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC"}
package/dist/index.js CHANGED
@@ -1,19 +1,18 @@
1
1
  /**
2
2
  * WayFinder
3
- * Copyright (C) 2022-2025 Permanent Data Solutions, Inc. All Rights Reserved.
3
+ * Copyright (C) 2022-2025 Permanent Data Solutions, Inc.
4
4
  *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU Affero General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
9
8
  *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU Affero General Public License for more details.
9
+ * http://www.apache.org/licenses/LICENSE-2.0
14
10
  *
15
- * You should have received a copy of the GNU Affero General Public License
16
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
17
16
  */
18
17
  export * from './wayfinder.js';
19
18
  // routing strategies
@@ -29,4 +28,4 @@ export * from './gateways/static.js';
29
28
  // verification strategies
30
29
  export * from './verification/data-root-verifier.js';
31
30
  export * from './verification/hash-verifier.js';
32
- // TODO: signature verifier
31
+ // TODO: signature verification
@@ -2,18 +2,17 @@ import { RoutingStrategy } from '../../types/wayfinder.js';
2
2
  import { Logger } from '../wayfinder.js';
3
3
  export declare class FastestPingRoutingStrategy implements RoutingStrategy {
4
4
  private timeoutMs;
5
- private probePath;
6
5
  private logger;
7
6
  private maxConcurrency;
8
- constructor({ timeoutMs, maxConcurrency, probePath, // TODO: limit to allowed /ar-io and arweave node endpoints
9
- logger, }?: {
7
+ constructor({ timeoutMs, maxConcurrency, logger, }?: {
10
8
  timeoutMs?: number;
11
9
  maxConcurrency?: number;
12
- probePath?: string;
13
10
  logger?: Logger;
14
11
  });
15
- selectGateway({ gateways }: {
12
+ selectGateway({ gateways, path, subdomain, }: {
16
13
  gateways: URL[];
14
+ path?: string;
15
+ subdomain?: string;
17
16
  }): Promise<URL>;
18
17
  }
19
18
  //# sourceMappingURL=ping.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ping.d.ts","sourceRoot":"","sources":["../../src/routing/ping.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAiB,MAAM,iBAAiB,CAAC;AAExD,qBAAa,0BAA2B,YAAW,eAAe;IAChE,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,cAAc,CAAS;gBAEnB,EACV,SAAe,EACf,cAAmB,EACnB,SAAyB,EAAE,2DAA2D;IACtF,MAAsB,GACvB,GAAE;QACD,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,MAAM,CAAC,EAAE,MAAM,CAAC;KACZ;IAOA,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE;QAAE,QAAQ,EAAE,GAAG,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,GAAG,CAAC;CA2DrE"}
1
+ {"version":3,"file":"ping.d.ts","sourceRoot":"","sources":["../../src/routing/ping.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAiB,MAAM,iBAAiB,CAAC;AAExD,qBAAa,0BAA2B,YAAW,eAAe;IAChE,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,cAAc,CAAS;gBAEnB,EACV,SAAe,EACf,cAAmB,EACnB,MAAsB,GACvB,GAAE;QACD,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,MAAM,CAAC,EAAE,MAAM,CAAC;KACZ;IAMA,aAAa,CAAC,EAClB,QAAQ,EACR,IAAS,EACT,SAAS,GACV,EAAE;QACD,QAAQ,EAAE,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC,GAAG,CAAC;CA+DjB"}
@@ -1,35 +1,31 @@
1
1
  /**
2
2
  * WayFinder
3
- * Copyright (C) 2022-2025 Permanent Data Solutions, Inc. All Rights Reserved.
3
+ * Copyright (C) 2022-2025 Permanent Data Solutions, Inc.
4
4
  *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU Affero General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
9
8
  *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU Affero General Public License for more details.
9
+ * http://www.apache.org/licenses/LICENSE-2.0
14
10
  *
15
- * You should have received a copy of the GNU Affero General Public License
16
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
17
16
  */
18
17
  import { pLimit } from 'plimit-lit';
19
18
  import { defaultLogger } from '../wayfinder.js';
20
19
  export class FastestPingRoutingStrategy {
21
20
  timeoutMs;
22
- probePath;
23
21
  logger;
24
22
  maxConcurrency;
25
- constructor({ timeoutMs = 500, maxConcurrency = 50, probePath = '/ar-io/info', // TODO: limit to allowed /ar-io and arweave node endpoints
26
- logger = defaultLogger, } = {}) {
23
+ constructor({ timeoutMs = 500, maxConcurrency = 50, logger = defaultLogger, } = {}) {
27
24
  this.timeoutMs = timeoutMs;
28
- this.probePath = probePath;
29
25
  this.logger = logger;
30
26
  this.maxConcurrency = maxConcurrency;
31
27
  }
32
- async selectGateway({ gateways }) {
28
+ async selectGateway({ gateways, path = '', subdomain, }) {
33
29
  if (gateways.length === 0) {
34
30
  const error = new Error('No gateways provided');
35
31
  this.logger.error('Failed to select gateway', { error: error.message });
@@ -38,12 +34,16 @@ export class FastestPingRoutingStrategy {
38
34
  this.logger.debug(`Pinging ${gateways.length} gateways with timeout ${this.timeoutMs}ms`, {
39
35
  gateways: gateways.map((g) => g.toString()),
40
36
  timeoutMs: this.timeoutMs,
41
- probePath: this.probePath,
37
+ probePath: path,
42
38
  });
43
39
  const throttle = pLimit(Math.min(this.maxConcurrency, gateways.length));
44
40
  const pingPromises = gateways.map(async (gateway) => {
45
41
  return throttle(async () => {
46
- const pingUrl = `${gateway.toString().replace(/\/$/, '')}${this.probePath}`;
42
+ const url = new URL(gateway.toString());
43
+ if (subdomain) {
44
+ url.hostname = `${subdomain}.${url.hostname}`;
45
+ }
46
+ const pingUrl = new URL(path.replace(/^\//, ''), url).toString();
47
47
  this.logger.debug(`Pinging gateway ${gateway.toString()}`, {
48
48
  gateway: gateway.toString(),
49
49
  pingUrl,
@@ -61,7 +61,7 @@ export class FastestPingRoutingStrategy {
61
61
  throw new Error('Failed to ping gateway', {
62
62
  cause: {
63
63
  gateway: gateway.toString(),
64
- probePath: this.probePath,
64
+ probePath: path,
65
65
  status: response.status,
66
66
  },
67
67
  });
@@ -1,19 +1,18 @@
1
1
  /**
2
2
  * WayFinder
3
- * Copyright (C) 2022-2025 Permanent Data Solutions, Inc. All Rights Reserved.
3
+ * Copyright (C) 2022-2025 Permanent Data Solutions, Inc.
4
4
  *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU Affero General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
9
8
  *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU Affero General Public License for more details.
9
+ * http://www.apache.org/licenses/LICENSE-2.0
14
10
  *
15
- * You should have received a copy of the GNU Affero General Public License
16
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
17
16
  */
18
17
  import { RoutingStrategy } from '../../types/wayfinder.js';
19
18
  import { Logger } from '../wayfinder.js';
@@ -27,8 +26,10 @@ export declare class PreferredWithFallbackRoutingStrategy implements RoutingStra
27
26
  fallbackStrategy?: RoutingStrategy;
28
27
  logger?: Logger;
29
28
  });
30
- selectGateway({ gateways }: {
29
+ selectGateway({ gateways, path, subdomain, }: {
31
30
  gateways: URL[];
31
+ path?: string;
32
+ subdomain?: string;
32
33
  }): Promise<URL>;
33
34
  }
34
35
  //# sourceMappingURL=preferred-with-fallback.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"preferred-with-fallback.d.ts","sourceRoot":"","sources":["../../src/routing/preferred-with-fallback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAiB,MAAM,iBAAiB,CAAC;AAGxD,qBAAa,oCAAqC,YAAW,eAAe;IAC1E,SAAgB,IAAI,6BAA6B;IACjD,OAAO,CAAC,gBAAgB,CAAM;IAC9B,OAAO,CAAC,gBAAgB,CAAkB;IAC1C,OAAO,CAAC,MAAM,CAAS;gBAEX,EACV,gBAAgB,EAChB,gBAAmD,EACnD,MAAsB,GACvB,EAAE;QACD,gBAAgB,EAAE,MAAM,CAAC;QACzB,gBAAgB,CAAC,EAAE,eAAe,CAAC;QACnC,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;IAMK,aAAa,CAAC,EAAE,QAAa,EAAE,EAAE;QAAE,QAAQ,EAAE,GAAG,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,GAAG,CAAC;CAoC1E"}
1
+ {"version":3,"file":"preferred-with-fallback.d.ts","sourceRoot":"","sources":["../../src/routing/preferred-with-fallback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAiB,MAAM,iBAAiB,CAAC;AAGxD,qBAAa,oCAAqC,YAAW,eAAe;IAC1E,SAAgB,IAAI,6BAA6B;IACjD,OAAO,CAAC,gBAAgB,CAAM;IAC9B,OAAO,CAAC,gBAAgB,CAAkB;IAC1C,OAAO,CAAC,MAAM,CAAS;gBAEX,EACV,gBAAgB,EAChB,gBAAmD,EACnD,MAAsB,GACvB,EAAE;QACD,gBAAgB,EAAE,MAAM,CAAC;QACzB,gBAAgB,CAAC,EAAE,eAAe,CAAC;QACnC,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;IAMK,aAAa,CAAC,EAClB,QAAa,EACb,IAAS,EACT,SAAS,GACV,EAAE;QACD,QAAQ,EAAE,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC,GAAG,CAAC;CA6CjB"}
@@ -10,13 +10,18 @@ export class PreferredWithFallbackRoutingStrategy {
10
10
  this.fallbackStrategy = fallbackStrategy;
11
11
  this.preferredGateway = new URL(preferredGateway);
12
12
  }
13
- async selectGateway({ gateways = [] }) {
13
+ async selectGateway({ gateways = [], path = '', subdomain, }) {
14
14
  this.logger.debug('Attempting to connect to preferred gateway', {
15
15
  preferredGateway: this.preferredGateway.toString(),
16
16
  });
17
17
  try {
18
18
  // Check if the preferred gateway is responsive
19
- const response = await fetch(this.preferredGateway.toString(), {
19
+ const url = new URL(this.preferredGateway.toString());
20
+ if (subdomain) {
21
+ url.hostname = `${subdomain}.${url.hostname}`;
22
+ }
23
+ const probeUrl = path ? new URL(path.replace(/^\//, ''), url) : url;
24
+ const response = await fetch(probeUrl.toString(), {
20
25
  method: 'HEAD',
21
26
  signal: AbortSignal.timeout(1000),
22
27
  });
@@ -35,7 +40,11 @@ export class PreferredWithFallbackRoutingStrategy {
35
40
  fallbackStrategy: this.fallbackStrategy.constructor.name,
36
41
  });
37
42
  // Fall back to the provided routing strategy
38
- return this.fallbackStrategy.selectGateway({ gateways });
43
+ return this.fallbackStrategy.selectGateway({
44
+ gateways,
45
+ path,
46
+ subdomain,
47
+ });
39
48
  }
40
49
  }
41
50
  }
@@ -1,24 +1,25 @@
1
1
  /**
2
2
  * WayFinder
3
- * Copyright (C) 2022-2025 Permanent Data Solutions, Inc. All Rights Reserved.
3
+ * Copyright (C) 2022-2025 Permanent Data Solutions, Inc.
4
4
  *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU Affero General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
9
8
  *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU Affero General Public License for more details.
9
+ * http://www.apache.org/licenses/LICENSE-2.0
14
10
  *
15
- * You should have received a copy of the GNU Affero General Public License
16
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
17
16
  */
18
17
  import { RoutingStrategy } from '../../types/wayfinder.js';
19
18
  export declare class RandomRoutingStrategy implements RoutingStrategy {
20
- selectGateway({ gateways }: {
19
+ selectGateway({ gateways, }: {
21
20
  gateways: URL[];
21
+ path?: string;
22
+ subdomain?: string;
22
23
  }): Promise<URL>;
23
24
  }
24
25
  //# sourceMappingURL=random.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../src/routing/random.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAG3D,qBAAa,qBAAsB,YAAW,eAAe;IACrD,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE;QAAE,QAAQ,EAAE,GAAG,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,GAAG,CAAC;CAMrE"}
1
+ {"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../src/routing/random.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAG3D,qBAAa,qBAAsB,YAAW,eAAe;IACrD,aAAa,CAAC,EAClB,QAAQ,GACT,EAAE;QACD,QAAQ,EAAE,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC,GAAG,CAAC;CAMjB"}
@@ -1,6 +1,6 @@
1
1
  import { randomInt } from '../utils/random.js';
2
2
  export class RandomRoutingStrategy {
3
- async selectGateway({ gateways }) {
3
+ async selectGateway({ gateways, }) {
4
4
  if (gateways.length === 0) {
5
5
  throw new Error('No gateways available');
6
6
  }
@@ -1,19 +1,18 @@
1
1
  /**
2
2
  * WayFinder
3
- * Copyright (C) 2022-2025 Permanent Data Solutions, Inc. All Rights Reserved.
3
+ * Copyright (C) 2022-2025 Permanent Data Solutions, Inc.
4
4
  *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU Affero General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
9
8
  *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU Affero General Public License for more details.
9
+ * http://www.apache.org/licenses/LICENSE-2.0
14
10
  *
15
- * You should have received a copy of the GNU Affero General Public License
16
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
17
16
  */
18
17
  import { RoutingStrategy } from '../../types/wayfinder.js';
19
18
  /**
@@ -45,6 +44,8 @@ export declare class RoundRobinRoutingStrategy implements RoutingStrategy {
45
44
  });
46
45
  selectGateway({ gateways, }?: {
47
46
  gateways?: URL[];
47
+ path?: string;
48
+ subdomain?: string;
48
49
  }): Promise<URL>;
49
50
  }
50
51
  //# sourceMappingURL=round-robin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"round-robin.d.ts","sourceRoot":"","sources":["../../src/routing/round-robin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EA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}
@@ -1,19 +1,18 @@
1
1
  /**
2
2
  * WayFinder
3
- * Copyright (C) 2022-2025 Permanent Data Solutions, Inc. All Rights Reserved.
3
+ * Copyright (C) 2022-2025 Permanent Data Solutions, Inc.
4
4
  *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU Affero General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
9
8
  *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU Affero General Public License for more details.
9
+ * http://www.apache.org/licenses/LICENSE-2.0
14
10
  *
15
- * You should have received a copy of the GNU Affero General Public License
16
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
17
16
  */
18
17
  import { RoutingStrategy } from '../../types/wayfinder.js';
19
18
  /**
@@ -44,6 +43,8 @@ export declare class StaticRoutingStrategy implements RoutingStrategy {
44
43
  });
45
44
  selectGateway({ gateways, }?: {
46
45
  gateways?: URL[];
46
+ path?: string;
47
+ subdomain?: string;
47
48
  }): Promise<URL>;
48
49
  }
49
50
  //# sourceMappingURL=static.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"static.d.ts","sourceRoot":"","sources":["../../src/routing/static.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,MAAM,EAAiB,MAAM,iBAAiB,CAAC;AAExD,qBAAa,qBAAsB,YAAW,eAAe;IAC3D,SAAgB,IAAI,YAAY;IAChC,OAAO,CAAC,OAAO,CAAM;IACrB,OAAO,CAAC,MAAM,CAAS;gBAEX,EACV,OAAO,EACP,MAAsB,GACvB,EAAE;QACD,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;IAOK,aAAa,CAAC,EAClB,QAAa,GACd,GAAE;QACD,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC;KACb,GAAG,OAAO,CAAC,GAAG,CAAC;CAYtB"}
1
+ {"version":3,"file":"static.d.ts","sourceRoot":"","sources":["../../src/routing/static.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,MAAM,EAAiB,MAAM,iBAAiB,CAAC;AAExD,qBAAa,qBAAsB,YAAW,eAAe;IAC3D,SAAgB,IAAI,YAAY;IAChC,OAAO,CAAC,OAAO,CAAM;IACrB,OAAO,CAAC,MAAM,CAAS;gBAEX,EACV,OAAO,EACP,MAAsB,GACvB,EAAE;QACD,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;IAOK,aAAa,CAAC,EAClB,QAAa,GACd,GAAE;QACD,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;KACf,GAAG,OAAO,CAAC,GAAG,CAAC;CAYtB"}
@@ -1,19 +1,18 @@
1
1
  /**
2
2
  * WayFinder
3
- * Copyright (C) 2022-2025 Permanent Data Solutions, Inc. All Rights Reserved.
3
+ * Copyright (C) 2022-2025 Permanent Data Solutions, Inc.
4
4
  *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU Affero General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
9
8
  *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU Affero General Public License for more details.
9
+ * http://www.apache.org/licenses/LICENSE-2.0
14
10
  *
15
- * You should have received a copy of the GNU Affero General Public License
16
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
17
16
  */
18
17
  export declare const arioGatewayHeaders: {
19
18
  digest: string;
@@ -1 +1 @@
1
- {"version":3,"file":"ario.d.ts","sourceRoot":"","sources":["../../src/utils/ario.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;CAS9B,CAAC"}
1
+ {"version":3,"file":"ario.d.ts","sourceRoot":"","sources":["../../src/utils/ario.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;CAS9B,CAAC"}
@@ -1,19 +1,18 @@
1
1
  /**
2
2
  * WayFinder
3
- * Copyright (C) 2022-2025 Permanent Data Solutions, Inc. All Rights Reserved.
3
+ * Copyright (C) 2022-2025 Permanent Data Solutions, Inc.
4
4
  *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU Affero General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
9
8
  *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU Affero General Public License for more details.
9
+ * http://www.apache.org/licenses/LICENSE-2.0
14
10
  *
15
- * You should have received a copy of the GNU Affero General Public License
16
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
17
16
  */
18
17
  export const arioGatewayHeaders = {
19
18
  digest: 'x-ar-io-digest',
@@ -1,19 +1,18 @@
1
1
  /**
2
2
  * WayFinder
3
- * Copyright (C) 2022-2025 Permanent Data Solutions, Inc. All Rights Reserved.
3
+ * Copyright (C) 2022-2025 Permanent Data Solutions, Inc.
4
4
  *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU Affero General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
9
8
  *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU Affero General Public License for more details.
9
+ * http://www.apache.org/licenses/LICENSE-2.0
14
10
  *
15
- * You should have received a copy of the GNU Affero General Public License
16
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
17
16
  */
18
17
  export declare function fromB64Url(str: string): Uint8Array;
19
18
  export declare function toB64Url(bytes: Uint8Array): string;
@@ -1 +1 @@
1
- {"version":3,"file":"base64.d.ts","sourceRoot":"","sources":["../../src/utils/base64.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAsBH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAIlD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAGlD;AASD,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAEtD"}
1
+ {"version":3,"file":"base64.d.ts","sourceRoot":"","sources":["../../src/utils/base64.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAsBH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAIlD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAGlD;AASD,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAEtD"}
@@ -1,19 +1,18 @@
1
1
  /**
2
2
  * WayFinder
3
- * Copyright (C) 2022-2025 Permanent Data Solutions, Inc. All Rights Reserved.
3
+ * Copyright (C) 2022-2025 Permanent Data Solutions, Inc.
4
4
  *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU Affero General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
9
8
  *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU Affero General Public License for more details.
9
+ * http://www.apache.org/licenses/LICENSE-2.0
14
10
  *
15
- * You should have received a copy of the GNU Affero General Public License
16
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
17
16
  */
18
17
  import { createHash } from 'crypto';
19
18
  // safely encodes and decodes base64url strings to and from buffers
@@ -1 +1 @@
1
- {"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../src/utils/hash.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,MAAM,EAAiB,MAAM,iBAAiB,CAAC;AAGxD,wBAAgB,eAAe,CAC7B,GAAG,EAAE,OAAO,GACX,GAAG,IAAI,aAAa,CAAC,UAAU,CAAC,CAQlC;AAED,wBAAuB,6BAA6B,CAClD,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,GACjC,aAAa,CAAC,UAAU,CAAC,CAa3B;AAED,wBAAsB,sBAAsB,CAAC,EAC3C,MAAM,EACN,SAAqB,EACrB,MAAsB,GACvB,EAAE;IACD,MAAM,EAAE,UAAU,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CA2C9B"}
1
+ {"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../src/utils/hash.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,MAAM,EAAiB,MAAM,iBAAiB,CAAC;AAGxD,wBAAgB,eAAe,CAC7B,GAAG,EAAE,OAAO,GACX,GAAG,IAAI,aAAa,CAAC,UAAU,CAAC,CAQlC;AAED,wBAAuB,6BAA6B,CAClD,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,GACjC,aAAa,CAAC,UAAU,CAAC,CAa3B;AAED,wBAAsB,sBAAsB,CAAC,EAC3C,MAAM,EACN,SAAqB,EACrB,MAAsB,GACvB,EAAE;IACD,MAAM,EAAE,UAAU,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CA2C9B"}
@@ -1,19 +1,18 @@
1
1
  /**
2
2
  * WayFinder
3
- * Copyright (C) 2022-2025 Permanent Data Solutions, Inc. All Rights Reserved.
3
+ * Copyright (C) 2022-2025 Permanent Data Solutions, Inc.
4
4
  *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU Affero General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
9
8
  *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU Affero General Public License for more details.
9
+ * http://www.apache.org/licenses/LICENSE-2.0
14
10
  *
15
- * You should have received a copy of the GNU Affero General Public License
16
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
17
16
  */
18
17
  import { createHash } from 'crypto';
19
18
  import { defaultLogger } from '../wayfinder.js';
@@ -1,19 +1,18 @@
1
1
  /**
2
2
  * WayFinder
3
- * Copyright (C) 2022-2025 Permanent Data Solutions, Inc. All Rights Reserved.
3
+ * Copyright (C) 2022-2025 Permanent Data Solutions, Inc.
4
4
  *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU Affero General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
9
8
  *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU Affero General Public License for more details.
9
+ * http://www.apache.org/licenses/LICENSE-2.0
14
10
  *
15
- * You should have received a copy of the GNU Affero General Public License
16
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
17
16
  */
18
17
  /**
19
18
  * Returns a random integer between min (inclusive) and max (exclusive)
@@ -1 +1 @@
1
- {"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../src/utils/random.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAE1D"}
1
+ {"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../src/utils/random.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAE1D"}
@@ -1,19 +1,18 @@
1
1
  /**
2
2
  * WayFinder
3
- * Copyright (C) 2022-2025 Permanent Data Solutions, Inc. All Rights Reserved.
3
+ * Copyright (C) 2022-2025 Permanent Data Solutions, Inc.
4
4
  *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU Affero General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
9
8
  *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU Affero General Public License for more details.
9
+ * http://www.apache.org/licenses/LICENSE-2.0
14
10
  *
15
- * You should have received a copy of the GNU Affero General Public License
16
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
17
16
  */
18
17
  /**
19
18
  * Returns a random integer between min (inclusive) and max (exclusive)
@@ -1 +1 @@
1
- {"version":3,"file":"data-root-verifier.d.ts","sourceRoot":"","sources":["../../src/verification/data-root-verifier.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAM5E,OAAO,EAAE,MAAM,EAAiB,MAAM,iBAAiB,CAAC;AAExD,eAAO,MAAM,2BAA2B,GAAU,aAE/C;IACD,MAAM,EAAE,UAAU,CAAC;CACpB,KAAG,OAAO,CAAC,MAAM,CAwDjB,CAAC;AAEF,qBAAa,4BAA6B,YAAW,oBAAoB;IACvE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAQ;IACxC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IACxC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBACpB,EACV,eAAe,EACf,cAAkB,EAClB,MAAsB,GACvB,EAAE;QACD,eAAe,EAAE,GAAG,EAAE,CAAC;QACvB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;IAMD;;;;OAIG;IACG,WAAW,CAAC,EAAE,IAAI,EAAE,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAuCxD,UAAU,CAAC,EACf,IAAI,EACJ,IAAI,GACL,EAAE;QACD,IAAI,EAAE,UAAU,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;KACd,GAAG,OAAO,CAAC,IAAI,CAAC;CAelB"}
1
+ {"version":3,"file":"data-root-verifier.d.ts","sourceRoot":"","sources":["../../src/verification/data-root-verifier.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAM5E,OAAO,EAAE,MAAM,EAAiB,MAAM,iBAAiB,CAAC;AAExD,eAAO,MAAM,2BAA2B,GAAU,aAE/C;IACD,MAAM,EAAE,UAAU,CAAC;CACpB,KAAG,OAAO,CAAC,MAAM,CAwDjB,CAAC;AAEF,qBAAa,4BAA6B,YAAW,oBAAoB;IACvE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAQ;IACxC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IACxC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBACpB,EACV,eAAe,EACf,cAAkB,EAClB,MAAsB,GACvB,EAAE;QACD,eAAe,EAAE,GAAG,EAAE,CAAC;QACvB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;IAMD;;;;OAIG;IACG,WAAW,CAAC,EAAE,IAAI,EAAE,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAuCxD,UAAU,CAAC,EACf,IAAI,EACJ,IAAI,GACL,EAAE;QACD,IAAI,EAAE,UAAU,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;KACd,GAAG,OAAO,CAAC,IAAI,CAAC;CAelB"}
@@ -1,19 +1,18 @@
1
1
  /**
2
2
  * WayFinder
3
- * Copyright (C) 2022-2025 Permanent Data Solutions, Inc. All Rights Reserved.
3
+ * Copyright (C) 2022-2025 Permanent Data Solutions, Inc.
4
4
  *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU Affero General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
9
8
  *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU Affero General Public License for more details.
9
+ * http://www.apache.org/licenses/LICENSE-2.0
14
10
  *
15
- * You should have received a copy of the GNU Affero General Public License
16
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
17
16
  */
18
17
  import Arweave from 'arweave';
19
18
  import { MAX_CHUNK_SIZE, MIN_CHUNK_SIZE, buildLayers, generateLeaves, } from 'arweave/node/lib/merkle.js';
@@ -1 +1 @@
1
- {"version":3,"file":"hash-verifier.d.ts","sourceRoot":"","sources":["../../src/verification/hash-verifier.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAG5E,OAAO,EAAE,MAAM,EAAgC,MAAM,iBAAiB,CAAC;AAEvE,qBAAa,wBAAyB,YAAW,oBAAoB;IACnE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAQ;IACxC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IACxC,OAAO,CAAC,QAAQ,CAAC,MAAM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AqE5C,UAAU,CAAC,EACf,IAAI,EACJ,IAAI,GACL,EAAE;QACD,IAAI,EAAE,UAAU,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;KACd,GAAG,OAAO,CAAC,IAAI,CAAC;CAgBlB"}
@@ -1,19 +1,18 @@
1
1
  /**
2
2
  * WayFinder
3
- * Copyright (C) 2022-2025 Permanent Data Solutions, Inc. All Rights Reserved.
3
+ * Copyright (C) 2022-2025 Permanent Data Solutions, Inc.
4
4
  *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU Affero General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
9
8
  *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU Affero General Public License for more details.
9
+ * http://www.apache.org/licenses/LICENSE-2.0
14
10
  *
15
- * You should have received a copy of the GNU Affero General Public License
16
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
17
16
  */
18
17
  import { pLimit } from 'plimit-lit';
19
18
  import { arioGatewayHeaders } from '../utils/ario.js';
@@ -1,22 +1,21 @@
1
1
  /**
2
2
  * WayFinder
3
- * Copyright (C) 2022-2025 Permanent Data Solutions, Inc. All Rights Reserved.
3
+ * Copyright (C) 2022-2025 Permanent Data Solutions, Inc.
4
4
  *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU Affero General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
9
8
  *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU Affero General Public License for more details.
9
+ * http://www.apache.org/licenses/LICENSE-2.0
14
10
  *
15
- * You should have received a copy of the GNU Affero General Public License
16
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
17
16
  */
18
17
  import { EventEmitter } from 'eventemitter3';
19
- import { DataVerificationStrategy, GatewaysProvider, RoutingStrategy } from '../types/wayfinder.js';
18
+ import { GatewaysProvider, RoutingStrategy, VerificationStrategy } from '../types/wayfinder.js';
20
19
  type WayfinderHttpClient = typeof fetch;
21
20
  /**
22
21
  * Simple logger interface that Wayfinder will use
@@ -90,7 +89,7 @@ export declare class WayfinderEmitter extends EventEmitter<WayfinderEvent> {
90
89
  export declare function tapAndVerifyReadableStream({ originalStream, contentLength, verifyData, txId, emitter, strict, }: {
91
90
  originalStream: ReadableStream;
92
91
  contentLength: number;
93
- verifyData: DataVerificationStrategy['verifyData'];
92
+ verifyData: VerificationStrategy['verifyData'];
94
93
  txId: string;
95
94
  emitter?: WayfinderEmitter;
96
95
  strict?: boolean;
@@ -117,7 +116,7 @@ export declare const createWayfinderClient: ({ resolveUrl, verifyData, selectGat
117
116
  selectedGateway: URL;
118
117
  logger?: Logger;
119
118
  }) => URL;
120
- verifyData?: DataVerificationStrategy["verifyData"];
119
+ verifyData?: VerificationStrategy["verifyData"];
121
120
  logger?: Logger;
122
121
  emitter?: WayfinderEmitter;
123
122
  strict?: boolean;
@@ -144,7 +143,7 @@ export interface WayfinderOptions {
144
143
  * The verification strategy to use for verifying data
145
144
  * @default HashVerificationStrategy with TrustedGatewaysHashProvider
146
145
  */
147
- verificationStrategy?: DataVerificationStrategy;
146
+ verificationStrategy?: VerificationStrategy;
148
147
  /**
149
148
  * Event handlers for verification events
150
149
  */
@@ -210,11 +209,7 @@ export declare class Wayfinder {
210
209
  * @example
211
210
  * const wayfinder = new Wayfinder({
212
211
  * verificationStrategy: new HashVerificationStrategy({
213
- * trustedHashProvider: new TrustedGatewaysHashProvider({
214
- * gatewaysProvider: new StaticGatewaysProvider({
215
- * gateways: ['https://permagate.io'],
216
- * }),
217
- * }),
212
+ * trustedGateways: [new URL('https://permagate.io')],
218
213
  * }),
219
214
  * })
220
215
  *
@@ -248,7 +243,7 @@ export declare class Wayfinder {
248
243
  * },
249
244
  * });
250
245
  */
251
- readonly verifyData: DataVerificationStrategy['verifyData'];
246
+ readonly verifyData: VerificationStrategy['verifyData'];
252
247
  /**
253
248
  * Whether verification should be strict (blocking) or not.
254
249
  * If true, verification failures will cause requests to fail.
@@ -1 +1 @@
1
- {"version":3,"file":"wayfinder.d.ts","sourceRoot":"","sources":["../src/wayfinder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAG7C,OAAO,EACL,wBAAwB,EACxB,gBAAgB,EAChB,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAK/B,KAAK,mBAAmB,GAAG,OAAO,KAAK,CAAC;AAExC;;;GAGG;AACH,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;IACjD,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;IAChD,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,E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;;;OAcG;IACH,SAAgB,UAAU,EAAE,CAAC,MAAM,EAAE;QACnC,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IAEnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,SAAgB,OAAO,EAAE,mBAAmB,CAAC;IAE7C;;;;;;;;;;OAUG;IACH,SAAgB,UAAU,EAAE,oBAAoB,CAAC,YAAY,CAAC,CAAC;IAE/D;;;;OAIG;IACH,SAAgB,MAAM,EAAE,OAAO,CAAC;IAEhC;;OAEG;IACH,SAAgB,MAAM,EAAE,MAAM,CAAC;IAE/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,SAAgB,OAAO,EAAE,gBAAgB,CAAC;IAE1C;;;OAGG;gBACS,EACV,MAAsB,EACtB,gBAAgB,EAChB,eAGE,EACF,oBAEE,EACF,MAcC,EACD,MAAc,GACf,EAAE,gBAAgB;CAuCpB"}
package/dist/wayfinder.js CHANGED
@@ -1,19 +1,18 @@
1
1
  /**
2
2
  * WayFinder
3
- * Copyright (C) 2022-2025 Permanent Data Solutions, Inc. All Rights Reserved.
3
+ * Copyright (C) 2022-2025 Permanent Data Solutions, Inc.
4
4
  *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU Affero General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
9
8
  *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU Affero General Public License for more details.
9
+ * http://www.apache.org/licenses/LICENSE-2.0
14
10
  *
15
- * You should have received a copy of the GNU Affero General Public License
16
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
17
16
  */
18
17
  import { EventEmitter } from 'eventemitter3';
19
18
  import { base32 } from 'rfc4648';
@@ -361,11 +360,7 @@ export class Wayfinder {
361
360
  * @example
362
361
  * const wayfinder = new Wayfinder({
363
362
  * verificationStrategy: new HashVerificationStrategy({
364
- * trustedHashProvider: new TrustedGatewaysHashProvider({
365
- * gatewaysProvider: new StaticGatewaysProvider({
366
- * gateways: ['https://permagate.io'],
367
- * }),
368
- * }),
363
+ * trustedGateways: [new URL('https://permagate.io')],
369
364
  * }),
370
365
  * })
371
366
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ar.io/wayfinder-core",
3
- "version": "0.0.2-beta.0",
3
+ "version": "0.0.3-alpha.1",
4
4
  "description": "WayFinder core library for intelligently routing to optimal AR.IO gateways",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -13,7 +13,11 @@
13
13
  "wayfinder",
14
14
  "ar://"
15
15
  ],
16
- "author": "Permanent Data Solutions, Inc.",
16
+ "author": {
17
+ "name": "Permanent Data Solutions Inc",
18
+ "email": "info@ar.io",
19
+ "website": "https://ar.io"
20
+ },
17
21
  "publishConfig": {
18
22
  "access": "public"
19
23
  },
@@ -36,6 +40,7 @@
36
40
  "scripts": {
37
41
  "build": "npm run clean && tsc",
38
42
  "clean": "rimraf dist",
43
+ "test": "npm run test:unit",
39
44
  "test:unit": "c8 node --import=../../register.mjs --test --enable-source-maps --trace-warnings 'src/**/*.test.ts'",
40
45
  "lint:fix": "biome check --write --unsafe",
41
46
  "lint:check": "biome check --unsafe",
@@ -43,6 +48,7 @@
43
48
  "format:check": "biome format"
44
49
  },
45
50
  "dependencies": {
51
+ "@dha-team/arbundles": "^1.0.3",
46
52
  "arweave": "^1.14.0",
47
53
  "eventemitter3": "^5.0.1",
48
54
  "plimit-lit": "^3.0.1",