Skip to content

Commit

Permalink
Merge pull request #66 from okto-hq/zaje-patch
Browse files Browse the repository at this point in the history
Update Quickstart
  • Loading branch information
oviawork authored Feb 19, 2025
2 parents 34988ee + 5a837ce commit f28843e
Show file tree
Hide file tree
Showing 20 changed files with 50 additions and 103 deletions.
2 changes: 1 addition & 1 deletion content/docs/quickstart/new-okto-nextjs-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ const result = await nftTransfer(oktoClient, nftParams);
```

#### 3. Raw Transaction (EVM)
Execute custom EVM contract calls. <ExternalLink href="/docs/react-sdk/rawTransaction">Learn more</ExternalLink>
Execute custom EVM contract calls. <ExternalLink href="/docs/react-sdk/evmRawTransaction">Learn more</ExternalLink>

```typescript
import { encodeFunctionData } from 'viem';
Expand Down
2 changes: 1 addition & 1 deletion content/docs/quickstart/new-okto-react-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ const result = await nftTransfer(oktoClient, nftParams);
```

#### 3. Raw Transaction (EVM)
Execute custom EVM contract calls. <ExternalLink href="/docs/react-sdk/rawTransaction">Learn more</ExternalLink>
Execute custom EVM contract calls. <ExternalLink href="/docs/react-sdk/evmRawTransaction">Learn more</ExternalLink>

```typescript
import { encodeFunctionData } from 'viem';
Expand Down
2 changes: 1 addition & 1 deletion content/docs/quickstart/new-okto-typescript-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ const result = await nftTransfer(oktoClient, nftParams);
```

#### 3. Raw Transaction (EVM)
Execute custom EVM contract calls. <ExternalLink href="/docs/typescript-sdk/usage/rawTransaction">Learn more</ExternalLink>
Execute custom EVM contract calls. <ExternalLink href="/docs/typescript-sdk/usage/evmRawTransaction">Learn more</ExternalLink>

```typescript
import { encodeFunctionData } from 'viem';
Expand Down
2 changes: 1 addition & 1 deletion content/docs/react-native-sdk/(Intents)/intents.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ Transfer NFTs with ease and security.

For advanced users: direct contract calls and complex operations.

[Learn more →](/docs/react-native-sdk/rawTransaction)
[Learn more →](/docs/react-native-sdk/evmRawTransaction)
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Where `RawTransactionIntentParams` contains:

| Field | Type | Description |
|-------|------|-------------|
| `networkId` | `string` | The network identifier (e.g., eip155:1 for Ethereum) |
| `caip2Id` | `string` | The network identifier (e.g., eip155:1 for Ethereum) |
| `transaction` | `EVMRawTransaction` | The raw transaction parameters |

And `EVMRawTransaction` contains:
Expand All @@ -49,7 +49,7 @@ And `EVMRawTransaction` contains:
| `from` | `Address` | The sender's address |
| `to` | `Address` | The recipient's address |
| `data` | `Hash` | The transaction data (optional) |
| `value` | `number \| bigint` | The amount of native currency to send (optional) |
| `value` | `Hash` | The amount of native currency to send (optional) |

### Response

Expand Down
2 changes: 1 addition & 1 deletion content/docs/react-sdk/(Intents)/intents.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ Transfer NFTs with ease and security.

For advanced users: direct contract calls and complex operations.

[Learn more →](/docs/react-sdk/rawTransaction)
[Learn more →](/docs/react-sdk/evmRawTransaction)
2 changes: 1 addition & 1 deletion content/docs/react-sdk/(Intents)/meta.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "Intents",
"pages": [
"intents", "tokenTransfer", "nftTransfer", "createNFTCollection", "rawTransaction"
"intents", "tokenTransfer", "nftTransfer", "createNFTCollection", "evmRawTransaction"
]
}
2 changes: 1 addition & 1 deletion content/docs/react-sdk/(Intents)/tokenTransfer.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Where `TokenTransferIntentParams` contains:
| `amount` | `number \| bigint` | Amount to send, in the smallest unit (e.g., gwei for ETH) |
| `recipient` | `Address` | Wallet address of the recipient |
| `token` | `Address \| ''` | The token address for the transaction |
| `chain` | `string` | The network ID (e.g., Ethereum - eip155:1, Polygon - eip155:137) |
| `caip2Id` | `string` | The network ID (e.g., Ethereum - eip155:1, Polygon - eip155:137) |

### Response

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ Congratulations! You have successfully integrated the Okto SDK with your Next.js
| `const nfts = await getPortfolioNFT(oktoClient);` | Get user's NFT holdings | <ExternalLink href="/docs/react-sdk/getPortfolioNFT">Method Overview</ExternalLink> |
| `const activity = await getPortfolioActivity(oktoClient);` | Get transaction history | <ExternalLink href="/docs/react-sdk/getPortfolioActivity">Method Overview</ExternalLink> |
| `const orders = await getOrdersHistory(oktoClient);` | Get transaction order history | <ExternalLink href="/docs/react-sdk/getOrdersHistory">Method Overview</ExternalLink> |
| `const collections = await getNftCollections(oktoClient);` | Get NFT collections | <ExternalLink href="/docs/react-sdk/getNFTCollection">Method Overview</ExternalLink> |
| `const collections = await getNftCollections(oktoClient);` | Get NFT collections | <ExternalLink href="/docs/react-sdk/getNFTCollections">Method Overview</ExternalLink> |

### User Operations (Intents)

Expand Down
40 changes: 20 additions & 20 deletions content/docs/react-sdk/quickstart/new-okto-react-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Without completing these steps first, your application won't be able to interact

const config = {
environment: "sandbox",
clientPrivKey: import.meta.env.VITE_CLIENT_PRIV_KEY,
clientPrivateKey: import.meta.env.VITE_CLIENT_PRIV_KEY,
clientSWA: import.meta.env.VITE_CLIENT_SWA,
};

Expand Down Expand Up @@ -135,7 +135,7 @@ Without completing these steps first, your application won't be able to interact

const config = {
environment: "sandbox",
clientPrivKey: import.meta.env.VITE_CLIENT_PRIV_KEY,
clientPrivateKey: import.meta.env.VITE_CLIENT_PRIV_KEY,
clientSWA: import.meta.env.VITE_CLIENT_SWA,
};

Expand Down Expand Up @@ -231,7 +231,7 @@ Without completing these steps first, your application won't be able to interact

return (
<div>
<h2>Welcome {oktoClient.user?.userAddress}</h2>
<h2>Welcome {oktoClient.userSWA?.userAddress}</h2>
<h3>Your Accounts:</h3>
{accounts.map(account => (
<div key={account.caip_id}>
Expand Down Expand Up @@ -278,21 +278,21 @@ Now that we have our basic setup complete, let's implement a token transfer on S
<Step>
### 1. Get Your Wallet Address

First, get your Solana wallet address:
First, get your Polygon wallet address:

```tsx
import { getAccount } from "@okto_web3/react-sdk";

const accounts = await getAccount(oktoClient);
const solanaAccount = accounts.data.find(account => account.network_name === "SOLANA_DEVNET");
console.log("Your Solana address:", solanaAccount.address);
const polygonAccount = accounts.data.find(account => account.network_name === "POLYGON_TESTNET_AMOY");
console.log("Your Polygon Amoy address:", polygonAccount.address);
```
</Step>

<Step>
### 2. Fund Your Wallet

To perform a token transfer, you'll need some funds in your wallet. Add funds to this address using the [Solana Devnet Faucet](https://faucet.solana.com).
To perform a token transfer, you'll need some funds in your wallet. Add funds to this address using the [Polygon Amoy Faucet](https://faucet.polygon.technology/).
</Step>

<Step>
Expand All @@ -318,10 +318,10 @@ Now that we have our basic setup complete, let's implement a token transfer on S
async function handleTransfer() {
try {
const txHash = await tokenTransfer(oktoClient, {
amount: BigInt("1000000000"), // 1 SOL
amount: BigInt("1000000000"), // Amount of tokens to transfer (smallest unit)
recipient: "YOUR_RECIPIENT_ADDRESS",
token: "", // Empty string for native token
chain: "SOLANA_CHAIN_ID" // caip2id of Solana devnet from step 3
caip2Id: "eip155:137" // caip2id of Polygon Amoy
});
setStatus(`Transfer complete! Hash: ${txHash}`);
} catch (error) {
Expand All @@ -334,7 +334,7 @@ Now that we have our basic setup complete, let's implement a token transfer on S
<div>
<h2>Token Transfer</h2>
<button onClick={handleTransfer}>
Send 1 SOL
Send 1 POL
</button>
<p>{status}</p>
</div>
Expand All @@ -348,7 +348,7 @@ Now that we have our basic setup complete, let's implement a token transfer on S

After the transfer is complete, you can verify it through:
- The `getPortfolio` method to check your updated balance
- The [Solana Explorer](https://explorer.solana.com) (devnet) using the transaction hash
- The [Polygon Explorer](https://amoy.polygonscan.com/) using the transaction hash
</Step>

</Steps>
Expand All @@ -372,7 +372,7 @@ For more examples and advanced usage, check out the [Template Repo](https://gith
| `const nfts = await getPortfolioNFT(oktoClient);` | Get user's NFT holdings | <ExternalLink href="/docs/react-sdk/getPortfolioNFT">Method Overview</ExternalLink> |
| `const activity = await getPortfolioActivity(oktoClient);` | Get transaction history | <ExternalLink href="/docs/react-sdk/getPortfolioActivity">Method Overview</ExternalLink> |
| `const orders = await getOrdersHistory(oktoClient);` | Get transaction order history | <ExternalLink href="/docs/react-sdk/getOrdersHistory">Method Overview</ExternalLink> |
| `const collections = await getNftCollections(oktoClient);` | Get NFT collections | <ExternalLink href="/docs/react-sdk/getNFTCollection">Method Overview</ExternalLink> |
| `const collections = await getNftCollections(oktoClient);` | Get NFT collections | <ExternalLink href="/docs/react-sdk/getNFTCollections">Method Overview</ExternalLink> |

### User Operations (Intents)

Expand All @@ -385,8 +385,8 @@ Send tokens to another address. <ExternalLink href="/docs/react-sdk/tokenTransfe
const transferParams = {
amount: BigInt("1000000000000000000"), // Amount in smallest unit
recipient: "0xRecipientAddress...", // Recipient wallet address
token: "0xTokenAddress...", // Token address ("" for native token)
chain: "eip155:1", // Target chain CAIP-2 ID
token: "", // Token address ("" for native token)
caip2Id: "eip155:137", // Target chain CAIP-2 ID
};
const result = await tokenTransfer(oktoClient, transferParams);
```
Expand All @@ -400,7 +400,7 @@ const nftParams = {
collectionAddress: "0xCollectionAddress...", // NFT Collection address
nftId: "NFTTokenID", // NFT identifier
recipientWalletAddress: "0xRecipientAddress...",// Recipient address
amount: 1n,
amount: 1, // Amount of tokens to transfer
nftType: "ERC721", // or "ERC1155"
};
const result = await nftTransfer(oktoClient, nftParams);
Expand All @@ -413,7 +413,6 @@ Execute custom EVM contract calls. <ExternalLink href="/docs/react-sdk/rawTransa
import { encodeFunctionData } from 'viem';

// 1. Define Contract Interaction
const contractAddress = '0xContractAddress...';
const functionName = 'setValue';
const functionArgs = [123];

Expand All @@ -426,18 +425,19 @@ const functionData = encodeFunctionData({
"stateMutability": "nonpayable",
"inputs": [{ "type": "uint256", "name": "_value" }]
}
] as const,
],
functionName,
args: functionArgs,
});

// 3. Execute Transaction
const rawTxParams = {
networkId: "eip155:1",
caip2Id: "eip155:1",
transaction: {
to: contractAddress,
from: "0xuserWalletAddress",
to: "0xcontractAddress",
data: functionData,
// value: BigInt(0), // Optional: for payable functions
value: BigInt(0),
},
};
const result = await evmRawTransaction(oktoClient, rawTxParams);
Expand Down
8 changes: 4 additions & 4 deletions content/docs/react-sdk/usage-overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,16 @@ The Okto React SDK provides a comprehensive set of tools and hooks for integrati

<TechnologyCard
icon={<IoAppsOutline size={"1.5rem"} />}
title="getNftCollection"
title="getNftCollections"
subtitle="Browse and verify NFT collections"
link="/docs/react-sdk/getNFTCollection"
link="/docs/react-sdk/getNFTCollections"
/>

<TechnologyCard
icon={<IoSearchOutline size={"1.5rem"} />}
title="getOrderHistory"
title="getOrdersHistory"
subtitle="View historical transactions and orders"
link="/docs/react-sdk/getOrderHistory"
link="/docs/react-sdk/getOrdersHistory"
/>

<TechnologyCard
Expand Down
66 changes: 2 additions & 64 deletions content/docs/system-capabilities/supported-chains.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Supported Chains & Tokens
full: false
---

Overview of supported chains, wallet structure, testnet availability, and token whitelisting in Okto’s ecosystem. These chains and tokens can be enabled from the [**Okto Dashboard**](https://dashboard.okto.tech/#).
Overview of supported chains, wallet structure, testnet availability, and token whitelisting in Okto’s ecosystem. These chains and tokens can be enabled from the [**Okto Dashboard**](https://dashboard.okto.tech/#).

import SupportedChainCard from "app/components/mdx/SupportedChainCard";

Expand All @@ -13,7 +13,7 @@ import SupportedChainCard from "app/components/mdx/SupportedChainCard";
chainIcon="/images/HL-icon.png"
chainName="HyperEVM"
tokens={[
{ name: "HYPE (Native)", icon: "/images/aptos-icon.svg" },
{ name: "HYPE (Native)", icon: "/images/HL-icon.png" },
]}
whitelistNote="For HyperEVM, any fungible asset can be whitelisted by contacting the team."
resources={{
Expand Down Expand Up @@ -66,38 +66,6 @@ import SupportedChainCard from "app/components/mdx/SupportedChainCard";
]}
/>
<br/>
<SupportedChainCard
chainIcon="/images/sol-icon.svg"
chainName="Solana"
tokens={[
{ name: "SOL (Native)", icon: "/images/sol-icon.svg" },
{ name: "USDT (Default)", icon: "/images/usdt-icon.svg" },
{ name: "USDC (Default)", icon: "/images/usdc-icon.svg" },
]}
whitelistNote="For Solana, any SPL token can be whitelisted by contacting the team."
resources={{
"Solana Docs": "https://solana.com/docs",
"Rust": "https://www.rust-lang.org/",
"Anchor": "https://www.anchor-lang.com/",
"Solana Playground": "https://beta.solpg.io/",
}}
supportedTestnet={{
"Solana Devnet": "https://explorer.solana.com/?cluster=devnet",
}}
networkInfo={[
{
name: "Solana Mainnet",
confirmations: "1",
blockInterval: "0.4s",
},
{
name: "Solana Devnet",
confirmations: "1",
blockInterval: "0.4s",
},
]}
/>
<br/>
<SupportedChainCard
chainIcon="/images/base-icon.svg"
chainName="Base"
Expand Down Expand Up @@ -129,36 +97,6 @@ import SupportedChainCard from "app/components/mdx/SupportedChainCard";
]}
/>
<br/>
<SupportedChainCard
chainIcon="/images/aptos-icon.svg"
chainName="Aptos"
tokens={[
{ name: "APTOS (Native)", icon: "/images/aptos-icon.svg" },
{ name: "USDC (Default)", icon: "/images/usdc-icon.svg" },
]}
whitelistNote="For Aptos, any fungible asset can be whitelisted by contacting the team."
resources={{
"Aptos Docs": "https://aptos.dev/en",
"Move": "https://aptos.dev/en/build/smart-contracts",
"Aptos CLI": "https://aptos.dev/en/build/cli",
"Aptos SDK": "https://aptos.dev/en/build/sdks",
}}
supportedTestnet={{
"Aptos Testnet": "https://explorer.aptoslabs.com/?network=testnet",
}}
networkInfo={[
{
name: "Aptos Mainnet",
confirmations: "1",
blockInterval: "4s",
},
{
name: "Aptos Testnet",
confirmations: "1",
blockInterval: "4s",
},
]}
/>

## Conclusion

Expand Down
2 changes: 1 addition & 1 deletion content/docs/typescript-sdk/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ const result = await nftTransfer(oktoClient, nftParams);
```

#### 3. Raw Transaction (EVM)
Execute custom EVM contract calls. <ExternalLink href="/docs/typescript-sdk/usage/rawTransaction">Learn more</ExternalLink>
Execute custom EVM contract calls. <ExternalLink href="/docs/typescript-sdk/usage/evmRawTransaction">Learn more</ExternalLink>

```typescript
import { encodeFunctionData } from 'viem';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Where `RawTransactionIntentParams` contains:

| Field | Type | Description |
|-------|------|-------------|
| `networkId` | `string` | The network identifier (e.g., eip155:1 for Ethereum) |
| `caip2Id` | `string` | The network identifier (e.g., eip155:1 for Ethereum) |
| `transaction` | `EVMRawTransaction` | The raw transaction parameters |

And `EVMRawTransaction` contains:
Expand Down
2 changes: 1 addition & 1 deletion content/docs/typescript-sdk/usage/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ This section provides a comprehensive overview of the functions available in the
icon={<IoCodeSlashOutline size={"1.5rem"} />}
title="rawTransaction"
subtitle="Create custom EVM transactions"
link="/docs/typescript-sdk/usage/rawTransaction"
link="/docs/typescript-sdk/usage/evmRawTransaction"
/>
</div>

Expand Down
2 changes: 1 addition & 1 deletion content/docs/typescript-sdk/usage/intents.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ Transfer NFTs with ease and security.

For advanced users: direct contract calls and complex operations.

[Learn more →](/docs/react-sdk/rawTransaction)
[Learn more →](/docs/react-sdk/evmRawTransaction)
2 changes: 1 addition & 1 deletion content/docs/typescript-sdk/usage/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
"nftCreateCollection",
"nftTransfer",
"tokenTransfer",
"rawTransaction"
"evmRawTransaction"
]
}
Loading

0 comments on commit f28843e

Please # to comment.