@mysten/docs 0.1.17 โ 0.1.19
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/dist/bcs/index.md +1 -1
- package/dist/bcs/llms-index.md +1 -1
- package/dist/codegen/index.md +53 -53
- package/dist/codegen/llms-index.md +1 -1
- package/dist/dapp-kit/actions/connect-wallet.md +4 -4
- package/dist/dapp-kit/actions/disconnect-wallet.md +8 -7
- package/dist/dapp-kit/actions/sign-and-execute-transaction.md +14 -14
- package/dist/dapp-kit/actions/sign-personal-message.md +8 -8
- package/dist/dapp-kit/actions/sign-transaction.md +7 -7
- package/dist/dapp-kit/actions/switch-account.md +6 -6
- package/dist/dapp-kit/actions/switch-network.md +5 -5
- package/dist/dapp-kit/dapp-kit-instance.md +19 -18
- package/dist/dapp-kit/getting-started/create-dapp.md +12 -12
- package/dist/dapp-kit/getting-started/next-js.md +12 -11
- package/dist/dapp-kit/getting-started/react.md +25 -25
- package/dist/dapp-kit/getting-started/vue.md +12 -12
- package/dist/dapp-kit/index.md +4 -4
- package/dist/dapp-kit/llms-index.md +23 -23
- package/dist/dapp-kit/react/components/connect-button.md +3 -3
- package/dist/dapp-kit/react/components/connect-modal.md +3 -3
- package/dist/dapp-kit/react/components/index.md +2 -2
- package/dist/dapp-kit/react/dapp-kit-provider.md +6 -6
- package/dist/dapp-kit/react/hooks/index.md +4 -3
- package/dist/dapp-kit/react/hooks/use-current-account.md +3 -3
- package/dist/dapp-kit/react/hooks/use-current-client.md +3 -3
- package/dist/dapp-kit/react/hooks/use-current-network.md +3 -3
- package/dist/dapp-kit/react/hooks/use-current-wallet.md +3 -3
- package/dist/dapp-kit/react/hooks/use-dapp-kit.md +5 -5
- package/dist/dapp-kit/react/hooks/use-wallet-connection.md +3 -3
- package/dist/dapp-kit/react/hooks/use-wallets.md +3 -3
- package/dist/dapp-kit/state.md +16 -16
- package/dist/dapp-kit/theming.md +27 -27
- package/dist/dapp-kit/web-components/connect-button.md +9 -9
- package/dist/dapp-kit/web-components/connect-modal.md +16 -16
- package/dist/kiosk/advanced-examples.md +1 -1
- package/dist/kiosk/from-v1.md +1 -1
- package/dist/kiosk/index.md +5 -5
- package/dist/kiosk/kiosk-client/introduction.md +6 -6
- package/dist/kiosk/kiosk-client/kiosk-transaction/examples.md +3 -3
- package/dist/kiosk/kiosk-client/kiosk-transaction/kiosk-transaction.md +1 -1
- package/dist/kiosk/kiosk-client/kiosk-transaction/managing.md +11 -11
- package/dist/kiosk/kiosk-client/kiosk-transaction/purchasing.md +1 -1
- package/dist/kiosk/kiosk-client/querying.md +1 -1
- package/dist/kiosk/kiosk-client/transfer-policy-transaction/introduction.md +1 -1
- package/dist/kiosk/kiosk-client/transfer-policy-transaction/using-the-manager.md +1 -3
- package/dist/kiosk/llms-index.md +5 -5
- package/dist/llms-index.md +84 -83
- package/dist/payment-kit/getting-started.md +13 -13
- package/dist/payment-kit/index.md +13 -13
- package/dist/payment-kit/llms-index.md +5 -5
- package/dist/payment-kit/payment-kit-sdk.md +18 -18
- package/dist/payment-kit/payment-processing.md +34 -34
- package/dist/payment-kit/registry-management.md +35 -35
- package/dist/seal/index.md +5 -5
- package/dist/seal/llms-index.md +1 -1
- package/dist/slush-wallet/dapp.md +10 -10
- package/dist/slush-wallet/deep-linking.md +54 -54
- package/dist/slush-wallet/index.md +2 -2
- package/dist/slush-wallet/llms-index.md +3 -3
- package/dist/sui/bcs.md +11 -11
- package/dist/sui/clients/core.md +57 -56
- package/dist/sui/clients/graphql.md +3 -3
- package/dist/sui/clients/grpc.md +10 -10
- package/dist/sui/clients/index.md +14 -14
- package/dist/sui/clients/json-rpc.md +16 -16
- package/dist/sui/cryptography/keypairs.md +6 -6
- package/dist/sui/cryptography/multisig.md +4 -4
- package/dist/sui/cryptography/passkey.md +15 -14
- package/dist/sui/cryptography/webcrypto-signer.md +4 -4
- package/dist/sui/executors.md +18 -16
- package/dist/sui/faucet.md +3 -3
- package/dist/sui/hello-sui.md +5 -5
- package/dist/sui/index.md +12 -12
- package/dist/sui/install.md +3 -3
- package/dist/sui/llm-docs.md +9 -9
- package/dist/sui/llms-index.md +41 -41
- package/dist/sui/migrations/0.38.md +6 -6
- package/dist/sui/migrations/sui-1.0.md +32 -32
- package/dist/sui/migrations/sui-2.0/agent-prompt.md +3 -3
- package/dist/sui/migrations/sui-2.0/dapp-kit.md +43 -43
- package/dist/sui/migrations/sui-2.0/deepbook-v3.md +1 -1
- package/dist/sui/migrations/sui-2.0/index.md +37 -37
- package/dist/sui/migrations/sui-2.0/json-rpc-migration.md +53 -47
- package/dist/sui/migrations/sui-2.0/kiosk.md +8 -8
- package/dist/sui/migrations/sui-2.0/sdk-maintainers.md +7 -7
- package/dist/sui/migrations/sui-2.0/seal.md +1 -1
- package/dist/sui/migrations/sui-2.0/sui.md +16 -16
- package/dist/sui/migrations/sui-2.0/suins.md +4 -3
- package/dist/sui/migrations/sui-2.0/wallet-builders.md +5 -5
- package/dist/sui/migrations/sui-2.0/walrus.md +3 -3
- package/dist/sui/migrations/sui-2.0/zksend.md +5 -5
- package/dist/sui/plugins.md +14 -14
- package/dist/sui/sdk-building.md +32 -32
- package/dist/sui/transaction-building/basics.md +13 -13
- package/dist/sui/transaction-building/gas.md +2 -3
- package/dist/sui/transaction-building/intents.md +4 -4
- package/dist/sui/transaction-building/offline.md +8 -8
- package/dist/sui/transaction-building/sponsored-transactions.md +1 -1
- package/dist/sui/utils/derived_objects.md +10 -10
- package/dist/sui/utils/index.md +8 -1
- package/dist/sui/zklogin.md +1 -1
- package/dist/walrus/index.md +1 -1
- package/dist/walrus/llms-index.md +1 -1
- package/dist/zksend/composable-claim.md +70 -0
- package/dist/zksend/index.md +2 -2
- package/dist/zksend/link-builder.md +5 -4
- package/dist/zksend/llms-index.md +3 -2
- package/package.json +8 -8
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Payment Processing
|
|
2
2
|
|
|
3
|
-
> Process payments and handle transaction results
|
|
3
|
+
> Process registry-based and ephemeral payments and handle transaction results on Sui.
|
|
4
4
|
|
|
5
5
|
> **Note:** This package is in active development and should be used with caution. APIs are experimental and
|
|
6
6
|
> subject to breaking changes without notice. We recommend thoroughly testing any implementation
|
|
@@ -9,15 +9,15 @@
|
|
|
9
9
|
Payment Kit provides two distinct payment processing models, each designed for different use cases.
|
|
10
10
|
This guide explains how each model works and when to use them.
|
|
11
11
|
|
|
12
|
-
## Payment
|
|
12
|
+
## Payment models overview
|
|
13
13
|
|
|
14
|
-
### Registry-
|
|
14
|
+
### Registry-based payments
|
|
15
15
|
|
|
16
|
-
Registry-based payments create a persistent `PaymentRecord` stored
|
|
16
|
+
Registry-based payments create a persistent `PaymentRecord` stored onchain in a `PaymentRegistry`.
|
|
17
17
|
This model provides:
|
|
18
18
|
|
|
19
19
|
- **Duplicate Prevention**: A payment with the same parameters can only be processed once
|
|
20
|
-
- **Verifiable Proof**:
|
|
20
|
+
- **Verifiable Proof**: Onchain proof that a payment was made
|
|
21
21
|
- **Expiration Management**: Records can be deleted after a configurable period
|
|
22
22
|
- **Centralized Tracking**: All payments are indexed under a specific registry
|
|
23
23
|
|
|
@@ -28,12 +28,12 @@ This model provides:
|
|
|
28
28
|
- Invoice payments
|
|
29
29
|
- Any scenario requiring duplicate prevention
|
|
30
30
|
|
|
31
|
-
### Ephemeral
|
|
31
|
+
### Ephemeral payments
|
|
32
32
|
|
|
33
|
-
Ephemeral payments process transfers without creating persistent
|
|
33
|
+
Ephemeral payments process transfers without creating persistent onchain records. This model
|
|
34
34
|
provides:
|
|
35
35
|
|
|
36
|
-
- **Lower Gas Costs**: No
|
|
36
|
+
- **Lower Gas Costs**: No onchain storage means cheaper transactions
|
|
37
37
|
- **Flexibility**: No registry configuration required
|
|
38
38
|
|
|
39
39
|
**When to Use:**
|
|
@@ -41,14 +41,14 @@ provides:
|
|
|
41
41
|
- Tipping/donations
|
|
42
42
|
- Recurring payments with external tracking
|
|
43
43
|
- High-frequency microtransactions
|
|
44
|
-
- Scenarios where duplicate prevention is handled
|
|
44
|
+
- Scenarios where duplicate prevention is handled offchain
|
|
45
45
|
|
|
46
|
-
## How
|
|
46
|
+
## How payment keys work
|
|
47
47
|
|
|
48
48
|
Payment Kit uses a composite key system to uniquely identify payments. Understanding this is crucial
|
|
49
49
|
for using the SDK effectively.
|
|
50
50
|
|
|
51
|
-
### Payment
|
|
51
|
+
### Payment key components
|
|
52
52
|
|
|
53
53
|
A payment key is derived from four parameters:
|
|
54
54
|
|
|
@@ -61,7 +61,7 @@ type PaymentKeyArgs = {
|
|
|
61
61
|
};
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
-
### Key
|
|
64
|
+
### Key generation
|
|
65
65
|
|
|
66
66
|
When you process a registry payment, Payment Kit hashes these parameters to create a unique key:
|
|
67
67
|
|
|
@@ -89,7 +89,7 @@ const tx2 = client.paymentKit.tx.processRegistryPayment({
|
|
|
89
89
|
});
|
|
90
90
|
```
|
|
91
91
|
|
|
92
|
-
### Changing
|
|
92
|
+
### Changing any component creates a new key
|
|
93
93
|
|
|
94
94
|
Each component affects the payment key. Changing any parameter creates a different payment. This
|
|
95
95
|
means, as an example, that a `nonce` can be reused for a different payment, if the `coinType` or
|
|
@@ -125,11 +125,11 @@ const payment3 = {
|
|
|
125
125
|
// All three are unique payments that can be processed separately
|
|
126
126
|
```
|
|
127
127
|
|
|
128
|
-
## Processing
|
|
128
|
+
## Processing registry-based payments
|
|
129
129
|
|
|
130
130
|
Let's walk through a complete registry payment workflow:
|
|
131
131
|
|
|
132
|
-
### Step 1: Create the
|
|
132
|
+
### Step 1: Create the transaction
|
|
133
133
|
|
|
134
134
|
```ts
|
|
135
135
|
// Define your payment parameters
|
|
@@ -145,7 +145,7 @@ const paymentParams = {
|
|
|
145
145
|
const tx = client.paymentKit.tx.processRegistryPayment(paymentParams);
|
|
146
146
|
```
|
|
147
147
|
|
|
148
|
-
### What
|
|
148
|
+
### What happens onchain
|
|
149
149
|
|
|
150
150
|
When this transaction executes, Payment Kit:
|
|
151
151
|
|
|
@@ -155,7 +155,7 @@ When this transaction executes, Payment Kit:
|
|
|
155
155
|
4. **Creates** a `PaymentRecord` dynamic field on the registry
|
|
156
156
|
5. **Emits** a `PaymentReceipt` event
|
|
157
157
|
|
|
158
|
-
### Step 2: Execute the
|
|
158
|
+
### Step 2: Execute the transaction
|
|
159
159
|
|
|
160
160
|
```ts
|
|
161
161
|
const result = await client.signAndExecuteTransaction({
|
|
@@ -176,7 +176,7 @@ if (result.$kind === 'FailedTransaction') {
|
|
|
176
176
|
console.log('Transaction digest:', result.Transaction.digest);
|
|
177
177
|
```
|
|
178
178
|
|
|
179
|
-
### Step 3: Extract the
|
|
179
|
+
### Step 3: Extract the receipt
|
|
180
180
|
|
|
181
181
|
```ts
|
|
182
182
|
// Find the PaymentReceipt event
|
|
@@ -197,7 +197,7 @@ if (receiptEvent) {
|
|
|
197
197
|
}
|
|
198
198
|
```
|
|
199
199
|
|
|
200
|
-
### Step 4: Verify the
|
|
200
|
+
### Step 4: Verify the payment record
|
|
201
201
|
|
|
202
202
|
```ts
|
|
203
203
|
// Query the payment record to confirm it exists
|
|
@@ -216,11 +216,11 @@ if (record) {
|
|
|
216
216
|
}
|
|
217
217
|
```
|
|
218
218
|
|
|
219
|
-
## Processing
|
|
219
|
+
## Processing ephemeral payments
|
|
220
220
|
|
|
221
221
|
Ephemeral payments follow a simpler flow without creating persistent records:
|
|
222
222
|
|
|
223
|
-
### Creating an
|
|
223
|
+
### Creating an ephemeral payment
|
|
224
224
|
|
|
225
225
|
```ts
|
|
226
226
|
// No registry needed for ephemeral payments
|
|
@@ -246,7 +246,7 @@ if (result.$kind === 'FailedTransaction') {
|
|
|
246
246
|
}
|
|
247
247
|
```
|
|
248
248
|
|
|
249
|
-
### What
|
|
249
|
+
### What happens onchain
|
|
250
250
|
|
|
251
251
|
For ephemeral payments, Payment Kit:
|
|
252
252
|
|
|
@@ -254,9 +254,9 @@ For ephemeral payments, Payment Kit:
|
|
|
254
254
|
2. **Transfers** the coins from sender to receiver
|
|
255
255
|
3. **Emits** a `PaymentReceipt` event
|
|
256
256
|
|
|
257
|
-
|
|
257
|
+
No `PaymentRecord` is created, so duplicate payments are not prevented.
|
|
258
258
|
|
|
259
|
-
### Extracting the
|
|
259
|
+
### Extracting the receipt
|
|
260
260
|
|
|
261
261
|
```ts
|
|
262
262
|
const receiptEvent = result.Transaction.events?.find((event) =>
|
|
@@ -269,9 +269,9 @@ if (receiptEvent) {
|
|
|
269
269
|
}
|
|
270
270
|
```
|
|
271
271
|
|
|
272
|
-
## Advanced
|
|
272
|
+
## Advanced payment scenarios
|
|
273
273
|
|
|
274
|
-
### Processing
|
|
274
|
+
### Processing multiple payments in one transaction
|
|
275
275
|
|
|
276
276
|
You can combine multiple payment operations in a single transaction:
|
|
277
277
|
|
|
@@ -307,7 +307,7 @@ const result = await client.signAndExecuteTransaction({
|
|
|
307
307
|
});
|
|
308
308
|
```
|
|
309
309
|
|
|
310
|
-
### Working with
|
|
310
|
+
### Working with custom coin types
|
|
311
311
|
|
|
312
312
|
Payment Kit works with any Sui coin type:
|
|
313
313
|
|
|
@@ -330,9 +330,9 @@ const result = await client.signAndExecuteTransaction({
|
|
|
330
330
|
});
|
|
331
331
|
```
|
|
332
332
|
|
|
333
|
-
## Gas
|
|
333
|
+
## Gas considerations
|
|
334
334
|
|
|
335
|
-
### Registry
|
|
335
|
+
### Registry payments
|
|
336
336
|
|
|
337
337
|
Registry payments have higher gas costs because they:
|
|
338
338
|
|
|
@@ -340,7 +340,7 @@ Registry payments have higher gas costs because they:
|
|
|
340
340
|
- Write data to the registry object
|
|
341
341
|
- Perform duplicate checking
|
|
342
342
|
|
|
343
|
-
### Ephemeral
|
|
343
|
+
### Ephemeral payments
|
|
344
344
|
|
|
345
345
|
Ephemeral payments have lower gas costs because they:
|
|
346
346
|
|
|
@@ -348,9 +348,9 @@ Ephemeral payments have lower gas costs because they:
|
|
|
348
348
|
- Don't create persistent storage
|
|
349
349
|
- Skip duplicate checking
|
|
350
350
|
|
|
351
|
-
## Best
|
|
351
|
+
## Best practices
|
|
352
352
|
|
|
353
|
-
1. **Use Meaningful Nonces**: Choose nonces that help you track payments (
|
|
353
|
+
1. **Use Meaningful Nonces**: Choose nonces that help you track payments (for example, `order-123`,
|
|
354
354
|
`invoice-456`)
|
|
355
355
|
|
|
356
356
|
2. **Store Receipts Off-Chain**: Save `PaymentReceipt` events in your database for quick lookup
|
|
@@ -358,7 +358,7 @@ Ephemeral payments have lower gas costs because they:
|
|
|
358
358
|
3. **Handle Duplicate Attempts**: Gracefully handle duplicate payment attempts with proper error
|
|
359
359
|
messages
|
|
360
360
|
|
|
361
|
-
4. **Verify Before Delivery**: Always verify payment records before delivering goods
|
|
361
|
+
4. **Verify Before Delivery**: Always verify payment records before delivering goods or services
|
|
362
362
|
|
|
363
363
|
5. **Choose the Right Model**:
|
|
364
364
|
- Use registry payments for critical transactions requiring duplicate prevention
|
|
@@ -367,6 +367,6 @@ Ephemeral payments have lower gas costs because they:
|
|
|
367
367
|
6. **Monitor Expiration**: If using registry payments, be aware of the expiration policy and query
|
|
368
368
|
records before they expire
|
|
369
369
|
|
|
370
|
-
## Next
|
|
370
|
+
## Next steps
|
|
371
371
|
|
|
372
372
|
- [Registry Management](./registry-management) - Learn how to create and configure custom registries
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Registry Management
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Create, configure, and manage payment registries and accepted coin types on Sui.
|
|
4
4
|
|
|
5
5
|
> **Note:** This package is in active development and should be used with caution. APIs are experimental and
|
|
6
6
|
> subject to breaking changes without notice. We recommend thoroughly testing any implementation
|
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
Payment registries are the core of Payment Kit's duplicate prevention and payment tracking system.
|
|
10
10
|
This guide covers creating, configuring, and managing payment registries.
|
|
11
11
|
|
|
12
|
-
## Understanding
|
|
12
|
+
## Understanding payment registries
|
|
13
13
|
|
|
14
|
-
A `PaymentRegistry` is an
|
|
14
|
+
A `PaymentRegistry` is an onchain object that:
|
|
15
15
|
|
|
16
16
|
- Stores `PaymentRecord` dynamic fields for each unique payment
|
|
17
17
|
- Manages configuration settings (expiration, fund management)
|
|
18
18
|
- Can be owned and administered by a specific account
|
|
19
19
|
- Provides namespaced payment tracking
|
|
20
20
|
|
|
21
|
-
### Default
|
|
21
|
+
### Default registry
|
|
22
22
|
|
|
23
23
|
Payment Kit provides a default registry that's ready to use:
|
|
24
24
|
|
|
@@ -33,7 +33,7 @@ const tx = client.paymentKit.tx.processRegistryPayment({
|
|
|
33
33
|
});
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
### When to
|
|
36
|
+
### When to create a custom registry
|
|
37
37
|
|
|
38
38
|
Consider creating your own registry when:
|
|
39
39
|
|
|
@@ -43,11 +43,11 @@ Consider creating your own registry when:
|
|
|
43
43
|
- You need better indexing of your payments
|
|
44
44
|
- You want to avoid potential congestion on the default registry
|
|
45
45
|
|
|
46
|
-
## Creating a
|
|
46
|
+
## Creating a registry
|
|
47
47
|
|
|
48
|
-
### Basic
|
|
48
|
+
### Basic registry creation
|
|
49
49
|
|
|
50
|
-
Creating a registry is
|
|
50
|
+
Creating a registry is straightforward. You only need to provide a unique name:
|
|
51
51
|
|
|
52
52
|
```ts
|
|
53
53
|
// Create a new registry
|
|
@@ -73,14 +73,14 @@ console.log('Registry created!');
|
|
|
73
73
|
console.log('Transaction:', result.Transaction.digest);
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
-
### What
|
|
76
|
+
### What gets created
|
|
77
77
|
|
|
78
78
|
When you create a registry, two objects are created:
|
|
79
79
|
|
|
80
80
|
1. **PaymentRegistry**: The registry object that stores payment records
|
|
81
81
|
2. **RegistryAdminCap**: A capability object that grants admin permissions
|
|
82
82
|
|
|
83
|
-
### Extracting the
|
|
83
|
+
### Extracting the admin capability
|
|
84
84
|
|
|
85
85
|
The `RegistryAdminCap` is crucial for configuring your registry:
|
|
86
86
|
|
|
@@ -104,7 +104,7 @@ if (adminCapObject && 'objectId' in adminCapObject) {
|
|
|
104
104
|
}
|
|
105
105
|
```
|
|
106
106
|
|
|
107
|
-
### Deriving the
|
|
107
|
+
### Deriving the registry ID
|
|
108
108
|
|
|
109
109
|
Payment Kit derives registry IDs deterministically from the registry name:
|
|
110
110
|
|
|
@@ -118,15 +118,15 @@ console.log('Registry ID:', registryId);
|
|
|
118
118
|
|
|
119
119
|
This allows you to reference registries by name throughout your application.
|
|
120
120
|
|
|
121
|
-
## Registry
|
|
121
|
+
## Registry configuration
|
|
122
122
|
|
|
123
123
|
Registries have two main configuration options:
|
|
124
124
|
|
|
125
|
-
### 1
|
|
125
|
+
### Step 1: Epoch expiration duration
|
|
126
126
|
|
|
127
127
|
Controls how long payment records persist before they can be deleted.
|
|
128
128
|
|
|
129
|
-
**Default**: 30 epochs (~30 days on
|
|
129
|
+
**Default**: 30 epochs (~30 days on Mainnet)
|
|
130
130
|
|
|
131
131
|
```ts
|
|
132
132
|
// Set expiration to 60 epochs
|
|
@@ -167,7 +167,7 @@ anyone can delete the record to reclaim storage fees:
|
|
|
167
167
|
- **Medium expiration (30-60 epochs)**: Standard e-commerce transactions
|
|
168
168
|
- **Long expiration (180+ epochs)**: Important financial records requiring long-term verification
|
|
169
169
|
|
|
170
|
-
### 2
|
|
170
|
+
### Step 2: Registry managed funds
|
|
171
171
|
|
|
172
172
|
Controls whether payments must be sent to the registry itself for later withdrawal.
|
|
173
173
|
|
|
@@ -189,7 +189,7 @@ await client.signAndExecuteTransaction({
|
|
|
189
189
|
console.log('Registry now manages funds');
|
|
190
190
|
```
|
|
191
191
|
|
|
192
|
-
**How
|
|
192
|
+
**How it works:**
|
|
193
193
|
|
|
194
194
|
When enabled:
|
|
195
195
|
|
|
@@ -219,7 +219,7 @@ const tx = client.paymentKit.tx.processRegistryPayment({
|
|
|
219
219
|
- Scenarios with very high transaction volumes
|
|
220
220
|
- Simplified accounting and reconciliation
|
|
221
221
|
|
|
222
|
-
### Configuring
|
|
222
|
+
### Configuring both settings
|
|
223
223
|
|
|
224
224
|
You can configure both settings independently:
|
|
225
225
|
|
|
@@ -252,7 +252,7 @@ await client.signAndExecuteTransaction({
|
|
|
252
252
|
});
|
|
253
253
|
```
|
|
254
254
|
|
|
255
|
-
## Withdrawing
|
|
255
|
+
## Withdrawing funds from a registry
|
|
256
256
|
|
|
257
257
|
If you've enabled registry-managed funds, you can withdraw accumulated coins:
|
|
258
258
|
|
|
@@ -275,14 +275,14 @@ const result = await client.signAndExecuteTransaction({
|
|
|
275
275
|
console.log('Funds withdrawn!');
|
|
276
276
|
```
|
|
277
277
|
|
|
278
|
-
**Important
|
|
278
|
+
**Important notes:**
|
|
279
279
|
|
|
280
280
|
- Only the admin cap owner can withdraw funds
|
|
281
281
|
- You must specify the coin type to withdraw
|
|
282
282
|
- All coins of that type are withdrawn in one operation
|
|
283
283
|
- The withdrawn coins are sent to the transaction sender
|
|
284
284
|
|
|
285
|
-
### Withdrawing
|
|
285
|
+
### Withdrawing multiple coin types
|
|
286
286
|
|
|
287
287
|
If your registry accumulates different coin types:
|
|
288
288
|
|
|
@@ -313,7 +313,7 @@ await client.signAndExecuteTransaction({
|
|
|
313
313
|
});
|
|
314
314
|
```
|
|
315
315
|
|
|
316
|
-
## Deleting
|
|
316
|
+
## Deleting expired payment records
|
|
317
317
|
|
|
318
318
|
After the expiration period, payment records can be deleted to reclaim storage fees:
|
|
319
319
|
|
|
@@ -335,14 +335,14 @@ const result = await client.signAndExecuteTransaction({
|
|
|
335
335
|
console.log('Record deleted, storage rebate received');
|
|
336
336
|
```
|
|
337
337
|
|
|
338
|
-
**Key
|
|
338
|
+
**Key points:**
|
|
339
339
|
|
|
340
340
|
- Records can only be deleted after expiration
|
|
341
341
|
- Anyone can delete expired records (permissionless cleanup)
|
|
342
342
|
- The deleter receives a small storage rebate
|
|
343
343
|
- This incentivizes automatic cleanup of old records
|
|
344
344
|
|
|
345
|
-
### Checking
|
|
345
|
+
### Checking if a record can be deleted
|
|
346
346
|
|
|
347
347
|
```ts
|
|
348
348
|
// Get the payment record
|
|
@@ -369,7 +369,7 @@ if (record) {
|
|
|
369
369
|
}
|
|
370
370
|
```
|
|
371
371
|
|
|
372
|
-
## Using
|
|
372
|
+
## Using registry ID directly
|
|
373
373
|
|
|
374
374
|
If you know the registry ID, you can use it instead of the name:
|
|
375
375
|
|
|
@@ -396,7 +396,7 @@ const record = await client.paymentKit.getPaymentRecord({
|
|
|
396
396
|
});
|
|
397
397
|
```
|
|
398
398
|
|
|
399
|
-
## Complete
|
|
399
|
+
## Complete registry setup example
|
|
400
400
|
|
|
401
401
|
Here's a complete workflow for setting up a custom registry:
|
|
402
402
|
|
|
@@ -502,28 +502,28 @@ if (paymentResult.$kind === 'FailedTransaction') {
|
|
|
502
502
|
console.log('First payment processed:', paymentResult.Transaction.digest);
|
|
503
503
|
```
|
|
504
504
|
|
|
505
|
-
## Best
|
|
505
|
+
## Best practices
|
|
506
506
|
|
|
507
|
-
1. **Store
|
|
507
|
+
1. **Store admin caps securely**: Treat your admin capability like private keys - they control your
|
|
508
508
|
registry
|
|
509
509
|
|
|
510
|
-
2. **Use
|
|
511
|
-
`acme-subscriptions`, `store-123-payments`)
|
|
510
|
+
2. **Use descriptive names**: Choose registry names that clearly identify their purpose (for
|
|
511
|
+
example, `acme-subscriptions`, `store-123-payments`)
|
|
512
512
|
|
|
513
|
-
3. **Set
|
|
513
|
+
3. **Set appropriate expiration**: Balance storage costs with verification needs
|
|
514
514
|
- Short expiration = lower storage costs
|
|
515
515
|
- Long expiration = longer verification period
|
|
516
516
|
|
|
517
|
-
4. **Monitor
|
|
517
|
+
4. **Monitor registry growth**: Track the number of payment records to anticipate storage costs
|
|
518
518
|
|
|
519
|
-
5. **Plan
|
|
519
|
+
5. **Plan fund management**: Decide upfront whether to use registry-managed funds based on your
|
|
520
520
|
withdrawal patterns
|
|
521
521
|
|
|
522
|
-
6. **Document
|
|
522
|
+
6. **Document your configuration**: Keep records of your registry settings for operational
|
|
523
523
|
consistency
|
|
524
524
|
|
|
525
|
-
7. **Test
|
|
525
|
+
7. **Test thoroughly**: Always test registry operations on Testnet before Mainnet deployment
|
|
526
526
|
|
|
527
|
-
## Next
|
|
527
|
+
## Next steps
|
|
528
528
|
|
|
529
529
|
- [SDK API Reference](./payment-kit-sdk) - Complete SDK API documentation
|
package/dist/seal/index.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Seal SDK
|
|
2
2
|
|
|
3
|
-
> Decentralized secrets management with threshold encryption on Sui
|
|
3
|
+
> Decentralized secrets management with threshold encryption on Sui.
|
|
4
4
|
|
|
5
5
|
> **Note:** This is a beta version of Seal. See https://github.com/MystenLabs/seal for more details.
|
|
6
6
|
|
|
@@ -32,7 +32,7 @@ const client = new SuiGrpcClient({
|
|
|
32
32
|
);
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
## Configuration
|
|
35
|
+
## Configuration options
|
|
36
36
|
|
|
37
37
|
The `seal()` function accepts the following options:
|
|
38
38
|
|
|
@@ -40,9 +40,9 @@ The `seal()` function accepts the following options:
|
|
|
40
40
|
- **`verifyKeyServers`** (optional) - Whether to verify key server authenticity (default: `true`)
|
|
41
41
|
- **`timeout`** (optional) - Timeout in milliseconds for network requests (default: `10000`)
|
|
42
42
|
|
|
43
|
-
## Basic
|
|
43
|
+
## Basic usage
|
|
44
44
|
|
|
45
|
-
### Encrypting
|
|
45
|
+
### Encrypting data
|
|
46
46
|
|
|
47
47
|
```ts
|
|
48
48
|
const data = new Uint8Array([1, 2, 3]);
|
|
@@ -55,7 +55,7 @@ const { encryptedObject } = await client.seal.encrypt({
|
|
|
55
55
|
});
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
-
### Decrypting
|
|
58
|
+
### Decrypting data
|
|
59
59
|
|
|
60
60
|
```ts
|
|
61
61
|
|
package/dist/seal/llms-index.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
# Seal
|
|
2
2
|
> Use Seal, a decentralized secrets management service that secures your data using threshold encryption and on-chain access control.
|
|
3
3
|
|
|
4
|
-
- [Seal SDK](..md): Decentralized secrets management with threshold encryption on Sui
|
|
4
|
+
- [Seal SDK](..md): Decentralized secrets management with threshold encryption on Sui.
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
#
|
|
1
|
+
# App Integration
|
|
2
2
|
|
|
3
|
-
> Connect your
|
|
3
|
+
> Connect your app to Slush Wallet using the Slush Wallet SDK and wallet standard.
|
|
4
4
|
|
|
5
5
|
> **Note:** If you are using `dapp-kit`, you do not need to install any additional packages to integrate with
|
|
6
6
|
> the Slush wallet. [Read how to integrate with dapp-kit.](/dapp-kit/legacy/slush)
|
|
7
7
|
|
|
8
|
-
Using the Slush Wallet SDK, you can allow users to connect to the Slush wallet from your
|
|
8
|
+
Using the Slush Wallet SDK, you can allow users to connect to the Slush wallet from your app. The
|
|
9
9
|
wallet is provided through the [Wallet Standard](https://docs.sui.io/standards/wallet-standard), and
|
|
10
10
|
should appear automatically in your existing wallet connection UI.
|
|
11
11
|
|
|
12
|
-
> The Slush Wallet SDK is only needed if you want to support the Slush web wallet in your
|
|
12
|
+
> The Slush Wallet SDK is only needed if you want to support the Slush web wallet in your app. If
|
|
13
13
|
> you want to integrate with the Slush browser extension or native mobile wallet, you do not need to
|
|
14
14
|
> install any additional packages - they will work automatically through the Wallet Standard.
|
|
15
15
|
|
|
@@ -21,7 +21,7 @@ your application's lifecycle.
|
|
|
21
21
|
|
|
22
22
|
`registerSlushWallet` takes two arguments:
|
|
23
23
|
|
|
24
|
-
- `name`: The name of your
|
|
24
|
+
- `name`: The name of your app. This is shown to the user when they are asked to approve the
|
|
25
25
|
connection in Slush.
|
|
26
26
|
- `options`: An optional object with the following properties:
|
|
27
27
|
- `origin`: The origin of the Slush website. Defaults to `https://[TODO]`.
|
|
@@ -59,18 +59,18 @@ function SlushOnly() {
|
|
|
59
59
|
}
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
# Migration from Stashed Wallet
|
|
62
|
+
# Migration from Stashed Wallet to Slush Wallet
|
|
63
63
|
|
|
64
64
|
If you're currently using `@mysten/zksend`'s `registerStashedWallet` directly, you should migrate to
|
|
65
65
|
the `@mysten/slush-wallet` package to ensure compatibility with the new Slush experience.
|
|
66
66
|
|
|
67
|
-
##
|
|
67
|
+
## Installation
|
|
68
68
|
|
|
69
69
|
```bash
|
|
70
70
|
pnpm install @mysten/slush-wallet
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
##
|
|
73
|
+
## Migration
|
|
74
74
|
|
|
75
75
|
If you're using `registerStashedWallet`, switch to `registerSlushWallet`:
|
|
76
76
|
|
|
@@ -91,5 +91,5 @@ registerSlushWallet(...);
|
|
|
91
91
|
If you're using dapp-kit, update to the latest dapp-kit version and change the `stashedWallet` prop
|
|
92
92
|
on WalletProvider to `slushWallet`
|
|
93
93
|
|
|
94
|
-
>
|
|
95
|
-
>
|
|
94
|
+
> In the connect modal, users with the Slush Wallet extension installed only see the extension. If
|
|
95
|
+
> they donโt have it, the connection defaults to the Slush web app.
|