{"id":23676048,"url":"https://github.com/blockboltprotocol/boltpay-sui-wallet","last_synced_at":"2026-02-08T09:31:04.301Z","repository":{"id":210654762,"uuid":"727092882","full_name":"BlockBoltProtocol/boltpay-sui-wallet","owner":"BlockBoltProtocol","description":"Boltpay SDK allows secure payments in Sui wallet app with QR code scanning and payment request interpretation features. It handles transactions on Sui chain and ensures safe delivery to merchant's wallet.","archived":false,"fork":false,"pushed_at":"2025-02-05T14:32:06.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-01T09:17:29.672Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://blockbolt.io","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BlockBoltProtocol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-04T07:02:18.000Z","updated_at":"2025-02-05T14:32:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"430a08d4-270d-4d05-a566-96b24708145e","html_url":"https://github.com/BlockBoltProtocol/boltpay-sui-wallet","commit_stats":{"total_commits":25,"total_committers":2,"mean_commits":12.5,"dds":0.28,"last_synced_commit":"4c7c30fa4d18ab531246dd564d0a564b56c3df9f"},"previous_names":["blockboltprotocol/boltpay-sui-wallet"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BlockBoltProtocol/boltpay-sui-wallet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlockBoltProtocol%2Fboltpay-sui-wallet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlockBoltProtocol%2Fboltpay-sui-wallet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlockBoltProtocol%2Fboltpay-sui-wallet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlockBoltProtocol%2Fboltpay-sui-wallet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BlockBoltProtocol","download_url":"https://codeload.github.com/BlockBoltProtocol/boltpay-sui-wallet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlockBoltProtocol%2Fboltpay-sui-wallet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273234186,"owners_count":25068945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-29T14:41:15.816Z","updated_at":"2026-02-08T09:31:04.271Z","avatar_url":"https://github.com/BlockBoltProtocol.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BlockBolt SDK\n\nThe BlockBolt SDK for the Sui Wallet App offers a highly beneficial and smoothly integrated feature set for Sui chain transactions. It provides a user-friendly and secure way for users to execute payments. The key features of this SDK include QR code scanning and payment request interpretation, allowing users to confirm payments effortlessly within their Sui wallet app. By handling transactions on the Sui chain, the BlockBolt SDK ensures safe and reliable delivery of payments to the merchant's wallet.\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Dependencies](#dependencies)\n- [Supported Coins](#supported-coins)\n- [Usage](#usage)\n  - [Initializing the SDK](#initializing-the-sdk)\n  - [Sending a Transaction](#sending-a-transaction)\n- [API Reference](#api-reference)\n- [Error Handling](#error-handling)\n- [Examples](#examples)\n\u003c!-- - [Contributing](#contributing) --\u003e\n- [License](#license)\n\n## Installation\n\nInstall the BlockBolt SDK using npm:\n\n```bash\nnpm install @blockbolt/boltpay-wallet\n```\n\nOr using yarn:\n\n```bash\nyarn add @blockbolt/boltpay-wallet\n```\n\n## Dependencies\n\nBlockBolt SDK requires the `@mysten/sui` package as a peer dependency. Make sure to install it alongside the SDK:\n\n```bash\nnpm install @mysten/sui\n```\n\nOr using yarn:\n\n```bash\nyarn add @mysten/sui\n```\n\n## Supported Coins\n\nBlockBolt SDK currently supports the following coins:\n\n| Coin Name | Symbol | Decimals | Coin Type |\n|-----------|--------|----------|-----------|\n| USD Coin | USDC | 6 | 0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN |\n| Tether | USDT | 6 | 0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c::coin::COIN |\n| SCA Token | SCA | 9 | 0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6::sca::SCA |\n| Sacabum | SCB | 5 | 0x9a5502414b5d51d01c8b5641db7436d789fa15a245694b24aa37c25c2a6ce001::scb::SCB |\n| Buck USD | BUCK | 9 | 0xce7ff77a83ea0cb6fd39bd8748e2ec89a3f41e8efdc3f4eb123e0ca37b184db2::buck::BUCK |\n| Turbos | TURBOS | 9 | 0x5d1f47ea69bb0de31c313d7acf89b890dbb8991ea8e03c6c355171f84bb1ba4a::turbos::TURBOS |\n| FlowX | FLX | 8 | 0x6dae8ca14311574fdfe555524ea48558e3d1360d1607d1c7f98af867e3b7976c::flx::FLX |\n| NavX | NAVX | 9 | 0xa99b8952d4f7d947ea77fe0ecdcc9e5fc0bcab2841d6e2a5aa00c3044e5544b5::navx::NAVX |\n| FUD Token | FUD | 5 | 0x76cb819b01abed502bee8a702b4c2d547532c12f25001c9dea795a5e631c26f1::fud::FUD |\n\n\n\n## Usage\n\n### Initializing the SDK\n\nFirst, import and initialize the BlockBolt SDK:\n\n```javascript\nimport { BlockBolt } from '@blockbolt/boltpay-wallet';\nimport { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';\n\nconst sdk = new BlockBolt();\n```\n\n### Preparing the Keypair\n\nYou'll need to prepare your keypair separately. This can be done using the Mysten Sui SDK or package. Please refer to the official Sui documentation for the most current methods of keypair generation and management.\nThe Sui SDK provides various ways to create and manage keypairs, including deriving them from mnemonics, private keys, or other sources. Ensure you're using the latest version of the Sui SDK and follow their best practices for secure key management.\n\n### Sending a Transaction\n\nTo send a transaction, use the `send` method. Most of the transaction details will be obtained by scanning a QR code:\n\n```javascript\n// Assume `qrCodeData` is the object obtained from scanning the QR code\nconst qrCodeData = {\n    receiverAddr: \"0xa2a0c531c0aecf0e96f2834e846422eb49e77fb50410cb9f09c797ba902ce752\",\n    nameProduct: 'Coffee',\n    amount: 1000000000, // 1 SUI (9 decimal places)\n    coinType: \"0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI\",\n    randomId: \"123456789\" // This will be a string in the QR code\n    senderAddr: \"0x9d655392521726d0eb26915670f7a37fe78b6fe001d133280ddaf57e4428aae1\" // Optional\n\n};\n\ntry {\n    const result = await sdk.send({\n        keyPair, // This is prepared separately and not part of the QR code data\n        ...qrCodeData,\n        randomId: BigInt(qrCodeData.randomId) // Convert the string to BigInt\n    });\n\n    console.log('Transaction result:', result.digest);\n    \n    if (result.effects?.status.status === \"success\") {\n        console.log('Transaction successful');\n    } else {\n        console.log('Transaction failed:', result.effects?.status.error);\n    }\n} catch (error) {\n    console.error('Transaction failed:', error);\n}\n```\nNote: \n- The `keyPair` is not included in the QR code data for security reasons. It should be managed securely within your application. \n- The `senderAddr` is an optional field. If provided, it specifies that only this address can send the transaction. If not provided, anyone can pay.\n- All other transaction details are obtained from the QR code scan.\n\nThe QR code will contain a JSON object with the necessary transaction details. Your application should parse this JSON and use it to populate the `send` method parameters.\n\n\n## API Reference\n\n### `BlockBolt.send(params)`\n\nSends a transaction on the Sui network.\n\nParameters:\n- `params.keyPair`: The Ed25519Keypair derived from the mnemonic phrase\n- `params.receiverAddr`: The recipient's address\n- `params.nameProduct`: Name or description of the product/service\n- `params.amount`: Amount to send (in the smallest unit of the coin)\n- `params.coinType`: The type of coin to send (use the full coin type string)\n- `params.randomId`: A random BigInt for transaction uniqueness\n- `params.senderAddr (optional)`: : The sender's address. If provided, only this address can send the transaction\n\nReturns: A promise that resolves to the transaction result.\n\n## Error Handling\n\nThe SDK uses custom error types for different scenarios. Always wrap your SDK calls in a try-catch block:\n\n```javascript\ntry {\n    const result = await sdk.send(/* ... */);\n    // Handle successful transaction\n} catch (error) {\n    if (error instanceof TreasuryError) {\n        console.error('Treasury error:', error.message, 'Coin type:', error.coinType);\n    } else {\n        console.error('Transaction failed:', error);\n    }\n}\n```\n\n## Examples\n\nHere's a complete example of using the BlockBolt SDK:\n\n```typescript\nimport { BlockBolt } from '@blockbolt/boltpay-wallet';\nimport { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';\n\nconst sdk = new BlockBolt();\n\n// Prepare keypair using sui SDK or Package (in practice, handle this securely)\n\nconst generateRandomBigInt = () =\u003e BigInt(Math.floor(Math.random() * Number.MAX_SAFE_INTEGER));\n\nconst sendTransaction = async () =\u003e {\n    try {\n        const result = await sdk.send({\n            keyPair,\n            receiverAddr: \"0xa2a0c531c0aecf0e96f2834e846422eb49e77fb50410cb9f09c797ba902ce752\",\n            nameProduct: 'Coffee',\n            amount: 1000000000, // 1 SUI (assuming 9 decimal places)\n            coinType: \"0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI\",\n            randomId: generateRandomBigInt(),\n            senderAddr: \"0x9d655392521726d0eb26915670f7a37fe78b6fe001d133280ddaf57e4428aae1\" // Optional\n        });\n        \n        console.log('Transaction result:', result.digest);\n        \n        if (result.effects?.status.status === \"success\") {\n            console.log('Transaction successful');\n        } else {\n            console.log('Transaction failed:', result.effects?.status.error);\n        }\n    } catch (error) {\n        console.error('Transaction failed:', error);\n    }\n};\n\n```\n\nThis example demonstrates:\n\nImporting and initializing the SDK\nPreparing a keypair (ensure secure handling in production)\nSending a transaction with required parameters, including the optional senderAddr\nHandling the transaction result and potential errors\n\nNote: In a real-world scenario, many of these parameters would typically come from user input or a QR code scan.\n\n## Best Practices\nSecurity: Avoid hardcoding sensitive information like seed phrases. Always retrieve them from a secure and encrypted source. Key Management: Especially in client-side applications, use pre-derived signer for enhanced security. Additional Information: Make sure to replace placeholders in the code examples with actual data from your application.\n\nDisclaimer: Please note that the BlockBolt protocol relies solely on blockchain verification for payment confirmation and process.\n\nDo you encounter any issues or require assistance? Kindly send us an email at support@blockbolt.io or submit a support ticket on our Discord server [Discord](https://discord.gg/Fb8CA6ny67). We are happy to help you.\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblockboltprotocol%2Fboltpay-sui-wallet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblockboltprotocol%2Fboltpay-sui-wallet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblockboltprotocol%2Fboltpay-sui-wallet/lists"}