Skip to content

Commit

Permalink
Doc fixes (MystenLabs#19270)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan-Mysten authored Sep 8, 2024
1 parent dd951f8 commit 2a06af6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
3 changes: 2 additions & 1 deletion sdk/docs/pages/dapp-kit/wallet-hooks/useSignTransaction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { UseSignTransactionExample } from '../../../examples/wallet-hooks';
Use the `useSignTransaction` hook to prompt the user to sign a transaction with their wallet.

```ts
import { Transaction } from '@mysten/sui/transactions';
import {
ConnectButton,
useCurrentAccount,
Expand Down Expand Up @@ -42,7 +43,7 @@ function MyComponent() {
});

// Always report transaction effects to the wallet after execution
reportTransactionEffects(result.rawEffects!);
reportTransactionEffects(executeResult.rawEffects!);

console.log(executeResult);
}}
Expand Down
8 changes: 4 additions & 4 deletions sdk/docs/pages/typescript/executors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ const tx1 = new Transaction();
const [coin1] = tx1.splitCoins(tx1.gas, [1]);
tx1.transferObjects([coin1], address1);
const tx2 = new Transaction();
const [coin2] = tx1.splitCoins(tx2.gas, [1]);
tx1.transferObjects([coin2], address2);
const [coin2] = tx2.splitCoins(tx2.gas, [1]);
tx2.transferObjects([coin2], address2);

const [{ digest: digest1 }, { digest: digest2 }] = await Promise.all([
executor.executeTransaction(tx1),
Expand Down Expand Up @@ -117,8 +117,8 @@ const tx1 = new Transaction();
const [coin1] = tx1.splitCoins(tx1.gas, [1]);
tx1.transferObjects([coin1], address1);
const tx2 = new Transaction();
const [coin2] = tx1.splitCoins(tx2.gas, [1]);
tx1.transferObjects([coin2], address2);
const [coin2] = tx2.splitCoins(tx2.gas, [1]);
tx2.transferObjects([coin2], address2);

const [{ digest: digest1 }, { digest: digest2 }] = await Promise.all([
executor.executeTransaction(tx1),
Expand Down
6 changes: 3 additions & 3 deletions sdk/docs/pages/typescript/sui-client.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ const result = await client.executeTransactionBlock({

- `transactionBlock` - either a Transaction or BCS serialized transaction data bytes as a Uint8Array
or as a base-64 encoded string.
- `signer` - A `Keypair` instance to sign the transaction
- `signature` - A signature, or list of signatures committed to the intent message of the
transaction data, as a base-64 encoded string.
- `requestType`: `WaitForEffectsCert` or `WaitForLocalExecution`. Determines when the RPC node
should return the response. Default to be `WaitForLocalExecution`
- `options`:
Expand Down Expand Up @@ -170,8 +171,7 @@ const result = await client.signAndExecuteTransaction({

- `transaction` - BCS serialized transaction data bytes as a Uint8Array or as a base-64 encoded
string.
- `signature` - A signature, or list of signatures committed to the intent message of the
transaction data, as a base-64 encoded string.
- `signer` - A `Keypair` instance to sign the transaction
- `requestType`: `WaitForEffectsCert` or `WaitForLocalExecution`. Determines when the RPC node
should return the response. Default to be `WaitForLocalExecution`
- `options`:
Expand Down
6 changes: 3 additions & 3 deletions sdk/docs/pages/typescript/zklogin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@ signatures and compute zkLogin addresses.
To parse a serialized zkLogin signature

```typescript
import { parseZkLoginSignature } '@mysten/sui/zklogin';
import { parseZkLoginSignature } from '@mysten/sui/zklogin';

const parsedSignature = await parseZkLoginSignature('BQNNMTY4NjAxMzAyO....');
```

Use `getZkLoginSignature` to serialize a zkLogin signature.

```typescript
import { getZkLoginSignature } '@mysten/sui/zklogin';
import { getZkLoginSignature } from '@mysten/sui/zklogin';

const serializedSignature = await getZkLoginSignature({ inputs, maxEpoch, userSignature });
```

To compute the address for a given address seed and iss you can use `computeZkLoginAddressFromSeed`

```typescript
import { computeZkLoginAddressFromSeed } '@mysten/sui/zklogin';
import { computeZkLoginAddressFromSeed } from '@mysten/sui/zklogin';

const address = await computeZkLoginAddressFromSeed(0n, 'https://accounts.google.com');
```
Expand Down

0 comments on commit 2a06af6

Please sign in to comment.