diff --git a/docs/src/docs/turbo/turbo-sdk/index.md b/docs/src/docs/turbo/turbo-sdk/index.md index 13b2394..504f77c 100644 --- a/docs/src/docs/turbo/turbo-sdk/index.md +++ b/docs/src/docs/turbo/turbo-sdk/index.md @@ -36,13 +36,17 @@ yarn add @ardrive/turbo-sdk ## Quick Start ```typescript -import { TurboFactory } from '@ardrive/turbo-sdk'; +import { TurboFactory, ArweaveSigner } from '@ardrive/turbo-sdk'; -// load your JWK from a file or generate a new one +// load your JWK directly to authenticate const jwk = fs.readFileSync('./my-jwk.json'); const address = arweave.wallets.jwkToAddress(jwk); const turbo = TurboFactory.authenticated({ privateKey: jwk }); +// or provide your own signer +const signer = new ArweaveSigner(jwk); +const turbo = TurboFactory.authenticated({ signer }); + // get the wallet balance const { winc: balance } = await turbo.getBalance(); @@ -92,14 +96,25 @@ The SDK is provided in both CommonJS and ESM formats, and it's compatible with b #### Bundlers (Webpack, Rollup, ESbuild, etc.) -```javascript +CommonJS: + +```typescript import { TurboFactory } from "@ardrive/turbo-sdk"; const turbo = TurboFactory.unauthenticated(); const rates = await turbo.getFiatRates(); ``` -#### Browser +ESM: + +```typescript +import { TurboFactory } from "@ardrive/turbo-sdk/"; + +const turbo = TurboFactory.unauthenticated(); +const rates = await turbo.getFiatRates(); +``` + +Browser: ```html