@ar.io/sdk 3.15.1 → 3.16.0-alpha.1

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
@@ -1233,10 +1233,18 @@ const record = await ario.resolveArNSName({ name: 'logo_ardrive' });
1233
1233
 
1234
1234
  #### `buyRecord({ name, type, years, processId })`
1235
1235
 
1236
- Purchases a new ArNS record with the specified name, type, and duration.
1236
+ Purchases a new ArNS record with the specified name, type, processId, and duration.
1237
1237
 
1238
1238
  _Note: Requires `signer` to be provided on `ARIO.init` to sign the transaction._
1239
1239
 
1240
+ **Arguments:**
1241
+
1242
+ - `name` - _required_: the name of the ArNS record to purchase
1243
+ - `type` - _required_: the type of ArNS record to purchase
1244
+ - `processId` - _optional_: the process id of an existing ANT process. If not provided, a new ANT process using the provided `signer` will be spawned, and the ArNS record will be assigned to that process.
1245
+ - `years` - _optional_: the duration of the ArNS record in years. If not provided and `type` is `lease`, the record will be leased for 1 year. If not provided and `type` is `permabuy`, the record will be permanently registered.
1246
+ - `referrer` - _optional_: track purchase referrals for analytics (e.g. `my-app.com`)
1247
+
1240
1248
  ```typescript
1241
1249
  const ario = ARIO.mainnet({ signer });
1242
1250
  const record = await ario.buyRecord(
@@ -1244,6 +1252,7 @@ const record = await ario.buyRecord(
1244
1252
  name: 'ardrive',
1245
1253
  type: 'lease',
1246
1254
  years: 1,
1255
+ processId: 'bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM', // optional: assign to existing ANT process
1247
1256
  referrer: 'my-app.com', // optional: track purchase referrals for analytics
1248
1257
  },
1249
1258
  {
@@ -1989,6 +1998,56 @@ const ant = ANT.init({
1989
1998
 
1990
1999
  ```
1991
2000
 
2001
+ #### `spawn({ signer, module?, ao?, scheduler?, state?, antRegistryId?, logger?, authority? })`
2002
+
2003
+ Spawns a new ANT (Arweave Name Token) process. This static function creates a new ANT process on the AO network and returns the process ID.
2004
+
2005
+ _Note: Requires `signer` to be provided to sign the spawn transaction._
2006
+
2007
+ ```typescript
2008
+ import { ANT } from '@ar.io/sdk';
2009
+ import { ArweaveSigner } from '@ar.io/sdk/node';
2010
+
2011
+ const processId = await ANT.spawn({
2012
+ signer: new ArweaveSigner(jwk),
2013
+ state: {
2014
+ name: 'My ANT',
2015
+ ticker: 'MYANT',
2016
+ description: 'My custom ANT token',
2017
+ },
2018
+ });
2019
+ ```
2020
+
2021
+ **Parameters:**
2022
+
2023
+ - `signer: AoSigner` - The signer used to authenticate the spawn transaction
2024
+ - `module?: string` - Optional module ID to use; if not provided, gets latest from ANT registry
2025
+ - `ao?: AoClient` - Optional AO client instance (defaults to legacy mode connection)
2026
+ - `scheduler?: string` - Optional scheduler ID
2027
+ - `state?: SpawnANTState` - Optional initial state for the ANT including name, ticker, description, etc.
2028
+ - `antRegistryId?: string` - Optional ANT registry ID
2029
+ - `logger?: Logger` - Optional logger instance
2030
+ - `authority?: string` - Optional authority
2031
+
2032
+ **Returns:** `Promise<ProcessId>` - The process ID of the newly spawned ANT
2033
+
2034
+ #### `versions`
2035
+
2036
+ Returns an ANTVersions instance that provides access to available ANT versions from the ANT registry. This static property allows you to query version information without needing a specific ANT process.
2037
+
2038
+ ```typescript
2039
+ import { ANT } from '@ar.io/sdk';
2040
+
2041
+ // Get all available ANT versions
2042
+ const antVersions = ANT.versions;
2043
+ const versions = await antVersions.getANTVersions();
2044
+
2045
+ // Get the latest ANT version
2046
+ const latestVersion = await antVersions.getLatestANTVersion();
2047
+ ```
2048
+
2049
+ **Returns:** `AoANTVersionsRead` - A read-only ANT versions client
2050
+
1992
2051
  #### `getInfo()`
1993
2052
 
1994
2053
  Retrieves the information of the ANT process.