feat: complete typed Funding (Beta) API - #105
Merged
Merged
Conversation
nyg
force-pushed
the
nyg/funding-beta-feature-7821e1
branch
from
September 21, 2026 17:05
00ba4d2 to
d0a1623
Compare
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.
Completes the 15 Funding (Beta) operations from #82 with typed endpoints, parameter builders, response records and KrakenAPI methods: Calculate Funding Fees, List Funding Methods, List Funding Assets, List Funding Networks, List Funding Deposit Limits, List Funding Withdrawal Limits, Claim Funding Deposit Address, List Funding Claimed Addresses (v2), List Funding Deposits, List/Create/Update/Delete Funding Address, and List/Create Funding Withdrawal. They live in a new
fundingbeta/package with the usual{Name}Endpoint,params/andresponse/layout.Endpoint model. These operations don't fit
PublicEndpointorPrivateEndpoint, so a third base class,FundingBetaEndpoint<T>, handles:GET,POST,PUT,DELETE) on/funding/{path}, with path parameters percent-encoded by the endpointFundingBetaParams, with nested objects in the bracket notation Kraken documents, e.g.asset[class]=currency&scope[method_id]=…API-Nonceheader rather than the bodyKrakenCredentials.sign(signedPath, nonce, body)is the new overload, and the existingsign(URL, …)now delegates to it{error, result}envelope, deserialized from the whole bodyHTTP error statuses become a
KrakenExceptionwhose only error is the status code followed by the response body.KrakenRestRequestergainsexecute(FundingBetaEndpoint, …)as a default method throwingUnsupportedOperationException, so existing custom requesters keep compiling.KrakenAPI.query(FundingBetaEndpoint)lets users run their own Funding (Beta) endpoints.Signing. The signing rules come from Kraken's Funding (Beta) guide and match Kraken's
api-goSDK. Tests check signatures against digests computed with the guide's Python helper, for both a GET with a query string and a POST with a JSON body. One requester test uses real credentials end to end, from the endpoint URL to theAPI-Signheader.Types.
Asset,AssetAmountandScope(method, network or network group, created throughScope.method/network/networkGroup) are shared by parameters and responses. Amounts useBigDecimal, times useInstant, and limit time windows useDuration. Limit values are a count for attempt/success limits or amounts otherwise: Kraken sends both shapes, and a small deserializer reads them. Address details cover crypto addresses, fiat addresses and beneficiaries. Every enum falls back toUNKNOWN.Validation before any connection opens. Create Funding Withdrawal rejects a fee token combined with
maxFee, and a token ormaxFeewithoutfeeIncluded. Create Funding Withdrawal and List Funding Claimed Addresses reject network group scopes, which Kraken doesn't accept there.Not covered. The
statusfilter of List Funding Deposits is left out. Its schema is alist/rangeobject declared withstyle: form, unlike the other nested filters, and neither the spec nor the guide shows how it is encoded. Sending a guessed encoding could filter the wrong deposits without any error.Validation. Temurin 25
mvnd -B clean packagepasses for both modules with 453 tests, 121 of them new. The library Javadoc jar passes withdoclint=all,-missing. Fixtures are the Spot REST OpenAPI1.1.0examples, plus schema-based fixtures for Update and Delete Funding Address, which have no example. Tests use mocked connections, with no API keys, network calls, addresses or withdrawals. README, AGENTS.md and ARCHITECTURE.md (with a new sequence diagram) describe the new group.SimpleExampleslists USDC withdrawal methods.Refs #82; the umbrella issue stays open for the remaining unit test coverage.