### Example GET Request for Documentation Query Source: https://docs.orda.network/developers/api/onchain-transactions/monitoring-status Use this format to query the documentation dynamically by adding an 'ask' parameter with your question. ```plaintext GET https://docs.orda.network/developers/api/onchain-transactions/monitoring-status.md?ask= ``` -------------------------------- ### HTTP Request Example Source: https://docs.orda.network/developers/guides/postman-workspace Example of an HTTP GET request with an 'ask' query parameter to query documentation dynamically. ```http GET https://docs.orda.network/developers/guides/postman-workspace.md?ask= ``` -------------------------------- ### Dynamic Documentation Query Example Source: https://docs.orda.network/developers/api/on-ramps/monitoring-status To get more information not directly on this page, make a GET request to the documentation URL with an 'ask' query parameter containing your question. ```http GET https://docs.orda.network/developers/api/on-ramps/monitoring-status.md?ask= ``` -------------------------------- ### Install Widget and SDK Source: https://docs.orda.network/developers/widget Install the new widget package alongside the core SDK. The SDK remains a peer dependency. ```bash npm install @ordanetwork/widget @ordanetwork/sdk ``` -------------------------------- ### Install Orda SDK with npm Source: https://docs.orda.network/developers/sdk/getting-started Use this command to install the Orda SDK using npm. Ensure you have Node.js 18.0.0+ installed. ```bash npm install @ordanetwork/sdk ``` -------------------------------- ### Install Orda SDK with yarn Source: https://docs.orda.network/developers/sdk/getting-started Use this command to install the Orda SDK using yarn. Ensure you have Node.js 18.0.0+ installed. ```bash yarn add @ordanetwork/sdk ``` -------------------------------- ### Querying Documentation with GET Request Source: https://docs.orda.network/api-reference/api-reference/authentication/signature-generation Perform an HTTP GET request with the 'ask' query parameter to dynamically query documentation. The question should be specific and self-contained. ```http GET https://docs.orda.network/api-reference/api-reference/authentication/signature-generation.md?ask= ``` -------------------------------- ### Run Development Server Source: https://docs.orda.network/developers/widget Start the development server to see the widget in action. ```bash npm run dev ``` -------------------------------- ### Install Orda Widget and SDK Source: https://docs.orda.network/developers/widget Install the orda Widget and SDK packages along with their peer dependencies. ```bash npm install @ordanetwork/widget @ordanetwork/sdk # peers (you almost certainly have most of these already) npm install react react-dom @tanstack/react-query wagmi viem ``` -------------------------------- ### Amount Formatting Examples Source: https://docs.orda.network/developers/api/onchain-transactions/requesting-a-quote Examples demonstrating how to format amounts for quote requests based on token decimal precision. Use the token's smallest unit for 'fromAmount' or 'toAmount' calculations. ```plaintext fromAmount: "2500000000000000000" ``` ```plaintext toAmount: "1000000000" ``` -------------------------------- ### Example .env.local File Configuration Source: https://docs.orda.network/developers/widget/authentication This bash snippet shows an example `.env.local` file for configuring WalletConnect and orda API credentials. It highlights required variables like `NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID`, `ORDA_CLIENT_ID`, and `ORDA_CLIENT_SECRET`, emphasizing that orda credentials should not be exposed to the client. ```bash # WalletConnect Configuration NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6 # orda API Credentials (DO NOT expose to client) ORDA_CLIENT_ID=prj_8a8ce3b783ef467f8f48270e4818e57b ORDA_CLIENT_SECRET=sec_a3e8773348898a0e6ab19e94ee1169505283c1d5b3eb6f40fdaee99b476a25ea # NEXT_PUBLIC_ORDA_API_BASE_URL=http://localhost:5002/v1 ``` -------------------------------- ### Install Orda SDK with pnpm Source: https://docs.orda.network/developers/sdk/getting-started Use this command to install the Orda SDK using pnpm. Ensure you have Node.js 18.0.0+ installed. ```bash pnpm add @ordanetwork/sdk ``` -------------------------------- ### Querying Documentation Dynamically Source: https://docs.orda.network/developers/api/onchain-transactions/executing-a-quote Perform an HTTP GET request to the current page URL with the 'ask' query parameter to get specific information. The question should be self-contained and in natural language. ```bash GET https://docs.orda.network/developers/api/onchain-transactions/executing-a-quote.md?ask= ``` -------------------------------- ### Querying Documentation Dynamically Source: https://docs.orda.network/api-reference/api-reference/authentication/required-headers To get more information not present on the page, perform an HTTP GET request with the `ask` query parameter. The question should be specific and self-contained. ```http GET https://docs.orda.network/api-reference/api-reference/authentication/required-headers.md?ask= ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.orda.network/developers/widget/authentication Perform an HTTP GET request on a documentation URL with the 'ask' query parameter to ask a question. The response will contain a direct answer and relevant excerpts. ```http GET https://docs.orda.network/developers/widget/authentication.md?ask= ``` -------------------------------- ### Create AppKit Config with Custom Metadata Source: https://docs.orda.network/developers/widget/advanced-usage Example of creating an AppKit configuration using `createAppKitConfig`, including custom metadata for the wallet connection UI. ```typescript const appKitConfig = createAppKitConfig({ projectId: process.env.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID!, metadata: { name: 'My DeFi App', description: 'Multi-chain payment platform', url: 'https://mydefiapp.com', icons: ['https://mydefiapp.com/logo.png'], }, }); ``` -------------------------------- ### Querying Documentation Dynamically Source: https://docs.orda.network/api-reference/api-reference/authentication/important-notes To get information not directly on the page, perform an HTTP GET request to the current URL with the 'ask' query parameter. The question should be specific and in natural language. ```http GET https://docs.orda.network/api-reference/api-reference/authentication/important-notes.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.orda.network/api-reference/api-reference/authentication/error-responses Perform an HTTP GET request to the current page URL with the `ask` query parameter to get dynamic information. The question should be specific and in natural language. Use this for clarifications or additional context not explicitly present. ```HTTP GET https://docs.orda.network/api-reference/api-reference/authentication/error-responses.md?ask= ``` -------------------------------- ### Perform GET Request with 'ask' Parameter Source: https://docs.orda.network/api-reference/api-reference/authentication/authentication-flow Use this mechanism to query documentation dynamically. The question should be specific and self-contained. The response includes an answer and relevant excerpts. ```HTTP GET https://docs.orda.network/api-reference/api-reference/authentication/authentication-flow.md?ask= ``` -------------------------------- ### Query Documentation with GET Request Source: https://docs.orda.network/developers/api/recipients Perform an HTTP GET request on the current page URL with the `ask` query parameter to retrieve specific information not explicitly present on the page. The question should be specific, self-contained, and in natural language. ```HTTP GET https://docs.orda.network/developers/api/recipients.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.orda.network/api-reference/api-reference/authentication-1 To get additional information not directly present on the page, perform an HTTP GET request to the current page URL with an 'ask' query parameter. The question should be specific and self-contained. ```http GET https://docs.orda.network/api-reference/api-reference/authentication-1.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.orda.network/api-reference/api-reference/authentication To get more information not present on the current page, make an HTTP GET request to the current page URL with the 'ask' query parameter. The question should be specific and in natural language. ```HTTP GET https://docs.orda.network/api-reference/api-reference/authentication.md?ask= ``` -------------------------------- ### Querying Documentation Dynamically Source: https://docs.orda.network/developers/api/on-ramps/executing-a-quote To get additional information not directly present on a page, make an HTTP GET request to the page URL with the 'ask' query parameter. The question should be specific and in natural language. ```HTTP GET https://docs.orda.network/developers/api/on-ramps/executing-a-quote.md?ask= ``` -------------------------------- ### Dynamic Documentation Query Source: https://docs.orda.network/developers/widget/frameworks Perform an HTTP GET request to query documentation dynamically. The 'ask' parameter should contain a specific, self-contained question in natural language. ```bash GET https://docs.orda.network/developers/widget/frameworks.md?ask= ``` -------------------------------- ### Request Quote with Fiat Amount (BRL) Source: https://docs.orda.network/developers/api/on-ramps/requesting-a-quote Use this example to request a quote when you know the exact fiat amount you want to send. This is useful for direct fiat-to-crypto conversions. ```bash curl -X POST https://api.orda.network/v1/onramp/quote \ -H "Content-Type: application/json" \ -H "x-client-id: your-client-id" \ -H "x-signature: your-signature" \ -H "x-timestamp: 1234567890" \ -d '{ "fromCurrency": "BRL", "intent": { "method": "fromAmount", "value": "500" }, "recipientId": "123e4567-e89b-12d3-a456-426614174000" }' ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.orda.network/developers/sdk Perform an HTTP GET request to query the documentation dynamically. Use the 'ask' query parameter with a specific, self-contained question in natural language. ```http GET https://docs.orda.network/developers/sdk.md?ask= ``` -------------------------------- ### Check Peer Dependencies Source: https://docs.orda.network/developers/widget/troubleshooting Verify that your project has the correct versions of peer dependencies installed. Mismatched versions can lead to build errors or runtime issues. ```bash npm ls react wagmi viem @tanstack/react-query ``` -------------------------------- ### Request Quote with Crypto Amount Source: https://docs.orda.network/developers/api/on-ramps/requesting-a-quote Use this example to request a quote when you know the exact amount of cryptocurrency you want to receive. Note that large values represent smallest units of the token. ```bash curl -X POST https://api.orda.network/v1/onramp/quote \ -H "Content-Type: application/json" \ -H "x-client-id: your-client-id" \ -H "x-signature: your-signature" \ -H "x-timestamp: 1234567890" \ -d '{ "fromCurrency": "BRL", "intent": { "method": "toAmount", "value": "100000000000000000000" }, "recipientId": "123e4567-e89b-12d3-a456-426614174000" }' ``` -------------------------------- ### Request Quote with USD Value Source: https://docs.orda.network/developers/api/on-ramps/requesting-a-quote Use this example to request a quote based on a specific USD value. This is useful for transactions where the target value is denominated in USD. ```bash curl -X POST https://api.orda.network/v1/onramp/quote \ -H "Content-Type: application/json" \ -H "x-client-id: your-client-id" \ -H "x-signature: your-signature" \ -H "x-timestamp: 1234567890" \ -d '{ "fromCurrency": "BRL", "intent": { "method": "usd", "value": "100" }, "recipientId": "123e4567-e89b-12d3-a456-426614174000" }' ``` -------------------------------- ### Ask a Question via Documentation API Source: https://docs.orda.network/api-reference Perform an HTTP GET request to the documentation index with the 'ask' parameter to find specific information. The question should be specific and in natural language. ```http GET https://docs.orda.network/developers/widget/widget-reference.md?ask= ``` -------------------------------- ### Canonical JSON Serialization Example Source: https://docs.orda.network/api-reference/api-reference/authentication/signature-generation Ensures consistent signatures by sorting object keys alphabetically and removing whitespace. Use this for request bodies before generating a signature. ```json // Original JSON (key order may vary) {"name": "John", "age": 30, "city": "New York"} ``` ```json // Canonical JSON (always same output) {"age":30,"city":"New York","name":"John"} ``` -------------------------------- ### Check Transaction Status Request Source: https://docs.orda.network/developers/guides/postman-workspace Example GET request to check the status of a cross-chain transfer using the `transaction_id` saved in the environment. ```http GET /v1/status?transactionId={{transaction_id}} ``` -------------------------------- ### Create React App: index.tsx Entry Point Source: https://docs.orda.network/developers/widget/frameworks Set up the main entry point for a Create React App application. Import SDK styles and render the root component using ReactDOM. ```typescript import React from 'react'; import ReactDOM from 'react-dom/client'; import App from './App'; import '@ordanetwork/sdk/react/styles.css'; import './index.css'; const root = ReactDOM.createRoot( document.getElementById('root') as HTMLElement ); root.render( ); ``` -------------------------------- ### GET /status - Get Transaction Status Source: https://docs.orda.network/api-reference/api-reference/crypto-to-crypto Retrieve the status of a transaction using its ID, source hash, or destination hash. At least one of these parameters is required. ```APIDOC ## GET /status ### Description Retrieve the status of a transaction by transaction ID, source hash, or destination hash. At least one of these parameters must be provided. ### Authentication All API requests to orda require HMAC signatures using your project's client ID and client secret. The signature is a HMAC-SHA256 hash of the request body, using your Client Secret as the key. For GET or endpoints with no request body, use the string "{}" (canonical empty object) for the signature. #### Required Headers | Header | Description | |--------|-------------| | `x-client-id` | Your project's client ID | | `x-signature` | HMAC-SHA256 signature derived from your client secret | | `Content-Type` | `application/json` for this request | --- **Status Values:** - `Pending`: Transaction submitted to blockchain - `In_progress`: Cross-chain processing in progress - `Completed`: Transaction completed successfully - `Failed`: Transaction failed - `Refunded`: Transaction was refunded ### Method GET ### Endpoint /status ### Query Parameters - **transactionId** (string) - Optional - Transaction ID from quote response - **sourceHash** (string) - Optional - Source transaction hash - **destinationHash** (string) - Optional - Destination transaction hash ### Headers - **x-client-id** (string) - Required - Your project's client ID - **x-signature** (string) - Required - HMAC-SHA256 signature derived from your client secret - **x-timestamp** (string) - Optional - Unix timestamp in milliseconds for replay protection (recommended) - **Content-Type** (string) - Required - `application/json` ### Response #### Success Response (200) - **requestSuccess** (boolean) - Indicates if the request was successful. - **transaction** (object) - Details about the transaction. - **id** (string) - The unique identifier for the transaction. - **status** (string) - The current status of the transaction. Possible values: `Pending`, `In_progress`, `Completed`, `Failed`, `Refunded`. - **type** (string) - The type of transaction. Possible values: `Direct`, `LiFi`, `Relay`, `Wormhole`, `Transfero`. - **fromChain** (string) - The source chain of the transaction. - **toChain** (string) - The destination chain of the transaction. - **fromToken** (string) - The token used in the source chain. - **toToken** (string) - The token used in the destination chain. - **fromAmount** (string) - The amount of tokens in the source chain. - **usdAmount** (number) - The equivalent amount in USD. - **sourceTransactionHash** (string) - The hash of the transaction on the source chain. - **destinationTransactionHash** (string) - The hash of the transaction on the destination chain. - **createdAt** (string) - The timestamp when the transaction was created (ISO 8601 format). - **updatedAt** (string) - The timestamp when the transaction was last updated (ISO 8601 format). #### Response Example ```json { "requestSuccess": true, "transaction": { "id": "txn_abc123def456ghi789", "status": "Completed", "type": "LiFi", "fromChain": "ethereum", "toChain": "polygon", "fromToken": "USDC", "toToken": "USDC", "fromAmount": "1000000000000000000", "usdAmount": 100.50, "sourceTransactionHash": "0xabcdef1234567890abcdef1234567890abcdef1234567890", "destinationTransactionHash": "0xfedcba0987654321fedcba0987654321fedcba0987654321", "createdAt": "2023-10-27T10:00:00Z", "updatedAt": "2023-10-27T10:05:00Z" } } ``` ``` -------------------------------- ### Vite + React: main.tsx Entry Point Source: https://docs.orda.network/developers/widget/frameworks Set up the main entry point for a Vite + React application. Import necessary SDK styles and render the root component. ```typescript import React from 'react'; import ReactDOM from 'react-dom/client'; import App from './App'; import '@ordanetwork/sdk/react/styles.css'; import './index.css'; ReactDOM.createRoot(document.getElementById('root')!).render( ); ``` -------------------------------- ### GET Request for On-Ramp Status Source: https://docs.orda.network/developers/api/on-ramps/monitoring-status Use this GET request to check the status of a specific on-ramp transaction. Ensure you include the transactionId query parameter and proper authentication headers. ```http GET https://api.orda.network/v1/onramp/status ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.orda.network/api-reference/api-reference/authentication/testing-your-implementation Perform an HTTP GET request to the current page URL with the 'ask' query parameter to dynamically query documentation. Use this for clarifications or additional context not explicitly present on the page. ```HTTP GET https://docs.orda.network/api-reference/api-reference/authentication/testing-your-implementation.md?ask= ``` -------------------------------- ### Perform HTTP GET Request with 'ask' Parameter Source: https://docs.orda.network/api-reference/api-reference/crypto-to-fiat Use this method to query documentation dynamically. Append the 'ask' query parameter with a specific, self-contained natural language question to the current page URL. The response will contain a direct answer and relevant documentation excerpts. ```http GET https://docs.orda.network/api-reference/api-reference/crypto-to-fiat.md?ask= ``` -------------------------------- ### Get Successful Transactions Source: https://docs.orda.network/developers/sdk/monitoring-transactions Retrieve a list of all transactions that have successfully completed. ```APIDOC ## Get Successful Transactions Retrieve all successful transactions: ### Method ``` GET ``` ### Endpoint ``` /transactions/successful ``` ### Response #### Success Response (200) - **transactions** (array) - A list of successful transaction objects. - Each object contains transaction details similar to the Status Response. ``` -------------------------------- ### Backend Initialization with Credentials Source: https://docs.orda.network/developers/sdk/getting-started Initialize the Orda SDK on your backend server using environment variables for client ID and client secret. Never expose credentials in frontend code. ```javascript const orda = new OrdaSDK({ clientId: process.env.ORDA_CLIENT_ID, clientSecret: process.env.ORDA_CLIENT_SECRET }); ``` -------------------------------- ### Get Status Source: https://docs.orda.network/developers/sdk/on-ramp-quote Retrieves the current status of an on-ramp transaction using its transaction ID. ```APIDOC ## Get Status ### Description Retrieves the current status of an on-ramp transaction using its transaction ID. ### Method GET (implied by SDK method `getStatus`) ### Endpoint `/onRamp/status/{transactionId}` (inferred from SDK usage) ### Parameters #### Path Parameters - **transactionId** (string) - Required - The ID of the transaction to check the status for. ``` -------------------------------- ### GET /onramp/status Source: https://docs.orda.network/api-reference/api-reference/fiat-to-crypto Retrieves the status of a fiat-to-crypto transaction. Requires authentication via HMAC signatures. ```APIDOC ## GET /onramp/status ### Description Check the status of a fiat-to-crypto transaction. ### Method GET ### Endpoint /onramp/status ### Parameters #### Query Parameters - **transactionId** (string) - Required - UUID of the transaction to check #### Headers - **x-client-id** (string) - Required - Your project's client ID - **x-signature** (string) - Required - HMAC-SHA256 signature derived from your client secret - **x-timestamp** (string) - Optional - Unix timestamp in milliseconds for replay protection ### Responses #### Success Response (200) - **transactionId** (string) - Unique transaction identifier - **status** (string) - Current transaction status (`In_progress`, `Completed`, `Failed`) - **type** (string) - Transaction type (always `"FIAT_TO_CRYPTO"`) - **fromCurrency** (string) - Source fiat currency - **toCrypto** (string) - Target cryptocurrency token address - **toChain** (string) - Destination blockchain ID - **fiatAmount** (string) - Amount of fiat currency deposited - **cryptoAmount** (string) - Amount of cryptocurrency to receive - **settlementAddress** (string) - Recipient's wallet address - **depositMethod** (string) - Payment method used (e.g., `"PIX"`) - **depositStatus** (string) - Status of fiat deposit (`awaiting`, `received`, `confirmed`, `completed`) - **transferoOrderId** (string) - Provider's order identifier - **transferoReferenceId** (string) - Provider's reference ID - **createdAt** (string) - Timestamp when the transaction was created #### Error Response (4xx/5xx) - **error** (string) - Error type identifier - **message** (string) - Human-readable error message - **correlationId** (string) - Request correlation ID for debugging ``` -------------------------------- ### POST /v1/quote Source: https://docs.orda.network/developers/api/onchain-transactions/requesting-a-quote Request a quote for a crypto-to-crypto transaction. This allows you to get pricing information before executing a trade. ```APIDOC ## POST /v1/quote ### Description Requests pricing information for a potential crypto-to-crypto transaction across supported tokens and chains. ### Method POST ### Endpoint https://api.orda.network/v1/quote ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **intent** (object) - Required - Specifies how the amount should be calculated. - **usd** (string) - Optional - Calculate based on USD amount (e.g., "10" for $10). - **fromAmount** (string) - Optional - Calculate based on the source token amount in its smallest unit (e.g., "2500000000000000000" for 2.5 ETH). - **toAmount** (string) - Optional - Calculate based on the destination token amount in its smallest unit (e.g., "1000000000" for 1000 USDC). ### Request Example ```json { "intent": { "fromAmount": "2500000000000000000" } } ``` ### Response #### Success Response (200) - **quote** (object) - Details of the quote. - **fromAmount** (string) - The calculated amount of the source token. - **toAmount** (string) - The calculated amount of the destination token. - **estimatedFees** (string) - Estimated fees for the transaction. - **exchangeRate** (string) - The current exchange rate. #### Response Example ```json { "quote": { "fromAmount": "2500000000000000000", "toAmount": "2450000000000000000", "estimatedFees": "5000000000000000", "exchangeRate": "0.98" } } ``` ### Headers - `x-client-id` (string) - Required - Your project's client ID. - `x-signature` (string) - Required - HMAC-SHA256 signature derived from your client secret. - `Content-Type` (string) - Required - `application/json` ``` -------------------------------- ### Querying API Documentation Source: https://docs.orda.network/api-reference/api-reference/models Instructions on how to dynamically query the API documentation using the `ask` query parameter. ```APIDOC ## Agent Instructions: Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question. Perform an HTTP GET request on the current page URL with the `ask` query parameter: ``` GET https://docs.orda.network/api-reference/api-reference/models.md?ask= ``` The question should be specific, self-contained, and written in natural language. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. ``` -------------------------------- ### Get Off-Ramp Status Source: https://docs.orda.network/api-reference/api-reference/crypto-to-fiat Retrieve the current status of a crypto-to-fiat transaction. Requires authentication via HMAC signatures. ```APIDOC ## GET /offramp/status ### Description Check the status of a crypto-to-fiat transaction. **Status Values:** - `pending`: The order has been created but crypto deposit has not been received yet - `processing`: The crypto has been received and fiat conversion is in process - `completed`: The fiat has been successfully sent to the recipient's bank account - `failed`: The transaction failed - `refunded`: The transaction was refunded ### Method GET ### Endpoint https://api.orda.network/v1/offramp/status ### Parameters #### Query Parameters - **transactionId** (string) - Required - Reference ID of the off-ramp transaction #### Headers - **x-client-id** (string) - Required - Your project's client ID - **x-signature** (string) - Required - HMAC-SHA256 signature derived from your client secret - **x-timestamp** (string) - Optional - Unix timestamp in milliseconds for replay protection (recommended) ### Responses #### Success Response (200) - **id** (string) - Transaction ID - **status** (string) - Current status of the transaction (`pending`, `processing`, `completed`, `failed`, `refunded`) - **createdAt** (string) - Timestamp when the transaction was created - **updatedAt** (string) - Timestamp when the transaction was last updated - **depositAddress** (string) - The address where the crypto was deposited - **depositAmount** (string) - The amount of crypto deposited - **depositTxHash** (string) - The transaction hash of the crypto deposit - **withdrawalAmount** (string) - The amount of fiat to be withdrawn - **withdrawalDetails** (object) - Details of the fiat withdrawal #### Error Responses - **400 Bad Request**: Missing reference ID. - **401 Unauthorized**: Missing or invalid API key. - **404 Not Found**: Transaction not found. - **429 Too Many Requests**: Rate limit exceeded. - **500 Internal Server Error**: Server error. ``` -------------------------------- ### On-ramp/Off-ramp Status Request Source: https://docs.orda.network/developers/guides/postman-workspace Example endpoint for tracking fiat operations (PIX to crypto on-ramp, crypto to PIX off-ramp) using the `pix_quote_id`. ```http /v1/onramp/status ``` -------------------------------- ### useTransaction Source: https://docs.orda.network/developers/widget/widget-reference Hook to monitor transaction status. It provides transaction status, loading and error states, and functions to get status and wait for completion. ```APIDOC ## `useTransaction` ### Description Monitor transaction status. ### Return Value ```typescript function useTransaction(): UseTransactionReturn; interface UseTransactionReturn { status: TransactionStatusResponse | null; isLoading: boolean; error: Error | null; getStatus: (params: TransactionStatusParams) => Promise; waitForCompletion: (txId: string, options?: PollingOptions) => Promise; clearStatus: () => void; } ``` ``` -------------------------------- ### OrdaProvider Source: https://docs.orda.network/developers/widget/widget-reference The main provider component that wraps your application. It requires configuration including a method to get authentication tokens and app kit configuration. ```APIDOC ## `OrdaProvider` ### Description Main provider component that wraps your application. ### Props ```typescript interface OrdaProviderProps { config: OrdaProviderConfig; children: React.ReactNode; } interface OrdaProviderConfig { getToken: () => Promise; appKitConfig: AppKitConfig; debug?: boolean; } ``` ``` -------------------------------- ### Initialize Orda SDK and Create Recipient Source: https://docs.orda.network/developers/quickstart Initialize the Orda SDK with your client ID and secret. Then, create a recipient, optionally generating a smart wallet address automatically. ```typescript import { OrdaSDK } from '@ordanetwork/sdk'; const orda = new OrdaSDK({ clientId: 'your-client-id', clientSecret: 'your-client-secret', // Never expose your clientSecret in frontend code }); // Create a recipient with a smart wallet const recipient = await orda.recipients.create({ name: 'Test Recipient', cryptoSettlementDetails: { toChain: '8453', toToken: '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913', // omit toAddress → auto-generates smart wallet } }); console.log('Smart wallet:', recipient.smartWallet?.address); ``` -------------------------------- ### Next.js Pages Router: _app.tsx Setup Source: https://docs.orda.network/developers/widget/frameworks Wrap your Next.js Pages Router application with the OrdaProvider in _app.tsx. Ensure SDK styles are imported. ```typescript import type { AppProps } from 'next/app'; import '@ordanetwork/sdk/react/styles.css'; import { Providers } from '../components/Providers'; export default function App({ Component, pageProps }: AppProps) { return ( ); } ``` -------------------------------- ### Initialize Orda SDK Source: https://docs.orda.network/developers/sdk/getting-started Initialize the Orda SDK with your client ID and client secret. It is recommended to use environment variables for security. ```typescript import { OrdaSDK } from '@ordanetwork/sdk'; const orda = new OrdaSDK({ clientId: process.env.ORDA_CLIENT_ID, clientSecret: process.env.ORDA_CLIENT_SECRET }); ``` -------------------------------- ### HMAC-SHA256 Calculation Source: https://docs.orda.network/api-reference/api-reference/authentication/signature-generation Calculates the signature using HMAC-SHA256. For GET or requests without a body, use the canonical empty object string "{}". ```text signature = HMAC-SHA256(canonical_body, client_secret) ```