Skip to content

Commit

Permalink
Merge branch 'stephen-tailwind' into tailwind
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobinstein committed Dec 4, 2024
2 parents 21ec9b7 + 86af813 commit 9b05e1f
Show file tree
Hide file tree
Showing 22 changed files with 1,824 additions and 5 deletions.
103 changes: 103 additions & 0 deletions src/app/build/ar-io-sdk/ants/approve-primary-name-request/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
import { CodeGroup } from '@/components/Code'
import {HeroPattern} from "@/components/HeroPattern"

<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

{

<div style={{ textAlign: 'center' }}>
<table className="inline-table">
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Description</th>
<th>Optional</th>
</tr>
</thead>
<tbody>
<tr>
<th>name</th>
<td>string</td>
<td>ArNS name to approve as primary name.</td>
<td>false</td>
</tr>
<tr>
<th>address</th>
<td>string - WalletAddress</td>
<td>Public wallet address that made the primary name request being approved.</td>
<td>false</td>
</tr>
<tr>
<th>ioProcessId</th>
<td>string</td>
<td>Process Id of the ARIO contract.</td>
<td>false</td>
</tr>
<tr>
<th>tags</th>
<td>array</td>
<td>
An array of GQL tag objects to attach to the transfer AO message.
</td>
<td>true</td>
</tr>
</tbody>
</table>
</div>
}

## Examples

<CodeGroup title="approvePrimaryNameRequest">

```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();
```

</CodeGroup>
110 changes: 110 additions & 0 deletions src/app/build/ar-io-sdk/ants/configuration/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
import { CodeGroup } from '@/components/Code'
import {HeroPattern} from "@/components/HeroPattern"

<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

{
<div style={{ textAlign: 'center' }}>
<table className="inline-table">
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Description</th>
<th>Optional</th>
</tr>
</thead>
<tbody>
<tr>
<th>processId</th>
<td>String</td>
<td>The AO process ID of the ANT to connect to.</td>
<td>false</td>
</tr>
<tr>
<th>process</th>
<td>AOProcess</td>
<td>
A pre-configured AOProcess instance used to initialize the ARIO class
</td>
<td>true</td>
</tr>
<tr>
<th>signer</th>
<td>ContractSigner</td>
<td>
An optional signer instance, used to enable write operations on the
blockchain
</td>
<td>true</td>
</tr>
</tbody>
</table>
</div>
}

## Examples

<CodeGroup title="init">

```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: '<ARIO_PROCESS_ID>'
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
})
})
})
```

</CodeGroup>
52 changes: 52 additions & 0 deletions src/app/build/ar-io-sdk/ants/get-controllers/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import {CodeGroup} from "@/components/Code"
import {HeroPattern} from "@/components/HeroPattern"

<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

<CodeGroup title="getControllers">

```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();
```

</CodeGroup>

## Output

```json
["ccp3blG__gKUvG3hsGC2u06aDmqv4CuhuDJGOIg0jw4"]
```
71 changes: 71 additions & 0 deletions src/app/build/ar-io-sdk/ants/get-handlers/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import {CodeGroup} from "@/components/Code"
import {HeroPattern} from "@/components/HeroPattern"

<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

<CodeGroup title="getHandlers">

```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();
```

</CodeGroup>

## Output

```json
[
"_eval",
"_default",
"transfer",
"balance",
"balances",
"totalSupply",
"info",
"addController",
"removeController",
"controllers",
"setRecord",
"removeRecord",
"record",
"records",
"setName",
"setTicker",
"initializeState",
"state"
]
```
Loading

0 comments on commit 9b05e1f

Please sign in to comment.