@ar.io/sdk 2.4.0-alpha.2 → 2.4.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -56,6 +56,7 @@ This is the home of [ar.io] SDK. This SDK provides functionality for interacting
56
56
  - [`increaseUndernameLimit({ name, qty })`](#increaseundernamelimit-name-qty-)
57
57
  - [`extendLease({ name, years })`](#extendlease-name-years-)
58
58
  - [`cancelDelegateWithdrawal({ address, vaultId })`](#canceldelegatewithdrawal-address-vaultid-)
59
+ - [`submitAuctionBid({ name, type, years, processId })`](#submitauctionbid-name-type-years-processid-)
59
60
  - [Configuration](#configuration)
60
61
  - [Arweave Name Tokens (ANT's)](#arweave-name-tokens-ants)
61
62
  - [ANT APIs](#ant-apis)
@@ -1255,6 +1256,32 @@ const { id: txId } = await io.cancelDelegateWithdrawal(
1255
1256
  );
1256
1257
  ```
1257
1258
 
1259
+ #### `submitAuctionBid({ name, type, years, processId })`
1260
+
1261
+ 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.
1262
+
1263
+ _Note: Requires `signer` to be provided on `IO.init` to sign the transaction._
1264
+
1265
+ ```typescript
1266
+ const io = IO.init({ signer: new ArweaveSigner(jwk) });
1267
+
1268
+ const auction = await io.getAuction({ name: 'permalink' });
1269
+
1270
+ // check the current price is under some threshold
1271
+ if (auction && auction.currentPrice <= new IOToken(20_000).toMIO().valueOf()) {
1272
+ const { id: txId } = await io.submitAuctionBid(
1273
+ {
1274
+ name: 'permalink',
1275
+ type: 'lease',
1276
+ years: 1,
1277
+ processId: 'bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM',
1278
+ },
1279
+ // optional additional tags
1280
+ { tags: [{ name: 'App-Name', value: 'My-Awesome-App' }] },
1281
+ );
1282
+ }
1283
+ ```
1284
+
1258
1285
  ### Configuration
1259
1286
 
1260
1287
  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.