{"id":28156035,"url":"https://github.com/terra-money/bridge-sdk","last_synced_at":"2025-05-15T07:17:28.452Z","repository":{"id":61051221,"uuid":"523254719","full_name":"terra-money/bridge-sdk","owner":"terra-money","description":"Javascript Terra Bridge SDK","archived":false,"fork":false,"pushed_at":"2023-08-29T15:26:26.000Z","size":2796,"stargazers_count":8,"open_issues_count":5,"forks_count":9,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-05-07T22:17:59.371Z","etag":null,"topics":["axelar","blockchain","cosmos","ibc","keplr","ledger","metamask","npm","osmosis","station","terra","typescript","wormhole"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@terra-money/bridge-sdk","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/terra-money.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-10T08:04:47.000Z","updated_at":"2024-07-30T16:14:42.000Z","dependencies_parsed_at":"2023-02-08T09:46:54.131Z","dependency_job_id":null,"html_url":"https://github.com/terra-money/bridge-sdk","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terra-money%2Fbridge-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terra-money%2Fbridge-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terra-money%2Fbridge-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terra-money%2Fbridge-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/terra-money","download_url":"https://codeload.github.com/terra-money/bridge-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254292085,"owners_count":22046428,"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":["axelar","blockchain","cosmos","ibc","keplr","ledger","metamask","npm","osmosis","station","terra","typescript","wormhole"],"created_at":"2025-05-15T07:15:10.944Z","updated_at":"2025-05-15T07:17:28.436Z","avatar_url":"https://github.com/terra-money.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bridge SDK\n\n## Basic usage\n\nInstall from npm:\n```bash\nnpm i @terra-money/bridge-sdk\n```\n\nConnect station:\n```js\nimport { StationWallet, ChainType, BridgeType, isValidAddress } from '@terra-money/bridge-sdk'\n\nconst wallet = new StationWallet()\n\nif (!wallet.isSupported()) {\n  console.log(\n    `${wallet.description.name} is not supported on your device, please try from a different wallet.`,\n  )\n} else if (!wallet.isInstalled()) {\n  console.log(`You can install ${wallet.description.name} here: ${wallet.description.installLink}`)\n}\n\nwallet\n  .connect(ChainType.terra)\n  .then(({ address }) =\u003e console.log(address))\n```\n\n\u003e If you are using `TerraLedgerWallet` you can specify more options on the connect function, to select a custom derivation index (default is 0) and to use bluetooth (default is USB)\n \n\nGet the balance (wallet must be already connected):\n```js\nwallet\n  .getBalance('uluna')\n  .then((res) =\u003e {\n    res.success\n      ? console.log(`Balance: ${res.data} uluna`)\n      : console.log(`Error: ${res.error}`\n  })\n```\n\nSend tx from station (wallet must be already connected):\n\n```js\nconst destinationAddress = 'osmo1...'\n\n// validate destination address\nif(!isValidAddress(destinationAddress, ChainType.osmosis)) {\n  console.log('Error: invalid address')\n  return\n}\n\n// transfer\nwallet\n  .transfer({\n    src: ChainType.terra,\n    dst: ChainType.osmosis,\n    bridge: BridgeType.ibc,\n    address: destinationAddress,\n    coin: {\n      amount: 100_000,\n      denom: 'uluna',\n    },\n  })\n  .then((res) =\u003e {\n    res.success\n      ? console.log(`TX hash: ${res.txhash}`)\n      : console.log(`Error: ${res.error}`\n  })\n```\n\n\u003e You can use the same functions on the `TerraLedgerWallet`,`KeplrWallet` and `MetaMaskWallet` to send a tx from those wallets\n\u003e \n\u003e You can find more info about the available functions on the [Wallet inteface](/src/wallets/Wallet.ts#25)\n\n\n\n## Coming soon\n\n- More IBC chains\n\n- Support for wormhole\n\n- Other wallets: (Station mobile, Coinbase wallet, BSC, WalletConnect, Keplr Mobile)\n\n- Function `estimateBridgeFee()` to calculate the fee that the user will pay on the transfer.\n\n- Function `waitForTx()`to wait until the tx is confirmed on-chain.\n\n- Functions `onAccountChange()` and `onNetworkChange()` to trigger actions when the user switch account or networ.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterra-money%2Fbridge-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterra-money%2Fbridge-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterra-money%2Fbridge-sdk/lists"}