@inkd/sdk 0.9.0
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 +288 -0
- package/dist/InkdClient.d.ts +89 -0
- package/dist/InkdClient.d.ts.map +1 -0
- package/dist/InkdClient.js +398 -0
- package/dist/InkdClient.js.map +1 -0
- package/dist/ProjectRegistry.d.ts +655 -0
- package/dist/ProjectRegistry.d.ts.map +1 -0
- package/dist/ProjectRegistry.js +708 -0
- package/dist/ProjectRegistry.js.map +1 -0
- package/dist/__tests__/InkdClient.advanced.test.d.ts +10 -0
- package/dist/__tests__/InkdClient.advanced.test.d.ts.map +1 -0
- package/dist/__tests__/InkdClient.advanced.test.js +588 -0
- package/dist/__tests__/InkdClient.advanced.test.js.map +1 -0
- package/dist/__tests__/InkdClient.connectArweave.test.d.ts +10 -0
- package/dist/__tests__/InkdClient.connectArweave.test.d.ts.map +1 -0
- package/dist/__tests__/InkdClient.connectArweave.test.js +132 -0
- package/dist/__tests__/InkdClient.connectArweave.test.js.map +1 -0
- package/dist/__tests__/InkdClient.test.d.ts +2 -0
- package/dist/__tests__/InkdClient.test.d.ts.map +1 -0
- package/dist/__tests__/InkdClient.test.js +259 -0
- package/dist/__tests__/InkdClient.test.js.map +1 -0
- package/dist/__tests__/ProjectRegistry.test.d.ts +8 -0
- package/dist/__tests__/ProjectRegistry.test.d.ts.map +1 -0
- package/dist/__tests__/ProjectRegistry.test.js +689 -0
- package/dist/__tests__/ProjectRegistry.test.js.map +1 -0
- package/dist/__tests__/arweave.test.d.ts +9 -0
- package/dist/__tests__/arweave.test.d.ts.map +1 -0
- package/dist/__tests__/arweave.test.js +353 -0
- package/dist/__tests__/arweave.test.js.map +1 -0
- package/dist/__tests__/encryption.test.d.ts +2 -0
- package/dist/__tests__/encryption.test.d.ts.map +1 -0
- package/dist/__tests__/encryption.test.js +154 -0
- package/dist/__tests__/encryption.test.js.map +1 -0
- package/dist/__tests__/errors.test.d.ts +2 -0
- package/dist/__tests__/errors.test.d.ts.map +1 -0
- package/dist/__tests__/errors.test.js +136 -0
- package/dist/__tests__/errors.test.js.map +1 -0
- package/dist/__tests__/events.test.d.ts +10 -0
- package/dist/__tests__/events.test.d.ts.map +1 -0
- package/dist/__tests__/events.test.js +380 -0
- package/dist/__tests__/events.test.js.map +1 -0
- package/dist/__tests__/index.InkdClient.test.d.ts +8 -0
- package/dist/__tests__/index.InkdClient.test.d.ts.map +1 -0
- package/dist/__tests__/index.InkdClient.test.js +422 -0
- package/dist/__tests__/index.InkdClient.test.js.map +1 -0
- package/dist/__tests__/multicall.test.d.ts +9 -0
- package/dist/__tests__/multicall.test.d.ts.map +1 -0
- package/dist/__tests__/multicall.test.js +362 -0
- package/dist/__tests__/multicall.test.js.map +1 -0
- package/dist/__tests__/types.test.d.ts +2 -0
- package/dist/__tests__/types.test.d.ts.map +1 -0
- package/dist/__tests__/types.test.js +35 -0
- package/dist/__tests__/types.test.js.map +1 -0
- package/dist/abi.d.ts +2632 -0
- package/dist/abi.d.ts.map +1 -0
- package/dist/abi.js +3423 -0
- package/dist/abi.js.map +1 -0
- package/dist/arweave.d.ts +45 -0
- package/dist/arweave.d.ts.map +1 -0
- package/dist/arweave.js +154 -0
- package/dist/arweave.js.map +1 -0
- package/dist/encryption.d.ts +52 -0
- package/dist/encryption.d.ts.map +1 -0
- package/dist/encryption.js +80 -0
- package/dist/encryption.js.map +1 -0
- package/dist/errors.d.ts +63 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +124 -0
- package/dist/errors.js.map +1 -0
- package/dist/events.d.ts +136 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +131 -0
- package/dist/events.js.map +1 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +12 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/useInkd.d.ts +24 -0
- package/dist/hooks/useInkd.d.ts.map +1 -0
- package/dist/hooks/useInkd.js +109 -0
- package/dist/hooks/useInkd.js.map +1 -0
- package/dist/hooks/useInkdHolder.d.ts +16 -0
- package/dist/hooks/useInkdHolder.d.ts.map +1 -0
- package/dist/hooks/useInkdHolder.js +45 -0
- package/dist/hooks/useInkdHolder.js.map +1 -0
- package/dist/hooks/useInscriptions.d.ts +17 -0
- package/dist/hooks/useInscriptions.d.ts.map +1 -0
- package/dist/hooks/useInscriptions.js +46 -0
- package/dist/hooks/useInscriptions.js.map +1 -0
- package/dist/hooks/useToken.d.ts +16 -0
- package/dist/hooks/useToken.d.ts.map +1 -0
- package/dist/hooks/useToken.js +45 -0
- package/dist/hooks/useToken.js.map +1 -0
- package/dist/index.d.ts +54 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +290 -0
- package/dist/index.js.map +1 -0
- package/dist/multicall.d.ts +134 -0
- package/dist/multicall.d.ts.map +1 -0
- package/dist/multicall.js +182 -0
- package/dist/multicall.js.map +1 -0
- package/dist/types.d.ts +187 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +32 -0
- package/dist/types.js.map +1 -0
- package/package.json +78 -0
package/README.md
ADDED
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
# @inkd/sdk
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@inkd/sdk)
|
|
4
|
+
[](https://github.com/inkdprotocol/inkd-protocol/actions/workflows/ci.yml)
|
|
5
|
+
[](../LICENSE)
|
|
6
|
+
[](https://base.org)
|
|
7
|
+
|
|
8
|
+
TypeScript SDK for the **Inkd Protocol** — permanent on-chain project registry on Base. Lock 1 `$INKD` to register. Pay 0.001 ETH to push a version. Own your work forever.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @inkd/sdk viem
|
|
16
|
+
# or
|
|
17
|
+
pnpm add @inkd/sdk viem
|
|
18
|
+
# or
|
|
19
|
+
yarn add @inkd/sdk viem
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
> **Peer dependency:** [`viem`](https://viem.sh) ≥ 2.0.0 must be installed in your project.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Quick Start
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
import { InkdClient } from '@inkd/sdk'
|
|
30
|
+
import { createWalletClient, http } from 'viem'
|
|
31
|
+
import { privateKeyToAccount } from 'viem/accounts'
|
|
32
|
+
import { base } from 'viem/chains'
|
|
33
|
+
|
|
34
|
+
const account = privateKeyToAccount('0x...')
|
|
35
|
+
const wallet = createWalletClient({ account, chain: base, transport: http() })
|
|
36
|
+
|
|
37
|
+
const inkd = new InkdClient({ walletClient: wallet, network: 'mainnet' })
|
|
38
|
+
|
|
39
|
+
// 1. Approve $INKD spend (one-time per project)
|
|
40
|
+
await inkd.approveToken()
|
|
41
|
+
|
|
42
|
+
// 2. Register your project on-chain
|
|
43
|
+
const hash = await inkd.createProject({
|
|
44
|
+
name: 'my-awesome-tool',
|
|
45
|
+
description: 'An AI tool for doing amazing things',
|
|
46
|
+
license: 'MIT',
|
|
47
|
+
isPublic: true,
|
|
48
|
+
isAgent: true,
|
|
49
|
+
agentEndpoint: 'https://api.myawesometool.xyz',
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
console.log('Project registered! tx:', hash)
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## API Reference
|
|
58
|
+
|
|
59
|
+
### `new InkdClient(options)`
|
|
60
|
+
|
|
61
|
+
| Option | Type | Default | Description |
|
|
62
|
+
|--------|------|---------|-------------|
|
|
63
|
+
| `walletClient` | `WalletClient` | required | viem wallet client |
|
|
64
|
+
| `network` | `'mainnet' \| 'testnet'` | `'testnet'` | Target network |
|
|
65
|
+
| `rpcUrl` | `string` | viem default | Custom RPC URL |
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
### Token Methods
|
|
70
|
+
|
|
71
|
+
#### `approveToken(amount?)`
|
|
72
|
+
Approve the registry contract to spend `$INKD` tokens. Call before `createProject()`.
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
await inkd.approveToken() // approve 1 INKD (default)
|
|
76
|
+
await inkd.approveToken(parseEther('5')) // approve 5 INKD
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
#### `tokenBalance(address?)`
|
|
80
|
+
Get `$INKD` balance for an address (defaults to connected wallet).
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
const balance = await inkd.tokenBalance()
|
|
84
|
+
// → 1000000000000000000n (1 INKD in wei)
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
### Project Methods
|
|
90
|
+
|
|
91
|
+
#### `createProject(opts)`
|
|
92
|
+
Register a new project. Requires 1 `$INKD` locked permanently.
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
const hash = await inkd.createProject({
|
|
96
|
+
name: 'my-project', // unique, immutable, lowercase
|
|
97
|
+
description: 'What it does',
|
|
98
|
+
license: 'MIT', // MIT | GPL-3.0 | Apache-2.0 | Proprietary
|
|
99
|
+
readmeHash: 'ar://abc123', // Arweave hash of README
|
|
100
|
+
isPublic: true,
|
|
101
|
+
isAgent: false,
|
|
102
|
+
agentEndpoint: '',
|
|
103
|
+
})
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
#### `pushVersion(projectId, opts)`
|
|
107
|
+
Push a new version. Costs 0.001 ETH.
|
|
108
|
+
|
|
109
|
+
```typescript
|
|
110
|
+
const hash = await inkd.pushVersion(1n, {
|
|
111
|
+
arweaveHash: 'ar://QmXyz...',
|
|
112
|
+
versionTag: '1.2.0',
|
|
113
|
+
changelog: 'Fixed critical bug in payment processor',
|
|
114
|
+
})
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
#### `getProject(projectId)`
|
|
118
|
+
Fetch project metadata from the registry.
|
|
119
|
+
|
|
120
|
+
```typescript
|
|
121
|
+
const project = await inkd.getProject(1n)
|
|
122
|
+
// → { id, name, description, license, owner, isAgent, versionCount, ... }
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
#### `getVersions(projectId)`
|
|
126
|
+
List all versions of a project.
|
|
127
|
+
|
|
128
|
+
```typescript
|
|
129
|
+
const versions = await inkd.getVersions(1n)
|
|
130
|
+
// → [{ arweaveHash, versionTag, changelog, pushedBy, pushedAt }, ...]
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
#### `transferProject(projectId, newOwner)`
|
|
134
|
+
Transfer project ownership. Costs 0.005 ETH.
|
|
135
|
+
|
|
136
|
+
```typescript
|
|
137
|
+
await inkd.transferProject(1n, '0xNewOwner...')
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
#### `getAgentProjects(offset?, limit?)`
|
|
141
|
+
List all AI agent projects registered on-chain.
|
|
142
|
+
|
|
143
|
+
```typescript
|
|
144
|
+
const ids = await inkd.getAgentProjects(0n, 50n)
|
|
145
|
+
// → [1n, 4n, 7n, ...]
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
### Fee Methods
|
|
151
|
+
|
|
152
|
+
#### `getVersionFee()`
|
|
153
|
+
Current fee to push a version (in wei).
|
|
154
|
+
|
|
155
|
+
```typescript
|
|
156
|
+
const fee = await inkd.getVersionFee()
|
|
157
|
+
// → 1000000000000000n (0.001 ETH)
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## React Hooks
|
|
163
|
+
|
|
164
|
+
The SDK ships optional React hooks (requires `react` ≥ 18):
|
|
165
|
+
|
|
166
|
+
```typescript
|
|
167
|
+
import { useInkdProject, useInkdVersions, useInkdStats } from '@inkd/sdk/hooks'
|
|
168
|
+
|
|
169
|
+
function ProjectCard({ id }: { id: bigint }) {
|
|
170
|
+
const { project, loading, error } = useInkdProject(client, id)
|
|
171
|
+
|
|
172
|
+
if (loading) return <Spinner />
|
|
173
|
+
if (error) return <Error message={error.message} />
|
|
174
|
+
|
|
175
|
+
return (
|
|
176
|
+
<div>
|
|
177
|
+
<h2>{project.name}</h2>
|
|
178
|
+
<p>{project.description}</p>
|
|
179
|
+
<span>{project.versionCount.toString()} versions</span>
|
|
180
|
+
</div>
|
|
181
|
+
)
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Available hooks:
|
|
186
|
+
- `useInkdProject(client, projectId)` — fetch project metadata
|
|
187
|
+
- `useInkdVersions(client, projectId)` — fetch all versions
|
|
188
|
+
- `useInkdStats(client)` — protocol-wide stats
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## Error Handling
|
|
193
|
+
|
|
194
|
+
All SDK errors extend `InkdError`:
|
|
195
|
+
|
|
196
|
+
```typescript
|
|
197
|
+
import { InkdError, ProjectNotFound, InsufficientAllowance, InsufficientBalance } from '@inkd/sdk'
|
|
198
|
+
|
|
199
|
+
try {
|
|
200
|
+
await inkd.createProject({ name: 'exists', ... })
|
|
201
|
+
} catch (err) {
|
|
202
|
+
if (err instanceof ProjectNotFound) {
|
|
203
|
+
console.log('Project does not exist')
|
|
204
|
+
} else if (err instanceof InsufficientAllowance) {
|
|
205
|
+
console.log('Need to approve $INKD first')
|
|
206
|
+
await inkd.approveToken()
|
|
207
|
+
} else if (err instanceof InkdError) {
|
|
208
|
+
console.log('Protocol error:', err.message, err.code)
|
|
209
|
+
} else {
|
|
210
|
+
throw err // re-throw unexpected errors
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
| Error Class | Code | When thrown |
|
|
216
|
+
|-------------|------|-------------|
|
|
217
|
+
| `InkdError` | — | Base class |
|
|
218
|
+
| `ProjectNotFound` | `PROJECT_NOT_FOUND` | Project ID doesn't exist |
|
|
219
|
+
| `ProjectNameTaken` | `PROJECT_NAME_TAKEN` | Name already registered |
|
|
220
|
+
| `Unauthorized` | `UNAUTHORIZED` | Not owner/collaborator |
|
|
221
|
+
| `InsufficientBalance` | `INSUFFICIENT_BALANCE` | Not enough $INKD |
|
|
222
|
+
| `InsufficientAllowance` | `INSUFFICIENT_ALLOWANCE` | Token not approved |
|
|
223
|
+
| `InvalidArweaveHash` | `INVALID_ARWEAVE_HASH` | Bad hash format |
|
|
224
|
+
| `VersionAlreadyExists` | `VERSION_ALREADY_EXISTS` | Tag already pushed |
|
|
225
|
+
| `ClientNotConnected` | `CLIENT_NOT_CONNECTED` | No wallet connected |
|
|
226
|
+
| `ArweaveNotConnected` | `ARWEAVE_NOT_CONNECTED` | Arweave client missing |
|
|
227
|
+
| `EncryptionError` | `ENCRYPTION_ERROR` | Encryption/decryption failed |
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## AI Agent Usage
|
|
232
|
+
|
|
233
|
+
Register your AI agent's capabilities on-chain:
|
|
234
|
+
|
|
235
|
+
```typescript
|
|
236
|
+
const hash = await inkd.createProject({
|
|
237
|
+
name: 'my-agent-v1',
|
|
238
|
+
description: 'Autonomous coding agent — builds and deploys software',
|
|
239
|
+
license: 'Proprietary',
|
|
240
|
+
isAgent: true,
|
|
241
|
+
agentEndpoint: 'https://api.myagent.xyz/v1',
|
|
242
|
+
isPublic: true,
|
|
243
|
+
})
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
Query all registered agents:
|
|
247
|
+
|
|
248
|
+
```typescript
|
|
249
|
+
const agentIds = await inkd.getAgentProjects(0n, 100n)
|
|
250
|
+
const agents = await Promise.all(agentIds.map(id => inkd.getProject(id)))
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
## Network Addresses
|
|
256
|
+
|
|
257
|
+
| Contract | Mainnet (Base) | Testnet (Base Sepolia) |
|
|
258
|
+
|----------|---------------|------------------------|
|
|
259
|
+
| `InkdToken` | TBD | TBD |
|
|
260
|
+
| `InkdRegistry` | TBD | TBD |
|
|
261
|
+
| `InkdTreasury` | TBD | TBD |
|
|
262
|
+
|
|
263
|
+
> Addresses will be populated after mainnet deployment.
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## Contributing
|
|
268
|
+
|
|
269
|
+
See [`CONTRIBUTING.md`](../CONTRIBUTING.md) in the monorepo root.
|
|
270
|
+
|
|
271
|
+
**Dev setup:**
|
|
272
|
+
```bash
|
|
273
|
+
cd sdk
|
|
274
|
+
npm install
|
|
275
|
+
npm test # run 42 unit tests
|
|
276
|
+
npm run typecheck # TypeScript check
|
|
277
|
+
npm run build # compile to dist/
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## License
|
|
283
|
+
|
|
284
|
+
MIT — see [LICENSE](../LICENSE)
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
*Made by [Inkd Protocol](https://inkdprotocol.xyz)*
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file InkdClient.ts
|
|
3
|
+
* @description Main client class for interacting with the Inkd Protocol.
|
|
4
|
+
* Handles InkdToken minting, InkdVault inscriptions, and InkdRegistry operations.
|
|
5
|
+
*/
|
|
6
|
+
import type { PublicClient, WalletClient, Account, Chain, Transport } from "viem";
|
|
7
|
+
import { type IEncryptionProvider } from "./encryption";
|
|
8
|
+
import type { Address, InkdClientConfig, InkdTokenData, Inscription, ProtocolStats, MintOptions, InscribeOptions, InscribeResult, InscribeCostEstimate, TransactionResult } from "./types";
|
|
9
|
+
/**
|
|
10
|
+
* The main Inkd Protocol client.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { InkdClient } from "@inkd/sdk";
|
|
15
|
+
* import { createWalletClient, createPublicClient, http } from "viem";
|
|
16
|
+
* import { baseSepolia } from "viem/chains";
|
|
17
|
+
* import { privateKeyToAccount } from "viem/accounts";
|
|
18
|
+
*
|
|
19
|
+
* const inkd = new InkdClient({
|
|
20
|
+
* tokenAddress: "0x...",
|
|
21
|
+
* vaultAddress: "0x...",
|
|
22
|
+
* registryAddress: "0x...",
|
|
23
|
+
* chainId: 84532,
|
|
24
|
+
* });
|
|
25
|
+
*
|
|
26
|
+
* inkd.connect(walletClient, publicClient);
|
|
27
|
+
* await inkd.connectArweave("private-key");
|
|
28
|
+
*
|
|
29
|
+
* // Mint an InkdToken
|
|
30
|
+
* const { tokenId } = await inkd.mintToken();
|
|
31
|
+
*
|
|
32
|
+
* // Inscribe data on it
|
|
33
|
+
* const result = await inkd.inscribe(tokenId, Buffer.from("agent brain data"), {
|
|
34
|
+
* contentType: "application/json",
|
|
35
|
+
* name: "brain.json",
|
|
36
|
+
* });
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare class InkdClient {
|
|
40
|
+
private config;
|
|
41
|
+
private walletClient;
|
|
42
|
+
private publicClient;
|
|
43
|
+
private arweave;
|
|
44
|
+
private encryption;
|
|
45
|
+
constructor(config: InkdClientConfig);
|
|
46
|
+
/** Connect wallet and public clients for on-chain interaction. */
|
|
47
|
+
connect(walletClient: WalletClient<Transport, Chain, Account>, publicClient: PublicClient): void;
|
|
48
|
+
/** Connect Arweave storage client for file uploads. */
|
|
49
|
+
connectArweave(privateKey: string, irysUrl?: string, gateway?: string): Promise<void>;
|
|
50
|
+
/** Set a custom encryption provider (for Lit Protocol integration). */
|
|
51
|
+
setEncryptionProvider(provider: IEncryptionProvider): void;
|
|
52
|
+
/** Mint a single InkdToken. Returns the new token ID. */
|
|
53
|
+
mintToken(options?: MintOptions): Promise<TransactionResult>;
|
|
54
|
+
/** Batch mint multiple InkdTokens (max 10). */
|
|
55
|
+
private batchMintTokens;
|
|
56
|
+
/** Inscribe data onto your InkdToken. Uploads to Arweave first. */
|
|
57
|
+
inscribe(tokenId: bigint, data: Buffer | Uint8Array | string, options?: InscribeOptions): Promise<InscribeResult>;
|
|
58
|
+
/** Get all inscriptions on a token. */
|
|
59
|
+
getInscriptions(tokenId: bigint): Promise<Inscription[]>;
|
|
60
|
+
/** Remove (soft-delete) an inscription. */
|
|
61
|
+
removeInscription(tokenId: bigint, index: number): Promise<TransactionResult>;
|
|
62
|
+
/** Update an inscription with new data (creates a new version). */
|
|
63
|
+
updateInscription(tokenId: bigint, index: number, newData: Buffer | Uint8Array | string, contentType?: string): Promise<TransactionResult>;
|
|
64
|
+
/** Grant temporary read access to a wallet. */
|
|
65
|
+
grantAccess(tokenId: bigint, wallet: Address, durationSeconds: number): Promise<TransactionResult>;
|
|
66
|
+
/** Revoke read access from a wallet. */
|
|
67
|
+
revokeAccess(tokenId: bigint, wallet: Address): Promise<TransactionResult>;
|
|
68
|
+
/** List an InkdToken for sale on the marketplace. */
|
|
69
|
+
listForSale(tokenId: bigint, price: bigint): Promise<TransactionResult>;
|
|
70
|
+
/** Buy an InkdToken from the marketplace. */
|
|
71
|
+
buyToken(tokenId: bigint): Promise<TransactionResult>;
|
|
72
|
+
/** Get token data for a specific InkdToken. */
|
|
73
|
+
getToken(tokenId: bigint): Promise<InkdTokenData>;
|
|
74
|
+
/** Get all InkdTokens owned by an address. */
|
|
75
|
+
getTokensByOwner(address: Address): Promise<InkdTokenData[]>;
|
|
76
|
+
/** Check if an address holds at least one InkdToken. */
|
|
77
|
+
hasInkdToken(address: Address): Promise<boolean>;
|
|
78
|
+
/** Estimate the cost of inscribing data. */
|
|
79
|
+
estimateInscribeCost(fileSize: number): Promise<InscribeCostEstimate>;
|
|
80
|
+
/** Get protocol-wide statistics from the registry. */
|
|
81
|
+
getStats(): Promise<ProtocolStats>;
|
|
82
|
+
private requireWallet;
|
|
83
|
+
private requirePublic;
|
|
84
|
+
private requireArweave;
|
|
85
|
+
private extractTokenIdFromLogs;
|
|
86
|
+
private extractAllTokenIdsFromLogs;
|
|
87
|
+
private extractInscriptionIndexFromLogs;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=InkdClient.d.ts.map
|
|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