Skip to content

Commit

Permalink
Merge pull request #140 from ardriveapp/alpha
Browse files Browse the repository at this point in the history
chore: release v1.11.0
  • Loading branch information
fedellen authored Aug 29, 2024
2 parents c334e39 + a8695b8 commit d2f28ff
Show file tree
Hide file tree
Showing 30 changed files with 1,796 additions and 97 deletions.
12 changes: 12 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,15 @@ NODE_ENV=test
UPLOAD_SERVICE_URL=http://localhost:3000
PAYMENT_SERVICE_URL=http://localhost:4000
ARWEAVE_GATEWAY=http://localhost:1984
BUNDLER_ARWEAVE_WALLET='{
"kty": "RSA",
"n": "hlziBgDh3L-NoSdLryUOOV-RTcti5RviXGhuYoYyDclC48xIvJAUlxAS9oX2VHJz-Y8lxtkLa-nr5_XjsIsb5TbKepW0hCkAnLvR9VRx000nk6hOjJddkfjB1qpFallH4sWoXYLcHFhRvnMBOn9S3bJTDWl1lo0Ncjfw61vfoOoPLSgfgLK5jpHPrzhRnyNFaJgkEe_OBI1ehttzFPQ9Re6h3qQRRipGl7pb2UsStyfbWfZ6302Ae3oiHTZfRYEkzTtswEcVkFMI35h1-o_-UfD8F__5LDpSM2XMEbP9B5DfMihdBLTunZRCPeGzxHwDcduXxmOlmmSZeCdKmDEO-4EfmhtVzM2PCc1yspbcgwX45jdt0v593YNUGZXNhi17g4ldmk60hn-zbiVKJLghjL-0iwUt6xeb6xRzpOejM5IMj4O_IPIfTD_ThNtpOMOj93TXzzNQzZZEWaLi5IvNJB-Ic5mHii3PC2hoSdtzEB5k86bAH-Nc3xru69UCrj7Ch5NcPnmqCHY5A0Adamw9HrcVCZtDvb2QhTd7oXguRcF4nkXBMVhS56lfrTcOoeTrVr3Nq5jU9HqGH8Zss_VN3j1mjD8hcS2JOi9FAHeFQWyXSuXRhroLWKtXi2KIQ51a5ecBF5QknoRpQaa6RDQTtBn-sH-SStUg-rVhvEZcd50",
"e": "AQAB",
"d": "Axuq7tCeaOjVceDi005cId-gENiflQUsG08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bdlGD9EWLHQuo_dxo_paYjzF5E_D9OapElUVVmPt5iudYFmvEdxzDhDUzJmuhnDWivjeDV79uxJDJe7Fd01Hbjmn7E4iYv0whQOzRsz_Rjjh56Tu5rHRETacZveofBz-g1lGZsuOth6oS-xabNRDsizgDq55nLp4F3V0OJLxrTR4b1xAFJGX1Fsxf5FXIsBr1ClRWjD_o6CMOvjtLHG4T8-10-6_suVZFA",
"kid": "2011-04-29"
}'
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ coverage
dist
.husky/_

data

# Example files
*.min.js

Expand Down
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
. "$(dirname -- "$0")/_/husky.sh"

yarn commitlint --edit $1
yarn docs
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,30 @@
"Blockhash",
"codecov",
"commitlint",
"cosmjs",
"Cosmoshub",
"holesky",
"iife",
"irys",
"Keypair",
"korellia",
"kyve",
"kyvejs",
"lamport",
"lamports",
"mocharc",
"nacl",
"nvmrc",
"outfile",
"plimit",
"privkey",
"Secp",
"solana",
"tocstop",
"trivago",
"tweetnacl",
"typecheck",
"ukyve",
"webkitdirectory",
"Winc"
],
Expand Down
6 changes: 0 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@

* expose `token` on unauthenticated turbo factory PE-6569 ([7f0c44c](https://github.com/ardriveapp/turbo-sdk/commit/7f0c44cfc319d0f303d252d0aa73f0d42a635e03))

## [1.10.1-alpha.1](https://github.com/ardriveapp/turbo-sdk/compare/v1.10.0...v1.10.1-alpha.1) (2024-08-16)


### Bug Fixes

* expose `token` on unauthenticated turbo factory PE-6569 ([7f0c44c](https://github.com/ardriveapp/turbo-sdk/commit/7f0c44cfc319d0f303d252d0aa73f0d42a635e03))

# [1.10.0](https://github.com/ardriveapp/turbo-sdk/compare/v1.9.0...v1.10.0) (2024-08-15)

Expand Down
146 changes: 136 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Welcome to the `@ardrive/turbo-sdk`! This SDK provides functionality for interac
- [Ethereum Private Key](#ethereum-private-key)
- [HexSolanaSigner](#hexsolanasigner)
- [Solana Secret Key](#solana-secret-key)
- [KYVE Private Key](#kyve-private-key)
- [KYVE Mnemonic](#kyve-mnemonic)
- [TurboUnauthenticatedClient](#turbounauthenticatedclient)
- [`getSupportedCurrencies()`](#getsupportedcurrencies)
- [`getSupportedCountries()`](#getsupportedcountries)
Expand All @@ -40,9 +42,10 @@ Welcome to the `@ardrive/turbo-sdk`! This SDK provides functionality for interac
- [`getUploadCosts({ bytes })`](#getuploadcosts-bytes-)
- [`uploadSignedDataItem({ dataItemStreamFactory, dataItemSizeFactory, signal })`](#uploadsigneddataitem-dataitemstreamfactory-dataitemsizefactory-signal-)
- [`createCheckoutSession({ amount, owner })`](#createcheckoutsession-amount-owner-)
- [Arweave (AR)](#arweave-ar)
- [Ethereum (ETH)](#ethereum-eth)
- [Solana (SOL)](#solana-sol)
- [Arweave (AR) Fiat Top Up](#arweave-ar-fiat-top-up)
- [Ethereum (ETH) Fiat Top Up](#ethereum-eth-fiat-top-up)
- [Solana (SOL) Fiat Top Up](#solana-sol-fiat-top-up)
- [KYVE Fiat Top Up](#kyve-fiat-top-up)
- [`submitFundTransaction({ txId })`](#submitfundtransaction-txid-)
- [TurboAuthenticatedClient](#turboauthenticatedclient)
- [`getBalance()`](#getbalance)
Expand All @@ -53,8 +56,16 @@ Welcome to the `@ardrive/turbo-sdk`! This SDK provides functionality for interac
- [NodeJS Upload Folder](#nodejs-upload-folder)
- [Browser Upload Folder](#browser-upload-folder)
- [`topUpWithTokens({ tokenAmount, feeMultiplier })`](#topupwithtokens-tokenamount-feemultiplier-)
- [Ethereum (ETH)](#ethereum-eth-1)
- [Solana (SOL)](#solana-sol-1)
- [Arweave (AR) Crypto Top Up](#arweave-ar-crypto-top-up)
- [Ethereum (ETH) Crypto Top Up](#ethereum-eth-crypto-top-up)
- [Solana (SOL) Crypto Top Up](#solana-sol-crypto-top-up)
- [KYVE Crypto Top Up](#kyve-crypto-top-up)
- [CLI](#cli)
- [Install CLI](#install-cli)
- [CLI Usage](#cli-usage)
- [Options](#options)
- [Commands](#commands)
- [`crypto-fund`](#crypto-fund)
- [Developers](#developers)
- [Requirements](#requirements)
- [Setup & Build](#setup--build)
Expand Down Expand Up @@ -268,6 +279,26 @@ const turbo = TurboFactory.authenticated({
});
```

##### KYVE Private Key

```typescript
const turbo = TurboFactory.authenticated({
privateKey: kyveHexadecimalPrivateKey,
token: 'kyve',
});
```

##### KYVE Mnemonic

```typescript
import { privateKeyFromKyveMnemonic } from '@ardrive/turbo-sdk';

const turbo = TurboFactory.authenticated({
privateKey: privateKeyFromKyveMnemonic(mnemonic),
token: 'kyve',
});
```

### TurboUnauthenticatedClient

#### `getSupportedCurrencies()`
Expand Down Expand Up @@ -341,7 +372,7 @@ const uploadResponse = await turbo.uploadSignedDataItem({

Creates a Stripe checkout session for a Turbo Top Up with the provided amount, currency, owner. The returned URL can be opened in the browser, all payments are processed by Stripe. To leverage promo codes, see [TurboAuthenticatedClient].

##### Arweave (AR)
##### Arweave (AR) Fiat Top Up

```typescript
const { url, winc, paymentAmount, quotedPaymentAmount, adjustments } =
Expand All @@ -364,7 +395,7 @@ if (process.platform === 'darwin') {
}
```

##### Ethereum (ETH)
##### Ethereum (ETH) Fiat Top Up

```ts
const turbo = TurboFactory.unauthenticated({ token: 'ethereum' });
Expand All @@ -375,7 +406,7 @@ const { url, winc, paymentAmount } = await turbo.createCheckoutSession({
});
```

##### Solana (SOL)
##### Solana (SOL) Fiat Top Up

```ts
const turbo = TurboFactory.unauthenticated({ token: 'solana' });
Expand All @@ -386,6 +417,17 @@ const { url, winc, paymentAmount } = await turbo.createCheckoutSession({
});
```

##### KYVE Fiat Top Up

```ts
const turbo = TurboFactory.unauthenticated({ token: 'kyve' });

const { url, winc, paymentAmount } = await turbo.createCheckoutSession({
amount: USD(10.0), // $10.00 USD
owner: publicKyveAddress,
});
```

#### `submitFundTransaction({ txId })`

Submits the transaction ID of a funding transaction to Turbo Payment Service for top up processing. The `txId` is the transaction ID of the transaction to be submitted.
Expand Down Expand Up @@ -536,6 +578,8 @@ Tops up the connected wallet with Credits by submitting a payment transaction fo
- The `tokenAmount` is the amount of tokens in the token type's smallest unit value (e.g: Winston for arweave token type) to fund the wallet with.
- The `feeMultiplier` (optional) is the multiplier to apply to the reward for the transaction to modify its chances of being mined. Credits will be added to the wallet balance after the transaction is confirmed on the given blockchain. Defaults to 1.0, meaning no multiplier.

##### Arweave (AR) Crypto Top Up

```typescript
const turbo = TurboFactory.authenticated({ signer, token: 'arweave' });

Expand All @@ -545,7 +589,7 @@ const { winc, status, id, ...fundResult } = await turbo.topUpWithTokens({
});
```

##### Ethereum (ETH)
##### Ethereum (ETH) Crypto Top Up

```ts
const turbo = TurboFactory.authenticated({ signer, token: 'ethereum' });
Expand All @@ -555,7 +599,7 @@ const { winc, status, id, ...fundResult } = await turbo.topUpWithTokens({
});
```

##### Solana (SOL)
##### Solana (SOL) Crypto Top Up

```ts
const turbo = TurboFactory.authenticated({ signer, token: 'solana' });
Expand All @@ -565,6 +609,88 @@ const { winc, status, id, ...fundResult } = await turbo.topUpWithTokens({
});
```

##### KYVE Crypto Top Up

```ts
const turbo = TurboFactory.authenticated({ signer, token: 'kyve' });

const { winc, status, id, ...fundResult } = await turbo.topUpWithTokens({
tokenAmount: KYVEToTokenAmount(0.00001), // 0.00001 KYVE
});
```

## CLI

### Install CLI

Global installation:

```shell
npm install -g @ardrive/turbo-sdk
```

or

```shell
yarn global add @ardrive/turbo-sdk
```

or install locally as a dev dependency:

```shell
npm install --save-dev @ardrive/turbo-sdk
```

or

```shell
yarn add -D @ardrive/turbo-sdk
```

### CLI Usage

```shell
turbo --help
```

or from local installation:

```shell
yarn turbo --help
```

```shell
npx turbo --help
```

#### Options

- `-V, --version` - output the version number
- `-h, --help` - display help for command
- `--dev` - Enable development endpoints (default: false)
- `-g, --gateway <url>` - Set a custom crypto gateway URL
- `-t, --token <token>` - Token type for the command or connected wallet (default: "arweave")

- `-w, --wallet-file <filePath>` - Wallet file to use with the action. Formats accepted: JWK.json, KYVE or ETH private key as a string, or SOL Secret Key as a Uint8Array
- `-m, --mnemonic <phrase>` - Mnemonic to use with the action (KYVE only)
- `-p, --private-key <key>` - Private key to use with the action

#### Commands

##### `crypto-fund`

Fund a wallet with Turbo Credits by submitting a payment transaction for the crypto amount to the Turbo wallet and then submitting that transaction id to Turbo Payment Service for top up processing.

Command Options:

- `-v, --value <value>` - Amount of tokens in the token type's smallest unit value to fund the wallet with

e.g:

```shell
turbo crypto-fund --value 0.0001 --token kyve --private-key 'b27...45c'
```

## Developers

### Requirements
Expand Down
1 change: 1 addition & 0 deletions bundle.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const bundle = () => {
},
}),
],
external: ['commander'],
tsconfig: './tsconfig.web.json',
outfile: './bundles/web.bundle.min.js',
})
Expand Down
4 changes: 3 additions & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ coverage:
status:
project:
default:
target: 95%
target: 80%
threshold: 1%
ignore:
- 'src/cli/*'
Loading

0 comments on commit d2f28ff

Please sign in to comment.