-
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.
Merge pull request #9 from ardriveapp/PE-4472-uploads
feat(PE-4472): add uploadFile, uploadSignedDataItem implementations for node and web
- Loading branch information
Showing
36 changed files
with
2,116 additions
and
644 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
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
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.unauthenticated({}); | ||
const rates = await turbo.getFiatRates(); | ||
``` | ||
|
||
### Browser | ||
|
||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/@ardrive/turbo-sdk"></script> | ||
<script> | ||
const turbo = TurboFactory.unauthenticated({}); | ||
const rates = await turbo.getFiatRates(); | ||
</script> | ||
``` | ||
|
||
## NodeJS | ||
|
||
### CommonJS | ||
|
||
```javascript | ||
const { TurboFactory } = require('@ardrive/turbo-sdk/node'); | ||
|
||
const turbo = TurboFactory.unauthenticated({}); | ||
const rates = await turbo.getFiatRates(); | ||
``` | ||
|
||
### ESM | ||
|
||
```javascript | ||
import { TurboFactory } from '@ardrive/turbo-sdk/node'; | ||
|
||
const turbo = TurboFactory.unauthenticated({}); | ||
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 (WIP) | ||
|
||
## 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. |
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
Empty file.
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
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
Oops, something went wrong.