Title: Wallet creation endpoint not working after refactor introduced recently · Issue #7218 · BitGo/BitGoJS · GitHub
Open Graph Title: Wallet creation endpoint not working after refactor introduced recently · Issue #7218 · BitGo/BitGoJS
X Title: Wallet creation endpoint not working after refactor introduced recently · Issue #7218 · BitGo/BitGoJS
Description: Creation of wallet address endpoint POST /api/v2/{coin}/wallet/{walletId}/address is not working anymore, and even the error doesn't follow the error format specified in the endpoint documentation here https://developers.bitgo.com/api/v2...
Open Graph Description: Creation of wallet address endpoint POST /api/v2/{coin}/wallet/{walletId}/address is not working anymore, and even the error doesn't follow the error format specified in the endpoint documentation ...
X Description: Creation of wallet address endpoint POST /api/v2/{coin}/wallet/{walletId}/address is not working anymore, and even the error doesn't follow the error format specified in the endpoint documentat...
Opengraph URL: https://github.com/BitGo/BitGoJS/issues/7218
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Wallet creation endpoint not working after refactor introduced recently","articleBody":"Creation of wallet address endpoint `POST /api/v2/{coin}/wallet/{walletId}/address` is not working anymore, and even the error doesn't follow the error format specified in the endpoint documentation here https://developers.bitgo.com/api/v2.wallet.newaddress.\n \nHere is a POST request example with curl we tried against a BitGoJS Express instance we run, using a HTETH wallet (testnet coin):\n\n```sh\ncurl -i -X POST \"http://bitgo-express:3080/api/v2/hteth/wallet/{MY_WALLET}/address\" \\\n -H \"Content-Type: application/json\" -H \"Accept: application/json\" \\\n -H \"Bearer {MY_TOKEN}\" \\\n -d '{\"label\": \"my-address-10\", \"forwarderVersion\": 2}'\n```\n\nResponse:\n\n```\nHTTP/1.1 400 Bad Request\nX-Powered-By: Express\nContent-Type: application/json; charset=utf-8\nContent-Length: 158\nETag: W/\"9e-SCCh1WHc45CyixlBppDuHU6JGvU\"\nDate: Mon, 13 Oct 2025 13:19:22 GMT\nConnection: keep-alive\nKeep-Alive: timeout=5\n\n[\"Invalid value undefined supplied to : httpRequest/params: Exact\u003c({ coin: string, id: string } \u0026 Partial\u003c{ }\u003e)\u003e/0: { coin: string, id: string }/id: string\"]\n```\n\n## Environment Details\n\n- **OS:** we run BitGoJS with Docker using the official image `bitgo/express:15.6.0`\n- **Node Version:** Same we don't run it in our own version of Node\n- **Yarn Version:** Same above\n- **BitGoJS Version:** 15.6.0\n- **BitGo Environment:** testnet, coin HTETH\n\n## Expected Behavior\n\nAn HTTP 200 OK response, with a wallet address created.\n\n## Current Behavior\n\nAn HTTP 400 Bad Request response, with an validation error that is wrong, an no wallet address created.\n\nAlso the JSON response error doesn't follow the especification from the official documentation. Unexpected errors like this should be normalized through some sort of middleware that prevent the API to serialize error in whatever format not documented.\n\n## Possible Solution\n\nThe bug is in the source code of BitGo Express as far I understand, and it was introduced in a refactor here https://github.com/BitGo/BitGoJS/commit/4753b915ce798368be764b6ca99a31da28a11d1a#diff-2d63afad20775469d35fa72b1fc535af8b6daf51cf2aaa055983dd36ace25400L13-L16:\n\n```diff\n- walletId: t.string,\n+ id: t.string,\n```\n\nAnd here in the same commit https://github.com/BitGo/BitGoJS/commit/4753b915ce798368be764b6ca99a31da28a11d1a#diff-851997953dfe5ce12d4c10bbabf8afa6bc49777505aae9197b0bcc6534da6677L666:\n\n```diff\n- const wallet = await coin.wallets().get({ id: req.decoded.walletId });\n+ const wallet = await coin.wallets().get({ id: req.decoded.id });\n```\n\nThere the param argument was renamed from `walletId` to `id`, but it was not renamed in the path definition here https://github.com/BitGo/BitGoJS/blob/004035b88551c5808a985f9deb66c06269c1f9dc/modules/express/src/typedRoutes/api/v2/createAddress.ts#L69\n\nCC @danielzhao122\n\n## Steps to Reproduce\n\nOnly one step described above.\n","author":{"url":"https://github.com/mrsarm","@type":"Person","name":"mrsarm"},"datePublished":"2025-10-13T13:57:57.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/7218/BitGoJS/issues/7218"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:77c10b70-f92a-32d9-c2bb-11561037dd2c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AB8E:3D126:19C2AC5:2107DB5:6990EF0F |
| html-safe-nonce | 5633d522187b4ab334390df313aba1abfb7745290826afd93be40d076ef8e04f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQjhFOjNEMTI2OjE5QzJBQzU6MjEwN0RCNTo2OTkwRUYwRiIsInZpc2l0b3JfaWQiOiI1NzIxMjU3NzY3MDUxNzgzOTUxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 33244924fb844b7267b52902ce098225021c30b50f0002b9ea0dfa1c00ce913e |
| hovercard-subject-tag | issue:3510190629 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/BitGo/BitGoJS/7218/issue_layout |
| twitter:image | https://opengraph.githubassets.com/67f69d8cec9c258725eaf06fbc39fa24ce99474385762cb367d1960d7de11187/BitGo/BitGoJS/issues/7218 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/67f69d8cec9c258725eaf06fbc39fa24ce99474385762cb367d1960d7de11187/BitGo/BitGoJS/issues/7218 |
| og:image:alt | Creation of wallet address endpoint POST /api/v2/{coin}/wallet/{walletId}/address is not working anymore, and even the error doesn't follow the error format specified in the endpoint documentation ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mrsarm |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| go-import | github.com/BitGo/BitGoJS git https://github.com/BitGo/BitGoJS.git |
| octolytics-dimension-user_id | 6267684 |
| octolytics-dimension-user_login | BitGo |
| octolytics-dimension-repository_id | 20121980 |
| octolytics-dimension-repository_nwo | BitGo/BitGoJS |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20121980 |
| octolytics-dimension-repository_network_root_nwo | BitGo/BitGoJS |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 848bc6032dcc93a9a7301dcc3f379a72ba13b96e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width