@ardrive/turbo-sdk 1.2.0 → 1.3.0-alpha.2
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 +13 -2
- package/bundles/web.bundle.min.js +46326 -48343
- package/lib/cjs/node/factory.js +16 -5
- package/lib/cjs/node/signer.js +5 -10
- package/lib/cjs/version.js +1 -1
- package/lib/cjs/web/factory.js +16 -5
- package/lib/cjs/web/signer.js +17 -14
- package/lib/esm/node/factory.js +16 -5
- package/lib/esm/node/signer.js +6 -8
- package/lib/esm/version.js +1 -1
- package/lib/esm/web/factory.js +16 -5
- package/lib/esm/web/signer.js +17 -11
- package/lib/types/common/payment.d.ts +2 -2
- package/lib/types/common/payment.d.ts.map +1 -1
- package/lib/types/common/upload.d.ts +2 -2
- package/lib/types/common/upload.d.ts.map +1 -1
- package/lib/types/node/factory.d.ts +1 -17
- package/lib/types/node/factory.d.ts.map +1 -1
- package/lib/types/node/signer.d.ts +5 -22
- package/lib/types/node/signer.d.ts.map +1 -1
- package/lib/types/types.d.ts +6 -4
- package/lib/types/types.d.ts.map +1 -1
- package/lib/types/version.d.ts +1 -1
- package/lib/types/web/factory.d.ts +1 -17
- package/lib/types/web/factory.d.ts.map +1 -1
- package/lib/types/web/signer.d.ts +5 -22
- package/lib/types/web/signer.d.ts.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
@@ -49,11 +49,15 @@ yarn add @ardrive/turbo-sdk
|
|
49
49
|
```typescript
|
50
50
|
import { TurboFactory } from '@ardrive/turbo-sdk';
|
51
51
|
|
52
|
-
// load your JWK
|
52
|
+
// load your JWK directly to authenticate
|
53
53
|
const jwk = fs.readFileSync('./my-jwk.json');
|
54
54
|
const address = arweave.wallets.jwkToAddress(jwk);
|
55
55
|
const turbo = TurboFactory.authenticated({ privateKey: jwk });
|
56
56
|
|
57
|
+
// or provide your own signer
|
58
|
+
const signer = new ArweaveSigner(jwk);
|
59
|
+
const turbo = TurboFactory.authenticated({ signer });
|
60
|
+
|
57
61
|
// get the wallet balance
|
58
62
|
const { winc: balance } = await turbo.getBalance();
|
59
63
|
|
@@ -229,13 +233,20 @@ Types are exported from `./lib/types/[node/web]/index.d.ts` and should be automa
|
|
229
233
|
const turbo = TurboFactory.unauthenticated();
|
230
234
|
```
|
231
235
|
|
232
|
-
- `authenticated()` - Creates an instance of a client that accesses Turbo's authenticated and unauthenticated services.
|
236
|
+
- `authenticated()` - Creates an instance of a client that accesses Turbo's authenticated and unauthenticated services. Requires either a signer, or private key to be provided.
|
233
237
|
|
234
238
|
```typescript
|
235
239
|
const jwk = await arweave.crypto.generateJWK();
|
236
240
|
const turbo = TurboFactory.authenticated({ privateKey: jwk });
|
237
241
|
```
|
238
242
|
|
243
|
+
or
|
244
|
+
|
245
|
+
```typescript
|
246
|
+
const signer = new ArweaveSigner(jwk);
|
247
|
+
const turbo = TurboFactory.authenticated({ signer });
|
248
|
+
```
|
249
|
+
|
239
250
|
### TurboUnauthenticatedClient
|
240
251
|
|
241
252
|
- `getSupportedCurrencies()` - Returns the list of currencies supported by the Turbo Payment Service for topping up a user balance of AR Credits (measured in Winston Credits, or winc).
|