Skip to content

feat(antd-swift): 07_external_signer example + fix FinalizeUploadDTO optional address#137

Merged
Nic-dorman merged 1 commit into
mainfrom
nic/antd-swift-07-external-signer
May 27, 2026
Merged

feat(antd-swift): 07_external_signer example + fix FinalizeUploadDTO optional address#137
Nic-dorman merged 1 commit into
mainfrom
nic/antd-swift-07-external-signer

Conversation

@Nic-dorman
Copy link
Copy Markdown
Collaborator

Summary

Adds the external-signer round-trip example for antd-swift, bringing it to parity with the 11 SDKs (10 + elixir) that already have the slot. Wires the new external_signer slot into ant-dev's swift adapter.

Implementation notes

  • The example uses cast shell-out via Foundation Process (same pattern as antd-elixir). Web3.swift is the canonical Swift EVM lib but Linux-buildability is unclear (uses Apple Security framework on its primary path); cast is already a hard dependency of ant dev start --enable-evm and handles signing + EIP-1559 + tuple ABI correctly.
  • Main.swift now dispatches on CommandLine.arguments[1]: "2"/default runs the original data example, "7" runs the new external-signer example, "all" runs both. Args 1/3/4/6 silently fall through to data to preserve ant dev example all -l swift PASS in the sweep until the full Linux scaffolding lands (a separate concern from V2-312).

Drive-by SDK fix

FinalizeUploadDTO.address was non-optional (String), so JSON decoding failed when the daemon omits the field — which happens on public-prepared upload finalize responses (daemon returns data_map_address not address). Changed to String? with ?? "" at the two call sites (finalize_upload, finalize_merkle_upload), matching the existing pattern for dataMap and dataMapAddress.

This bug bit the new example immediately; folded into this PR since the example couldn't land without it.

Test plan

  • swift build clean
  • ant dev example external_signer -l swift against ant dev start --enable-evm — exit 0
  • File external-signer round-trip OK (prepare + cast send approve + cast send payForQuotes + finalize + download + byte-equal)
  • Single-chunk external-signer round-trip OK
  • ant dev example data -l swift still works (default branch)

🤖 Generated with Claude Code

…optional address

Adds the external-signer round-trip example for antd-swift, bringing
swift to parity with the 11 SDKs (10 + elixir) that already have the
07_external_signer slot. Wires the new external_signer slot into
ant-dev's swift adapter.

Implementation notes:

* The example uses `cast` shell-out via Foundation Process (same pattern
  as antd-elixir). Web3.swift is the canonical Swift EVM lib but
  Linux-buildability is unclear (uses Apple Security framework on its
  primary path); cast is already a hard dependency of `ant dev start
  --enable-evm` and handles signing + EIP-1559 + tuple ABI correctly.
* Main.swift now dispatches on CommandLine.arguments[1]: "2"/default
  runs the original data example, "7" runs the new external-signer
  example, "all" runs both. Args 1/3/4/6 silently fall through to data
  to preserve `ant dev example all -l swift` PASS in the sweep until the
  full Linux scaffolding lands.

Drive-by SDK fix:

`FinalizeUploadDTO.address` was non-optional (`String`), so JSON
decoding failed when the daemon omits the field — which happens on
public-prepared upload finalize responses (daemon returns
`data_map_address` not `address`). Changed to `String?` with `?? ""`
at the two call sites (finalize_upload, finalize_merkle_upload),
matching the existing pattern for `dataMap` and `dataMapAddress`.

Round-trip validated end-to-end on dev2 against `ant dev start
--enable-evm` — file external-signer OK, single-chunk external-signer
OK, exit 0.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Nic-dorman Nic-dorman merged commit 7fbdb58 into main May 27, 2026
@Nic-dorman Nic-dorman deleted the nic/antd-swift-07-external-signer branch May 27, 2026 15:01
@Nic-dorman Nic-dorman restored the nic/antd-swift-07-external-signer branch May 27, 2026 15:03
@Nic-dorman Nic-dorman deleted the nic/antd-swift-07-external-signer branch May 27, 2026 15:05
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