@ardrive/turbo-sdk 1.0.0-alpha.2 → 1.0.0-alpha.20

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 (80) hide show
  1. package/bundles/web.bundle.min.js +277 -38
  2. package/lib/cjs/common/factory.js +17 -0
  3. package/lib/cjs/common/http.js +49 -0
  4. package/lib/cjs/common/index.js +35 -0
  5. package/lib/cjs/common/jwk.js +2 -0
  6. package/lib/cjs/common/payment.js +86 -0
  7. package/lib/cjs/common/turbo.js +105 -0
  8. package/lib/cjs/common/upload.js +59 -0
  9. package/lib/cjs/node/factory.js +34 -0
  10. package/lib/cjs/node/index.js +36 -0
  11. package/lib/cjs/node/signer.js +61 -0
  12. package/lib/cjs/package.json +1 -0
  13. package/lib/cjs/types.js +2 -0
  14. package/lib/cjs/utils/axiosClient.js +66 -0
  15. package/lib/cjs/utils/base64.js +47 -0
  16. package/lib/cjs/utils/errors.js +33 -0
  17. package/lib/cjs/utils/readableStream.js +28 -0
  18. package/lib/cjs/web/factory.js +34 -0
  19. package/lib/cjs/web/index.js +36 -0
  20. package/lib/cjs/web/signer.js +71 -0
  21. package/lib/{web → esm/node}/index.js +1 -0
  22. package/lib/{utils → esm/utils}/axiosClient.js +14 -8
  23. package/lib/{node → esm/web}/index.js +1 -0
  24. package/lib/{web → esm/web}/signer.js +6 -3
  25. package/lib/{common → types/common}/factory.d.ts +2 -1
  26. package/lib/types/common/factory.d.ts.map +1 -0
  27. package/lib/{common → types/common}/http.d.ts +7 -6
  28. package/lib/types/common/http.d.ts.map +1 -0
  29. package/lib/{common → types/common}/index.d.ts +1 -0
  30. package/lib/types/common/index.d.ts.map +1 -0
  31. package/lib/types/{arweave.d.ts → common/jwk.d.ts} +1 -0
  32. package/lib/types/common/jwk.d.ts.map +1 -0
  33. package/lib/{common → types/common}/payment.d.ts +2 -1
  34. package/lib/types/common/payment.d.ts.map +1 -0
  35. package/lib/{common → types/common}/turbo.d.ts +2 -1
  36. package/lib/types/common/turbo.d.ts.map +1 -0
  37. package/lib/{common → types/common}/upload.d.ts +2 -1
  38. package/lib/types/common/upload.d.ts.map +1 -0
  39. package/lib/{node → types/node}/factory.d.ts +2 -1
  40. package/lib/types/node/factory.d.ts.map +1 -0
  41. package/lib/{web → types/node}/index.d.ts +2 -0
  42. package/lib/types/node/index.d.ts.map +1 -0
  43. package/lib/{node → types/node}/signer.d.ts +4 -3
  44. package/lib/types/node/signer.d.ts.map +1 -0
  45. package/lib/types/{turbo.d.ts → types.d.ts} +7 -6
  46. package/lib/types/types.d.ts.map +1 -0
  47. package/lib/{utils → types/utils}/axiosClient.d.ts +3 -2
  48. package/lib/types/utils/axiosClient.d.ts.map +1 -0
  49. package/lib/{utils → types/utils}/base64.d.ts +4 -3
  50. package/lib/types/utils/base64.d.ts.map +1 -0
  51. package/lib/{utils → types/utils}/errors.d.ts +1 -0
  52. package/lib/types/utils/errors.d.ts.map +1 -0
  53. package/lib/{utils → types/utils}/readableStream.d.ts +3 -2
  54. package/lib/types/utils/readableStream.d.ts.map +1 -0
  55. package/lib/{web → types/web}/factory.d.ts +2 -1
  56. package/lib/types/web/factory.d.ts.map +1 -0
  57. package/lib/{node → types/web}/index.d.ts +2 -0
  58. package/lib/types/web/index.d.ts.map +1 -0
  59. package/lib/{web → types/web}/signer.d.ts +6 -5
  60. package/lib/types/web/signer.d.ts.map +1 -0
  61. package/package.json +19 -16
  62. package/lib/LICENSE.md +0 -661
  63. package/lib/README.md +0 -114
  64. package/lib/package.json +0 -105
  65. package/lib/types/index.d.ts +0 -18
  66. package/lib/types/index.js +0 -18
  67. /package/lib/{common → esm/common}/factory.js +0 -0
  68. /package/lib/{common → esm/common}/http.js +0 -0
  69. /package/lib/{common → esm/common}/index.js +0 -0
  70. /package/lib/{types/arweave.js → esm/common/jwk.js} +0 -0
  71. /package/lib/{common → esm/common}/payment.js +0 -0
  72. /package/lib/{common → esm/common}/turbo.js +0 -0
  73. /package/lib/{common → esm/common}/upload.js +0 -0
  74. /package/lib/{node → esm/node}/factory.js +0 -0
  75. /package/lib/{node → esm/node}/signer.js +0 -0
  76. /package/lib/{types/turbo.js → esm/types.js} +0 -0
  77. /package/lib/{utils → esm/utils}/base64.js +0 -0
  78. /package/lib/{utils → esm/utils}/errors.js +0 -0
  79. /package/lib/{utils → esm/utils}/readableStream.js +0 -0
  80. /package/lib/{web → esm/web}/factory.js +0 -0
package/lib/README.md DELETED
@@ -1,114 +0,0 @@
1
- # @ardriveapp/turbo-sdk 🚀
2
-
3
- Welcome to the `@ardrive/turbo-sdk`! This SDK provides functionalities for interacting with the Turbo Upload and Payment Services. It is available in both NodeJS and Web environments.
4
-
5
- ## Table of Contents
6
-
7
- - [Installation](#installation)
8
- - [Usage](#usage):
9
-
10
- - [NodeJS Environments](#nodejs)
11
- - [CommonJS](#commonjs)
12
- - [ESM](#esm)
13
- - [Web Environments](#web)
14
- - [Bundlers (Webpack, Rollup, ESbuild, etc.)](#bundlers-webpack-rollup-esbuild-etc)
15
- - [Browser](#browser)
16
- - [Typescript](#typescript)
17
- - [Examples](./examples)
18
-
19
- - [Contributions](#contributions)
20
-
21
- ## Installation
22
-
23
- ```shell
24
- npm install @ardrive/turbo-sdk
25
- ```
26
-
27
- or
28
-
29
- ```shell
30
- yarn add @ardrive/turbo-sdk
31
- ```
32
-
33
- ## Usage
34
-
35
- The SDK is available in both CommonJS and ESM formats and is compatible with bundlers such as Webpack, Rollup, and ESbuild.
36
-
37
- ### Web
38
-
39
- #### Bundlers (Webpack, Rollup, ESbuild, etc.)
40
-
41
- ```javascript
42
- import { TurboFactory } from '@ardrive/turbo-sdk/web';
43
-
44
- const turbo = TurboFactory.unauthenticated({});
45
- const rates = await turbo.getFiatRates();
46
- ```
47
-
48
- #### Browser
49
-
50
- ```html
51
- <script src="https://cdn.jsdelivr.net/npm/@ardrive/turbo-sdk"></script>
52
- <script>
53
- const turbo = TurboFactory.unauthenticated({});
54
- const rates = await turbo.getFiatRates();
55
- </script>
56
- ```
57
-
58
- ### NodeJS
59
-
60
- #### CommonJS
61
-
62
- ```javascript
63
- const { TurboFactory } = require('@ardrive/turbo-sdk/node');
64
-
65
- const turbo = TurboFactory.unauthenticated({});
66
- const rates = await turbo.getFiatRates();
67
- ```
68
-
69
- ### ESM
70
-
71
- ```javascript
72
- import { TurboFactory } from '@ardrive/turbo-sdk/node';
73
-
74
- const turbo = TurboFactory.unauthenticated({});
75
- const rates = await turbo.getFiatRates();
76
- ```
77
-
78
- ### Typescript
79
-
80
- The SDK provides TypeScript typings. When you import the SDK in a TypeScript project:
81
-
82
- ```typescript
83
- import Ardrive from '@ardrive/turbo-sdk/web';
84
-
85
- // or '@ardrive/turbo-sdk/node' for Node.js projects
86
- ```
87
-
88
- The provided typings (`./lib/types/index.d.ts`) will be automatically recognized, offering type checking and autocompletion benefits.
89
-
90
- ## APIs (WIP)
91
-
92
- ### TurboFactory
93
-
94
- - `public()`
95
- - `private()`
96
-
97
- ### TurboUnauthenticatedClient
98
-
99
- - `getFiatRates()`
100
- - `getFiatToAR()`
101
- - `getSupportedCountries()`
102
- - `getSupportedCurrencies()`
103
- - `getWincForFiat()`
104
- - `getUploadCosts()`
105
- - `uploadSignedDataItem()`
106
-
107
- ### TurboAuthenticatedClient
108
-
109
- - `getBalance()`
110
- - `uploadFile()`
111
-
112
- ## Contributions
113
-
114
- If you encounter any issues or have feature requests, please file an issue on our GitHub repository. Contributions, pull requests, and feedback are welcome and encouraged.
package/lib/package.json DELETED
@@ -1,105 +0,0 @@
1
- {
2
- "name": "@ardrive/turbo-sdk",
3
- "version": "1.0.0-alpha.1",
4
- "main": "./lib/node/index.js",
5
- "types": "./lib/types/index.d.ts",
6
- "type": "module",
7
- "repository": {
8
- "type": "git",
9
- "url": "https://github.com/ardriveapp/turbo-sdk.git"
10
- },
11
- "files": [
12
- "lib",
13
- "bundles",
14
- "LICENSE",
15
- "README.md"
16
- ],
17
- "author": {
18
- "name": "Permanent Data Solutions Inc",
19
- "email": "info@ardrive.io",
20
- "website": "https://ardrive.io"
21
- },
22
- "exports": {
23
- ".": {
24
- "import": "./lib/node/index.js",
25
- "require": "./lib/node/index.js",
26
- "types": "./lib/types/index.d.ts",
27
- "browser": "./bundles/web.bundle.min.js"
28
- },
29
- "./node": {
30
- "import": "./lib/node/index.js",
31
- "require": "./lib/node/index.js",
32
- "types": "./lib/types/index.d.ts"
33
- },
34
- "./web": {
35
- "import": "./lib/web/index.js",
36
- "require": "./lib/web/index.js",
37
- "types": "./lib/types/index.d.ts",
38
- "browser": "./bundles/web.bundle.min.js"
39
- }
40
- },
41
- "engines": {
42
- "node": ">=18"
43
- },
44
- "license": "AGPL-3.0-or-later",
45
- "scripts": {
46
- "build:web": "node bundle.cjs",
47
- "build:esm": "yarn tsc -p tsconfig.node.json && yarn tsc -p tsconfig.web.json && cp package.json README.md LICENSE.md ./lib",
48
- "build": "yarn clean && yarn build:web && yarn build:esm",
49
- "clean": "rimraf [ lib coverage bundles ]",
50
- "lint": "eslint src",
51
- "lint:fix": "eslint src --fix",
52
- "format": "prettier --check .",
53
- "format:fix": "prettier --write .",
54
- "test": "c8 mocha --config .mocharc --exit",
55
- "test:web": "c8 mocha --config .mocharc --exclude tests/**/*.node.test.ts --exit",
56
- "test:node": "c8 mocha --config .mocharc --exclude tests/**/*.web.test.ts --exit",
57
- "prepare": "husky install",
58
- "example:mjs": "yarn build:esm && node examples/node/index.mjs",
59
- "example:cjs": "yarn build:esm && node examples/node/index.cjs",
60
- "example:web": "yarn build:web && cp -r bundles/* examples/web && http-server --port 8080 --host -o examples/web"
61
- },
62
- "dependencies": {
63
- "arbundles": "^0.9.9",
64
- "arweave": "^1.14.4",
65
- "axios": "^1.4.0",
66
- "retry-axios": "^3.0.0",
67
- "winston": "^3.10.0"
68
- },
69
- "devDependencies": {
70
- "@commitlint/cli": "^17.1.2",
71
- "@commitlint/config-conventional": "^17.1.0",
72
- "@esbuild-plugins/node-modules-polyfill": "^0.2.2",
73
- "@semantic-release/changelog": "^6.0.3",
74
- "@semantic-release/git": "^10.0.1",
75
- "@trivago/prettier-plugin-sort-imports": "^4.2.0",
76
- "@types/chai": "^4.3.5",
77
- "@types/mocha": "^10.0.1",
78
- "@types/node": "^20.4.8",
79
- "@types/sinon": "^10.0.15",
80
- "@typescript-eslint/eslint-plugin": "^5.62.0",
81
- "@typescript-eslint/parser": "^6.4.0",
82
- "c8": "^8.0.1",
83
- "chai": "^4.3.7",
84
- "esbuild": "^0.19.2",
85
- "eslint": "^8.47.0",
86
- "eslint-config-prettier": "^9.0.0",
87
- "eslint-config-standard-with-typescript": "^37.0.0",
88
- "eslint-plugin-header": "^3.1.1",
89
- "eslint-plugin-import": "^2.28.0",
90
- "eslint-plugin-mocha": "^10.1.0",
91
- "eslint-plugin-n": "^16.0.1",
92
- "eslint-plugin-prettier": "^5.0.0",
93
- "eslint-plugin-promise": "^6.1.1",
94
- "http-server": "^14.1.1",
95
- "husky": "^8.0.3",
96
- "mocha": "^10.2.0",
97
- "node-stdlib-browser": "^1.2.0",
98
- "prettier": "^3.0.2",
99
- "rimraf": "^5.0.1",
100
- "semantic-release": "^21.0.7",
101
- "sinon": "^15.2.0",
102
- "ts-node": "^10.9.1",
103
- "typescript": "^5.1.6"
104
- }
105
- }
@@ -1,18 +0,0 @@
1
- /**
2
- * Copyright (C) 2022-2023 Permanent Data Solutions, Inc. All Rights Reserved.
3
- *
4
- * This program is free software: you can redistribute it and/or modify
5
- * it under the terms of the GNU Affero General Public License as published by
6
- * the Free Software Foundation, either version 3 of the License, or
7
- * (at your option) any later version.
8
- *
9
- * This program is distributed in the hope that it will be useful,
10
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- * GNU Affero General Public License for more details.
13
- *
14
- * You should have received a copy of the GNU Affero General Public License
15
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
16
- */
17
- export * from './arweave.js';
18
- export * from './turbo.js';
@@ -1,18 +0,0 @@
1
- /**
2
- * Copyright (C) 2022-2023 Permanent Data Solutions, Inc. All Rights Reserved.
3
- *
4
- * This program is free software: you can redistribute it and/or modify
5
- * it under the terms of the GNU Affero General Public License as published by
6
- * the Free Software Foundation, either version 3 of the License, or
7
- * (at your option) any later version.
8
- *
9
- * This program is distributed in the hope that it will be useful,
10
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- * GNU Affero General Public License for more details.
13
- *
14
- * You should have received a copy of the GNU Affero General Public License
15
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
16
- */
17
- export * from './arweave.js';
18
- export * from './turbo.js';
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes