{"id":18594695,"url":"https://github.com/ernitingarg/nodejs-typescripts-firebase-functions","last_synced_at":"2025-05-16T12:12:58.291Z","repository":{"id":165084388,"uuid":"495069516","full_name":"ernitingarg/nodejs-typescripts-firebase-functions","owner":"ernitingarg","description":null,"archived":false,"fork":false,"pushed_at":"2022-05-22T13:37:49.000Z","size":141,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-17T22:46:29.461Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/ernitingarg.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,"governance":null}},"created_at":"2022-05-22T13:34:47.000Z","updated_at":"2023-10-21T12:28:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"167f5262-63fa-44fd-85c9-776497654e26","html_url":"https://github.com/ernitingarg/nodejs-typescripts-firebase-functions","commit_stats":null,"previous_names":["ernitingarg/nodejs-typescripts-firebase-functions"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ernitingarg%2Fnodejs-typescripts-firebase-functions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ernitingarg%2Fnodejs-typescripts-firebase-functions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ernitingarg%2Fnodejs-typescripts-firebase-functions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ernitingarg%2Fnodejs-typescripts-firebase-functions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ernitingarg","download_url":"https://codeload.github.com/ernitingarg/nodejs-typescripts-firebase-functions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254527099,"owners_count":22085919,"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":[],"created_at":"2024-11-07T01:16:41.818Z","updated_at":"2025-05-16T12:12:58.271Z","avatar_url":"https://github.com/ernitingarg.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# soteria-node-functions\n\n- [Document](https://www.notion.so/Soteria-612e438f04044e6298297efaee8d17e4)\n\n# commands\n\n## set project\n\n```sh\n$ firebase use soteria-production\n```\n\n## deploy all CF\n\n```sh\n$ yarn deploy\n```\n\n## deploy one CF\n```sh\n$ FUNC_NAME=\u003ccf name\u003e yarn deploy:mono\n```\n\n### how to add test\n\nhttps://www.notion.so/gssssss/CF-e2e-c91fb63c6ca3406291785c463c654313\n\n## For failed broadcast\nDecode payload\n- https://live.blockcypher.com/btc/decodetx/\n\nNeed to send manually.\n- https://blockchair.com/broadcast\n- https://live.blockcypher.com/btc/pushtx/\n\n\n# V0 Instructions\n## Deployment\nFollowing commands should be run by authorized user account.\n### prod\n```shell\nfirebase functions:config:set mnemonic.password=projects/924562074308/secrets/mnemonic-pwd/versions/1\nfirebase functions:config:set mnemonic.passphrase=projects/924562074308/secrets/mnemonic-production/versions/1\nfirebase functions:config:set destination.btc=projects/924562074308/secrets/Bitcoin-ftx-address/versions/1\nfirebase functions:config:set api.blockcypher=projects/924562074308/secrets/blockcypher-api-token/versions/1\nyarn deploy\n```\n### staging\n```shell\nfirebase functions:config:set mnemonic.password=projects/167835541928/secrets/mnemonic-phrase/versions/1\nfirebase functions:config:set mnemonic.passphrase=projects/167835541928/secrets/mnemonic-password/versions/1\nfirebase functions:config:set destination.btc=projects/167835541928/secrets/btc_dest_main/versions/2\nfirebase functions:config:set api.blockcypher=projects/167835541928/secrets/blockcypher_api_token/versions/1\nyarn deploy\n```\n\n## How it works\n1. chain watcher creates transaction document in `{coin_name}_transactions` collection. e.g. `btc_transactions`\n    - chain watcher is in https://github.com/SoteriaTech/blockchain-functions\n2. FirestoreCreateTrigger `{coin_name}DepositRecorder` is triggered by Create operation in `{coin_name}_transactions` collection.\n3. This `{coin_name}DepositRecorder` function will create deposit document in `deposits` collection.\n    - deposit document is in the format defined in `funcs/typings/deposit.ts`.\n4. FirestoreCreateTrigger `sendFromDeposit` is triggered by Create operation in `deposits` collection.\n5. This `sendFromDeposit` function will send received coin to FTX account.\n\n### Remark\n- chain watcher is implemented in separate project. It is basically doing finding customer related transaction and insert it into respective `{coin_name}_transactions` collection. \n- `sendFromDeposit` function takes care of all coin transfer from deposit address.\n- sender logic for each coin is found in `funcs/functions/sender` directory.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fernitingarg%2Fnodejs-typescripts-firebase-functions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fernitingarg%2Fnodejs-typescripts-firebase-functions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fernitingarg%2Fnodejs-typescripts-firebase-functions/lists"}