Skip to content

Commit

Permalink
chore(docs): add readme for submitAuctionBid)
Browse files Browse the repository at this point in the history
  • Loading branch information
dtfiedler committed Oct 24, 2024
1 parent 6780a80 commit 6e45701
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ This is the home of [ar.io] SDK. This SDK provides functionality for interacting
- [`increaseUndernameLimit({ name, qty })`](#increaseundernamelimit-name-qty-)
- [`extendLease({ name, years })`](#extendlease-name-years-)
- [`cancelDelegateWithdrawal({ address, vaultId })`](#canceldelegatewithdrawal-address-vaultid-)
- [`submitAuctionBid({ name, type, years, processId })`](#submitauctionbid-name-type-years-processid-)
- [Configuration](#configuration)
- [Arweave Name Tokens (ANT's)](#arweave-name-tokens-ants)
- [ANT APIs](#ant-apis)
Expand Down Expand Up @@ -1255,6 +1256,32 @@ const { id: txId } = await io.cancelDelegateWithdrawal(
);
```

#### `submitAuctionBid({ name, type, years, processId })`

Submit a bid for the current auction. If the bid is accepted, the name will be leased for the specified duration and assigned the specified type and processId.

_Note: Requires `signer` to be provided on `IO.init` to sign the transaction._

```typescript
const io = IO.init({ signer: new ArweaveSigner(jwk) });

const auction = await io.getAuction({ name: 'permalink' });

// check the current price is under some threshold
if (auction && auction.currentPrice <= new IOToken(20_000).toMIO().valueOf()) {
const { id: txId } = await io.submitAuctionBid(
{
name: 'permalink',
type: 'lease',
years: 1,
processId: 'bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM',
},
// optional additional tags
{ tags: [{ name: 'App-Name', value: 'My-Awesome-App' }] },
);
}
```

### Configuration

The IO client class exposes APIs relevant to the ar.io process. It can be configured to use any AO Process ID that adheres to the [IO Network Spec]. By default, it will use the current [IO Testnet Process]. Refer to [AO Connect] for more information on how to configure an IO process to use specific AO infrastructure.
Expand Down

0 comments on commit 6e45701

Please sign in to comment.