From 62bbf733eb67dc4fc06ee6d1f55a71da92404a0c Mon Sep 17 00:00:00 2001 From: zaje1 Date: Fri, 20 Dec 2024 18:17:36 +0530 Subject: [PATCH 1/3] fix: broken link --- README.md | 2 +- .../quickstart-okto-react-native/prerequisites.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f457b85..14367eb 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ## Overview -This repo houses Okto's [documentation](docs.okto.tech). More info below on how to run the website or submit PRs for new documentation, or website pages. +This repo houses Okto's [documentation](https://docs.okto.tech). More info below on how to run the website or submit PRs for new documentation, or website pages. ## Index diff --git a/content/docs/react-native-sdk/getting-started/quickstart-okto-react-native/prerequisites.mdx b/content/docs/react-native-sdk/getting-started/quickstart-okto-react-native/prerequisites.mdx index 0546870..27adf86 100644 --- a/content/docs/react-native-sdk/getting-started/quickstart-okto-react-native/prerequisites.mdx +++ b/content/docs/react-native-sdk/getting-started/quickstart-okto-react-native/prerequisites.mdx @@ -19,7 +19,7 @@ import { Callout } from 'fumadocs-ui/components/callout'; i. **Google Client IDs** - To authenticate users via Google, you'll need to set up a Google Console Project. - - Follow our guide to [set up your Google Console Project](/docs/react-native-sdk/advanced-sdk-config/authenticate-users/google-oauth/google-console-setup). + - Follow our guide to [set up your Google Console Project](/docs/react-native-sdk/advanced-sdk-config/authenticate-users/google-oauth/google-console-setup-android). - The required Client IDs depend on your target platforms: | Target Platform | Required Client IDs | From 7a9bfb4b27f95a6f68986f7093fa912ff53c329d Mon Sep 17 00:00:00 2001 From: zaje1 Date: Fri, 20 Dec 2024 18:43:56 +0530 Subject: [PATCH 2/3] modify: showcase page layout --- app/showcase/page.tsx | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/app/showcase/page.tsx b/app/showcase/page.tsx index 60b8c20..6ec3454 100644 --- a/app/showcase/page.tsx +++ b/app/showcase/page.tsx @@ -13,7 +13,7 @@ import { GitHubIcon, LinkLogo } from './icons'; import { showcases } from './projects'; // SDK type for the tabs -const sdkSections = ["React", "React Native", "Flutter", "API", "All"] as const; +const sdkSections = ["All", "React", "React Native", "Flutter", "API"] as const; function ShowcaseCard({ showcase, onOpen }: { showcase: (typeof showcases)[0]; onOpen: (showcase: (typeof showcases)[0]) => void }) { return ( @@ -82,15 +82,18 @@ export default function Showcase() {
{/* Header Section */}
-
- Explore Okto-Powered Projects + {/* Left Side: Heading and Description */} +
+
+ Explore Okto-Powered Projects +
+

+ Discover innovative applications built by developers worldwide using the Okto SDKs. +

-
- - - + + {/* Right Side: Buttons */} +
+ + +
- {/* Description and Disclaimer */} -
-

- Discover innovative applications built by developers worldwide using the Okto SDKs. -

- + {/* Disclaimer Section */} +

⚠️ Disclaimer: These are community projects and are not maintained by the Okto team. From 28137943294b6fe3ba603f89327aead7c3d14362 Mon Sep 17 00:00:00 2001 From: zaje1 Date: Fri, 20 Dec 2024 18:44:21 +0530 Subject: [PATCH 3/3] - fix blog date - add raw transactions blog --- .../executing-raw-transactions-with-okto.mdx | 213 ++++++++++++++++++ content/blogs/getting-started-with-okto.mdx | 4 +- content/blogs/interact-tokens-with-okto.mdx | 2 +- 3 files changed, 217 insertions(+), 2 deletions(-) create mode 100644 content/blogs/executing-raw-transactions-with-okto.mdx diff --git a/content/blogs/executing-raw-transactions-with-okto.mdx b/content/blogs/executing-raw-transactions-with-okto.mdx new file mode 100644 index 0000000..a49cea2 --- /dev/null +++ b/content/blogs/executing-raw-transactions-with-okto.mdx @@ -0,0 +1,213 @@ +--- +title: "Executing Raw Transactions with Okto SDK: A Comprehensive Guide" +description: Executing raw transactions across EVM, Solana, and Aptos using the Okto SDK allows developers to invoke any smart contract function and gain full control over blockchain interactions. This comprehensive guide will help you understand dynamic transaction objects, execute raw transactions, and leverage Okto’s abstractions for seamless signing, gas management, and execution. +date: 2024-12-17 +author: Ejaaz +--- + +Executing Raw Transactions with Okto SDK: A Comprehensive Guide + +TL;DR: +Learn how to execute raw transactions across EVM, Solana, and Aptos using the Okto SDK. Gain full control over smart contracts and blockchain interactions with dynamic transaction objects, while benefiting from Okto’s abstractions for signing, gas, and seamless execution. + +## Introduction + +Building sophisticated Web3 applications often requires interacting directly with smart contracts at a granular level. While pre-built functionalities and abstractions streamline common operations, sometimes you need a more flexible approach to execute on-chain actions not covered by pre-existing Blocs or APIs. + +This is where raw transactions come into play. A raw transaction gives you full control, allowing you to: + +- Invoke any smart contract function. +- Customize transaction data for complex operations. +- Interact seamlessly across multiple chains without blockchain-specific complexities. + +Enter Okto. With Okto, you can execute raw transactions on EVM-compatible networks, Solana, and Aptos — all through a single interface. The Okto SDK’s raw transaction APIs handle gas, signing, and transaction execution behind the scenes, enabling you to focus on your application logic rather than the intricacies of blockchain networks. + +In this guide, you’ll learn how to construct dynamic transaction objects for different networks and execute raw transactions programmatically. By the end, you’ll have the tools to build more flexible, future-proof, and powerful Web3 applications. + +## Understanding Raw Transactions + +A raw transaction is an unsigned, low-level transaction that can be broadcasted to a blockchain network. Executing raw transactions is ideal for developers who need to: + +- Interact with smart contracts not supported by higher-level SDK methods. +- Run complex operations requiring custom transaction data. +- Execute transactions across multiple blockchain networks with different protocols. + +While Okto’s Bloc Hub provides ready-to-use Blocs for common Web3 tasks (like token transfers, NFT operations, and DeFi actions), there are situations where a specific Bloc may not exist. The raw transaction API fills this gap, enabling you to call any function on any smart contract, across diverse ecosystems, while still leveraging Okto’s abstractions for gas, signing, and retries. + +## Dynamic Transaction Objects: The Key to Multi-Chain Flexibility + +Each blockchain network has its unique architecture and transaction model: + +- EVM Networks (Ethereum, Polygon, etc.): Account-based models with `from`, `to`, `value`, and `data` fields. +- Solana: Instruction-based models involving programs and accounts. +- Aptos: Transactions built around Move language functions with type and function arguments. + +To handle these differences, Okto uses dynamic transaction objects that adapt to the requirements of each network. This approach ensures: + +- **Network Compatibility:** Transactions are always valid for the target network. +- **Full Control:** You can include any custom data needed by your contract. +- **Future-Proofing:** Easily integrate new networks or changes to existing ones without overhauling your code. + +## Network-Specific Transaction Structures + +### EVM Networks (Ethereum, Polygon, etc.) + +For EVM-compatible networks, transactions typically include fields like `from`, `to`, `data`, and `value`. Here’s an example structure for an EVM network like Polygon: + +```json +{ + "network_name": "POLYGON", + "transaction": { + "from": "0xYourAddress", + "to": "0xContractAddress", + "data": "0xContractCallData", + "value": "0x0" + } +} +``` + +### Solana + +Solana uses a transaction model built around instructions. Each instruction specifies a program to execute and the accounts it interacts with: + +```json +{ + "network_name": "SOLANA", + "transaction": { + "instructions": [ + { + "keys": [ + { + "pubkey": "PublicKey", + "isSigner": true, + "isWritable": false + } + ], + "programId": "ProgramID", + "data": [1, 2, 3, 4] + } + ], + "signer": "SignerPublicKey" + } +} +``` + +### Aptos + +Aptos focuses on Move-based function calls with type arguments and function arguments: + +```json +{ + "network_name": "APTOS", + "transaction": { + "transactions": [ + { + "function": "ModuleAddress::ModuleName::FunctionName", + "typeArguments": ["TypeArgument1"], + "functionArguments": ["Argument1"] + } + ] + } +} +``` + +By providing the correct transaction object structure based on the target network, you can seamlessly execute any operation on any smart contract. + +## Executing Raw Transactions via Okto SDK APIs + +Once you’ve structured your transaction object, you can leverage the Okto SDK APIs to send and track these raw transactions. Okto’s unified interface handles the complexity of each network, empowering you to focus on your logic rather than low-level blockchain mechanics. + +### 1. Executing Raw Transactions + +Endpoint: `POST /api/v1/rawtransaction/execute` + +Sample Request (EVM): + +```bash +POST https://sandbox-api.okto.tech/api/v1/rawtransaction/execute +Content-Type: application/json +{ + "network_name": "POLYGON", + "transaction": { + "from": "0xYourAddress", + "to": "0xContractAddress", + "data": "0xYourContractData", + "value": "0x0" + } +} +``` + +Sample Response: + +```json +{ + "status": "success", + "data": { + "jobId": "f15c07cb-2d29-4670-8492-b1236fdd41dc" + } +} +``` + +SDK Function Equivalent: + +If you’re using the Okto SDK, this is wrapped in a function like `executeRawTransaction(transactionData)`. + +Documentation Links: + +* [React SDK — Execute Raw Transactions](https://docs.okto.tech/docs/react-sdk/advanced-sdk-config/okto-embedded-wallet/use-user-embedded-wallet/raw-transactions#execute-raw-transaction) +* [Flutter SDK — Execute Raw Transactions](https://docs.okto.tech/docs/flutter-sdk/advanced-sdk-config/okto-embedded-wallet/use-user-embedded-wallet/raw-transactions#execute-raw-transaction) +* [React Native SDK — Execute Raw Transactions](https://docs.okto.tech/docs/react-native-sdk/advanced-sdk-config/okto-embedded-wallet/use-user-embedded-wallet/raw-transactions#execute-raw-transaction) + +### 2. Getting Raw Transaction Status + +To monitor your transaction’s progress, use the Get Raw Transaction Status API. This endpoint retrieves transaction details, including its status and blockchain transaction hash, using the order_id from the execution response. + +Endpoint: `GET /api/v1/rawtransaction/status` + +Sample Request: + +```bash +GET https://sandbox-api.okto.tech/api/v1/rawtransaction/status?order_id=YOUR_ORDER_ID +``` + +Sample Response: + +```json +{ + "status": "success", + "data": { + "jobs": [ + { + "order_id": "YOUR_ORDER_ID", + "network_name": "POLYGON", + "status": "SUCCESS", + "transaction_hash": "0xTRANSACTION_HASH" + } + ] + } +} +``` + +SDK Function Equivalent: + +If you’re using the Okto SDK, this is available as `getRawTransactionStatus(order_id)`. + +Documentation Links: + +* [React SDK — Get Raw Transaction Status](https://docs.okto.tech/docs/react-sdk/advanced-sdk-config/okto-embedded-wallet/use-user-embedded-wallet/raw-transactions#get-raw-transaction-status) +* [Flutter SDK — Get Raw Transaction Status](https://docs.okto.tech/docs/flutter-sdk/advanced-sdk-config/okto-embedded-wallet/use-user-embedded-wallet/raw-transactions#get-raw-transaction-status) +* [React Native SDK — Get Raw Transaction Status](https://docs.okto.tech/docs/react-native-sdk/advanced-sdk-config/okto-embedded-wallet/use-user-embedded-wallet/raw-transactions#get-raw-transaction-status) + +## Conclusion + +In this guide, we explored how to execute raw transactions using the Okto SDK. By understanding dynamic transaction objects and network-specific data structures, you can: + +- Invoke any smart contract function on EVM, Solana, or Aptos. +- Retain complete control over transaction data and logic. +- Leverage Okto’s abstractions for signing, gas handling, and seamless execution. + +Raw transaction execution with Okto unlocks powerful capabilities, letting you integrate complex, custom functionalities into your applications without getting bogged down in the underlying blockchain specifics. + +For more details and advanced use cases, head over to the [Official Okto Documentation](https://docs.okto.tech/). + +Stop worrying about low-level blockchain mechanics — start building your next great application with Okto! 🚀 \ No newline at end of file diff --git a/content/blogs/getting-started-with-okto.mdx b/content/blogs/getting-started-with-okto.mdx index 357658e..7e01ba9 100644 --- a/content/blogs/getting-started-with-okto.mdx +++ b/content/blogs/getting-started-with-okto.mdx @@ -1,7 +1,7 @@ --- title: Getting Started with Okto description: Learn how to get started with Okto SDKs, check out the different available SDKs, and set up your first project using it. -date: 2024-06-13 +date: 2024-12-13 author: Ejaaz --- @@ -191,6 +191,8 @@ Embracing Web3 development doesn’t have to be overwhelming. With the Okto SDK, Whether you’re building a simple dApp or a complex multi-chain application, the Okto SDK equips you with the tools you need. Its plug-and-play solutions, combined with customizable features, offer the perfect balance between simplicity and power. +To dive deeper into the implementation details and explore additional features, head over to the [Official Okto Documentation](https://docs.okto.tech/). + Now is the perfect time to jump into Web3 development. With the Okto SDK, you can turn your innovative ideas into reality. Don’t let the complexities of blockchain technology hold you back — Start building with Okto today! Happy Coding! 🚀 diff --git a/content/blogs/interact-tokens-with-okto.mdx b/content/blogs/interact-tokens-with-okto.mdx index 8ca3ec5..6244d65 100644 --- a/content/blogs/interact-tokens-with-okto.mdx +++ b/content/blogs/interact-tokens-with-okto.mdx @@ -1,7 +1,7 @@ --- title: "Interacting with Tokens on Okto SDK: A Comprehensive Guide" description: Interacting with tokens on Okto SDK is a crucial part of building Web3 applications. This guide provides a comprehensive overview of how to interact with tokens using Okto SDK, including how to get token balances, send tokens, and more. -date: 2024-06-13 +date: 2024-12-15 author: Ejaaz ---