@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 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 from a file or generate a new one
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).