From 86af8130efcd36cfe9cab6125b9b2bdd045bbdde Mon Sep 17 00:00:00 2001 From: bobinstein Date: Wed, 4 Dec 2024 17:56:51 -0500 Subject: [PATCH] docs: ANT class pages --- .../approve-primary-name-request/page.mdx | 103 ++++++++++++++++ .../ar-io-sdk/ants/configuration/page.mdx | 110 +++++++++++++++++ .../ar-io-sdk/ants/get-controllers/page.mdx | 52 ++++++++ .../ar-io-sdk/ants/get-handlers/page.mdx | 71 +++++++++++ .../build/ar-io-sdk/ants/get-info/page.mdx | 58 +++++++++ .../build/ar-io-sdk/ants/get-owner/page.mdx | 52 ++++++++ .../build/ar-io-sdk/ants/get-records/page.mdx | 66 +++++++++++ .../build/ar-io-sdk/ants/get-state/page.mdx | 80 +++++++++++++ .../ar-io-sdk/ants/reassign-name/page.mdx | 103 ++++++++++++++++ .../ar-io-sdk/ants/release-name/page.mdx | 95 +++++++++++++++ .../ar-io-sdk/ants/remove-controller/page.mdx | 90 ++++++++++++++ .../ants/remove-primary-names/page.mdx | 95 +++++++++++++++ .../ar-io-sdk/ants/remove-record/page.mdx | 95 +++++++++++++++ .../ar-io-sdk/ants/set-controller/page.mdx | 90 ++++++++++++++ .../ar-io-sdk/ants/set-description/page.mdx | 91 ++++++++++++++ .../ar-io-sdk/ants/set-keywords/page.mdx | 91 ++++++++++++++ .../build/ar-io-sdk/ants/set-logo/page.mdx | 91 ++++++++++++++ .../build/ar-io-sdk/ants/set-name/page.mdx | 91 ++++++++++++++ .../build/ar-io-sdk/ants/set-record/page.mdx | 111 ++++++++++++++++++ .../build/ar-io-sdk/ants/set-ticker/page.mdx | 91 ++++++++++++++ .../build/ar-io-sdk/ants/transfer/page.mdx | 90 ++++++++++++++ .../{general/init => configuration}/page.mdx | 13 +- 22 files changed, 1824 insertions(+), 5 deletions(-) create mode 100644 src/app/build/ar-io-sdk/ants/approve-primary-name-request/page.mdx create mode 100644 src/app/build/ar-io-sdk/ants/configuration/page.mdx create mode 100644 src/app/build/ar-io-sdk/ants/get-controllers/page.mdx create mode 100644 src/app/build/ar-io-sdk/ants/get-handlers/page.mdx create mode 100644 src/app/build/ar-io-sdk/ants/get-info/page.mdx create mode 100644 src/app/build/ar-io-sdk/ants/get-owner/page.mdx create mode 100644 src/app/build/ar-io-sdk/ants/get-records/page.mdx create mode 100644 src/app/build/ar-io-sdk/ants/get-state/page.mdx create mode 100644 src/app/build/ar-io-sdk/ants/reassign-name/page.mdx create mode 100644 src/app/build/ar-io-sdk/ants/release-name/page.mdx create mode 100644 src/app/build/ar-io-sdk/ants/remove-controller/page.mdx create mode 100644 src/app/build/ar-io-sdk/ants/remove-primary-names/page.mdx create mode 100644 src/app/build/ar-io-sdk/ants/remove-record/page.mdx create mode 100644 src/app/build/ar-io-sdk/ants/set-controller/page.mdx create mode 100644 src/app/build/ar-io-sdk/ants/set-description/page.mdx create mode 100644 src/app/build/ar-io-sdk/ants/set-keywords/page.mdx create mode 100644 src/app/build/ar-io-sdk/ants/set-logo/page.mdx create mode 100644 src/app/build/ar-io-sdk/ants/set-name/page.mdx create mode 100644 src/app/build/ar-io-sdk/ants/set-record/page.mdx create mode 100644 src/app/build/ar-io-sdk/ants/set-ticker/page.mdx create mode 100644 src/app/build/ar-io-sdk/ants/transfer/page.mdx rename src/app/build/ar-io-sdk/ario/{general/init => configuration}/page.mdx (88%) diff --git a/src/app/build/ar-io-sdk/ants/approve-primary-name-request/page.mdx b/src/app/build/ar-io-sdk/ants/approve-primary-name-request/page.mdx new file mode 100644 index 00000000..02fcebed --- /dev/null +++ b/src/app/build/ar-io-sdk/ants/approve-primary-name-request/page.mdx @@ -0,0 +1,103 @@ +import { CodeGroup } from '@/components/Code' +import {HeroPattern} from "@/components/HeroPattern" + + + +# approvePrimaryNameRequest + +`approvePrimaryNameRequest` is a method on the `ANT` class that approves a primary name request for a given name or address. + +`approvePrimaryNameRequest` requires authentication. + +## Parameters + +{ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescriptionOptional
namestringArNS name to approve as primary name.false
addressstring - WalletAddressPublic wallet address that made the primary name request being approved.false
ioProcessIdstringProcess Id of the ARIO contract.false
tagsarray + An array of GQL tag objects to attach to the transfer AO message. + true
+
+} + +## Examples + + + + ```typescript {{title: "NodeJS"}} + const fs = require("fs"); + const { ANT, ArweaveSigner } = require("@ar.io/sdk"); + + async function main() { + const jwk = JSON.parse(fs.readFileSync("KeyFile.json")); + const ant = ANT.init({ + signer: new ArweaveSigner(jwk), + processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" + }); + + const { id: txId } = await ant.approvePrimaryNameRequest({ + name: 'arns', + address: 't4Xr0_J4Iurt7caNST02cMotaz2FIbWQ4Kbj616RHl3', // must match the request initiator address + ioProcessId: ARIO_TESTNET_PROCESS_ID, // the ARIO process id to use for the request + }); + } + + main(); + + ``` + + ```typescript {{ title: 'Web' }} + import { ANT, ArConnectSigner } from '@ar.io/sdk/web'; + + async function main() { + const ant = ANT.init({ + signer: new ArConnectSigner(window.arweaveWallet), + processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" + }) + + const { id: txId } = await ant.approvePrimaryNameRequest({ + name: 'arns', + address: 't4Xr0_J4Iurt7caNST02cMotaz2FIbWQ4Kbj616RHl3', // must match the request initiator address + ioProcessId: ARIO_TESTNET_PROCESS_ID, // the ARIO process id to use for the request + }); + } + + main(); + ``` + + diff --git a/src/app/build/ar-io-sdk/ants/configuration/page.mdx b/src/app/build/ar-io-sdk/ants/configuration/page.mdx new file mode 100644 index 00000000..0f3da604 --- /dev/null +++ b/src/app/build/ar-io-sdk/ants/configuration/page.mdx @@ -0,0 +1,110 @@ +import { CodeGroup } from '@/components/Code' +import {HeroPattern} from "@/components/HeroPattern" + + + +# init + +`init` is a factory function that creates a read-only or writeable client. By providing a `signer` additional write APIs that require signing, like `setRecord` and `transfer` are available. By default, a read-only client is returned and no write APIs are available. + +## Parameters + +{ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescriptionOptional
processIdStringThe AO process ID of the ANT to connect to.false
processAOProcess + A pre-configured AOProcess instance used to initialize the ARIO class + true
signerContractSigner + An optional signer instance, used to enable write operations on the + blockchain + true
+
+} + +## Examples + + + + ```typescript {{title: "NodeJS - unauthorized"}} + const { ANT } = require("@ar.io/sdk") + + const ant = ANT.init( + { + processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" + } + ) + ``` + + ```typescript {{title: "NodeJS - authorized"}} + const { ANT, ArweaveSigner} = require("@ar.io/sdk") + + const jwk = JSON.parse(fs.readFileSync("KeyFile.json")); + + const ant = ANT.init({ + signer: new ArweaveSigner(jwk), + processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" + }) + ``` + + ```typescript {{title: "Web - unauthorized"}} + import { ANT } from "@ar.io/sdk/web" + + const ant = ANT.init({ processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" }) + ``` + + ```typescript {{title: "Web - authorized"}} + import { ANT, ArConnectSigner } from "@ar.io/sdk/web" + + const ant = ANT.init({ + signer: new ArConnectSigner(window.arweaveWallet), + processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" + }) + ``` + + ```typescript {{title: "Custom AO"}} + import {AOProcess, ANT} from "@ar.io/sdk" + import {connect} from "@permaweb/aoconnect" + + const ant = ANT.init({ + processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM", + process: new AOProcess ({ + processId: '' + ao: connect({ + MU_URL: 'https://mu-testnet.xyz', //customizable + CU_URL: 'https://cu-testnet.xyz', //customizable + GRAPHQL_URL: 'https://arweave.net/graphql', //customizable + GATEWAY_URL: 'https://arweave.net', //customizable + }) + }) + }) + ``` + + diff --git a/src/app/build/ar-io-sdk/ants/get-controllers/page.mdx b/src/app/build/ar-io-sdk/ants/get-controllers/page.mdx new file mode 100644 index 00000000..511a60ca --- /dev/null +++ b/src/app/build/ar-io-sdk/ants/get-controllers/page.mdx @@ -0,0 +1,52 @@ +import {CodeGroup} from "@/components/Code" +import {HeroPattern} from "@/components/HeroPattern" + + + +# getControllers + +`getControllers` is a method on the `ANT` class that retrieves the controllers of the configured ANT process. + +`getControllers` does not require authentication. + +## Parameters + +`getControllers` does not accept parameters. + +## Examples + + + + ```typescript {{ title: 'NodeJS' }} + const { ANT } = require('@ar.io/sdk'); + + async function main() { + const ant = ANT.init({ processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" }); + const controllers = await ant.getControllers(); + + console.log(controllers); + } + + main(); + ``` + + ```typescript {{ title: 'Web' }} + import { ANT } from '@ar.io/sdk/web'; + + async function main() { + const ant = ANT.init({ processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" }); + const controllers = await ant.getControllers(); + + console.log(controllers); + } + + main(); + ``` + + + +## Output + +```json +["ccp3blG__gKUvG3hsGC2u06aDmqv4CuhuDJGOIg0jw4"] +``` \ No newline at end of file diff --git a/src/app/build/ar-io-sdk/ants/get-handlers/page.mdx b/src/app/build/ar-io-sdk/ants/get-handlers/page.mdx new file mode 100644 index 00000000..d08e4ea5 --- /dev/null +++ b/src/app/build/ar-io-sdk/ants/get-handlers/page.mdx @@ -0,0 +1,71 @@ +import {CodeGroup} from "@/components/Code" +import {HeroPattern} from "@/components/HeroPattern" + + + +# gethandlers + +`getHandlers` is a method on the `ANT` class that retrieves the handlers supported by the ANT. + +`getHandlers` does not require authentication. + +## Parameters + +`getHandlers` does not accept parameters. + +## Examples + + + + ```typescript {{ title: 'NodeJS' }} + const { ANT } = require('@ar.io/sdk'); + + async function main() { + const ant = ANT.init({ processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" }); + const handlers = await ant.getHandlers(); + + console.log(handlers); + } + + main(); + ``` + + ```typescript {{ title: 'Web' }} + import { ANT } from '@ar.io/sdk/web'; + + async function main() { + const ant = ANT.init({ processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" }); + const handlers = await ant.getHandlers(); + + console.log(handlers); + } + + main(); + ``` + + + +## Output + +```json +[ + "_eval", + "_default", + "transfer", + "balance", + "balances", + "totalSupply", + "info", + "addController", + "removeController", + "controllers", + "setRecord", + "removeRecord", + "record", + "records", + "setName", + "setTicker", + "initializeState", + "state" +] +``` \ No newline at end of file diff --git a/src/app/build/ar-io-sdk/ants/get-info/page.mdx b/src/app/build/ar-io-sdk/ants/get-info/page.mdx new file mode 100644 index 00000000..cd0abeb8 --- /dev/null +++ b/src/app/build/ar-io-sdk/ants/get-info/page.mdx @@ -0,0 +1,58 @@ +import {CodeGroup} from "@/components/Code" +import {HeroPattern} from "@/components/HeroPattern" + + + +# getInfo + +`getInfo` is a method on the `ANT` class that retrieves the information of the ANT process. + +`getInfo` does not require authentication. + +## Parameters + +`getInfo` does not accept parameters. + +## Examples + + + + ```typescript {{ title: 'NodeJS' }} + const { ANT } = require('@ar.io/sdk'); + + async function main() { + const ant = ANT.init({ processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" }); + const info = await ant.getInfo(); + + console.log(info); + } + + main(); + ``` + + ```typescript {{ title: 'Web' }} + import { ANT } from '@ar.io/sdk/web'; + + async function main() { + const ant = ANT.init({ processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" }); + const info = await ant.getInfo(); + + console.log(info); + } + + main(); + ``` + + + +## Output + +```json +{ + "name": "ArDrive", + "ticker": "ANT-ARDRIVE", + "description": "This is the ANT for the ArDrive decentralized web app.", + "keywords": ["File-sharing", "Publishing", "dApp"], + "owner": "QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ" +} +``` \ No newline at end of file diff --git a/src/app/build/ar-io-sdk/ants/get-owner/page.mdx b/src/app/build/ar-io-sdk/ants/get-owner/page.mdx new file mode 100644 index 00000000..2a070e5e --- /dev/null +++ b/src/app/build/ar-io-sdk/ants/get-owner/page.mdx @@ -0,0 +1,52 @@ +import {CodeGroup} from "@/components/Code" +import {HeroPattern} from "@/components/HeroPattern" + + + +# getOwner + +`getOwner` is a method on the `ANT` class that retrieves the owner of the configured ANT process. + +`getOwner` does not require authentication. + +## Parameters + +`getOwner` does not accept parameters. + +## Examples + + + + ```typescript {{ title: 'NodeJS' }} + const { ANT } = require('@ar.io/sdk'); + + async function main() { + const ant = ANT.init({ processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" }); + const owner = await ant.getOwner(); + + console.log(owner); + } + + main(); + ``` + + ```typescript {{ title: 'Web' }} + import { ANT } from '@ar.io/sdk/web'; + + async function main() { + const ant = ANT.init({ processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" }); + const owner = await ant.getOwner(); + + console.log(owner); + } + + main(); + ``` + + + +## Output + +```json +"ccp3blG__gKUvG3hsGC2u06aDmqv4CuhuDJGOIg0jw4" +``` \ No newline at end of file diff --git a/src/app/build/ar-io-sdk/ants/get-records/page.mdx b/src/app/build/ar-io-sdk/ants/get-records/page.mdx new file mode 100644 index 00000000..af5975f3 --- /dev/null +++ b/src/app/build/ar-io-sdk/ants/get-records/page.mdx @@ -0,0 +1,66 @@ +import {CodeGroup} from "@/components/Code" +import {HeroPattern} from "@/components/HeroPattern" + + + +# getRecords + +`getRecords` is a method on the `ANT` class that returns all records on the configured ANT process, including the required `@` record, that resolve connected ArNS names. + +`getRecords` does not require authentication. + +## Parameters + +`getRecords` does not accept parameters. + +## Examples + + + + ```typescript {{ title: 'NodeJS' }} + const { ANT } = require('@ar.io/sdk'); + + async function main() { + const ant = ANT.init({ processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" }); + const records = await ant.getRecords(); + + console.log(records); + } + + main(); + ``` + + ```typescript {{ title: 'Web' }} + import { ANT } from '@ar.io/sdk/web'; + + async function main() { + const ant = ANT.init({ processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" }); + const records = await ant.getRecords(); + + console.log(records); + } + + main(); + ``` + + + +## Output + +```json +{ + "@": { + "transactionId": "UyC5P5qKPZaltMmmZAWdakhlDXsBF6qmyrbWYFchRTk", + "ttlSeconds": 3600 + }, + "zed": { + "transactionId": "-k7t8xMoB8hW482609Z9F4bTFMC3MnuW8bTvTyT8pFI", + "ttlSeconds": 900 + }, + + "ardrive": { + "transactionId": "-cucucachoodwedwedoiwepodiwpodiwpoidpwoiedp", + "ttlSeconds": 900 + } +} +``` \ No newline at end of file diff --git a/src/app/build/ar-io-sdk/ants/get-state/page.mdx b/src/app/build/ar-io-sdk/ants/get-state/page.mdx new file mode 100644 index 00000000..4d5c006e --- /dev/null +++ b/src/app/build/ar-io-sdk/ants/get-state/page.mdx @@ -0,0 +1,80 @@ +import {CodeGroup} from "@/components/Code" +import {HeroPattern} from "@/components/HeroPattern" + + + +# getState + +`getState` is a method on the `ANT` class that retrieves the state of the ANT process. + +`getState` does not require authentication. + +## Parameters + +`getState` does not accept parameters. + +## Examples + + + + ```typescript {{ title: 'NodeJS' }} + const { ANT } = require('@ar.io/sdk'); + + async function main() { + const ant = ANT.init({ processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" }); + const state = await ant.getState(); + + console.log(state); + } + + main(); + ``` + + ```typescript {{ title: 'Web' }} + import { ANT } from '@ar.io/sdk/web'; + + async function main() { + const ant = ANT.init({ processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" }); + const state = await ant.getState(); + + console.log(state); + } + + main(); + ``` + + + +## Output + +```json +{ + "TotalSupply": 1, + "Balances": { + "98O1_xqDLrBKRfQPWjF5p7xZ4Jx6GM8P5PeJn26xwUY": 1 + }, + "Controllers": [], + "Records": { + "v1-0-0_whitepaper": { + "transactionId": "lNjWn3LpyhKC95Kqe-x8X2qgju0j98MhucdDKK85vc4", + "ttlSeconds": 900 + }, + "@": { + "transactionId": "2rMLb2uHAyEt7jSu6bXtKx8e-jOfIf7E-DOgQnm8EtU", + "ttlSeconds": 3600 + }, + "whitepaper": { + "transactionId": "lNjWn3LpyhKC95Kqe-x8X2qgju0j98MhucdDKK85vc4", + "ttlSeconds": 900 + } + }, + "Initialized": true, + "Ticker": "ANT-AR-IO", + "Description": "A friendly description for this ANT.", + "Keywords": ["keyword1", "keyword2", "keyword3"], + "Logo": "Sie_26dvgyok0PZD_-iQAFOhOd5YxDTkczOLoqTTL_A", + "Denomination": 0, + "Name": "AR.IO Foundation", + "Owner": "98O1_xqDLrBKRfQPWjF5p7xZ4Jx6GM8P5PeJn26xwUY" +} +``` \ No newline at end of file diff --git a/src/app/build/ar-io-sdk/ants/reassign-name/page.mdx b/src/app/build/ar-io-sdk/ants/reassign-name/page.mdx new file mode 100644 index 00000000..526d1142 --- /dev/null +++ b/src/app/build/ar-io-sdk/ants/reassign-name/page.mdx @@ -0,0 +1,103 @@ +import { CodeGroup } from '@/components/Code' +import {HeroPattern} from "@/components/HeroPattern" + + + +# reassignName + +`reassignName` is a method on the `ANT` class that reassigns a name to a new ANT. This can only be done by the current owner of the ANT. + +`reassignName` requires authentication. + +## Parameters + +{ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescriptionOptional
namestringArNS name to reassignfalse
ioProcessIdstringProcess Id of the ARIO contract.false
antProcessIdstringProcess Id of the new ANT.false
tagsarray + An array of GQL tag objects to attach to the transfer AO message. + true
+
+} + +## Examples + + + + ```typescript {{title: "NodeJS"}} + const fs = require("fs"); + const { ANT, ArweaveSigner } = require("@ar.io/sdk"); + + async function main() { + const jwk = JSON.parse(fs.readFileSync("KeyFile.json")); + const ant = ANT.init({ + signer: new ArweaveSigner(jwk), + processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" + }); + + const { id: txId } = await ant.reassignName({ + name: 'ardrive', + ioProcessId: ARIO_TESTNET_PROCESS_ID, + antProcessId: NEW_ANT_PROCESS_ID, // the new ANT process id that will take over ownership of the name + }); + } + + main(); + + ``` + + ```typescript {{ title: 'Web' }} + import { ANT, ArConnectSigner } from '@ar.io/sdk/web'; + + async function main() { + const ant = ANT.init({ + signer: new ArConnectSigner(window.arweaveWallet), + processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" + }) + + const { id: txId } = await ant.reassignName({ + name: 'ardrive', + ioProcessId: ARIO_TESTNET_PROCESS_ID, + antProcessId: NEW_ANT_PROCESS_ID, // the new ANT process id that will take over ownership of the name + }); + } + + main(); + ``` + + diff --git a/src/app/build/ar-io-sdk/ants/release-name/page.mdx b/src/app/build/ar-io-sdk/ants/release-name/page.mdx new file mode 100644 index 00000000..5dc89f0d --- /dev/null +++ b/src/app/build/ar-io-sdk/ants/release-name/page.mdx @@ -0,0 +1,95 @@ +import { CodeGroup } from '@/components/Code' +import {HeroPattern} from "@/components/HeroPattern" + + + +# releaseName + +`releaseName` is a method on the `ANT` class that releases a name from the ANT and makes it available for auction on the ARIO contract. The name must be permanently owned by the releasing wallet. 50% of the winning bid will be distributed to the ANT owner at the time of release. If no bids, the name will be released and can be reregistered by anyone. + +`releaseName` requires authentication. + +## Parameters + +{ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescriptionOptional
namestringArNS name to releasefalse
ioProcessIdstringProcess Id of the ARIO contract.false
tagsarray + An array of GQL tag objects to attach to the transfer AO message. + true
+
+} + +## Examples + + + + ```typescript {{title: "NodeJS"}} + const fs = require("fs"); + const { ANT, ArweaveSigner } = require("@ar.io/sdk"); + + async function main() { + const jwk = JSON.parse(fs.readFileSync("KeyFile.json")); + const ant = ANT.init({ + signer: new ArweaveSigner(jwk), + processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" + }); + + const { id: txId } = await ant.releaseName({ + name: 'permalink', + ioProcessId: ARIO_TESTNET_PROCESS_ID, // releases the name owned by the ANT and sends it to auction on the ARIO contract + }); + } + + main(); + + ``` + + ```typescript {{ title: 'Web' }} + import { ANT, ArConnectSigner } from '@ar.io/sdk/web'; + + async function main() { + const ant = ANT.init({ + signer: new ArConnectSigner(window.arweaveWallet), + processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" + }) + + const { id: txId } = await ant.releaseName({ + name: 'permalink', + ioProcessId: ARIO_TESTNET_PROCESS_ID, // releases the name owned by the ANT and sends it to auction on the ARIO contract + }); + } + + main(); + ``` + + diff --git a/src/app/build/ar-io-sdk/ants/remove-controller/page.mdx b/src/app/build/ar-io-sdk/ants/remove-controller/page.mdx new file mode 100644 index 00000000..015f0652 --- /dev/null +++ b/src/app/build/ar-io-sdk/ants/remove-controller/page.mdx @@ -0,0 +1,90 @@ +import { CodeGroup } from '@/components/Code' +import {HeroPattern} from "@/components/HeroPattern" + + + +# removeController + +`removeController` is a method on the `ANT` class that removes a controller from the list of approved controllers on the ANT. + +`removeController` requires authentication. + +## Parameters + +{ + +
+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescriptionOptional
controllerString - WalletAddressPublic wallet address of the controller being removed.false
tagsarray + An array of GQL tag objects to attach to the transfer AO message. + true
+
+} + +## Examples + + + + ```typescript {{title: "NodeJS"}} + const fs = require("fs"); + const { ANT, ArweaveSigner } = require("@ar.io/sdk"); + + async function main() { + const jwk = JSON.parse(fs.readFileSync("KeyFile.json")); + const ant = ANT.init({ + signer: new ArweaveSigner(jwk), + processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" + }); + + const { id: txId } = await ant.removeController( + { controller: 'aGzM_yjralacHIUo8_nQXMbh9l1cy0aksiL_x9M359f' }, + // optional additional tags + { tags: [{ name: 'App-Name', value: 'My-Awesome-App' }] }, + ); + } + + main(); + + ``` + + ```typescript {{ title: 'Web' }} + import { ANT, ArConnectSigner } from '@ar.io/sdk/web'; + + async function main() { + const ant = ANT.init({ + signer: new ArConnectSigner(window.arweaveWallet), + processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" + }) + const { id: txId } = await ant.removeController( + { controller: 'aGzM_yjralacHIUo8_nQXMbh9l1cy0aksiL_x9M359f' }, + // optional additional tags + { tags: [{ name: 'App-Name', value: 'My-Awesome-App' }] }, + ); + } + + main(); + ``` + + diff --git a/src/app/build/ar-io-sdk/ants/remove-primary-names/page.mdx b/src/app/build/ar-io-sdk/ants/remove-primary-names/page.mdx new file mode 100644 index 00000000..43321dfc --- /dev/null +++ b/src/app/build/ar-io-sdk/ants/remove-primary-names/page.mdx @@ -0,0 +1,95 @@ +import { CodeGroup } from '@/components/Code' +import {HeroPattern} from "@/components/HeroPattern" + + + +# removePrimaryNames + +`removePrimaryNames` is a method on the `ANT` class that removes primary names from the ANT process. + +`removePrimaryNames` requires authentication. + +## Parameters + +{ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescriptionOptional
namesarrayArray of primary names to be removed.false
ioProcessIdstringProcess Id of the ARIO contract.false
tagsarray + An array of GQL tag objects to attach to the transfer AO message. + true
+
+} + +## Examples + + + + ```typescript {{title: "NodeJS"}} + const fs = require("fs"); + const { ANT, ArweaveSigner } = require("@ar.io/sdk"); + + async function main() { + const jwk = JSON.parse(fs.readFileSync("KeyFile.json")); + const ant = ANT.init({ + signer: new ArweaveSigner(jwk), + processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" + }); + + const { id: txId } = await ant.removePrimaryNames({ + names: ['arns', 'test_arns'], // any primary names associated with a base name controlled by this ANT will be removed + ioProcessId: ARIO_TESTNET_PROCESS_ID, + }); + } + + main(); + + ``` + + ```typescript {{ title: 'Web' }} + import { ANT, ArConnectSigner } from '@ar.io/sdk/web'; + + async function main() { + const ant = ANT.init({ + signer: new ArConnectSigner(window.arweaveWallet), + processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" + }) + + const { id: txId } = await ant.removePrimaryNames({ + names: ['arns', 'test_arns'], // any primary names associated with a base name controlled by this ANT will be removed + ioProcessId: ARIO_TESTNET_PROCESS_ID, + }); + } + + main(); + ``` + + diff --git a/src/app/build/ar-io-sdk/ants/remove-record/page.mdx b/src/app/build/ar-io-sdk/ants/remove-record/page.mdx new file mode 100644 index 00000000..e534af0c --- /dev/null +++ b/src/app/build/ar-io-sdk/ants/remove-record/page.mdx @@ -0,0 +1,95 @@ +import { CodeGroup } from '@/components/Code' +import {HeroPattern} from "@/components/HeroPattern" + + + +# removeRecord + +`removeRecord` is a method on the `ANT` class that removes a record from the ANT process. + +`removeRecord` requires authentication. + +## Parameters + +{ + +
+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescriptionOptional
undernameStringUndername to remove record for. `@` represents the top level name.false
tagsarray + An array of GQL tag objects to attach to the transfer AO message. + true
+
+} + +## Examples + + + + ```typescript {{title: "NodeJS"}} + const fs = require("fs"); + const { ANT, ArweaveSigner } = require("@ar.io/sdk"); + + async function main() { + const jwk = JSON.parse(fs.readFileSync("KeyFile.json")); + const ant = ANT.init({ + signer: new ArweaveSigner(jwk), + processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" + }); + + const { id: txId } = await ant.removeRecord( + { + undername: 'remove-domemain', + }, + // optional additional tags + { tags: [{ name: 'App-Name', value: 'My-Awesome-App' }] }, + ); + } + + main(); + + ``` + + ```typescript {{ title: 'Web' }} + import { ANT, ArConnectSigner } from '@ar.io/sdk/web'; + + async function main() { + const ant = ANT.init({ + signer: new ArConnectSigner(window.arweaveWallet), + processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" + }) + + const { id: txId } = await ant.removeRecord( + { + undername: 'remove-domemain', + }, + // optional additional tags + { tags: [{ name: 'App-Name', value: 'My-Awesome-App' }] }, + ); + } + + main(); + ``` + + diff --git a/src/app/build/ar-io-sdk/ants/set-controller/page.mdx b/src/app/build/ar-io-sdk/ants/set-controller/page.mdx new file mode 100644 index 00000000..caa00186 --- /dev/null +++ b/src/app/build/ar-io-sdk/ants/set-controller/page.mdx @@ -0,0 +1,90 @@ +import { CodeGroup } from '@/components/Code' +import {HeroPattern} from "@/components/HeroPattern" + + + +# setController + +`setController` is a method on the `ANT` class that adds a new controller to the list of approved controllers on the ANT. Controllers can set records and change the ticker and name of the ANT process. + +`setController` requires authentication. + +## Parameters + +{ + +
+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescriptionOptional
controllerString - WalletAddressPublic wallet address of the new controller being added.false
tagsarray + An array of GQL tag objects to attach to the transfer AO message. + true
+
+} + +## Examples + + + + ```typescript {{title: "NodeJS"}} + const fs = require("fs"); + const { ANT, ArweaveSigner } = require("@ar.io/sdk"); + + async function main() { + const jwk = JSON.parse(fs.readFileSync("KeyFile.json")); + const ant = ANT.init({ + signer: new ArweaveSigner(jwk), + processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" + }); + + const { id: txId } = await ant.setController( + { controller: 'aGzM_yjralacHIUo8_nQXMbh9l1cy0aksiL_x9M359f' }, + // optional additional tags + { tags: [{ name: 'App-Name', value: 'My-Awesome-App' }] }, + ); + } + + main(); + + ``` + + ```typescript {{ title: 'Web' }} + import { ANT, ArConnectSigner } from '@ar.io/sdk/web'; + + async function main() { + const ant = ANT.init({ + signer: new ArConnectSigner(window.arweaveWallet), + processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" + }) + const { id: txId } = await ant.setController( + { controller: 'aGzM_yjralacHIUo8_nQXMbh9l1cy0aksiL_x9M359f' }, + // optional additional tags + { tags: [{ name: 'App-Name', value: 'My-Awesome-App' }] }, + ); + } + + main(); + ``` + + diff --git a/src/app/build/ar-io-sdk/ants/set-description/page.mdx b/src/app/build/ar-io-sdk/ants/set-description/page.mdx new file mode 100644 index 00000000..6604012e --- /dev/null +++ b/src/app/build/ar-io-sdk/ants/set-description/page.mdx @@ -0,0 +1,91 @@ +import { CodeGroup } from '@/components/Code' +import {HeroPattern} from "@/components/HeroPattern" + + + +# setDescription + +`setDescription` is a method on the `ANT` class that sets the description of the ANT process. + +`setDescription` requires authentication. + +## Parameters + +{ + +
+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescriptionOptional
descriptionStringDescription to set on ANT process.false
tagsarray + An array of GQL tag objects to attach to the transfer AO message. + true
+
+} + +## Examples + + + + ```typescript {{title: "NodeJS"}} + const fs = require("fs"); + const { ANT, ArweaveSigner } = require("@ar.io/sdk"); + + async function main() { + const jwk = JSON.parse(fs.readFileSync("KeyFile.json")); + const ant = ANT.init({ + signer: new ArweaveSigner(jwk), + processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" + }); + + const { id: txId } = await ant.setDescription( + { description: 'A friendly description of this ANT' }, + // optional tags + { tags: [{ name: 'App-Name', value: 'My-Awesome-App' }] }, + ); + } + + main(); + + ``` + + ```typescript {{ title: 'Web' }} + import { ANT, ArConnectSigner } from '@ar.io/sdk/web'; + + async function main() { + const ant = ANT.init({ + signer: new ArConnectSigner(window.arweaveWallet), + processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" + }) + + const { id: txId } = await ant.setDescription( + { description: 'A friendly description of this ANT' }, + // optional tags + { tags: [{ name: 'App-Name', value: 'My-Awesome-App' }] }, + ); + } + + main(); + ``` + + diff --git a/src/app/build/ar-io-sdk/ants/set-keywords/page.mdx b/src/app/build/ar-io-sdk/ants/set-keywords/page.mdx new file mode 100644 index 00000000..e5d43e12 --- /dev/null +++ b/src/app/build/ar-io-sdk/ants/set-keywords/page.mdx @@ -0,0 +1,91 @@ +import { CodeGroup } from '@/components/Code' +import {HeroPattern} from "@/components/HeroPattern" + + + +# setKeywords + +`setKeywords` is a method on the `ANT` class that sets the keywords of the ANT process. + +`setKeywords` requires authentication. + +## Parameters + +{ + +
+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescriptionOptional
keywordsarrayArray of keywords to set on ANT process.false
tagsarray + An array of GQL tag objects to attach to the transfer AO message. + true
+
+} + +## Examples + + + + ```typescript {{title: "NodeJS"}} + const fs = require("fs"); + const { ANT, ArweaveSigner } = require("@ar.io/sdk"); + + async function main() { + const jwk = JSON.parse(fs.readFileSync("KeyFile.json")); + const ant = ANT.init({ + signer: new ArweaveSigner(jwk), + processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" + }); + + const { id: txId } = await ant.setDescription( + { keywords: ['Game', 'FPS', 'AO'] }, + // optional tags + { tags: [{ name: 'App-Name', value: 'My-Awesome-App' }] }, + ); + } + + main(); + + ``` + + ```typescript {{ title: 'Web' }} + import { ANT, ArConnectSigner } from '@ar.io/sdk/web'; + + async function main() { + const ant = ANT.init({ + signer: new ArConnectSigner(window.arweaveWallet), + processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" + }) + + const { id: txId } = await ant.setDescription( + { keywords: ['Game', 'FPS', 'AO'] }, + // optional tags + { tags: [{ name: 'App-Name', value: 'My-Awesome-App' }] }, + ); + } + + main(); + ``` + + diff --git a/src/app/build/ar-io-sdk/ants/set-logo/page.mdx b/src/app/build/ar-io-sdk/ants/set-logo/page.mdx new file mode 100644 index 00000000..7ef24b7d --- /dev/null +++ b/src/app/build/ar-io-sdk/ants/set-logo/page.mdx @@ -0,0 +1,91 @@ +import { CodeGroup } from '@/components/Code' +import {HeroPattern} from "@/components/HeroPattern" + + + +# setLogo + +`setLogo` is a method on the `ANT` class that sets the logo of the ANT process. Logo should be an Arweave transaction Id. + +`setLogo` requires authentication. + +## Parameters + +{ + +
+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescriptionOptional
txIdstringArweave transaction Id representing an image to use as ANT logo.false
tagsarray + An array of GQL tag objects to attach to the transfer AO message. + true
+
+} + +## Examples + + + + ```typescript {{title: "NodeJS"}} + const fs = require("fs"); + const { ANT, ArweaveSigner } = require("@ar.io/sdk"); + + async function main() { + const jwk = JSON.parse(fs.readFileSync("KeyFile.json")); + const ant = ANT.init({ + signer: new ArweaveSigner(jwk), + processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" + }); + + const { id: txId } = await ant.setLogo( + { txId: 'U7RXcpaVShG4u9nIcPVmm2FJSM5Gru9gQCIiRaIPV7f' }, + // optional tags + { tags: [{ name: 'App-Name', value: 'My-Awesome-App' }] }, + ); + } + + main(); + + ``` + + ```typescript {{ title: 'Web' }} + import { ANT, ArConnectSigner } from '@ar.io/sdk/web'; + + async function main() { + const ant = ANT.init({ + signer: new ArConnectSigner(window.arweaveWallet), + processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" + }) + + const { id: txId } = await ant.setLogo( + { txId: 'U7RXcpaVShG4u9nIcPVmm2FJSM5Gru9gQCIiRaIPV7f' }, + // optional tags + { tags: [{ name: 'App-Name', value: 'My-Awesome-App' }] }, + ); + } + + main(); + ``` + + diff --git a/src/app/build/ar-io-sdk/ants/set-name/page.mdx b/src/app/build/ar-io-sdk/ants/set-name/page.mdx new file mode 100644 index 00000000..7a2e6960 --- /dev/null +++ b/src/app/build/ar-io-sdk/ants/set-name/page.mdx @@ -0,0 +1,91 @@ +import { CodeGroup } from '@/components/Code' +import {HeroPattern} from "@/components/HeroPattern" + + + +# setName + +`setName` is a method on the `ANT` class that sets the name of the ANT process. + +`setName` requires authentication. + +## Parameters + +{ + +
+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescriptionOptional
nameStringName to set on ANT process.false
tagsarray + An array of GQL tag objects to attach to the transfer AO message. + true
+
+} + +## Examples + + + + ```typescript {{title: "NodeJS"}} + const fs = require("fs"); + const { ANT, ArweaveSigner } = require("@ar.io/sdk"); + + async function main() { + const jwk = JSON.parse(fs.readFileSync("KeyFile.json")); + const ant = ANT.init({ + signer: new ArweaveSigner(jwk), + processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" + }); + + const { id: txId } = await ant.setName( + { name: 'My ANT' }, + // optional additional tags + { tags: [{ name: 'App-Name', value: 'My-Awesome-App' }] }, + ); + } + + main(); + + ``` + + ```typescript {{ title: 'Web' }} + import { ANT, ArConnectSigner } from '@ar.io/sdk/web'; + + async function main() { + const ant = ANT.init({ + signer: new ArConnectSigner(window.arweaveWallet), + processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" + }) + + const { id: txId } = await ant.setName( + { name: 'My ANT' }, + // optional additional tags + { tags: [{ name: 'App-Name', value: 'My-Awesome-App' }] }, + ); + } + + main(); + ``` + + diff --git a/src/app/build/ar-io-sdk/ants/set-record/page.mdx b/src/app/build/ar-io-sdk/ants/set-record/page.mdx new file mode 100644 index 00000000..bc5267d6 --- /dev/null +++ b/src/app/build/ar-io-sdk/ants/set-record/page.mdx @@ -0,0 +1,111 @@ +import { CodeGroup } from '@/components/Code' +import {HeroPattern} from "@/components/HeroPattern" + + + +# setRecord + +`setRecord` is a method on the `ANT` class that updates or creates a record in the ANT process. + +`setRecord` requires authentication. + +## Parameters + +{ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescriptionOptional
undernameStringUndername to set record for. `@` represents the top level name.false
transactionIdStringArweave transaction Id to set as record.false
ttlSecondsnumberNumber of seconds for DNS TTL.false
tagsarray + An array of GQL tag objects to attach to the transfer AO message. + true
+
+} + +## Examples + + + + ```typescript {{title: "NodeJS"}} + const fs = require("fs"); + const { ANT, ArweaveSigner } = require("@ar.io/sdk"); + + async function main() { + const jwk = JSON.parse(fs.readFileSync("KeyFile.json")); + const ant = ANT.init({ + signer: new ArweaveSigner(jwk), + processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" + }); + + const { id: txId } = await ant.setRecord( + { + undername: '@', + transactionId: '432l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM' + ttlSeconds: 3600 + }, + // optional additional tags + { tags: [{ name: 'App-Name', value: 'My-Awesome-App' }] }, + ); + } + + main(); + + ``` + + ```typescript {{ title: 'Web' }} + import { ANT, ArConnectSigner } from '@ar.io/sdk/web'; + + async function main() { + const ant = ANT.init({ + signer: new ArConnectSigner(window.arweaveWallet), + processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" + }) + + const { id: txId } = await ant.setRecord( + { + undername: '@', + transactionId: '432l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM' + ttlSeconds: 3600 + }, + // optional additional tags + { tags: [{ name: 'App-Name', value: 'My-Awesome-App' }] }, + ); + } + + main(); + ``` + + diff --git a/src/app/build/ar-io-sdk/ants/set-ticker/page.mdx b/src/app/build/ar-io-sdk/ants/set-ticker/page.mdx new file mode 100644 index 00000000..4123fe55 --- /dev/null +++ b/src/app/build/ar-io-sdk/ants/set-ticker/page.mdx @@ -0,0 +1,91 @@ +import { CodeGroup } from '@/components/Code' +import {HeroPattern} from "@/components/HeroPattern" + + + +# setTicker + +`setTicker` is a method on the `ANT` class that sets the ticker of the ANT process. + +`setTicker` requires authentication. + +## Parameters + +{ + +
+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescriptionOptional
tickerStringTicker to set on ANT process.false
tagsarray + An array of GQL tag objects to attach to the transfer AO message. + true
+
+} + +## Examples + + + + ```typescript {{title: "NodeJS"}} + const fs = require("fs"); + const { ANT, ArweaveSigner } = require("@ar.io/sdk"); + + async function main() { + const jwk = JSON.parse(fs.readFileSync("KeyFile.json")); + const ant = ANT.init({ + signer: new ArweaveSigner(jwk), + processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" + }); + + const { id: txId } = await ant.setTicker( + { ticker: 'ANT-NEW-TICKER' }, + // optional tags + { tags: [{ name: 'App-Name', value: 'My-Awesome-App' }] }, + ); + } + + main(); + + ``` + + ```typescript {{ title: 'Web' }} + import { ANT, ArConnectSigner } from '@ar.io/sdk/web'; + + async function main() { + const ant = ANT.init({ + signer: new ArConnectSigner(window.arweaveWallet), + processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" + }) + + const { id: txId } = await ant.setTicker( + { ticker: 'ANT-NEW-TICKER' }, + // optional tags + { tags: [{ name: 'App-Name', value: 'My-Awesome-App' }] }, + ); + } + + main(); + ``` + + diff --git a/src/app/build/ar-io-sdk/ants/transfer/page.mdx b/src/app/build/ar-io-sdk/ants/transfer/page.mdx new file mode 100644 index 00000000..fc128337 --- /dev/null +++ b/src/app/build/ar-io-sdk/ants/transfer/page.mdx @@ -0,0 +1,90 @@ +import { CodeGroup } from '@/components/Code' +import {HeroPattern} from "@/components/HeroPattern" + + + +# transfer + +`transfer` is a method on the `ANT` class that transfers ownership of the ANT to a new target address. Target must be an Arweave address. + +`transfer` requires authentication. + +## Parameters + +{ + +
+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescriptionOptional
targetString - WalletAddressRecipient wallet address to send ANT to.false
tagsarray + An array of GQL tag objects to attach to the transfer AO message. + true
+
+} + +## Examples + + + + ```typescript {{title: "NodeJS"}} + const fs = require("fs"); + const { ANT, ArweaveSigner } = require("@ar.io/sdk"); + + async function main() { + const jwk = JSON.parse(fs.readFileSync("KeyFile.json")); + const ant = ANT.init({ + signer: new ArweaveSigner(jwk), + processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" + }); + + const { id: txId } = await ant.transfer( + { target: 'aGzM_yjralacHIUo8_nQXMbh9l1cy0aksiL_x9M359f' }, + // optional additional tags + { tags: [{ name: 'App-Name', value: 'My-Awesome-App' }] }, + ); + } + + main(); + + ``` + + ```typescript {{ title: 'Web' }} + import { ANT, ArConnectSigner } from '@ar.io/sdk/web'; + + async function main() { + const ant = ANT.init({ + signer: new ArConnectSigner(window.arweaveWallet), + processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" + }) + const { id: txId } = await ant.transfer( + { target: 'aGzM_yjralacHIUo8_nQXMbh9l1cy0aksiL_x9M359f' }, + // optional additional tags + { tags: [{ name: 'App-Name', value: 'My-Awesome-App' }] }, + ); + } + + main(); + ``` + + diff --git a/src/app/build/ar-io-sdk/ario/general/init/page.mdx b/src/app/build/ar-io-sdk/ario/configuration/page.mdx similarity index 88% rename from src/app/build/ar-io-sdk/ario/general/init/page.mdx rename to src/app/build/ar-io-sdk/ario/configuration/page.mdx index 57289864..8c49510a 100644 --- a/src/app/build/ar-io-sdk/ario/general/init/page.mdx +++ b/src/app/build/ar-io-sdk/ario/configuration/page.mdx @@ -54,13 +54,16 @@ import {HeroPattern} from "@/components/HeroPattern" ```typescript {{title: "NodeJS - unauthorized"}} - import { ARIO } from "@ar.io/sdk" + const { ARIO } = require("@ar.io/sdk") const ario = ARIO.init() ``` ```typescript {{title: "NodeJS - authorized"}} - import { ARIO, ArweaveSigner} from "@ar.io/sdk" + const { ARIO, ArweaveSigner} = require("@ar.io/sdk") + const fs = require("fs"); + + const jwk = JSON.parse(fs.readFileSync("KeyFile.json")); const ario = ARIO.init({ signer: new ArweaveSigner(jwk) @@ -82,8 +85,8 @@ import {HeroPattern} from "@/components/HeroPattern" ``` ```typescript {{title: "Custom AO"}} - import {AOProcess, ARIO} from "@ar.io/sdk" - import {connect} from "@permaweb/aoconnect" + const {AOProcess, ARIO} = require("@ar.io/sdk") + const {connect} = require("@permaweb/aoconnect") const ario = ARIO.init({ process: new AOProcess ({ @@ -100,7 +103,7 @@ import {HeroPattern} from "@/components/HeroPattern" ```typescript {{title: "custom process ID"}} // This is used to connect to an AO process OTHER than IO, and does not interact with the ar.io network - import{ ARIO } from "@ar.io/sdk" + const { ARIO } = require("@ar.io/sdk") const ario = ARIO.init({ processId: ''