Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: subaccounts in ts #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ yarn add https://arweave.net/zXnMIZiiUEhKRcT1NqIKnDG26ZJX3Vt2tQU95XUNFsc
## Importing

```js
const Subaccounts = require('arweave-subaccounts');
const Subaccounts = require("arweave-subaccounts");
```

# Docs
Expand All @@ -31,13 +31,13 @@ const Subaccounts = require('arweave-subaccounts');
Here is an example of how to use the library:

```js
const Arweave = require('arweave');
const ArSubaccounts = require('arweave-subaccounts');
const Arweave = require("arweave");
const ArSubaccounts = require("arweave-subaccounts");

const arweave = Arweave.init({
host: 'g8way.io',
host: "g8way.io",
port: 443,
protocol: 'https',
protocol: "https",
});

// Create a wallet instance
Expand All @@ -51,10 +51,10 @@ const subaccounts = new ArSubaccounts(arweave, wallet);

// Use the subaccount methods
// useSubaccount() is probably the only function you'll ever need. It returns JWK and address
let subaccount=await subaccounts.useSubaccount("Test")//"Test" is app name
subaccount.jwk // is Arweave JWK key
subaccount.address // is subaccount's address
subaccount.txId // is subaccount's record txid
let subaccount = await subaccounts.useSubaccount("Test"); //"Test" is app name
subaccount.jwk; // is Arweave JWK key
subaccount.address; // is subaccount's address
subaccount.txId; // is subaccount's record txid
```

## API
Expand Down
Loading