Skip to content

feat(sdk-api): pass recipient addresses to v1 billing fee endpoint for PayGo migration waiver#9028

Merged
davidkaplanbitgo merged 1 commit into
masterfrom
t1-3579-waive-paygo-fees-v1-to-v2-migration
Jun 15, 2026
Merged

feat(sdk-api): pass recipient addresses to v1 billing fee endpoint for PayGo migration waiver#9028
davidkaplanbitgo merged 1 commit into
masterfrom
t1-3579-waive-paygo-fees-v1-to-v2-migration

Conversation

@bitgo-ai-agent-dev

Copy link
Copy Markdown

Summary

  • In transactionBuilder.ts, the getBitGoFee() inner function now passes recipient addresses alongside amount and instant when calling wallet.getBitGoFee()
  • In wallet.ts, Wallet.prototype.getBitGoFee forwards the recipients array to the server as repeated recipients[]=addr query params on GET /api/v1/wallet/:id/billing/fee
  • Backward-compatible: when recipients is empty or not provided, the request is identical to before

Context

When a customer migrates from a v1 PayGo wallet to a v2 PayGo wallet, the normal PayGo fee should be waived. Because the v1 fee is baked into the signed transaction client-side (the SDK calls the fee endpoint, then embeds any nonzero fee output before signing), the waiver must happen at the fee-query step. The server (companion ticket) will return fee: 0 when all recipient addresses resolve to v2 PayGo wallets — but only if the SDK sends the recipient addresses in the request.

This change is purely plumbing: it passes the recipient info the server needs to make the waiver determination.

Test plan

  • New unit tests in modules/sdk-api/test/unit/v1/wallet.ts cover:
    • recipients[] query params are sent when recipients provided
    • No recipients[] sent when empty array
    • No recipients[] sent when not provided (backward-compat)
    • Invalid amount and instant arguments still throw
  • All 205 existing @bitgo/sdk-api unit tests continue to pass

Fixes T1-3579
Parent: T1-3375

🤖 Generated with Ralph

@bitgo-ai-agent-dev bitgo-ai-agent-dev Bot force-pushed the t1-3579-waive-paygo-fees-v1-to-v2-migration branch from b270c1a to d56df37 Compare June 15, 2026 17:26
@linear-code

linear-code Bot commented Jun 15, 2026

Copy link
Copy Markdown

T1-3579

@davidkaplanbitgo davidkaplanbitgo marked this pull request as ready for review June 15, 2026 20:11
@davidkaplanbitgo davidkaplanbitgo requested a review from a team as a code owner June 15, 2026 20:11
Forward recipient addresses from the SDK to the server's
GET /api/v1/wallet/:id/billing/fee endpoint as recipients[]
query params. This allows the server to waive the PayGo fee
when all recipients are v2 PayGo wallets (v1-to-v2 migration
scenario). Backward-compatible: existing calls without
recipients are unchanged.

Ticket: T1-3579
Session-Id: 9bcb0f58-d633-492c-a7a4-70bcd09ce08b
Task-Id: bf7868aa-6a4c-4ee7-8520-1e6b61551a64
@davidkaplanbitgo davidkaplanbitgo force-pushed the t1-3579-waive-paygo-fees-v1-to-v2-migration branch from d56df37 to ff0cbb7 Compare June 15, 2026 20:12
@davidkaplanbitgo davidkaplanbitgo merged commit 092d3fc into master Jun 15, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants