Skip to content

feat(antd-kotlin): gRPC WalletService parity with REST#184

Merged
Nic-dorman merged 1 commit into
mainfrom
nic/v2-286-antd-kotlin-grpc-walletservice
May 28, 2026
Merged

feat(antd-kotlin): gRPC WalletService parity with REST#184
Nic-dorman merged 1 commit into
mainfrom
nic/v2-286-antd-kotlin-grpc-walletservice

Conversation

@Nic-dorman

Copy link
Copy Markdown
Collaborator

Summary

Adds 3 new suspend methods on AntdGrpcClient mirroring REST AntdRestClient:

  • suspend fun walletAddress(): WalletAddress
  • suspend fun walletBalance(): WalletBalance
  • suspend fun walletApprove(): Boolean

Depends on #154.

Implementation notes

  • New walletStub (WalletServiceGrpcKt.WalletServiceCoroutineStub) on AntdGrpcClient, constructed alongside the existing health/data/chunk/file stubs.
  • lib/src/main/proto/antd/v1/wallet.proto copied from antd/proto/ (kotlin keeps its own copy under lib/src/main/proto/).
  • Added internal constructor(channel: ManagedChannel) on AntdGrpcClient so tests can inject an InProcessChannel without spinning a TCP socket.
  • A missing daemon wallet emits gRPC FailedPrecondition; the existing ExceptionMapping.fromGrpcStatus surfaces it as PaymentException (established FailedPrecondition→Payment convention across all SDKs).
  • grpc-kotlin coroutine stubs throw io.grpc.StatusException (checked, suspend-friendly) NOT StatusRuntimeException — the existing code only catches StatusRuntimeException and would have missed errors here. Wallet methods catch both types and route through the same mapping. Pre-existing code paths have the same latent gap but are not in V2-286 scope to refactor.

Tests

  • GrpcWalletTest.kt (new) — InProcessServerBuilder + InProcessChannelBuilder with a MockWallet service. 4 tests: address, balance, approve, plus the unconfigured-wallet PaymentException path (separate in-process server).
  • New testImplementation dep on io.grpc:grpc-inprocess:1.65.1.

Gates passed on dev2

  • ./gradlew :lib:compileKotlin — clean
  • ./gradlew :lib:test — all suites passing (RestClientTest 29, SmokeTests 7, GrpcWalletTest 4)

Supersedes #161 (force-push after daemon merge auto-closed the original PR).

@Nic-dorman Nic-dorman force-pushed the nic/v2-286-antd-kotlin-grpc-walletservice branch from 8861116 to df31323 Compare May 28, 2026 17:48
@Nic-dorman Nic-dorman merged commit 4042329 into main May 28, 2026
@Nic-dorman Nic-dorman deleted the nic/v2-286-antd-kotlin-grpc-walletservice branch May 28, 2026 17:51
Nic-dorman added a commit that referenced this pull request May 28, 2026
Closes the gRPC parity gap with REST: external-signer (UploadService +
chunks PrepareChunk/FinalizeChunk) and WalletService are now reachable
over gRPC, plus stream-download stubs return honest UNIMPLEMENTED/501
instead of pretending. All 11 gRPC-capable SDKs follow with matching
fan-out.

## Additive (antd daemon)

- gRPC UploadService + chunks prepare/finalize — external-signer two-phase
  upload + single-chunk publish over gRPC, mirroring REST 1:1 (#140)
- gRPC WalletService — GetAddress / GetBalance / Approve, parity with
  REST /v1/wallet/* (#154)
- /v1/data/prepare now honors visibility for public DataMap chunk
  bundling via data_prepare_upload_with_visibility (#138)

## Fixes (antd daemon)

- Stream-download stubs (DataServiceStub.StreamDownload, REST
  /v1/data/stream/*) now return UNIMPLEMENTED / 501 honestly rather
  than empty success (#155)

## SDK fan-out — external-signer (gRPC prepare/finalize)

All 11 gRPC-capable SDKs replace their stub raises with real gRPC calls
to the new UploadService + ChunkService PrepareChunk/FinalizeChunk RPCs:

- antd-rust (#169), antd-go (#170), antd-py (#171), antd-java (#172),
  antd-kotlin (#173), antd-csharp (#174), antd-ruby (#175),
  antd-dart (#176), antd-swift (#177), antd-cpp (#178),
  antd-elixir (#179)

## SDK fan-out — WalletService

Same 11 SDKs gain walletAddress / walletBalance / walletApprove over gRPC:

- antd-rust (#180), antd-go (#181), antd-py (#182), antd-java (#183),
  antd-kotlin (#184), antd-csharp (#185), antd-ruby (#186),
  antd-dart (#187), antd-swift (#188), antd-cpp (#189),
  antd-elixir (#190)

## SDK examples + build fixes

- antd-ruby: payForQuotes tuple args as Hash for eth-0.5.13
  compatibility (#131)
- antd-go + ant-dev: add 03-chunks + 06-private-data examples;
  renumber 03-files to 04-files (#132)
- antd-java + antd-cpp: close async client surface gaps (#133)
- ant-dev: pull antd[rest,grpc] extras so 08_grpc example runs out
  of the box (#134)
- antd-js + antd-py + antd-go READMEs: surface external-signer
  methods + 07 example (#135)
- antd-elixir: 07_external_signer example via cast shell-out (#136)
- antd-swift: 07_external_signer example + fix FinalizeUploadDTO
  optional address (#137)
- antd-php: empty tx_hashes serializes as JSON object on finalize
  (#139)

## FFI

- ant-ffi refresh against current ant-core API + Swift xcframework
  build pipeline (#150)
- Android AAR build pipeline (#156)

## Infra

- CI: auto-tag Go submodules on umbrella release tag push (#129)
- Deploy: publish multi-arch withautonomi/antd image from ant-sdk
  release (#130)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant