@mysten/docs 0.1.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 +24 -0
- package/dist/bcs/index.md +358 -0
- package/dist/bcs/llms-index.md +4 -0
- package/dist/codegen/index.md +441 -0
- package/dist/codegen/llms-index.md +4 -0
- package/dist/dapp-kit/actions/connect-wallet.md +69 -0
- package/dist/dapp-kit/actions/disconnect-wallet.md +38 -0
- package/dist/dapp-kit/actions/sign-and-execute-transaction.md +96 -0
- package/dist/dapp-kit/actions/sign-personal-message.md +58 -0
- package/dist/dapp-kit/actions/sign-transaction.md +65 -0
- package/dist/dapp-kit/actions/switch-account.md +37 -0
- package/dist/dapp-kit/actions/switch-network.md +37 -0
- package/dist/dapp-kit/dapp-kit-instance.md +162 -0
- package/dist/dapp-kit/getting-started/create-dapp.md +151 -0
- package/dist/dapp-kit/getting-started/next-js.md +162 -0
- package/dist/dapp-kit/getting-started/react.md +172 -0
- package/dist/dapp-kit/getting-started/vue.md +193 -0
- package/dist/dapp-kit/index.md +70 -0
- package/dist/dapp-kit/llms-index.md +26 -0
- package/dist/dapp-kit/react/components/connect-button.md +42 -0
- package/dist/dapp-kit/react/components/connect-modal.md +51 -0
- package/dist/dapp-kit/react/components/index.md +13 -0
- package/dist/dapp-kit/react/dapp-kit-provider.md +86 -0
- package/dist/dapp-kit/react/hooks/index.md +25 -0
- package/dist/dapp-kit/react/hooks/use-current-account.md +33 -0
- package/dist/dapp-kit/react/hooks/use-current-client.md +36 -0
- package/dist/dapp-kit/react/hooks/use-current-network.md +28 -0
- package/dist/dapp-kit/react/hooks/use-current-wallet.md +36 -0
- package/dist/dapp-kit/react/hooks/use-dapp-kit.md +100 -0
- package/dist/dapp-kit/react/hooks/use-wallet-connection.md +48 -0
- package/dist/dapp-kit/react/hooks/use-wallets.md +33 -0
- package/dist/dapp-kit/state.md +169 -0
- package/dist/dapp-kit/theming.md +196 -0
- package/dist/dapp-kit/web-components/connect-button.md +89 -0
- package/dist/dapp-kit/web-components/connect-modal.md +177 -0
- package/dist/kiosk/advanced-examples.md +101 -0
- package/dist/kiosk/from-v1.md +320 -0
- package/dist/kiosk/index.md +22 -0
- package/dist/kiosk/kiosk-client/introduction.md +52 -0
- package/dist/kiosk/kiosk-client/kiosk-transaction/examples.md +119 -0
- package/dist/kiosk/kiosk-client/kiosk-transaction/kiosk-transaction.md +103 -0
- package/dist/kiosk/kiosk-client/kiosk-transaction/managing.md +235 -0
- package/dist/kiosk/kiosk-client/kiosk-transaction/purchasing.md +110 -0
- package/dist/kiosk/kiosk-client/querying.md +237 -0
- package/dist/kiosk/kiosk-client/transfer-policy-transaction/introduction.md +79 -0
- package/dist/kiosk/kiosk-client/transfer-policy-transaction/using-the-manager.md +115 -0
- package/dist/kiosk/llms-index.md +8 -0
- package/dist/llms-index.md +125 -0
- package/dist/payment-kit/getting-started.md +256 -0
- package/dist/payment-kit/index.md +132 -0
- package/dist/payment-kit/llms-index.md +8 -0
- package/dist/payment-kit/payment-kit-sdk.md +747 -0
- package/dist/payment-kit/payment-processing.md +372 -0
- package/dist/payment-kit/registry-management.md +529 -0
- package/dist/seal/index.md +85 -0
- package/dist/seal/llms-index.md +4 -0
- package/dist/slush-wallet/dapp.md +95 -0
- package/dist/slush-wallet/deep-linking.md +465 -0
- package/dist/slush-wallet/index.md +7 -0
- package/dist/slush-wallet/llms-index.md +6 -0
- package/dist/sui/bcs.md +134 -0
- package/dist/sui/clients/core.md +606 -0
- package/dist/sui/clients/graphql.md +101 -0
- package/dist/sui/clients/grpc.md +155 -0
- package/dist/sui/clients/index.md +95 -0
- package/dist/sui/clients/json-rpc.md +239 -0
- package/dist/sui/cryptography/keypairs.md +267 -0
- package/dist/sui/cryptography/multisig.md +194 -0
- package/dist/sui/cryptography/passkey.md +111 -0
- package/dist/sui/cryptography/webcrypto-signer.md +81 -0
- package/dist/sui/executors.md +148 -0
- package/dist/sui/faucet.md +26 -0
- package/dist/sui/hello-sui.md +115 -0
- package/dist/sui/index.md +53 -0
- package/dist/sui/install.md +61 -0
- package/dist/sui/llm-docs.md +32 -0
- package/dist/sui/llms-index.md +44 -0
- package/dist/sui/migrations/0.38.md +58 -0
- package/dist/sui/migrations/sui-1.0.md +455 -0
- package/dist/sui/migrations/sui-2.0/agent-prompt.md +42 -0
- package/dist/sui/migrations/sui-2.0/dapp-kit.md +350 -0
- package/dist/sui/migrations/sui-2.0/deepbook-v3.md +33 -0
- package/dist/sui/migrations/sui-2.0/index.md +158 -0
- package/dist/sui/migrations/sui-2.0/json-rpc-migration.md +386 -0
- package/dist/sui/migrations/sui-2.0/kiosk.md +120 -0
- package/dist/sui/migrations/sui-2.0/sdk-maintainers.md +90 -0
- package/dist/sui/migrations/sui-2.0/seal.md +14 -0
- package/dist/sui/migrations/sui-2.0/sui.md +341 -0
- package/dist/sui/migrations/sui-2.0/suins.md +43 -0
- package/dist/sui/migrations/sui-2.0/wallet-builders.md +66 -0
- package/dist/sui/migrations/sui-2.0/walrus.md +41 -0
- package/dist/sui/migrations/sui-2.0/zksend.md +95 -0
- package/dist/sui/plugins.md +258 -0
- package/dist/sui/sdk-building.md +344 -0
- package/dist/sui/transaction-building/basics.md +299 -0
- package/dist/sui/transaction-building/gas.md +62 -0
- package/dist/sui/transaction-building/intents.md +62 -0
- package/dist/sui/transaction-building/offline.md +73 -0
- package/dist/sui/transaction-building/sponsored-transactions.md +22 -0
- package/dist/sui/utils/derived_objects.md +59 -0
- package/dist/sui/utils/index.md +52 -0
- package/dist/sui/zklogin.md +83 -0
- package/dist/walrus/index.md +527 -0
- package/dist/walrus/llms-index.md +4 -0
- package/dist/zksend/index.md +27 -0
- package/dist/zksend/link-builder.md +192 -0
- package/dist/zksend/llms-index.md +5 -0
- package/package.json +66 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# Creating zkSend Links
|
|
2
|
+
|
|
3
|
+
> Create and customize zkSend claim links
|
|
4
|
+
|
|
5
|
+
> **Warning:** Products and services that incorporate zkSend links may be subject to financial regulations,
|
|
6
|
+
> including obtaining money transmitter licenses in jurisdictions where you provide your services.
|
|
7
|
+
> It is the developer's responsibility to ensure compliance with all relevant laws and obtain any
|
|
8
|
+
> necessary licenses. The information provided by Mysten Labs is not legal advice, and developers
|
|
9
|
+
> should consult with a qualified legal professional to address their specific circumstances.
|
|
10
|
+
|
|
11
|
+
## Limitations
|
|
12
|
+
|
|
13
|
+
- zkSend only supports Mainnet and Testnet at this time.
|
|
14
|
+
- Objects within links must be publicly transferrable.
|
|
15
|
+
|
|
16
|
+
## Create a link
|
|
17
|
+
|
|
18
|
+
You can start creating your own zkSend link using the `linkBuilder` method on the zkSend client
|
|
19
|
+
extension:
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
|
|
23
|
+
const client = new SuiGrpcClient({
|
|
24
|
+
network: 'mainnet',
|
|
25
|
+
baseUrl: 'https://fullnode.mainnet.sui.io:443',
|
|
26
|
+
}).$extend(zksend());
|
|
27
|
+
|
|
28
|
+
const link = client.zksend.linkBuilder({
|
|
29
|
+
sender: '0x...',
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
#### Adding SUI to the link
|
|
34
|
+
|
|
35
|
+
You can add SUI to the link by calling `link.addClaimableMist()`. This method takes the following
|
|
36
|
+
params:
|
|
37
|
+
|
|
38
|
+
- **`amount`** (required) - The amount of MIST (the base unit of SUI) to add to the link.
|
|
39
|
+
|
|
40
|
+
#### Adding non-SUI coins to the link
|
|
41
|
+
|
|
42
|
+
You can add non-SUI coins to the link by calling `link.addClaimableBalance()`. This method takes the
|
|
43
|
+
following params:
|
|
44
|
+
|
|
45
|
+
- **`coinType`** (required) - The coin type of the coin to add to the link (e.g. `0x2::sui::SUI`).
|
|
46
|
+
- **`amount`** (required) - The amount of the coin to add to the link. Represented in the base unit
|
|
47
|
+
of the coin.
|
|
48
|
+
|
|
49
|
+
The SDK will automatically perform the necessary coin management logic to transfer the defined
|
|
50
|
+
amount, such as merging and splitting coin objects.
|
|
51
|
+
|
|
52
|
+
#### Adding objects to the link
|
|
53
|
+
|
|
54
|
+
You can add a publicly-transferrable object to the link by calling `link.addClaimableObject()`. This
|
|
55
|
+
method takes the following params:
|
|
56
|
+
|
|
57
|
+
- **`id`** (required) - The ID of the object. This must be owned by the `sender` you configured when
|
|
58
|
+
creating the link.
|
|
59
|
+
|
|
60
|
+
#### Adding objects created in the same transaction
|
|
61
|
+
|
|
62
|
+
You can create objects to add to links in the same transaction the link is created in by using
|
|
63
|
+
`link.addClaimableObjectRef()`
|
|
64
|
+
|
|
65
|
+
- **`ref`** (required) - The reference to the object you want to add to the link.
|
|
66
|
+
- **`type`** (required) - The move type of the object you are adding
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
|
|
70
|
+
const tx = new Transaction();
|
|
71
|
+
|
|
72
|
+
const link = client.zksend.linkBuilder({
|
|
73
|
+
sender: '0x...',
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
const newObject = tx.moveCall({
|
|
77
|
+
target: `${PACKAGE_ID}::your_module::mint`,
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
link.addClaimableObjectRef({
|
|
81
|
+
ref: newObject,
|
|
82
|
+
type: `${PACKAGE_ID}::your_module::YourType`,
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
// Adds the link creation transactions to the transaction
|
|
86
|
+
link.createSendTransaction({
|
|
87
|
+
transaction: tx,
|
|
88
|
+
});
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
#### Getting the link URL
|
|
92
|
+
|
|
93
|
+
At any time, you can get the URL for the link by calling `link.getLink()`.
|
|
94
|
+
|
|
95
|
+
## Submitting the link transaction
|
|
96
|
+
|
|
97
|
+
Once you have built your zkSend link, you need to execute a transaction to transfer assets and make
|
|
98
|
+
the link claimable.
|
|
99
|
+
|
|
100
|
+
You can call the `link.createSendTransaction()` method, which returns a `Transaction` object that
|
|
101
|
+
you can sign and submit to the blockchain.
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
const tx = await link.createSendTransaction();
|
|
105
|
+
|
|
106
|
+
const { bytes, signature } = tx.sign({ client, signer: keypair });
|
|
107
|
+
|
|
108
|
+
const result = await client.executeTransactionBlock({
|
|
109
|
+
transactionBlock: bytes,
|
|
110
|
+
signature,
|
|
111
|
+
});
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
If you have a keypair you would like to send the transaction with, you can use the `create` method
|
|
115
|
+
as shorthand for creating the send transaction, signing it, and submitting it to the blockchain.
|
|
116
|
+
|
|
117
|
+
```ts
|
|
118
|
+
await link.create({
|
|
119
|
+
signer: yourKeypair,
|
|
120
|
+
// Wait until the new link is ready to be indexed so it is claimable
|
|
121
|
+
waitForTransaction: true,
|
|
122
|
+
});
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Claiming a link
|
|
126
|
+
|
|
127
|
+
To claim a link via the SDK you can use the `loadLinkFromUrl` method:
|
|
128
|
+
|
|
129
|
+
```ts
|
|
130
|
+
// Load a link instance from a URL
|
|
131
|
+
const link = await client.zksend.loadLinkFromUrl('https://zksend.com/claim#$abc...');
|
|
132
|
+
|
|
133
|
+
// list what claimable assets the link has
|
|
134
|
+
const { nfts, balances } = link.assets;
|
|
135
|
+
|
|
136
|
+
// claim all the assets from the link
|
|
137
|
+
await link.claimAssets(addressOfClaimer);
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Regenerating links
|
|
141
|
+
|
|
142
|
+
If you lose a link you've created, you can re-generate the link (this can only done from the address
|
|
143
|
+
that originally created the link):
|
|
144
|
+
|
|
145
|
+
```ts
|
|
146
|
+
// url will be the new link url
|
|
147
|
+
const { url, transaction } = await link.createRegenerateTransaction(addressOfLinkCreator);
|
|
148
|
+
|
|
149
|
+
// Execute the transaction to regenerate the link
|
|
150
|
+
const result = await client.signAndExecuteTransaction({
|
|
151
|
+
transaction,
|
|
152
|
+
signer: keypair,
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
// Check transaction status
|
|
156
|
+
if (result.$kind === 'FailedTransaction') {
|
|
157
|
+
throw new Error(`Link regeneration failed: ${result.FailedTransaction.status.error?.message}`);
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Bulk link creation
|
|
162
|
+
|
|
163
|
+
To create multiple links in a single transaction, you can use `client.zksend.createLinks`:
|
|
164
|
+
|
|
165
|
+
```ts
|
|
166
|
+
const links = [];
|
|
167
|
+
|
|
168
|
+
for (let i = 0; i < 10; i++) {
|
|
169
|
+
const link = client.zksend.linkBuilder({
|
|
170
|
+
sender: keypair.toSuiAddress(),
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
link.addClaimableMist(100n);
|
|
174
|
+
links.push(link);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
const urls = links.map((link) => link.getLink());
|
|
178
|
+
|
|
179
|
+
const tx = await client.zksend.createLinks({
|
|
180
|
+
links,
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
const result = await client.signAndExecuteTransaction({
|
|
184
|
+
transaction: tx,
|
|
185
|
+
signer: keypair,
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
// Check transaction status
|
|
189
|
+
if (result.$kind === 'FailedTransaction') {
|
|
190
|
+
throw new Error(`Link creation failed: ${result.FailedTransaction.status.error?.message}`);
|
|
191
|
+
}
|
|
192
|
+
```
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mysten/docs",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "LLM-friendly documentation for the Sui TypeScript SDK ecosystem",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist/"
|
|
8
|
+
],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "typedoc && next build && pnpm run build:docs",
|
|
11
|
+
"build:docs": "tsx scripts/build-docs.ts --all",
|
|
12
|
+
"dev": "next dev",
|
|
13
|
+
"start": "next start",
|
|
14
|
+
"postinstall": "fumadocs-mdx",
|
|
15
|
+
"validate-docs": "tsx scripts/validate-llm-docs.ts",
|
|
16
|
+
"prettier:check": "prettier -c --ignore-unknown .",
|
|
17
|
+
"prettier:fix": "prettier -w --ignore-unknown .",
|
|
18
|
+
"oxlint:check": "oxlint .",
|
|
19
|
+
"oxlint:fix": "oxlint --fix",
|
|
20
|
+
"lint": "pnpm run oxlint:check && pnpm run prettier:check",
|
|
21
|
+
"lint:fix": "pnpm run oxlint:fix && pnpm run prettier:fix"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@mysten/bcs": "workspace:^",
|
|
25
|
+
"@mysten/dapp-kit": "workspace:^",
|
|
26
|
+
"@mysten/dapp-kit-core": "workspace:^",
|
|
27
|
+
"@mysten/dapp-kit-react": "workspace:^",
|
|
28
|
+
"@mysten/deepbook-v3": "workspace:^",
|
|
29
|
+
"@mysten/enoki": "workspace:^",
|
|
30
|
+
"@mysten/enoki-connect": "workspace:^",
|
|
31
|
+
"@mysten/kiosk": "workspace:^",
|
|
32
|
+
"@mysten/payment-kit": "workspace:^",
|
|
33
|
+
"@mysten/seal": "workspace:^",
|
|
34
|
+
"@mysten/signers": "workspace:^",
|
|
35
|
+
"@mysten/slush-wallet": "workspace:^",
|
|
36
|
+
"@mysten/sui": "workspace:^",
|
|
37
|
+
"@mysten/suins": "workspace:^",
|
|
38
|
+
"@mysten/utils": "workspace:^",
|
|
39
|
+
"@mysten/wallet-standard": "workspace:^",
|
|
40
|
+
"@mysten/walrus": "workspace:^",
|
|
41
|
+
"@mysten/zksend": "workspace:^",
|
|
42
|
+
"@tanstack/react-query": "^5.90.16",
|
|
43
|
+
"fast-glob": "^3.3.3",
|
|
44
|
+
"fumadocs-core": "16.4.7",
|
|
45
|
+
"fumadocs-docgen": "^3.0.5",
|
|
46
|
+
"fumadocs-mdx": "14.2.5",
|
|
47
|
+
"fumadocs-typescript": "^5.0.1",
|
|
48
|
+
"fumadocs-ui": "16.4.7",
|
|
49
|
+
"gray-matter": "^4.0.3",
|
|
50
|
+
"next": "^16.1.5",
|
|
51
|
+
"react": "^19.2.3",
|
|
52
|
+
"react-dom": "^19.2.3"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@tailwindcss/postcss": "^4.1.18",
|
|
56
|
+
"@types/mdx": "^2.0.13",
|
|
57
|
+
"@types/node": "^25.0.8",
|
|
58
|
+
"@types/react": "^19.2.8",
|
|
59
|
+
"@types/react-dom": "^19.2.3",
|
|
60
|
+
"postcss": "^8.5.6",
|
|
61
|
+
"tailwindcss": "^4.1.18",
|
|
62
|
+
"typedoc": "^0.28.16",
|
|
63
|
+
"typedoc-plugin-mermaid": "^1.12.0",
|
|
64
|
+
"typescript": "^5.9.3"
|
|
65
|
+
}
|
|
66
|
+
}
|