@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 +50 -3
- package/bundles/web.bundle.min.js +37254 -14090
- package/lib/cjs/common/factory.js +6 -1
- package/lib/cjs/common/signer.js +15 -0
- package/lib/cjs/common/token/ethereum.js +70 -0
- package/lib/cjs/common/token/index.js +3 -1
- package/lib/cjs/types.js +8 -4
- package/lib/cjs/version.js +1 -1
- package/lib/cjs/web/factory.js +6 -1
- package/lib/esm/common/factory.js +7 -2
- package/lib/esm/common/signer.js +15 -0
- package/lib/esm/common/token/ethereum.js +64 -0
- package/lib/esm/common/token/index.js +3 -1
- package/lib/esm/types.js +6 -3
- package/lib/esm/version.js +1 -1
- package/lib/esm/web/factory.js +7 -2
- package/lib/types/common/factory.d.ts +2 -2
- package/lib/types/common/factory.d.ts.map +1 -1
- package/lib/types/common/payment.d.ts +2 -2
- package/lib/types/common/payment.d.ts.map +1 -1
- package/lib/types/common/signer.d.ts +3 -1
- package/lib/types/common/signer.d.ts.map +1 -1
- package/lib/types/common/token/ethereum.d.ts +36 -0
- package/lib/types/common/token/ethereum.d.ts.map +1 -0
- package/lib/types/common/token/index.d.ts +1 -0
- package/lib/types/common/token/index.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/types.d.ts +15 -6
- package/lib/types/types.d.ts.map +1 -1
- package/lib/types/version.d.ts +1 -1
- package/lib/types/web/factory.d.ts +2 -2
- package/lib/types/web/factory.d.ts.map +1 -1
- package/package.json +2 -1
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
|
-
|
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
|
-
|
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
|
-
|
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
|