{"id":39983964,"url":"https://github.com/vansergen/gemini-node-api","last_synced_at":"2026-01-18T23:08:54.610Z","repository":{"id":34998400,"uuid":"192153985","full_name":"vansergen/gemini-node-api","owner":"vansergen","description":"Node.js library for Gemini","archived":false,"fork":false,"pushed_at":"2025-06-04T07:49:07.000Z","size":2587,"stargazers_count":17,"open_issues_count":2,"forks_count":4,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-19T16:31:28.716Z","etag":null,"topics":["api","crypto","cryptocurrency","cryptoexchange","gemini"],"latest_commit_sha":null,"homepage":"https://vansergen.github.io/gemini-node-api/","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/vansergen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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},"funding":{"custom":"https://commerce.coinbase.com/checkout/04a40393-21f0-44aa-b11b-726b67f08c5a"}},"created_at":"2019-06-16T05:31:31.000Z","updated_at":"2024-04-29T15:37:07.000Z","dependencies_parsed_at":"2023-09-25T02:47:59.634Z","dependency_job_id":"30d06d90-bcaa-40ab-a2aa-bb27c92aacca","html_url":"https://github.com/vansergen/gemini-node-api","commit_stats":{"total_commits":553,"total_committers":8,"mean_commits":69.125,"dds":"0.11754068716094035","last_synced_commit":"a6ea812302b9a05d4ed6ca0b42d20a443529bdb8"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"purl":"pkg:github/vansergen/gemini-node-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vansergen%2Fgemini-node-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vansergen%2Fgemini-node-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vansergen%2Fgemini-node-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vansergen%2Fgemini-node-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vansergen","download_url":"https://codeload.github.com/vansergen/gemini-node-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vansergen%2Fgemini-node-api/sbom","scorecard":{"id":916147,"data":{"date":"2025-08-11","repo":{"name":"github.com/vansergen/gemini-node-api","commit":"a6ea812302b9a05d4ed6ca0b42d20a443529bdb8"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/10 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":6,"reason":"dependency not pinned by hash detected -- score normalized to 6","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:55: update your workflow using https://app.stepsecurity.io/secureworkflow/vansergen/gemini-node-api/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/vansergen/gemini-node-api/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:74: update your workflow using https://app.stepsecurity.io/secureworkflow/vansergen/gemini-node-api/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:78: update your workflow using https://app.stepsecurity.io/secureworkflow/vansergen/gemini-node-api/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/vansergen/gemini-node-api/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/vansergen/gemini-node-api/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:47: update your workflow using https://app.stepsecurity.io/secureworkflow/vansergen/gemini-node-api/ci.yml/main?enable=pin","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   3 out of   3 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 25 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"18 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-h5c3-5r3r-rr8q","Warn: Project is vulnerable to: GHSA-rmvr-2pp2-xj38","Warn: Project is vulnerable to: GHSA-xx4v-prfh-6cgc","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-vp56-6g26-6827","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-f9xv-q969-pqx4"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T21:04:06.520Z","repository_id":34998400,"created_at":"2025-08-24T21:04:06.520Z","updated_at":"2025-08-24T21:04:06.520Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28553072,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T20:59:07.572Z","status":"ssl_error","status_checked_at":"2026-01-18T20:59:02.799Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["api","crypto","cryptocurrency","cryptoexchange","gemini"],"created_at":"2026-01-18T23:08:53.812Z","updated_at":"2026-01-18T23:08:54.603Z","avatar_url":"https://github.com/vansergen.png","language":"TypeScript","funding_links":["https://commerce.coinbase.com/checkout/04a40393-21f0-44aa-b11b-726b67f08c5a"],"categories":[],"sub_categories":[],"readme":"# Gemini Node.js API ![CI Status](https://github.com/vansergen/gemini-node-api/workflows/CI/badge.svg) ![npm](https://img.shields.io/npm/v/gemini-node-api) [![Coverage Status](https://coveralls.io/repos/github/vansergen/gemini-node-api/badge.svg?branch=main)](https://coveralls.io/github/vansergen/gemini-node-api?branch=main) [![Known Vulnerabilities](https://snyk.io/test/github/vansergen/gemini-node-api/badge.svg)](https://snyk.io/test/github/vansergen/gemini-node-api) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) ![NPM license](https://img.shields.io/npm/l/gemini-node-api) ![node version](https://img.shields.io/node/v/gemini-node-api) ![npm downloads](https://img.shields.io/npm/dt/gemini-node-api) ![GitHub top language](https://img.shields.io/github/languages/top/vansergen/gemini-node-api)\n\nNode.js library for [Gemini](https://docs.gemini.com/).\n\n## Installation\n\n```bash\nnpm install gemini-node-api\n```\n\n## Usage\n\n### PublicClient\n\n```typescript\nimport { PublicClient } from \"gemini-node-api\";\nconst client = new PublicClient();\n```\n\n- [`getSymbols`](https://docs.gemini.com/rest-api/#symbols)\n\n```typescript\nconst symbols = await client.getSymbols();\n```\n\n- [`getSymbol`](https://docs.gemini.com/rest-api/#symbol-details)\n\n```typescript\nconst symbol = \"ZECLTC\";\nconst info = await client.getSymbol({ symbol });\n```\n\n- [`getTicker`](https://docs.gemini.com/rest-api/#ticker)\n\n```typescript\nconst symbol = \"zecltc\";\nconst ticker = await client.getTicker({ symbol });\n/**\n * for V2\n * @see https://docs.gemini.com/rest-api/#ticker-v2\n */\nconst v = \"v2\";\nconst tickerV2 = await client.getTicker({ symbol, v });\n```\n\n- [`getCandles`](https://docs.gemini.com/rest-api/#candles)\n\n```typescript\nconst symbol = \"zecltc\";\nconst time_frame = \"30m\";\nconst candles = await client.getCandles({ symbol, time_frame });\n```\n\n- [`getOrderBook`](https://docs.gemini.com/rest-api/#current-order-book)\n\n```typescript\nconst symbol = \"zecltc\";\nconst limit_bids = 25;\nconst limit_asks = 20;\nconst book = await client.getOrderBook({\n  symbol,\n  limit_bids,\n  limit_asks,\n});\n```\n\n- [`getTradeHistory`](https://docs.gemini.com/rest-api/#trade-history)\n\n```typescript\nconst symbol = \"zecltc\";\nconst timestamp = 1547146811;\nconst limit_trades = 100;\nconst include_breaks = true;\nconst trades = await client.getTradeHistory({\n  symbol,\n  timestamp,\n  limit_trades,\n  include_breaks,\n});\n```\n\n- [`getCurrentAuction`](https://docs.gemini.com/rest-api/#current-auction)\n\n```typescript\nconst symbol = \"zecltc\";\nconst auction = await client.getCurrentAuction({ symbol });\n```\n\n- [`getAuctionHistory`](https://docs.gemini.com/rest-api/#auction-history)\n\n```typescript\nconst symbol = \"zecltc\";\nconst timestamp = 1547146811;\nconst limit_auction_results = 100;\nconst include_indicative = true;\nconst history = await client.getAuctionHistory({\n  symbol,\n  timestamp,\n  limit_auction_results,\n  include_indicative,\n});\n```\n\n- [`getPriceFeed`](https://docs.gemini.com/rest-api/#price-feed)\n\n```typescript\nconst priceFeed = await client.getPriceFeed();\n```\n\n### AuthenticatedClient\n\n```typescript\nimport { AuthenticatedClient } from \"gemini-node-api\";\nconst key = \"gemini-api-key\";\nconst secret = \"gemini-api-secret\";\nconst client = new AuthenticatedClient({ key, secret });\n```\n\n- [`newOrder`](https://docs.gemini.com/rest-api/#new-order)\n\n```typescript\nconst symbol = \"zecltc\";\nconst client_order_id = \"d0c5340b-6d6c-49d9-b567-48c4bfca13d2\";\nconst amount = 1;\nconst price = 0.9;\nconst side = \"buy\";\nconst options = [\"maker-or-cancel\"];\nconst order = await client.newOrder({\n  symbol,\n  client_order_id,\n  amount,\n  price,\n  side,\n  options,\n});\n```\n\n- [`buy`](https://docs.gemini.com/rest-api/#new-order)\n\n```typescript\nconst symbol = \"zecltc\";\nconst amount = 1;\nconst price = 0.9;\nconst account = \"primary\";\nconst type = \"exchange limit\";\nconst order = await client.buy({ symbol, amount, price, account, type });\n```\n\n- [`sell`](https://docs.gemini.com/rest-api/#new-order)\n\n```typescript\nconst symbol = \"zecltc\";\nconst amount = 0.99;\nconst price = 0.99;\nconst stop_price = 1;\nconst type = \"exchange stop limit\";\nconst order = await client.sell({ symbol, amount, price, stop_price, type });\n```\n\n- [`cancelOrder`](https://docs.gemini.com/rest-api/#cancel-order)\n\n```typescript\nconst order_id = 106817811;\nconst account = \"primary\";\nconst order = await client.cancelOrder({ order_id, account });\n```\n\n- [`cancelSession`](https://docs.gemini.com/rest-api/#cancel-all-session-orders)\n\n```typescript\nconst account = \"primary\";\nconst response = await client.cancelSession({ account });\n```\n\n- [`cancelAll`](https://docs.gemini.com/rest-api/#cancel-all-active-orders)\n\n```typescript\nconst account = \"primary\";\nconst response = await client.cancelAll({ account });\n```\n\n- [`getOrderStatus`](https://docs.gemini.com/rest-api/#order-status)\n\n```typescript\nconst order_id = 44375901;\nconst account = \"primary\";\nconst include_trades = true;\nconst order = await client.getOrderStatus({\n  order_id,\n  account,\n  include_trades,\n});\n```\n\n- [`getActiveOrders`](https://docs.gemini.com/rest-api/#get-active-orders)\n\n```typescript\nconst account = \"primary\";\nconst orders = await client.getActiveOrders({ account });\n```\n\n- [`getPastTrades`](https://docs.gemini.com/rest-api/#get-past-trades)\n\n```typescript\nconst symbol = \"bcheth\";\nconst limit_trades = 10;\nconst timestamp = 1547232911;\nconst account = \"primary\";\nconst trades = await client.getPastTrades({\n  symbol,\n  limit_trades,\n  timestamp,\n  account,\n});\n```\n\n- [`getNotionalVolume`](https://docs.gemini.com/rest-api/#get-notional-volume)\n\n```typescript\nconst account = \"primary\";\nconst volume = await client.getNotionalVolume({ account });\n```\n\n- [`getTradeVolume`](https://docs.gemini.com/rest-api/#get-trade-volume)\n\n```typescript\nconst volume = await client.getTradeVolume();\n```\n\n- [`newClearingOrder`](https://docs.gemini.com/rest-api/#new-clearing-order)\n\n```typescript\nconst counterparty_id = \"OM9VNL1G\";\nconst expires_in_hrs = 24;\nconst symbol = \"btcusd\";\nconst amount = 100;\nconst price = 9500;\nconst side = \"buy\";\nconst order = await client.newClearingOrder({\n  counterparty_id,\n  expires_in_hrs,\n  symbol,\n  amount,\n  price,\n  side,\n});\n```\n\n- [`newBrokerOrder`](https://docs.gemini.com/rest-api/#new-broker-order)\n\n```typescript\nconst source_counterparty_id = \"R485E04Q\";\nconst target_counterparty_id = \"Z4929ZDY\";\nconst expires_in_hrs = 1;\nconst symbol = \"ethusd\";\nconst amount = 175;\nconst price = 200;\nconst side = \"sell\";\nconst order = await client.newBrokerOrder({\n  source_counterparty_id,\n  target_counterparty_id,\n  expires_in_hrs,\n  symbol,\n  amount,\n  price,\n  side,\n});\n```\n\n- [`getClearingOrderStatus`](https://docs.gemini.com/rest-api/#clearing-order-status)\n\n```typescript\nconst clearing_id = \"OM9VNL1G\";\nconst order = await client.getClearingOrderStatus({ clearing_id });\n```\n\n- [`cancelClearingOrder`](https://docs.gemini.com/rest-api/#cancel-clearing-order)\n\n```typescript\nconst clearing_id = \"OM9VNL1G\";\nconst order = await client.cancelClearingOrder({ clearing_id });\n```\n\n- [`confirmClearingOrder`](https://docs.gemini.com/rest-api/#confirm-clearing-order)\n\n```typescript\nconst clearing_id = \"OM9VNL1G\";\nconst symbol = \"btcusd\";\nconst amount = 100;\nconst price = 9500;\nconst side = \"sell\";\nconst order = await client.confirmClearingOrder({\n  clearing_id,\n  symbol,\n  amount,\n  price,\n  side,\n});\n```\n\n- [`getAvailableBalances`](https://docs.gemini.com/rest-api/#get-available-balances)\n\n```typescript\nconst account = \"primary\";\nconst balances = await client.getAvailableBalances({ account });\n```\n\n- [`getNotionalBalances`](https://docs.gemini.com/rest-api/#get-notional-balances)\n\n```typescript\nconst account = \"primary\";\nconst currency = \"gbp\";\nconst balances = await client.getNotionalBalances({ account, currency });\n```\n\n- [`getTransfers`](https://docs.gemini.com/rest-api/#transfers)\n\n```typescript\nconst timestamp = 1495127793;\nconst limit_transfers = 12;\nconst account = \"primary\";\nconst transfers = await client.getTransfers({\n  timestamp,\n  limit_transfers,\n  account,\n});\n```\n\n- [`getDepositAddresses`](https://docs.gemini.com/rest-api/#get-deposit-addresses)\n\n```typescript\nconst network = \"bitcoincash\";\nconst account = \"primary\";\nconst addresses = await client.getDepositAddresses({ network, account });\n```\n\n- [`getNewAddress`](https://docs.gemini.com/rest-api/#new-deposit-address)\n\n```typescript\nconst currency = \"ltc\";\nconst label = \"New LTC deposit address\";\nconst legacy = true;\nconst account = \"primary\";\nconst address = await client.getNewAddress({\n  currency,\n  label,\n  legacy,\n  account,\n});\n```\n\n- [`withdrawCrypto`](https://docs.gemini.com/rest-api/#withdraw-crypto-funds-to-whitelisted-address)\n\n```typescript\nconst currency = \"btc\";\nconst address = \"mi98Z9brJ3TgaKsmvXatuRahbFRUFKRUdR\";\nconst amount = 10;\nconst account = \"primary\";\nconst withdrawal = await client.withdrawCrypto({\n  currency,\n  address,\n  account,\n  amount,\n});\n```\n\n- [`internalTransfer`](https://docs.gemini.com/rest-api/#internal-transfers)\n\n```typescript\nconst currency = \"btc\";\nconst sourceAccount = \"primary\";\nconst targetAccount = \"secondary\";\nconst amount = \"100\";\nconst transfer = await client.internalTransfer({\n  currency,\n  sourceAccount,\n  targetAccount,\n  amount,\n});\n```\n\n- [`addBank`](https://docs.gemini.com/rest-api/#add-bank)\n\n```typescript\nconst accountnumber = \"account-number-string\";\nconst routing = \"routing-number-string\";\nconst type = \"checking\";\nconst name = \"Satoshi Nakamoto Checking\";\nconst result = await client.addBank({\n  accountnumber,\n  routing,\n  type,\n  name,\n});\n```\n\n- [`getPaymentMethods`](https://docs.gemini.com/rest-api/#payment-methods)\n\n```typescript\nconst account = \"primary\";\nconst methods = await client.getPaymentMethods({ account });\n```\n\n- [`withdrawSEN`](https://docs.gemini.com/rest-api/#sen-withdrawals)\n\n```typescript\nconst account = \"primary\";\nconst amount = \"893484.26\";\nconst bankId = \"97631a24-ca40-4277-b3d5-38c37673d029\";\nconst response = await client.withdrawSEN({ account, amount, bankId });\n```\n\n- [`getAccountDetails`](https://docs.gemini.com/rest-api/#account-detail)\n\n```typescript\nconst account = \"primary\";\nconst details = await client.getAccountDetails({ account });\n```\n\n- [`createAccount`](https://docs.gemini.com/rest-api/#create-account)\n\n```typescript\nconst name = \"My Secondary Account\";\nconst type = \"custody\";\nconst result = await client.createAccount({ name, type });\n```\n\n- [`getAccounts`](https://docs.gemini.com/rest-api/#get-accounts-in-master-group)\n\n```typescript\nconst accounts = await client.getAccounts();\n```\n\n- [`withdrawGUSD`](https://docs.gemini.com/rest-api/#withdraw-usd-as-gusd)\n\n```typescript\nconst address = \"0x0F2B20Acb2fD7EEbC0ABc3AEe0b00d57533b6bD1\";\nconst amount = \"500\";\nconst account = \"primary\";\nconst withdrawal = await client.withdrawGUSD({ address, amount, account });\n```\n\n- [`heartbeat`](https://docs.gemini.com/rest-api/#heartbeat)\n\n```typescript\nconst heartbeat = await client.heartbeat();\n```\n\n### [WebsocketClient](https://docs.gemini.com/websocket-api/)\n\n```typescript\nimport { WebsocketClient } from \"gemini-node-api\";\nconst key = \"gemini-api-key\";\nconst secret = \"gemini-api-secret\";\nconst websocket = new WebsocketClient({ key, secret });\nwebsocket.on(\"error\", (error, market) =\u003e {\n  console.error(error);\n});\nwebsocket.on(\"open\", (market) =\u003e {\n  console.log(\"The connection is open\", market);\n});\nwebsocket.on(\"close\", (market) =\u003e {\n  console.log(\"The connection is closed\", market);\n});\nwebsocket.on(\"message\", (message, market) =\u003e {\n  console.info(\"New message from\", market);\n  console.info(message);\n});\n```\n\n- [`connectMarket`](https://docs.gemini.com/websocket-api/#market-data)\n\n```typescript\nconst heartbeat = true;\nconst top_of_book = false;\nconst bids = true;\nconst offers = true;\nconst trades = true;\nconst auctions = false;\nconst symbol = \"zecltc\";\nwebsocket.on(\"open\", (market) =\u003e console.log(\"Open:\", market));\nawait websocket.connectMarket({\n  symbol,\n  heartbeat,\n  top_of_book,\n  bids,\n  offers,\n  trades,\n  auctions,\n});\nawait websocket.connectMarket({ symbol: \"btcusd\" });\n```\n\n- [`disconnectMarket`](https://docs.gemini.com/websocket-api/#market-data)\n\n```typescript\nconst symbol = \"zecltc\";\nwebsocket.once(\"close\", (market) =\u003e console.log(\"Closed:\", market));\nawait websocket.disconnectMarket({ symbol });\n```\n\n- [`connect`](https://docs.gemini.com/websocket-api/#market-data-version-2)\n\n```typescript\nwebsocket.on(\"open\", (market) =\u003e console.log(\"Open:\", market));\nawait websocket.connect();\n```\n\n- [`disconnect`](https://docs.gemini.com/websocket-api/#market-data-version-2)\n\n```typescript\nwebsocket.once(\"close\", (market) =\u003e console.log(\"Closed:\", market));\nawait websocket.disconnect();\n```\n\n- [`subscribe`](https://docs.gemini.com/websocket-api/#level-2-data)\n\n```typescript\nconst subscriptions = [\n  { name: \"l2\", symbols: [\"BTCUSD\", \"ETHUSD\"] },\n  { name: \"candles_1m\", symbols: [\"BTCUSD\"] },\n];\nawait websocket.connect();\nawait websocket.subscribe(subscriptions);\n```\n\n- [`unsubscribe`](https://docs.gemini.com/websocket-api/#unsubscribe)\n\n```typescript\nconst subscriptions = [{ name: \"l2\", symbols: [\"BTCUSD\", \"ETHUSD\"] }];\nawait websocket.unsubscribe(subscriptions);\n```\n\n- [`connectOrders`](https://docs.gemini.com/websocket-api/#order-events)\n\n```typescript\nconst symbolFilter = \"zecltc\";\nconst apiSessionFilter = \"UI\";\nconst eventTypeFilter = [\"accepted\", \"rejected\"];\nconst account = \"primary\";\nwebsocket.on(\"message\", (message, market) =\u003e {\n  if (market === \"orders\") {\n    console.log(\"New message:\", message);\n  }\n});\nawait websocket.connectOrders({\n  account,\n  symbolFilter,\n  apiSessionFilter,\n  eventTypeFilter,\n});\n```\n\n- [`disconnectOrders`](https://docs.gemini.com/websocket-api/#order-events)\n\n```typescript\nwebsocket.once(\"close\", (market) =\u003e {\n  if (market === \"orders\") {\n    console.log(\"Closed\");\n  }\n});\nawait websocket.disconnectOrders();\n```\n\n### Test\n\n```bash\nnpm test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvansergen%2Fgemini-node-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvansergen%2Fgemini-node-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvansergen%2Fgemini-node-api/lists"}