{"id":15294767,"url":"https://github.com/mrtnetwork/cosmos_sdk","last_synced_at":"2025-04-13T14:54:23.789Z","repository":{"id":230937690,"uuid":"780527480","full_name":"mrtnetwork/cosmos_sdk","owner":"mrtnetwork","description":"Experience effortless interaction with a Cosmos SDK-based network in Dart, facilitating the seamless creation, signing, and transmission of transactions. (Beta version)","archived":false,"fork":false,"pushed_at":"2025-04-11T18:01:52.000Z","size":4929,"stargazers_count":9,"open_issues_count":3,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T14:54:15.402Z","etag":null,"topics":["atom","cosmos-hub","cosmos-sdk","dart","flutter","ibc","interchain","tendermint","transaction","wallet"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrtnetwork.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2024-04-01T17:05:20.000Z","updated_at":"2025-04-11T18:01:56.000Z","dependencies_parsed_at":"2024-08-18T18:54:30.962Z","dependency_job_id":null,"html_url":"https://github.com/mrtnetwork/cosmos_sdk","commit_stats":null,"previous_names":["mrtnetwork/cosmos_sdk"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrtnetwork%2Fcosmos_sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrtnetwork%2Fcosmos_sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrtnetwork%2Fcosmos_sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrtnetwork%2Fcosmos_sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrtnetwork","download_url":"https://codeload.github.com/mrtnetwork/cosmos_sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248732512,"owners_count":21152851,"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","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":["atom","cosmos-hub","cosmos-sdk","dart","flutter","ibc","interchain","tendermint","transaction","wallet"],"created_at":"2024-09-30T17:06:48.967Z","updated_at":"2025-04-13T14:54:23.763Z","avatar_url":"https://github.com/mrtnetwork.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dart Cosmos-sdk\n\nExperience effortless interaction with a Cosmos SDK-based network in Dart, facilitating the seamless creation, signing, and transmission of transactions. (Beta version)\n\n*** This version is in beta and requires comprehensive testing for each model implementation. ****\n\n## Supported Protocol Buffer packages\n\n- cosmos.auth.v1beta1\n- cosmos.authz.v1beta1\n- cosmos.bank.v1beta1\n- cosmos.base.abci.v1beta1\n- cosmos.base.node.v1beta1\n- cosmos.base.query.v1beta1\n- cosmos.base.reflection.v1beta1\n- cosmos.base.tendermint.v1beta1\n- cosmos.base.v1beta1\n- cosmos.crisis.v1beta1\n- cosmos.crypto.ed25519\n- cosmos.crypto.multisig.v1beta1\n- cosmos.crypto.secp256k1\n- cosmos.crypto.secp256r1\n- cosmos.distribution.v1beta1\n- cosmos.feegrant.v1beta1\n- cosmos.genutil.v1beta1\n- cosmos.gov.v1beta1\n- cosmos.mint.v1beta1\n- cosmos.nft.v1beta1\n- cosmos.params.v1beta1\n- cosmos.slashing.v1beta1\n- cosmos.staking.v1beta1\n- cosmos.tx.signing.v1beta1\n- cosmos.tx.v1beta1\n- cosmos.upgrade.module.v1\n- cosmos.upgrade.v1beta1\n- cosmos.vesting.v1beta1\n- cosmos.ics23.v1\n- capability.v1\n- ibc.applications.fee.v1\n- ibc.applications.interchain_accounts.controller.v1\n- ibc.applications.interchain_accounts.genesis.v1\n- ibc.applications.interchain_accounts.host.v1\n- ibc.applications.interchain_accounts.v1\n- ibc.applications.transfer.v1\n- ibc.applications.transfer.v2\n- ibc.core.channel.v1\n- ibc.core.client.v1\n- ibc.core.commitment.v1\n- ibc.core.connection.v1\n- ibc.core.types.v1\n- ibc.lightclients.localhost.v2\n- ibc.lightclients.solomachine.v2\n- ibc.lightclients.solomachine.v3\n- ibc.lightclients.tendermint.v1\n- ibc.lightclients.wasm.v1\n- tendermint/tendermint\n\n## Example\n\n### Transaction\n\n Create and sign transactions related to the Cosmos Hub.\n\n```dart\n\n  /// Generating BIP39 seed from mnemonic phrase\n  final seedBytes = Bip39SeedGenerator(Mnemonic.fromString(\n          \"this dove indoor skin shed gap east welcome gift buffalo silent high\"))\n      .generate();\n\n  /// Deriving hierarchical deterministic (HD) wallet using BIP44\n  final bip44 = Bip44.fromSeed(seedBytes, Bip44Coins.cosmos).deriveDefaultPath;\n  final pubkey = CosmosSecp256K1PublicKey.fromBytes(bip44.publicKey.compressed);\n  final privateKey = CosmosSecp256K1PrivateKey.fromBytes(bip44.privateKey.raw);\n\n// Initializing provider to interact with Tendermint node of Theta testnet\n  final provider = TendermintProvider(TendermintHTTPProvider(\n      url: \"https://rpc.sentry-02.theta-testnet.polypore.xyz\"));\n\n  /// Querying account info from the blockchain\n  final accountInfo = await provider.request(TendermintRequestAbciQuery(\n      request: QueryAccountInfoRequest(pubkey.toAddress())));\n\n  /// Querying the latest block information\n  final latestBlock = await provider.request(\n      TendermintRequestAbciQuery(request: const GetLatestBlockRequest()));\n\n  /// Creating authentication info for transaction\n  final authInfo = AuthInfo(\n      signerInfos: [\n        SignerInfo(\n            publicKey: pubkey,\n            modeInfo: const ModeInfo(ModeInfoSignle(SignMode.signModeDirect)),\n            sequence: accountInfo.info.sequence)\n      ],\n      fee: Fee(amount: [\n        Coin(\n          denom: \"uatom\",\n          amount: BigInt.from(1000),\n        )\n      ], gasLimit: BigInt.from(200000)));\n\n  /// Creating a transaction message to send tokens\n  final message = MsgSend(\n      fromAddress: pubkey.toAddress(),\n      toAddress: CosmosBaseAddress(\"cosmos1qhslf0sx2fegltfqq0p5j6etmdznjgfnm2j6nc\"),\n      amount: [Coin(denom: \"uatom\", amount: BigInt.from(1000000))]);\n\n  /// Creating transaction body with the message\n  final txbody = TXBody(messages: [message]);\n\n  /// Creating a signable document for the transaction\n  final SignDoc signDoc = SignDoc(\n      bodyBytes: txbody.toBuffer(),\n      authInfoBytes: authInfo.toBuffer(),\n      chainId: latestBlock.block!.header.chainId!,\n      accountNumber: accountInfo.info.accountNumber);\n\n  /// Signing the document with the private key\n  final sign = privateKey.sign(signDoc.toBuffer());\n\n  /// Creating a raw transaction with body, authentication info, and signature\n  final txRaw = TxRaw(\n      bodyBytes: txbody.toBuffer(),\n      authInfoBytes: authInfo.toBuffer(),\n      signatures: [sign]);\n\n  /// Broadcasting the raw transaction to the network\n  await provider.request(TendermintRequestBroadcastTxCommit(\n      BytesUtils.toHexString(txRaw.toBuffer(), prefix: \"0x\")));\n\n ```\n\n### Address and key managment\n  \n  Support for Secp256k1, ED25519 and NIST P-256 keys.\n\n```dart\n\n  /// Generate seed bytes from a mnemonic\n  final seedBytes = Bip39SeedGenerator(Mnemonic.fromString(\n          \"this dove indoor skin shed gap east welcome gift buffalo silent high\"))on\n      .generate();\n\n  /// Derive BIP44 path\n  final bip44 = Bip44.fromSeed(seedBytes, Bip44Coins.cosmos).deriveDefaultPath;\n\n  /// Create a Cosmos Secp256k1 private key from the derived private key bytes\n  final privateKey = CosmosSecp256K1PrivateKey.fromBytes(bip44.privateKey.raw);\n\n  /// Generate the corresponding public key and address for Secp256k1\n  final pubkey = CosmosSecp256K1PublicKey.fromBytes(bip44.publicKey.compressed);\n  final cosmosAddress = pubkey.toAddress(hrp: \"cosmos\");\n\n  /// Sign the provided digest using the Secp256k1 private key\n  final sign = privateKey.sign(digest);\n\n  /// Create a Cosmos ED25519 private key from the provided key bytes\n  final ed25519PrivateKey = CosmosED25519PrivateKey.fromBytes(keyBytes);\n\n  /// Generate the corresponding public key and address for ED25519\n  final edPublicKey = ed25519PrivateKey.toPublicKey();\n  final validatorAddr = edPublicKey.toAddress(hrp: \"cosmosvaloper\");\n\n  /// Sign the provided digest using the ED25519 private key\n  final edSign = ed25519PrivateKey.sign(digest);\n\n  /// Create a Cosmos NIST P-256 private key from the provided key bytes\n  final nistPrivateKey = CosmosNist256p1PrivateKey.fromBytes(keyBytes);\n\n  /// Generate the corresponding public key and base address for NIST P-256\n  final nistPublicKey = nistPrivateKey.toPublicKey();\n  final baseAddress = nistPublicKey.toAddress();\n\n  /// Sign the provided digest using the NIST P-256 private key\n  final nistSign = nistPrivateKey.sign(digest);\n\n  ```\n\n### JSON-RPC\n\n  Support Tendermint RPC.\n\n```dart\n\n  /// Define a Tendermint provider with a HTTP URL\n  final provider = TendermintProvider(TendermintHTTPProvider(\n      url: \"https://rpc.sentry-02.theta-testnet.polypore.xyz\"));\n\n  /// Query account information using the provider\n  final accountInfo = await provider.request(TendermintRequestAbciQuery(\n      request: QueryAccountInfoRequest(pubkey.toAddress())));\n\n  /// Get the latest block information using the provider\n  final latestBlock = await provider.request(\n      TendermintRequestAbciQuery(request: const GetLatestBlockRequest()));\n\n  /// Broadcast a transaction and wait for a commit using the provider\n  final transaction = await provider.request(TendermintRequestBroadcastTxCommit(\n      BytesUtils.toHexString(txRaw.toBuffer(), prefix: \"0x\")));\n\n```\n\n## Contributing\n\nContributions are welcome! Please follow these guidelines:\n\n- Fork the repository and create a new branch.\n- Make your changes and ensure tests pass.\n- Submit a pull request with a detailed description of your changes.\n\n## Feature requests and bugs\n\nPlease file feature requests and bugs in the issue tracker.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrtnetwork%2Fcosmos_sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrtnetwork%2Fcosmos_sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrtnetwork%2Fcosmos_sdk/lists"}