{"id":50342522,"url":"https://github.com/BitteProtocol/near-ca","last_synced_at":"2026-06-15T09:01:05.013Z","repository":{"id":227280455,"uuid":"770890014","full_name":"BitteProtocol/near-ca","owner":"BitteProtocol","description":"An SDK for controlling Ethereum EOAs from a Near Account","archived":false,"fork":false,"pushed_at":"2025-11-02T11:30:43.000Z","size":1083,"stargazers_count":23,"open_issues_count":2,"forks_count":16,"subscribers_count":6,"default_branch":"main","last_synced_at":"2026-04-26T18:26:00.568Z","etag":null,"topics":["ethereum","near","sdk"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/near-ca","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/BitteProtocol.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-03-12T10:44:03.000Z","updated_at":"2025-11-18T12:45:51.000Z","dependencies_parsed_at":"2024-03-23T12:42:57.417Z","dependency_job_id":"dc09cea4-cde8-4c3c-91b4-31ba390df52b","html_url":"https://github.com/BitteProtocol/near-ca","commit_stats":null,"previous_names":["mintbase/near-ca","bitteprotocol/near-ca"],"tags_count":88,"template":false,"template_full_name":null,"purl":"pkg:github/BitteProtocol/near-ca","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BitteProtocol%2Fnear-ca","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BitteProtocol%2Fnear-ca/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BitteProtocol%2Fnear-ca/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BitteProtocol%2Fnear-ca/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BitteProtocol","download_url":"https://codeload.github.com/BitteProtocol/near-ca/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BitteProtocol%2Fnear-ca/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34355156,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"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":["ethereum","near","sdk"],"created_at":"2026-05-29T18:00:25.258Z","updated_at":"2026-06-15T09:01:05.003Z","avatar_url":"https://github.com/BitteProtocol.png","language":"TypeScript","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# NEAR Chain Abstraction Layer (NEAR-CA)\n\nNEAR-CA is a TypeScript library designed to provide an abstraction layer for interacting with the NEAR blockchain, simplifying the process of performing transactions and managing accounts on both NEAR and Ethereum chains. This library is intended for use in server-side applications only.\n\n## Features\n\n- EVM Account Derivation from NEAR blockchain.\n- Transaction signing and sending on the Ethereum blockchain.\n- Key derivation functions for cryptographic operations.\n- Support for EIP-1559 transactions on Ethereum.\n- Wallet Connect intergration tools.\n\n### Usage\n\n## CLI\n\nFor Ethereum, you can derive addresses, create payloads for transactions, and send signed transactions.\n\nFor more detailed usage examples, see the [Examples README](./examples/README.md).\n\n## Integrations\n\n[near-safe](https://github.com/BitteProtocol/near-safe) extends this tool kit by using the EOA as an owner of an ERC-4337 [Safe](https://safe.global/) account.\n\n## Frontend/UI\n\nInstall near-ca, run the following command:\n\n```bash\nyarn add near-ca\n```\n\n### Example: Setup NearEthAdapter and Send ETH\n\nHere's an example of how to set up the `NearEthAdapter` and send ETH:\n\n```typescript\nimport dotenv from \"dotenv\";\nimport {\n  broadcastSignedTransaction,\n  convertToAction,\n  isRlpHex,\n  setupAdapter,\n  signatureFromOutcome,\n} from \"near-ca\";\n\ndotenv.config();\nconst { NEAR_ACCOUNT_ID, NEAR_ACCOUNT_PRIVATE_KEY } = process.env;\n\nconst adapter = await setupAdapter({\n  accountId: NEAR_ACCOUNT_ID!,\n  mpcContractId: MPC_CONTRACT_ID!,\n  // privateKey: NEAR_ACCOUNT_PRIVATE_KEY!, // Optional depending on setup\n});\n\nconst {\n  evmMessage,\n  nearPayload: { receiverId, actions },\n} = await evm.encodeSignRequest({\n  method: \"eth_sendTransaction\",\n  chainId: 11_155_111, // Sepolia\n  params: [\n    {\n      from: evm.address,\n      to: \"0xdeADBeeF0000000000000000000000000b00B1e5\",\n      value: \"0x01\", // 1 WEI\n      // data: \"0x\", // Optional\n    },\n  ],\n});\nconsole.log(`Requesting Signature for ${evmMessage}`);\n// Using your near Account, send the nearPaylod as signature request:\nconst nearAccount = adapter.nearAccount();\n//\nconst outtcome = await nearAccount.signAndSendTransaction({\n  receiverId,\n  actions: actions.map((a) =\u003e convertToAction(a)),\n});\nconst signature = signatureFromOutcome(outtcome);\nconsole.log(\"Signature aquired!\");\nif (isRlpHex(evmMessage)) {\n  // This will be true for what we built above.\n  broadcastSignedTransaction({ transaction: evmMessage, signature });\n} else {\n  // Use Signature for whatever else.\n}\n```\n\n### Other Examples (CLI)\n\nThese examples require Private Key to be supplied:\n\nEach of the following scripts can be run with\n\n```bash\nnpx tsx examples/*.ts\n```\n\n1. [(Basic) Send ETH](./examples/send-eth.ts)\n2. **WETH**\n   - [Deposit (aka wrap-ETH)](./examples/weth/wrap.ts)\n   - [Withdraw (aka unwrap-ETH)](./examples/weth/wrap.ts)\n3. [Transfer ERC721](./examples/nft/erc721/transfer.ts)\n4. [(Advanced) Buy NFT On Opensea](./examples/opensea.ts)\n\n## Configuration\n\nBefore using NEAR-CA, ensure you have the following environment variables set in your `.env` file:\n\n- `NEAR_ACCOUNT_ID`: Your NEAR account identifier.\n- `NEAR_ACCOUNT_PRIVATE_KEY`: Your NEAR account private key.\n- `MPC_CONTRACT_ID`: The NEAR contract that handles multichain operations.\n- `NETWORK`: Either `near` or `testnet`.\n\nCopy the `.env.example` file and add these values to the `.env` file.\n\nSteps to get your `NEAR_ACCOUNT_ID` and `NEAR_ACCOUNT_PRIVATE_KEY`:\n\n1. Create a Near wallet address, super easy, here: https://wallet.bitte.ai/\n2. Your `XYZ.near` is your `NEAR_ACCOUNT_ID`.\n3. [Visit Settings Page](https://wallet.bitte.ai/settings)\n4. Go to \"Security \u0026 Recovery\" -\u003e \"Export Account\".\n5. After the exporting is complete click on \"Private Key\" and copy it.\n6. Paste it to `NEAR_ACCOUNT_PRIVATE_KEY` in your `.env` file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBitteProtocol%2Fnear-ca","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBitteProtocol%2Fnear-ca","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBitteProtocol%2Fnear-ca/lists"}