gRPC client for the antd daemon.
Provides the same functions as Antd.Client (REST), but communicates over
gRPC using the proto-generated modules from antd/v1/*.proto.
All public functions return {:ok, result} or {:error, exception}.
Bang variants (e.g. health!/1) raise on error.
Naming convention
Private = unqualified verb. Public = _public suffix. See Antd.Client
for full details.
Proto compilation
The generated modules under lib/antd/v1/ are committed; regenerate them
with scripts/generate-protos.sh, which pins protoc-gen-elixir and lists
the protos this SDK ships stubs for.
Pointers
The pointer_* functions mirror Antd.Client's, each with a :timeout
option (milliseconds, default 5 minutes). Every write pays, and every
attempt pays again, so they never retry and callers should not either.
Errors that share a gRPC status with older ones are told apart by the
daemon's x-antd-error-code metadata, trusted only when it agrees with the
status code.
Summary
Functions
Creates a gRPC client using port discovery.
Builds a .ant manifest from DataMaps and public addresses already in
hand. Mirrors Antd.Client.build_manifest/3, including its entry check
before sending; an entry the daemon rejects (INVALID_ARGUMENT) is an
Antd.BadRequestError whose message names entries[i]. Nothing is
uploaded or paid for.
Like build_manifest/3 but raises on error.
Retrieves a chunk by address.
Like chunk_get/2 but raises on error.
Stores a raw chunk on the network.
Like chunk_put/2 but raises on error.
Pre-upload cost breakdown for the given bytes.
Like data_cost/3 but raises on error.
Retrieves private data using a caller-held DataMap.
Like data_get/2 but raises on error.
Retrieves public data by address.
Like data_get_public/2 but raises on error.
Stores private encrypted data on the network.
Like data_put/3 but raises on error.
Stores public data on the network.
Like data_put_public/3 but raises on error.
Streams private data from a caller-held DataMap, one decrypt batch at a time,
instead of buffering the whole object. The gRPC counterpart to data_get/2
and mirror of the REST client's data_stream/2.
Like data_stream/2 but raises on error.
Streams public data by address — the gRPC counterpart to data_get_public/2.
Same {:ok, enumerable} of binary chunks contract as data_stream/2.
Like data_stream_public/2 but raises on error.
data_stream_public/2 with interleaved fetch-progress frames. See
data_stream_with_progress/2.
Like data_stream_public_with_progress/2 but raises on error.
data_stream/2 with interleaved fetch-progress frames so the caller can drive
a determinate download progress bar. Sets the request's include_progress
flag; enumerating the returned stream yields Antd.DownloadFrame structs —
each a plaintext chunk (:data) or a Antd.DownloadProgress update
(:progress). The byte denominator arrives separately as the
x-content-length response header.
Like data_stream_with_progress/2 but raises on error.
Decodes .ant bytes (a raw binary). Mirrors
Antd.Client.decode_manifest/3.
Like decode_manifest/3 but raises on error.
Decodes an ant:// manifest link, a file link or a bare 64-hex address.
Mirrors Antd.Client.decode_manifest_link/3; takes the same options as
decode_manifest/3.
Like decode_manifest_link/3 but raises on error.
Pre-upload cost breakdown for the file at path.
Like file_cost/4 but raises on error.
Downloads a private file from a caller-held DataMap into dest_path.
Like file_get/3 but raises on error.
Downloads a public file from the network to a local path.
Like file_get_public/3 but raises on error.
Uploads a local file privately.
Like file_put/3 but raises on error.
Uploads a local file publicly.
Like file_put_public/3 but raises on error.
Submits a prepared chunk after external payment. Returns the on-network
address of the stored chunk (matches PrepareChunkResult.address).
Like finalize_chunk_upload/3 but raises on error.
Finalizes a merkle-batch upload after the external signer has submitted
the payForMerkleTree2() transaction. winner_pool_hash is the
bytes32 from the MerklePaymentMade event (hex with 0x prefix).
Like finalize_merkle_upload/4 but raises on error.
Finalizes a wave-batch upload after an external signer has submitted
the payForQuotes() transactions. tx_hashes maps each quote_hash
from the prepare result to its on-chain tx_hash.
Like finalize_upload/3 but raises on error.
Checks the antd daemon status.
Like health/1 but raises on error.
Creates a new gRPC client and opens a channel to the daemon.
Like new/1 but raises on error.
Follows the transfers of the pointer at address to the pointer whose
owner now decides what it resolves to. Mirrors
Antd.Client.pointer_controller/2.
Like pointer_controller/3 but raises on error.
Creates the pointer at owner, pointing at target, paid by the daemon
wallet. Mirrors Antd.Client.pointer_create/4: Antd.AlreadyExistsError
if it exists, refused before paying. Each call pays: do not retry it
automatically.
Like pointer_create/4 but raises on error.
Asks the whole close group where the pointer at address stands. Mirrors
Antd.Client.pointer_finality/2; an unset counter, state or majority (an
empty string or absent message on the wire) reads as nil.
Like pointer_finality/3 but raises on error.
Stores a prepared pointer write once its external signer has paid.
Mirrors Antd.Client.pointer_finalize/3: an
Antd.CloseGroupShortfallError with retryable: true (read from the
message's closing (paid attempt retained...) hint) means the daemon kept
the paid state; repeat the call with the same upload_id, bounded. This
function never retries by itself.
Like pointer_finalize/4 but raises on error.
Reads the pointer at address. Mirrors Antd.Client.pointer_get/2:
Antd.NotFoundError if there is none.
Like pointer_get/3 but raises on error.
Lists the pointers this daemon holds owner keys for, as their addresses.
Mirrors Antd.Client.pointer_keys/1.
Like pointer_keys/2 but raises on error.
Has the daemon sign op on the pointer at owner and quote it for an
external signer. Mirrors Antd.Client.pointer_prepare/4; op is an
Antd.PointerOp.t/0.
Like pointer_prepare/4 but raises on error.
Follows a chain of pointers from address to the target at its end.
Mirrors Antd.Client.pointer_resolve/2.
Like pointer_resolve/3 but raises on error.
Hands the pointer at owner over to the pointer at recipient, for good,
paid by the daemon wallet. Mirrors Antd.Client.pointer_transfer/3.
Irreversible once stored. Each call pays: do not retry it
automatically.
Like pointer_transfer/4 but raises on error.
Points the pointer at owner at target, paid by the daemon wallet,
creating it if it does not exist. Mirrors Antd.Client.pointer_update/4:
Antd.PointerFinalError once it was transferred or frozen (usually refused
before paying), and Antd.ConflictError if a prepared write awaits payment
(refused before paying) or the update lost to a newer state (possibly after
paying). Each call pays: do not retry it automatically. Takes the same
options as pointer_create/4.
Like pointer_update/4 but raises on error.
Prepares a single-chunk publish for external signing.
Like prepare_chunk_upload/2 but raises on error.
Prepares an in-memory data upload for external signing.
Like prepare_data_upload/3 but raises on error.
Prepares a file upload for external signing.
Like prepare_upload/3 but raises on error.
Convenience wrapper: prepare a public file upload for external signing.
Equivalent to prepare_upload(client, path, visibility: "public").
Like prepare_upload_public/2 but raises on error.
Returns the wallet's on-chain address.
Like wallet_address/1 but raises on error.
Approves the wallet to spend tokens on the payment vault contract. One-time operation; idempotent at the contract level.
Like wallet_approve/1 but raises on error.
Returns the wallet's token + gas balances.
Like wallet_balance/1 but raises on error.
Types
@type t() :: %Antd.GrpcClient{channel: GRPC.Channel.t() | nil, target: String.t()}
Functions
@spec auto_discover() :: {:ok, t(), String.t()} | {:error, Exception.t()}
Creates a gRPC client using port discovery.
Reads the daemon.port file to find the gRPC port. Falls back to the default target if the port file is not found.
Examples
{:ok, client, target} = Antd.GrpcClient.auto_discover()
@spec build_manifest(t(), [Antd.ManifestEntryInput.t()], keyword()) :: {:ok, Antd.BuiltManifest.t()} | {:error, Exception.t()}
Builds a .ant manifest from DataMaps and public addresses already in
hand. Mirrors Antd.Client.build_manifest/3, including its entry check
before sending; an entry the daemon rejects (INVALID_ARGUMENT) is an
Antd.BadRequestError whose message names entries[i]. Nothing is
uploaded or paid for.
Options
:name,:torrent_info_hashes,:embed_roots(defaulttrue) — as forAntd.Client.build_manifest/3.:timeout— call timeout in milliseconds (default 300_000).
@spec build_manifest!(t(), [Antd.ManifestEntryInput.t()], keyword()) :: Antd.BuiltManifest.t()
Like build_manifest/3 but raises on error.
@spec chunk_get(t(), String.t()) :: {:ok, binary()} | {:error, Exception.t()}
Retrieves a chunk by address.
Like chunk_get/2 but raises on error.
@spec chunk_put(t(), binary()) :: {:ok, Antd.PutResult.t()} | {:error, Exception.t()}
Stores a raw chunk on the network.
@spec chunk_put!(t(), binary()) :: Antd.PutResult.t()
Like chunk_put/2 but raises on error.
@spec data_cost(t(), binary(), keyword()) :: {:ok, Antd.UploadCostEstimate.t()} | {:error, Exception.t()}
Pre-upload cost breakdown for the given bytes.
Options
:payment_mode—Antd.PaymentMode.t()(default:auto).
@spec data_cost!(t(), binary(), keyword()) :: Antd.UploadCostEstimate.t()
Like data_cost/3 but raises on error.
@spec data_get(t(), String.t()) :: {:ok, binary()} | {:error, Exception.t()}
Retrieves private data using a caller-held DataMap.
Like data_get/2 but raises on error.
@spec data_get_public(t(), String.t()) :: {:ok, binary()} | {:error, Exception.t()}
Retrieves public data by address.
Like data_get_public/2 but raises on error.
@spec data_put(t(), binary(), keyword()) :: {:ok, Antd.DataPutResult.t()} | {:error, Exception.t()}
Stores private encrypted data on the network.
Options
:payment_mode—Antd.PaymentMode.t()(default:auto).
@spec data_put!(t(), binary(), keyword()) :: Antd.DataPutResult.t()
Like data_put/3 but raises on error.
@spec data_put_public(t(), binary(), keyword()) :: {:ok, Antd.DataPutPublicResult.t()} | {:error, Exception.t()}
Stores public data on the network.
Options
:payment_mode—Antd.PaymentMode.t()(default:auto).
@spec data_put_public!(t(), binary(), keyword()) :: Antd.DataPutPublicResult.t()
Like data_put_public/3 but raises on error.
@spec data_stream(t(), String.t()) :: {:ok, Enumerable.t()} | {:error, Exception.t()}
Streams private data from a caller-held DataMap, one decrypt batch at a time,
instead of buffering the whole object. The gRPC counterpart to data_get/2
and mirror of the REST client's data_stream/2.
On success returns {:ok, enumerable} where enumerating yields binary chunks;
concatenate or write them as they arrive, e.g.
{:ok, stream} = Antd.GrpcClient.data_stream(client, data_map)
Enum.into(stream, File.stream!("out.bin"))A mid-stream gRPC error is raised as the translated exception while the enumerable is consumed.
@spec data_stream!(t(), String.t()) :: Enumerable.t()
Like data_stream/2 but raises on error.
@spec data_stream_public(t(), String.t()) :: {:ok, Enumerable.t()} | {:error, Exception.t()}
Streams public data by address — the gRPC counterpart to data_get_public/2.
Same {:ok, enumerable} of binary chunks contract as data_stream/2.
@spec data_stream_public!(t(), String.t()) :: Enumerable.t()
Like data_stream_public/2 but raises on error.
@spec data_stream_public_with_progress(t(), String.t()) :: {:ok, Enumerable.t()} | {:error, Exception.t()}
data_stream_public/2 with interleaved fetch-progress frames. See
data_stream_with_progress/2.
@spec data_stream_public_with_progress!(t(), String.t()) :: Enumerable.t()
Like data_stream_public_with_progress/2 but raises on error.
@spec data_stream_with_progress(t(), String.t()) :: {:ok, Enumerable.t()} | {:error, Exception.t()}
data_stream/2 with interleaved fetch-progress frames so the caller can drive
a determinate download progress bar. Sets the request's include_progress
flag; enumerating the returned stream yields Antd.DownloadFrame structs —
each a plaintext chunk (:data) or a Antd.DownloadProgress update
(:progress). The byte denominator arrives separately as the
x-content-length response header.
{:ok, frames} = Antd.GrpcClient.data_stream_with_progress(client, data_map)
Enum.each(frames, fn
%Antd.DownloadFrame{progress: %{} = p} -> render_bar(p.fetched, p.total)
%Antd.DownloadFrame{data: bytes} -> IO.binwrite(bytes)
end)
@spec data_stream_with_progress!(t(), String.t()) :: Enumerable.t()
Like data_stream_with_progress/2 but raises on error.
@spec decode_manifest(t(), binary(), keyword()) :: {:ok, Antd.DecodedManifest.t()} | {:error, Exception.t()}
Decodes .ant bytes (a raw binary). Mirrors
Antd.Client.decode_manifest/3.
Options
:resolve— as forAntd.Client.decode_manifest/3(defaultfalse).:timeout— call timeout in milliseconds (default 300_000).
@spec decode_manifest!(t(), binary(), keyword()) :: Antd.DecodedManifest.t()
Like decode_manifest/3 but raises on error.
@spec decode_manifest_link(t(), String.t(), keyword()) :: {:ok, Antd.DecodedManifest.t()} | {:error, Exception.t()}
Decodes an ant:// manifest link, a file link or a bare 64-hex address.
Mirrors Antd.Client.decode_manifest_link/3; takes the same options as
decode_manifest/3.
@spec decode_manifest_link!(t(), String.t(), keyword()) :: Antd.DecodedManifest.t()
Like decode_manifest_link/3 but raises on error.
@spec file_cost(t(), String.t(), boolean(), keyword()) :: {:ok, Antd.UploadCostEstimate.t()} | {:error, Exception.t()}
Pre-upload cost breakdown for the file at path.
Options
:payment_mode—Antd.PaymentMode.t()(default:auto).
@spec file_cost!(t(), String.t(), boolean(), keyword()) :: Antd.UploadCostEstimate.t()
Like file_cost/4 but raises on error.
@spec file_get(t(), String.t(), String.t()) :: :ok | {:error, Exception.t()}
Downloads a private file from a caller-held DataMap into dest_path.
Like file_get/3 but raises on error.
@spec file_get_public(t(), String.t(), String.t()) :: :ok | {:error, Exception.t()}
Downloads a public file from the network to a local path.
Like file_get_public/3 but raises on error.
@spec file_put(t(), String.t(), keyword()) :: {:ok, Antd.FilePutResult.t()} | {:error, Exception.t()}
Uploads a local file privately.
Options
:payment_mode—Antd.PaymentMode.t()(default:auto).
@spec file_put!(t(), String.t(), keyword()) :: Antd.FilePutResult.t()
Like file_put/3 but raises on error.
@spec file_put_public(t(), String.t(), keyword()) :: {:ok, Antd.FilePutPublicResult.t()} | {:error, Exception.t()}
Uploads a local file publicly.
Options
:payment_mode—Antd.PaymentMode.t()(default:auto).
@spec file_put_public!(t(), String.t(), keyword()) :: Antd.FilePutPublicResult.t()
Like file_put_public/3 but raises on error.
@spec finalize_chunk_upload(t(), String.t(), map()) :: {:ok, String.t()} | {:error, Exception.t()}
Submits a prepared chunk after external payment. Returns the on-network
address of the stored chunk (matches PrepareChunkResult.address).
Like finalize_chunk_upload/3 but raises on error.
@spec finalize_merkle_upload(t(), String.t(), String.t(), keyword()) :: {:ok, Antd.FinalizeUploadResult.t()} | {:error, Exception.t()}
Finalizes a merkle-batch upload after the external signer has submitted
the payForMerkleTree2() transaction. winner_pool_hash is the
bytes32 from the MerklePaymentMade event (hex with 0x prefix).
A partial store surfaces as {:error, %Antd.PartialUploadError{}} exactly
as for finalize_upload/3, with the same three cases: retry the same call
(bounded) while retryable is true; re-prepare the same content only
when retention_known is true and retryable is false (for example a
merkle finalize with deliberately unpaid batches); and when
retention_known is false, stop, keep upload_id and
winner_pool_hash, and reconcile before re-preparing or paying again.
Options
:store_data_map— legacy daemon-wallet path; whentrue, the daemon stores the DataMap on-network and returns its address. Prefer:visibility => "public"on prepare for the public-DataMap case. Omitting the option leaves the proto3 default offalse.
@spec finalize_merkle_upload!(t(), String.t(), String.t(), keyword()) :: Antd.FinalizeUploadResult.t()
Like finalize_merkle_upload/4 but raises on error.
@spec finalize_upload(t(), String.t(), map()) :: {:ok, Antd.FinalizeUploadResult.t()} | {:error, Exception.t()}
Finalizes a wave-batch upload after an external signer has submitted
the payForQuotes() transactions. tx_hashes maps each quote_hash
from the prepare result to its on-chain tx_hash.
A finalize that stored only part of the upload returns
{:error, %Antd.PartialUploadError{}} (gRPC ABORTED whose message
starts with Partial upload:; this used to be a plain Antd.AntdError,
as any other ABORTED still is) carrying chunks_stored, chunks_failed,
total_chunks, retryable and retention_known, parsed from the status
message: retention_known is true only when the counts parse and the
message ends with one of the daemon's two closing hints, which then
decides retryable ("paid attempt retained" sets it; "stored chunks
persist; re-prepare the same content" means nothing was retained).
Readable counts with a missing, truncated or unrecognised hint keep the
counts but read as retention unknown. The payment persists and the stored
chunks stay on the network. Recovery has three cases:
retryable: true(antd >= 0.14.0) — the daemon kept the paid attempt under the sameupload_id: call this function again with the same arguments to store the remainder against the same payment. Bound that loop (cap the attempts; achunks_failedthat stops shrinking means stuck).retention_known: true, retryable: false— the daemon confirmed it kept nothing: re-prepare the same content (already-stored chunks are skipped, so the retry pays only for the remainder).retention_known: false— the status message's counts or closing hint could not be read, so retention is unknown and the daemon may still hold the paid attempt. Stop automatic recovery, keepupload_idandtx_hashes, and reconcile before re-preparing or paying again.
See Antd.PartialUploadError, docs/external-signer-flow.md §6 and
examples/07_external_signer.exs.
@spec finalize_upload!(t(), String.t(), map()) :: Antd.FinalizeUploadResult.t()
Like finalize_upload/3 but raises on error.
@spec health(t()) :: {:ok, Antd.HealthStatus.t()} | {:error, Exception.t()}
Checks the antd daemon status.
@spec health!(t()) :: Antd.HealthStatus.t()
Like health/1 but raises on error.
@spec new(String.t()) :: {:ok, t()} | {:error, Exception.t()}
Creates a new gRPC client and opens a channel to the daemon.
Examples
{:ok, client} = Antd.GrpcClient.new()
{:ok, client} = Antd.GrpcClient.new("localhost:50051")
Like new/1 but raises on error.
@spec pointer_controller(t(), String.t(), keyword()) :: {:ok, Antd.PointerController.t()} | {:error, Exception.t()}
Follows the transfers of the pointer at address to the pointer whose
owner now decides what it resolves to. Mirrors
Antd.Client.pointer_controller/2.
Options
:timeout— call timeout in milliseconds (default 300_000).
@spec pointer_controller!(t(), String.t(), keyword()) :: Antd.PointerController.t()
Like pointer_controller/3 but raises on error.
@spec pointer_create(t(), String.t(), String.t(), keyword()) :: {:ok, Antd.PointerWriteResult.t()} | {:error, Exception.t()}
Creates the pointer at owner, pointing at target, paid by the daemon
wallet. Mirrors Antd.Client.pointer_create/4: Antd.AlreadyExistsError
if it exists, refused before paying. Each call pays: do not retry it
automatically.
Options
:kind—Antd.PointerKind.t/0(:chunk, the daemon's default, or:pointer).:timeout— call timeout in milliseconds (default 300_000).
@spec pointer_create!(t(), String.t(), String.t(), keyword()) :: Antd.PointerWriteResult.t()
Like pointer_create/4 but raises on error.
@spec pointer_finality(t(), String.t(), keyword()) :: {:ok, Antd.PointerFinality.t()} | {:error, Exception.t()}
Asks the whole close group where the pointer at address stands. Mirrors
Antd.Client.pointer_finality/2; an unset counter, state or majority (an
empty string or absent message on the wire) reads as nil.
Options
:timeout— call timeout in milliseconds (default 300_000).
@spec pointer_finality!(t(), String.t(), keyword()) :: Antd.PointerFinality.t()
Like pointer_finality/3 but raises on error.
@spec pointer_finalize(t(), String.t(), map(), keyword()) :: {:ok, Antd.PointerFinalizeResult.t()} | {:error, Exception.t()}
Stores a prepared pointer write once its external signer has paid.
Mirrors Antd.Client.pointer_finalize/3: an
Antd.CloseGroupShortfallError with retryable: true (read from the
message's closing (paid attempt retained...) hint) means the daemon kept
the paid state; repeat the call with the same upload_id, bounded. This
function never retries by itself.
Options
:timeout— call timeout in milliseconds (default 300_000).
@spec pointer_finalize!(t(), String.t(), map(), keyword()) :: Antd.PointerFinalizeResult.t()
Like pointer_finalize/4 but raises on error.
@spec pointer_get(t(), String.t(), keyword()) :: {:ok, Antd.PointerRecord.t()} | {:error, Exception.t()}
Reads the pointer at address. Mirrors Antd.Client.pointer_get/2:
Antd.NotFoundError if there is none.
Options
:timeout— call timeout in milliseconds (default 300_000).
@spec pointer_get!(t(), String.t(), keyword()) :: Antd.PointerRecord.t()
Like pointer_get/3 but raises on error.
@spec pointer_keys(t(), keyword()) :: {:ok, [String.t()]} | {:error, Exception.t()}
Lists the pointers this daemon holds owner keys for, as their addresses.
Mirrors Antd.Client.pointer_keys/1.
Options
:timeout— call timeout in milliseconds (default 300_000).
Like pointer_keys/2 but raises on error.
@spec pointer_prepare(t(), String.t(), Antd.PointerOp.t(), keyword()) :: {:ok, Antd.PointerPrepareResult.t()} | {:error, Exception.t()}
Has the daemon sign op on the pointer at owner and quote it for an
external signer. Mirrors Antd.Client.pointer_prepare/4; op is an
Antd.PointerOp.t/0.
Options
:include_signed_quotes— whentrue, the result'ssigned_quotescarries each quote in full signed form (base64, as over REST).:timeout— call timeout in milliseconds (default 300_000).
@spec pointer_prepare!(t(), String.t(), Antd.PointerOp.t(), keyword()) :: Antd.PointerPrepareResult.t()
Like pointer_prepare/4 but raises on error.
@spec pointer_resolve(t(), String.t(), keyword()) :: {:ok, Antd.PointerTarget.t()} | {:error, Exception.t()}
Follows a chain of pointers from address to the target at its end.
Mirrors Antd.Client.pointer_resolve/2.
Options
:timeout— call timeout in milliseconds (default 300_000).
@spec pointer_resolve!(t(), String.t(), keyword()) :: Antd.PointerTarget.t()
Like pointer_resolve/3 but raises on error.
@spec pointer_transfer(t(), String.t(), String.t(), keyword()) :: {:ok, Antd.PointerTransferResult.t()} | {:error, Exception.t()}
Hands the pointer at owner over to the pointer at recipient, for good,
paid by the daemon wallet. Mirrors Antd.Client.pointer_transfer/3.
Irreversible once stored. Each call pays: do not retry it
automatically.
Options
:timeout— call timeout in milliseconds (default 300_000).
@spec pointer_transfer!(t(), String.t(), String.t(), keyword()) :: Antd.PointerTransferResult.t()
Like pointer_transfer/4 but raises on error.
@spec pointer_update(t(), String.t(), String.t(), keyword()) :: {:ok, Antd.PointerWriteResult.t()} | {:error, Exception.t()}
Points the pointer at owner at target, paid by the daemon wallet,
creating it if it does not exist. Mirrors Antd.Client.pointer_update/4:
Antd.PointerFinalError once it was transferred or frozen (usually refused
before paying), and Antd.ConflictError if a prepared write awaits payment
(refused before paying) or the update lost to a newer state (possibly after
paying). Each call pays: do not retry it automatically. Takes the same
options as pointer_create/4.
@spec pointer_update!(t(), String.t(), String.t(), keyword()) :: Antd.PointerWriteResult.t()
Like pointer_update/4 but raises on error.
@spec prepare_chunk_upload(t(), binary()) :: {:ok, Antd.PrepareChunkResult.t()} | {:error, Exception.t()}
Prepares a single-chunk publish for external signing.
Returns either already_stored: true (no payment needed, no finalize
call required) or a wave-batch payment intent the external signer must
execute before calling finalize_chunk_upload/3.
@spec prepare_chunk_upload!(t(), binary()) :: Antd.PrepareChunkResult.t()
Like prepare_chunk_upload/2 but raises on error.
@spec prepare_data_upload(t(), binary(), keyword()) :: {:ok, Antd.PrepareUploadResult.t()} | {:error, Exception.t()}
Prepares an in-memory data upload for external signing.
Options
:visibility— seeprepare_upload/3.
@spec prepare_data_upload!(t(), binary(), keyword()) :: Antd.PrepareUploadResult.t()
Like prepare_data_upload/3 but raises on error.
@spec prepare_upload(t(), String.t(), keyword()) :: {:ok, Antd.PrepareUploadResult.t()} | {:error, Exception.t()}
Prepares a file upload for external signing.
Options
:visibility—"public"bundles the DataMap chunk into the same external-signer payment batch so finalize returns its on-network address via:data_map_address. Omitting the option leaves the proto3 default of"", preserving the wire shape for daemons predating the public-prepare addition.
@spec prepare_upload!(t(), String.t(), keyword()) :: Antd.PrepareUploadResult.t()
Like prepare_upload/3 but raises on error.
@spec prepare_upload_public(t(), String.t()) :: {:ok, Antd.PrepareUploadResult.t()} | {:error, Exception.t()}
Convenience wrapper: prepare a public file upload for external signing.
Equivalent to prepare_upload(client, path, visibility: "public").
@spec prepare_upload_public!(t(), String.t()) :: Antd.PrepareUploadResult.t()
Like prepare_upload_public/2 but raises on error.
@spec wallet_address(t()) :: {:ok, Antd.WalletAddress.t()} | {:error, Exception.t()}
Returns the wallet's on-chain address.
@spec wallet_address!(t()) :: Antd.WalletAddress.t()
Like wallet_address/1 but raises on error.
@spec wallet_approve(t()) :: {:ok, boolean()} | {:error, Exception.t()}
Approves the wallet to spend tokens on the payment vault contract. One-time operation; idempotent at the contract level.
Like wallet_approve/1 but raises on error.
@spec wallet_balance(t()) :: {:ok, Antd.WalletBalance.t()} | {:error, Exception.t()}
Returns the wallet's token + gas balances.
@spec wallet_balance!(t()) :: Antd.WalletBalance.t()
Like wallet_balance/1 but raises on error.