@ardrive/turbo-sdk 1.8.0 → 1.9.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
@@ -183,32 +183,59 @@ const turbo = TurboFactory.unauthenticated();
183
183
 
184
184
  Creates an instance of a client that accesses Turbo's authenticated and unauthenticated services. Requires either a signer, or private key to be provided.
185
185
 
186
+ ##### Construct Turbo with an Arweave JWK
187
+
186
188
  ```typescript
187
189
  const jwk = await arweave.crypto.generateJWK();
188
190
  const turbo = TurboFactory.authenticated({ privateKey: jwk });
189
191
  ```
190
192
 
191
- or
193
+ ##### Construct Turbo with an Arweave signer
192
194
 
193
195
  ```typescript
194
196
  const signer = new ArweaveSigner(jwk);
195
197
  const turbo = TurboFactory.authenticated({ signer });
196
198
  ```
197
199
 
198
- or with ETH signer
200
+ ##### Construct Turbo with an Arconnect signer
201
+
202
+ ```typescript
203
+ const signer = new ArconnectSigner(window.arweaveWallet);
204
+ const turbo = TurboFactory.authenticated({ signer });
205
+ ```
206
+
207
+ ##### Construct Turbo with an ETH signer
199
208
 
200
209
  ```typescript
201
210
  const signer = new EthereumSigner(privateKey);
202
211
  const turbo = TurboFactory.authenticated({ signer });
203
212
  ```
204
213
 
205
- or with SOL signer
214
+ ##### Construct Turbo with an ETH private key
215
+
216
+ ```typescript
217
+ const turbo = TurboFactory.authenticated({
218
+ privateKey: ethHexadecimalPrivateKey,
219
+ token: 'ethereum',
220
+ });
221
+ ```
222
+
223
+ ##### Construct Turbo with a SOL signer
206
224
 
207
225
  ```typescript
208
226
  const signer = new HexSolanaSigner(bs58.encode(secretKey));
209
227
  const turbo = TurboFactory.authenticated({ signer });
210
228
  ```
211
229
 
230
+ ##### Construct Turbo with a SOL secret key
231
+
232
+ ```typescript
233
+ const turbo = TurboFactory.authenticated({
234
+ privateKey: bs58.encode(secretKey),
235
+ token: 'solana',
236
+ });
237
+ ```
238
+
212
239
  ### TurboUnauthenticatedClient
213
240
 
214
241
  #### `getSupportedCurrencies()`
@@ -426,6 +453,26 @@ const { winc, status, id, ...fundResult } = await turbo.topUpWithTokens({
426
453
  });
427
454
  ```
428
455
 
456
+ ##### Top up ETH tokens to ETH wallet
457
+
458
+ ```ts
459
+ const turbo = TurboFactory.authenticated({ signer, token: 'ethereum' });
460
+
461
+ const { winc, status, id, ...fundResult } = await turbo.topUpWithTokens({
462
+ tokenAmount: ETHToTokenAmount(0.00001), // 0.00001 ETH
463
+ });
464
+ ```
465
+
466
+ ##### Top up SOL tokens to SOL wallet
467
+
468
+ ```ts
469
+ const turbo = TurboFactory.authenticated({ signer, token: 'solana' });
470
+
471
+ const { winc, status, id, ...fundResult } = await turbo.topUpWithTokens({
472
+ tokenAmount: SOLToTokenAmount(0.00001), // 0.00001 SOL
473
+ });
474
+ ```
475
+
429
476
  ## Developers
430
477
 
431
478
  ### Requirements