Repository navigation
3.0 beta, step 1: wallet update, freeze, maximum spendable, total balances and the cross-coin list - #53
Merged
Conversation
…per coin and across coins, and the cross-coin $bitgo->wallets()->list().
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #53 +/- ##
===========================================
Coverage 100.00% 100.00%
- Complexity 159 170 +11
===========================================
Files 16 17 +1
Lines 370 436 +66
===========================================
+ Hits 370 436 +66 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The first 3.0.0-beta step: the wallet calls that 2.x had and the alpha didn't, plus the cross-coin list.
What changed
Wallet:update(),freeze()andmaximumSpendable(). Each takes the params in BitGo's current reference as named args, plus$extra.Coin\Wallets::balances(): one coin's totals. This is the endpoint 2.x'sgetTotalBalances()called.Wallets, fromBitGo::wallets():list()on/api/v2/wallets(a lazyPaginator, like the per-coin list) andbalances()on/api/v2/wallet/balances. Thecoinfilter takesCoinCodes or strings.[Unreleased]updated.Choices worth a look
freeze()always sendsduration, 3600 by default. BitGo marks it required, with 3600 as the default, so sending it never depends on BitGo filling in a missing field. 2.x required anotphere, but BitGo's current reference doesn't list one, so it isn't named. It can still go through$extra.maximumSpendable()'sminValueandmaxValuetakeAmount|string|int, the first verb to take anAmountin a query. BitGo wants a string for DOGE.neto737\BitGoSDK\Wallets, next toBitGo, the same wayCoin\Walletssits underCoin.ROADMAP.mdlists "update/delete wallet", but step 1's checklist doesn't. Delete stays a separate decision.Testing
composer checkpasses: CS, Rector, PHPStan and 195 PHPUnit tests. Line coverage is 100% (355/355).WalletTestandAllWalletsTest, plusbalances()cases inWalletsTest. They assert each request's method, URL (including array andAmountquery encoding) and body. The navigation test now covers$bitgo->wallets()->list()sending nothing until it's iterated.