-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(README): add a skeleton README with placeholders for API specs
- Loading branch information
dtfiedler
committed
Sep 6, 2023
1 parent
f0a19e0
commit 3acba94
Showing
1 changed file
with
113 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,114 @@ | ||
# turbo-sdk | ||
# @ardriveapp/turbo-sdk 🚀 | ||
|
||
Hello developer, welcome to this SDK!! | ||
Welcome to the `@ardrive/turbo-sdk`! This SDK provides functionalities for interacting with the Turbo Upload and Payment Services. It is available in both NodeJS and Web environments. | ||
|
||
## Table of Contents | ||
|
||
- [Installation](#installation) | ||
- [Usage](#usage): | ||
|
||
- [NodeJS Environments](#nodejs) | ||
- [CommonJS](#commonjs) | ||
- [ESM](#esm) | ||
- [Web Environments](#web) | ||
- [Bundlers (Webpack, Rollup, ESbuild, etc.)](#bundlers-webpack-rollup-esbuild-etc) | ||
- [Browser](#browser) | ||
- [Typescript](#typescript) | ||
- [Examples](./examples) | ||
|
||
- [Contributions](#contributions) | ||
|
||
# Installation | ||
|
||
```shell | ||
npm install @ardrive/turbo-sdk | ||
``` | ||
|
||
or | ||
|
||
```shell | ||
yarn add @ardrive/turbo-sdk | ||
``` | ||
|
||
# Usage | ||
|
||
The SDK is available in both CommonJS and ESM formats and is compatible with bundlers such as Webpack, Rollup, and ESbuild. | ||
|
||
## Web | ||
|
||
# Bundlers (Webpack, Rollup, ESbuild, etc.) | ||
|
||
```javascript | ||
import TurboFactory from '@ardrive/turbo-sdk/web'; | ||
|
||
const turbo = TurboFactory.public({}); | ||
const rates = await turbo.getFiatRates(); | ||
``` | ||
|
||
### Browser | ||
|
||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/@ardrive/turbo-sdk"></script> | ||
<script> | ||
const turbo = TurboFactory.public({}); | ||
const rates = await turbo.getFiatRates(); | ||
</script> | ||
``` | ||
|
||
## NodeJS | ||
|
||
### CommonJS | ||
|
||
```javascript | ||
const TurboFactory = require('@ardrive/turbo-sdk/node'); | ||
|
||
const turbo = TurboFactory.public({}); | ||
const rates = await turbo.getFiatRates(); | ||
``` | ||
|
||
### ESM | ||
|
||
```javascript | ||
import TurboFactory from '@ardrive/turbo-sdk/node'; | ||
|
||
const turbo = TurboFactory.public({}); | ||
const rates = await turbo.getFiatRates(); | ||
``` | ||
|
||
## Typescript | ||
|
||
The SDK provides TypeScript typings. When you import the SDK in a TypeScript project: | ||
|
||
```typescript | ||
import Ardrive from '@ardrive/turbo-sdk/web'; | ||
|
||
// or '@ardrive/turbo-sdk/node' for Node.js projects | ||
``` | ||
|
||
The provided typings (`./lib/types/index.d.ts`) will be automatically recognized, offering type checking and autocompletion benefits. | ||
|
||
# APIs | ||
|
||
## TurboFactory | ||
|
||
- `public()` | ||
- `private()` | ||
|
||
## TurboUnauthenticatedClient | ||
|
||
- `getFiatRates()` | ||
- `getFiatToAR()` | ||
- `getSupportedCountries()` | ||
- `getSupportedCurrencies()` | ||
- `getWincForFiat()` | ||
- `getUploadCosts()` | ||
- `uploadSignedDataItem()` | ||
|
||
## TurboAuthenticatedClient | ||
|
||
- `getBalance()` | ||
- `uploadFile()` | ||
|
||
# Contributions | ||
|
||
If you encounter any issues or have feature requests, please file an issue on our GitHub repository. Contributions, pull requests, and feedback are welcome and encouraged. |