ishtaran

package module
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2026 License: Apache-2.0 Imports: 28 Imported by: 0

README

Ishtaran Go SDK

Official Go SDK for the Ishtaran API -- a programmable financial platform (virtual accounts, conditional release workflows, settlements, and self-custody blockchain execution).

Public Sandbox available -- Production not yet available

Project status

Ishtaran's public Sandbox is live and has been validated end to end (signup -> payment -> self-custody signing -> simulated broadcast -> reconciliation), with all four official SDKs published on their real package registries.

  • Public Sandbox: available now, simulated blockchain execution, no real funds involved.
  • Production blockchain execution is not available yet -- no real blockchain connector is registered; see Production status below.

See Sandbox below for how to point this SDK at it.

What this SDK does

Fourth and final implementation of the Ishtaran Official SDK Program (Java -> TypeScript -> Python -> Go), 100% functional parity with Java (the reference SDK). See also: Java · TypeScript/Node.js · Python.

Two layers over the same backend:

  • Easy Mode -- client.ReceivePayment(...), client.Withdraw(...), client.GetBalance(...), client.VerifyWebhookSignature(...): fast composition, never duplicates business logic.
  • Core API -- client.Accounts, client.Transactions, client.Withdrawals, etc.: granular access to the same real API endpoints, with nothing invented beyond what the real API exposes.
  • AccountHolders -- client.AccountHolders: self-service for the financial holder's global identity -- SignUp/Login/Me/ClaimInvitation/SignUpAndClaimInvitation. Isolated session: never shares a token with client.Auth (Member) nor with the Organization's API Key within the same client instance.

Self-custody

Your keys stay with you. The SDK signs locally. Ishtaran verifies and relays. The blockchain executes.

  • Wallet generation/restoration happens client-side, inside this SDK.
  • Private keys, seeds, and mnemonic phrases never need to be sent to Ishtaran.
  • Signing happens in your own environment/process.
  • The SDK validates the signing context before signing.
  • Ishtaran only ever receives public wallet/derivation material and signed execution payloads.
  • Ishtaran verifies each signature, relays the transaction, and monitors and reconciles execution.
  • Sandbox and Production use the same signing semantics from the SDK's perspective -- environment behavior (simulated vs. real execution) is resolved by the Ishtaran API/infrastructure, never by a special cryptographic code path inside the SDK.

GenerateWallet/RestoreWallet generate or restore a BIP39/BIP32/BIP44 wallet locally and sign a leg's canonical hash. The private key, seed, and mnemonic never leave this code and are never sent to Ishtaran.

// Wallet generated locally -- the mnemonic/private key never leave this process.
generated, err := ishtaran.GenerateWallet() // 24-word mnemonic, back it up now -- it is shown only once

// Only the public key is registered with Ishtaran.
registered, err := client.Wallets.Register(ctx, applicationID, networkID,
	ishtaran.DerivationSchemeTronBIP44HardenedAccount,
	generated.Wallet.AccountExtendedPublicKey)

// Signing also happens locally, against a hash Ishtaran computed and verifies.
signature, err := generated.Signer.Sign(0, canonicalHash)

generated.Signer (*InMemorySigner, the reference Signer returned by GenerateWallet) keeps the account private key in plain process memory -- documented as unsafe for Production. Implement the Signer interface yourself against a Vault/KMS/HSM/OS keychain for any real deployment; the interface never mandates a specific backend.

Execution destinations (required before a SelfCustody Settlement can execute)

client.ExecutionDestinations.Register declares the real on-chain address a beneficiary Account receives funds at, for a given AssetNetwork. Settlements.ExecuteSettlement now resolves the destination for every beneficiary (and for the Platform Fee) before it builds a SigningRequest -- if none is registered, the call fails fast with a clear error before any signing/broadcast starts, rather than silently reusing a WithdrawalDestination or guessing. First-registration-wins: a second call for the same accountID+assetNetworkID pair is rejected, never silently overwritten (deliberately simpler than WithdrawalDestination's whitelist/cooldown policy -- this is a beneficiary declaring where they get paid, not an integrator-controlled withdrawal).

_, err := client.ExecutionDestinations.Register(ctx, organizationID, sellerAccountID, assetNetworkID, sellerAddress)

Once a Settlement moves to SelfCustody execution, SettlementResponse.SigningRequestIDs is populated -- a Settlement funded by multiple physical deposit addresses produces one SigningRequest per source, fetched/signed the same way for each ID. SigningRequestID (singular) is kept as a compatibility field, always just the first entry of SigningRequestIDs -- prefer the plural field for any Settlement that might have more than one funding source. Withdrawal.SigningRequestID stays singular only -- Withdrawals don't support multi-source funding today. Fetch a request with client.SigningRequests.Get(ctx, signingRequestID) to sign locally, the same flow as the wallet example above.

See examples/13_self_custody_signing/main.go for the full runnable flow (register a wallet, allocate a deposit address, create a SigningRequest, sign and submit every leg), and Self-Custody for the complete protocol detail.

Current capabilities

  • Organizations / Applications / Environments
  • API Keys
  • Accounts / AccountHolders
  • Payment Intents / Deposits
  • Ledger
  • Transactions
  • Workflows / Rules
  • Settlements / Splits / Fees / Refunds
  • Withdrawals
  • Webhooks
  • Self-custody: wallet generation/restore, public address derivation, SigningRequest validation, local signing, signed transaction submission
  • Network Execution Engine: cost quoting, execution source registration/resource-stake sync, network cost payer account registration and CUSTOMER_RESOURCES/ISHTARAN_RESOURCES preference -- see CORE_API.md § Network Execution Engine
  • Payout: payable summary (accrued/paid, never the same as on-chain balance), Manual PayoutBatch creation and retrieval -- see CORE_API.md § Payout
  • Wallet Balance: client.WalletBalance -- the wallet's own observed on-chain balance at a registered self-custody address (snapshot read, authoritative refresh with a server-side 30s guard, multi-asset/multi-network aggregate) -- a fundamentally different question from client.Ledger's economic accounting, never summed or substituted for one another -- see CORE_API.md § Wallet Balance

This is deliberately not a full reference -- see FEATURES.md and the API Reference for details.

Installation

go get github.com/taylorjeftedasilva/ishtaran-go@v0.1.4

v0.1.4 is a real, tagged Development Preview release, resolvable through the standard Go module proxy -- verified live from a clean, credential-less environment (2026-09-11). v0.1.4 is also the minimum version if your code needs client.WalletBalance or reads Payable/ReservedForPayout/Delivered from client.GetBalance/client.Ledger.GetBalance (G.2). See CHANGELOG.md for what's in it.

Requires Go 1.23+ (uses iter.Seq2 -- native range-over-func -- for pagination iterators).

Quick example

package main

import (
	"context"
	"fmt"
	"os"

	"github.com/taylorjeftedasilva/ishtaran-go"
)

func main() {
	client, err := ishtaran.NewClient(
		ishtaran.WithAPIKey(os.Getenv("ISHTARAN_API_KEY")),
		ishtaran.WithEnvironment(ishtaran.Sandbox), // resolves to the real public Sandbox; Local/Production also available
	)
	if err != nil {
		panic(err)
	}

	balance, err := client.GetBalance(context.Background(), accountID, assetNetworkID)
	if err != nil {
		panic(err)
	}
	fmt.Println("Available:", balance.Available) // decimal.Decimal, never float64
}

See GETTING_STARTED.md and examples/.

Sandbox

The public Sandbox is live at https://sandbox-api.ishtaran.com (ishtaran.Sandbox resolves to it automatically -- no WithBaseURL needed, though an explicit WithBaseURL always overrides it). The raw Cloud Run URL from the initial 2026-08-24 deploy still works, but is no longer advertised -- use the canonical domain above.

  • Sandbox uses simulated blockchain execution -- no real funds are involved.
  • The self-custody signing protocol described above is fully exercised in Sandbox: signatures are not skipped just because execution is simulated.
  • Rate limits and idempotency behave the same as Production; only the blockchain broadcast is simulated.

Production status

Production blockchain execution is not available yet.

Additional networks/assets may be mentioned elsewhere in this project as roadmap items -- none of them should be read as available in Production today.

Security

  • Never commit API keys.
  • Never transmit mnemonic phrases, seeds, or private keys to Ishtaran -- there is no legitimate reason for any Ishtaran API call to ever need them.
  • Use a production-grade KeyStore/Signer implementation for real deployments.
  • The reference *InMemorySigner returned by GenerateWallet/RestoreWallet is an example, not a production secret-storage solution.
  • Verify the expected destination, asset, amount, and signing context before signing.
  • Treat any integration, tool, or request asking you to upload private key material as invalid.

See SECURITY.md for more detail.

Documentation

Document Content
GETTING_STARTED.md First use
AUTHENTICATION.md X-Api-Key vs. Member JWT
EASY_MODE.md When to use Easy Mode vs. Core
CORE_API.md Full resource coverage
ERROR_HANDLING.md IshtaranError hierarchy
IDEMPOTENCY.md Automatic vs. explicit key
RETRIES.md Retry policy
WEBHOOKS.md Signature verification
CONFIGURATION.md Client configuration
SECURITY.md Secrets, TLS, redaction
FEATURES.md Capability coverage
CHANGELOG.md Version history

Every behavior is extracted from the real API, never invented -- see the Documentation and API Reference.

Money is always decimal.Decimal

Every monetary field uses github.com/shopspring/decimal -- never float64. The real API sends money as number(double) in JSON; encoding/json already deserializes a raw number directly into decimal.Decimal with no precision loss (confirmed by test), so no custom parser is needed on the response side. The request side is different: decimal.Decimal.MarshalJSON() quotes the value as a string by default, which the real API (expecting a number) would reject -- the same class of finding fixed in the TypeScript/Python SDKs. This SDK fixes it with an internal wrapper (rawDecimal) applied to every monetary field in a request body. See the API Reference for the real JSON shape of every monetary field.

Single package, context.Context mandatory

The whole SDK lives in a single flat ishtaran package (no subpackages) -- the same pattern used by large, idiomatic Go SDKs (e.g. stripe-go). Every method that makes a network call takes context.Context as its first parameter -- that's where the WaitFor/WaitForPayment timeout comes from (see EASY_MODE.md and polling.go), a deliberate idiomatic divergence from the explicit timeoutSeconds parameter used in Java/TypeScript/Python.

Package distribution roadmap

v0.1.4 (Development Preview) is tagged and live -- see Installation. Future releases follow the same path: a reviewed, tested commit gets a new semver tag (v0.2.0, ..., eventually v1.0.0 once the API is considered stable), and go get resolves it immediately through the standard Go module proxy. No separate registry step is needed for Go.

License

This SDK is licensed under the Apache License 2.0. See LICENSE.

Documentation

Index

Constants

View Source
const (
	SDKVersion       = "0.1.3"
	DefaultUserAgent = "ishtaran-go/" + SDKVersion
)

SDKVersion and DefaultUserAgent -- fixed format ishtaran-go/<version> -- never contains personal data (a brief rule).

View Source
const LocalBaseURL = "http://localhost:8080"

LocalBaseURL and SandboxBaseURL are real known defaults today. SandboxBaseURL points at the canonical sandbox-api.ishtaran.com domain (Cloud Run Domain Mapping, live since 2026-08-25 -- the raw Cloud Run URL from the 2026-08-24 deploy still works but is no longer advertised). Production does not have real infrastructure provisioned yet (terraform apply has never run against it): resolving it without an explicit BaseURL is a configuration error, never a silent fallback.

View Source
const SandboxBaseURL = "https://sandbox-api.ishtaran.com"

Variables

This section is empty.

Functions

func ComputeCanonicalHash

func ComputeCanonicalHash(
	protocolVersion int,
	environmentID, walletID string,
	derivationReference int,
	originReference, assetNetworkID, sourceAddress, legRole, destinationAddress string,
	amount decimal.Decimal,
	expiresAtUnixSeconds int64,
) (string, error)

ComputeCanonicalHash -- reference reimplementation of the backend's canonical algorithm (CreateSigningRequestCommandHandler.ComputeCanonicalLegHash, C#). Must reproduce it byte for byte -- see docs/specs/execution-custody/CANONICAL-HASH-TEST-VECTORS.md for the full specification and the reference vectors this function is tested against (canonical_hash_reference_vectors_test.go). Never JSON (key order/whitespace/number formatting vary across languages, the classic source of cross-language divergence) -- a fixed string joined by "|", SHA-256, uppercase hex.

func ComputeWebhookSignature

func ComputeWebhookSignature(unixTimestampSeconds int64, rawBody, endpointSecret string) string

ComputeWebhookSignature -- algorithm extracted byte for byte from WebhookSignatureCalculator.cs/HttpWebhookDeliveryPort.cs (see SDK_CAPABILITY_SPEC.md section 10): signedContent = "{unixTimestamp}.{rawBodyJson}", signature = lowercase_hex(HMAC_SHA256(secret, signedContent)).

func DeriveTronAddress

func DeriveTronAddress(accountExtendedPublicKey string, index uint32) (string, error)

DeriveTronAddress -- derives a Tron mainnet address from an extended public key (xpub) -- CKDpub only (non-hardened BIP32), never needs/touches a private key (INV-SC-01). Mirrors TronAddressDerivationProvider (backend) field for field -- used by the SDK to independently verify sourceAddress/destinationAddress before signing (defense in depth).

Algorithm: uncompressed secp256k1 public key (65 bytes: 0x04||X(32)||Y(32)) -> strip the 0x04 prefix -> Keccak-256 (64-byte input) -> last 20 bytes -> mainnet prefix 0x41 -> Base58Check.

func GenerateIdempotencyKey

func GenerateIdempotencyKey() string

GenerateIdempotencyKey -- generates the idempotencyKey (a body field, or a header on 2 specific OrganizationTenancy endpoints -- see SDK_CAPABILITY_SPEC.md section 9) when the caller doesn't supply one explicitly. UUID v4 -- the same format the API's real Guid fields accept.

func VerifyWebhookSignature

func VerifyWebhookSignature(rawBody, signatureHeader, timestampHeader, endpointSecret string) bool

VerifyWebhookSignature uses rawBody exactly as received -- never reserializes the JSON before computing. Real constant-time comparison (crypto/subtle).

func VerifyWebhookSignatureWithTolerance

func VerifyWebhookSignatureWithTolerance(rawBody, signatureHeader, timestampHeader, endpointSecret string, tolerance time.Duration) bool

Types

type AccountHolderResponse

type AccountHolderResponse struct {
	AccountHolderID string     `json:"accountHolderId"`
	AccountID       string     `json:"accountId"`
	Email           *string    `json:"email"`
	HasCredentials  bool       `json:"hasCredentials"`
	Status          string     `json:"status"`
	CreatedAt       time.Time  `json:"createdAt"`
	LastLoginAt     *time.Time `json:"lastLoginAt"`
}

AccountHolderResponse -- DEC-032.

type AccountHolderTokenResult

type AccountHolderTokenResult struct {
	Success     bool       `json:"success"`
	AccessToken string     `json:"accessToken"`
	ExpiresAt   *time.Time `json:"expiresAt"`
	ErrorCode   string     `json:"errorCode"`
}

AccountHolderTokenResult -- result of AccountHolders.SignUp()/.Login(). A dedicated type (never TokenResult from model_control_plane.go): the AccountHolder has no Refresh Token in this version (MVP, scope deliberately reduced by the backend) and never carries organizationId/Role.

type AccountHoldersResource

type AccountHoldersResource struct {
	// contains filtered or unexported fields
}

AccountHoldersResource -- DEC-032: self-service, global AccountHolder identity (/v1/account-holders/*), authenticated via AccountHolderJwtScheme -- its own key/token, never shared with AuthResource's (Member) bearerTokenHolder nor with the Organization's API Key. Built on its own transport (see client.go) precisely so the two tokens never mix within the same client instance.

func (*AccountHoldersResource) ClaimInvitation

func (r *AccountHoldersResource) ClaimInvitation(ctx context.Context, plainTextToken string) (ClaimAccountHolderInvitationResult, error)

ClaimInvitation -- requires an active AccountHolder session -- claims an invitation from a NEW Organization for the already-authenticated identity (BR-HLD-006, reuses the existing Account, never duplicates it).

func (*AccountHoldersResource) Login

func (r *AccountHoldersResource) Login(ctx context.Context, email, password string) (AccountHolderTokenResult, error)

func (*AccountHoldersResource) Logout

func (r *AccountHoldersResource) Logout()

Logout -- no HTTP call -- clears the local AccountHolder session (never affects the Organization's Member/API Key session).

func (*AccountHoldersResource) Me

Me -- requires an active AccountHolder session (SignUp/Login already called on this client instance, or SetAccessToken).

func (*AccountHoldersResource) SetAccessToken

func (r *AccountHoldersResource) SetAccessToken(accessToken string)

SetAccessToken -- fills in the session manually (e.g. a token obtained in a previous process).

func (*AccountHoldersResource) SignUp

func (r *AccountHoldersResource) SignUp(ctx context.Context, email, password string) (AccountHolderTokenResult, error)

func (*AccountHoldersResource) SignUpAndClaimInvitation

func (r *AccountHoldersResource) SignUpAndClaimInvitation(ctx context.Context, plainTextToken, email, password string) (SignUpAndClaimAccountHolderInvitationResult, error)

SignUpAndClaimInvitation -- no prior authentication -- creates the identity and claims the invitation atomically (holder never seen before).

type AccountResponse

type AccountResponse struct {
	AccountID       string    `json:"accountId"`
	AccountHolderID string    `json:"accountHolderId"`
	Status          string    `json:"status"`
	CreatedAt       time.Time `json:"createdAt"`
}

AccountResponse -- DEC-032: an Account no longer belongs to a single Organization directly (global identity, linked to N Organizations via Relationship). For the Organization-scoped link, see OrganizationAccountResponse (model_account_holders.go), returned by AccountsResource.List.

type AccountStatus

type AccountStatus string
const (
	AccountStatusActive AccountStatus = "Active"
	AccountStatusFrozen AccountStatus = "Frozen"
	AccountStatusClosed AccountStatus = "Closed"
)

type AccountsResource

type AccountsResource struct {
	// contains filtered or unexported fields
}

AccountsResource -- Data Plane -- Accounts (9 real routes, DEC-032).

func (*AccountsResource) AuthorizeApplication

func (r *AccountsResource) AuthorizeApplication(ctx context.Context, organizationID, accountID, applicationID string) error

AuthorizeApplication -- DEC-032: route nested under organizationID (formerly /v1/accounts/{accountId}/authorize-application) -- the backend revalidates the Relationship (organizationId, Account.AccountHolderId) internally.

func (*AccountsResource) Close

func (r *AccountsResource) Close(ctx context.Context, accountID string) error

func (*AccountsResource) Create

func (r *AccountsResource) Create(ctx context.Context, organizationID, externalID string) (CreateAccountResult, error)

func (*AccountsResource) CreateAccountHolderInvitation

func (r *AccountsResource) CreateAccountHolderInvitation(ctx context.Context, organizationID, externalID string) (CreateAccountHolderInvitationResult, error)

CreateAccountHolderInvitation -- DEC-032/BR-HLD-005: issues an invitation for an AccountHolder to link with this Organization. PlainTextToken only exists in this response, once -- treat it as a secret. externalID can be "" (omitted from the resulting link).

func (*AccountsResource) Freeze

func (r *AccountsResource) Freeze(ctx context.Context, accountID, reason string) error

func (*AccountsResource) Get

func (r *AccountsResource) Get(ctx context.Context, accountID string) (AccountResponse, error)

func (*AccountsResource) List

func (r *AccountsResource) List(ctx context.Context, organizationID string) ([]OrganizationAccountResponse, error)

List -- returns this Organization's link (Relationship) to each Account -- never the standalone Account (DEC-032).

func (*AccountsResource) RevokeRelationship

func (r *AccountsResource) RevokeRelationship(ctx context.Context, organizationID, relationshipID string) error

RevokeRelationship -- DEC-032/BR-ACC-008: never deletes the AccountHolder/Account, only removes this Organization's authorization.

func (*AccountsResource) Unfreeze

func (r *AccountsResource) Unfreeze(ctx context.Context, accountID string) error

type AllocatedDepositAddressResult

type AllocatedDepositAddressResult struct {
	WalletID            string `json:"walletId"`
	Address             string `json:"address"`
	DerivationReference uint32 `json:"derivationReference"`
}

AllocatedDepositAddressResult -- BR-WLT-001 -- DerivationReference is never reused across calls.

type ApiError

type ApiError struct {
	// contains filtered or unexported fields
}

ApiError -- fallback, any 4xx/5xx whose Code is not recognized.

func (ApiError) Code

func (e ApiError) Code() string

func (ApiError) Details

func (e ApiError) Details() any

func (ApiError) Error

func (e ApiError) Error() string

func (ApiError) HTTPStatus

func (e ApiError) HTTPStatus() int

func (ApiError) RequestID

func (e ApiError) RequestID() string

func (ApiError) Retryable

func (e ApiError) Retryable() bool

func (ApiError) Unwrap

func (e ApiError) Unwrap() error

type ApiKeyMetadataResponse

type ApiKeyMetadataResponse struct {
	ApiKeyID   string     `json:"apiKeyId"`
	CreatedAt  time.Time  `json:"createdAt"`
	LastUsedAt *time.Time `json:"lastUsedAt"`
}

type ApiKeysResource

type ApiKeysResource struct {
	// contains filtered or unexported fields
}

ApiKeysResource -- Control Plane -- ApiKeys (2 real routes).

func (*ApiKeysResource) Revoke

func (r *ApiKeysResource) Revoke(ctx context.Context, apiKeyID string) error

func (*ApiKeysResource) Rotate

func (r *ApiKeysResource) Rotate(ctx context.Context, apiKeyID string, overlapWindow time.Duration) (RotateApiKeyResult, error)

Rotate -- overlapWindow is sent in .NET's real TimeSpan format (not a Go duration string). PlainTextKey of the new key only ever appears in this response.

type ApplicationResponse

type ApplicationResponse struct {
	ApplicationID  string `json:"applicationId"`
	OrganizationID string `json:"organizationId"`
	Name           string `json:"name"`
	Status         string `json:"status"`
}

type ApplicationStatus

type ApplicationStatus string
const (
	ApplicationStatusActive    ApplicationStatus = "Active"
	ApplicationStatusSuspended ApplicationStatus = "Suspended"
	ApplicationStatusArchived  ApplicationStatus = "Archived"
)

type ApplicationsResource

type ApplicationsResource struct {
	// contains filtered or unexported fields
}

ApplicationsResource -- Control Plane -- Applications (4 real routes, plus Create in OrganizationsResource).

func (*ApplicationsResource) Archive

func (r *ApplicationsResource) Archive(ctx context.Context, applicationID string) error

func (*ApplicationsResource) CreateEnvironment

func (r *ApplicationsResource) CreateEnvironment(ctx context.Context, applicationID string, environmentType EnvironmentType) (CreatedResourceResponse, error)

func (*ApplicationsResource) Reactivate

func (r *ApplicationsResource) Reactivate(ctx context.Context, applicationID string) error

func (*ApplicationsResource) Suspend

func (r *ApplicationsResource) Suspend(ctx context.Context, applicationID, reason string) error

type AssetKind

type AssetKind string
const (
	AssetKindFiat   AssetKind = "Fiat"
	AssetKindCrypto AssetKind = "Crypto"
)

type AssetNetworkCatalogResource

type AssetNetworkCatalogResource struct {
	// contains filtered or unexported fields
}

AssetNetworkCatalogResource -- Catalog -- AssetNetworkCatalog (6 real routes, read-only within the SDK's scope). Always Member JWT -- doesn't accept an API Key today (a real Known Gap, see SDK_CAPABILITY_SPEC.md section 12.3).

func (*AssetNetworkCatalogResource) GetAsset

func (*AssetNetworkCatalogResource) GetAssetNetwork

func (r *AssetNetworkCatalogResource) GetAssetNetwork(ctx context.Context, assetNetworkID string) (AssetNetworkResponse, error)

func (*AssetNetworkCatalogResource) GetNetwork

func (r *AssetNetworkCatalogResource) GetNetwork(ctx context.Context, networkID string) (NetworkResponse, error)

func (*AssetNetworkCatalogResource) ListAssetNetworks

ListAssetNetworks -- status is sent as a raw INTEGER in the query string, per the real documented OpenAPI contract -- even though the response returns status as a string (Group A). Pass "" to not filter.

func (*AssetNetworkCatalogResource) ListAssets

func (*AssetNetworkCatalogResource) ListNetworks

type AssetNetworkResponse

type AssetNetworkResponse struct {
	AssetNetworkID   string           `json:"assetNetworkId"`
	AssetID          string           `json:"assetId"`
	NetworkID        string           `json:"networkId"`
	MinConfirmations int              `json:"minConfirmations"`
	MinAmount        *decimal.Decimal `json:"minAmount"`
	MaxAmount        *decimal.Decimal `json:"maxAmount"`
	EstimatedFee     *decimal.Decimal `json:"estimatedFee"`
	ContractAddress  string           `json:"contractAddress"`
	Status           string           `json:"status"`
	CreatedAt        time.Time        `json:"createdAt"`
}

type AssetNetworkStatus

type AssetNetworkStatus string

AssetNetworkStatus -- the response is a string (Group A); the List query filter is sent as a raw integer (see SDK_CAPABILITY_SPEC.md section 11.3) -- assetNetworkStatusQueryValue below.

const (
	AssetNetworkStatusEnabled  AssetNetworkStatus = "Enabled"
	AssetNetworkStatusPaused   AssetNetworkStatus = "Paused"
	AssetNetworkStatusDisabled AssetNetworkStatus = "Disabled"
)

type AssetResponse

type AssetResponse struct {
	AssetID   string    `json:"assetId"`
	Symbol    string    `json:"symbol"`
	Name      string    `json:"name"`
	Decimals  int       `json:"decimals"`
	Kind      AssetKind `json:"kind"`
	Status    string    `json:"status"`
	CreatedAt time.Time `json:"createdAt"`
}

type AuthResource

type AuthResource struct {
	// contains filtered or unexported fields
}

AuthResource -- Control Plane -- /v1/auth/* (5 real routes). Login() automatically fills the client's bearerTokenHolder, used by authenticatingTransport on every subsequent Control Plane call -- the caller never has to pass the token manually.

func (*AuthResource) ConfirmPasswordReset

func (r *AuthResource) ConfirmPasswordReset(ctx context.Context, resetToken, newPassword string) error

func (*AuthResource) Login

func (r *AuthResource) Login(ctx context.Context, email, password string) (TokenResult, error)

func (*AuthResource) Logout

func (r *AuthResource) Logout()

Logout -- no HTTP call -- lets the caller clear the client's local session.

func (*AuthResource) Refresh

func (r *AuthResource) Refresh(ctx context.Context, refreshToken string) (TokenResult, error)

func (*AuthResource) RequestPasswordReset

func (r *AuthResource) RequestPasswordReset(ctx context.Context, email string) error

func (*AuthResource) SignUp

func (r *AuthResource) SignUp(ctx context.Context, organizationName, email, password string, idempotencyKey ...string) (SignUpResponse, error)

SignUp -- POST /v1/auth/signup requires an Idempotency-Key header (400 IDEMPOTENCY_KEY_REQUIRED otherwise, real backend behavior -- CompositionRoot.EndpointMapping.SignUpEndpoints). Auto-generated when idempotencyKey is omitted, same convention as OrganizationsResource.Create.

type AuthenticationError

type AuthenticationError struct {
	// contains filtered or unexported fields
}

AuthenticationError -- 401, no JSON body (see section 6.3). Code()/Details() always empty.

func (AuthenticationError) Code

func (e AuthenticationError) Code() string

func (AuthenticationError) Details

func (e AuthenticationError) Details() any

func (AuthenticationError) Error

func (e AuthenticationError) Error() string

func (AuthenticationError) HTTPStatus

func (e AuthenticationError) HTTPStatus() int

func (AuthenticationError) RequestID

func (e AuthenticationError) RequestID() string

func (AuthenticationError) Retryable

func (e AuthenticationError) Retryable() bool

func (AuthenticationError) Unwrap

func (e AuthenticationError) Unwrap() error

type AuthorizationError

type AuthorizationError struct {
	// contains filtered or unexported fields
}

AuthorizationError -- 403, no JSON body (see section 6.3).

func (AuthorizationError) Code

func (e AuthorizationError) Code() string

func (AuthorizationError) Details

func (e AuthorizationError) Details() any

func (AuthorizationError) Error

func (e AuthorizationError) Error() string

func (AuthorizationError) HTTPStatus

func (e AuthorizationError) HTTPStatus() int

func (AuthorizationError) RequestID

func (e AuthorizationError) RequestID() string

func (AuthorizationError) Retryable

func (e AuthorizationError) Retryable() bool

func (AuthorizationError) Unwrap

func (e AuthorizationError) Unwrap() error

type BalanceResponse

type BalanceResponse struct {
	Available         decimal.Decimal `json:"available"`
	Pending           decimal.Decimal `json:"pending"`
	Reserved          decimal.Decimal `json:"reserved"`
	Payable           decimal.Decimal `json:"payable"`
	ReservedForPayout decimal.Decimal `json:"reservedForPayout"`
	Delivered         decimal.Decimal `json:"delivered"`
}

BalanceResponse -- G.2 (found 2026-09-11, SDK audit): the real backend record (Ledger.Contracts.Responses.BalanceResponse) has carried Payable/ReservedForPayout/Delivered since SPEC-024/025 (2026-08-30) -- previously silently dropped here. Payable is what Payout owes a beneficiary but hasn't paid yet (an economic obligation, never an on-chain balance); ReservedForPayout is Payable already claimed by an in-flight PayoutBatch; Delivered is the cumulative real payout total -- under SelfCustody this can grow while Available stays exactly 0, because the money already left the platform's custody entirely (see WalletBalanceResource for the wallet's own on-chain state, a different question again). Backward compatible: an older wire response that omits these three fields zero-values them (decimal.Decimal's own JSON-unmarshal default), never an error.

type CatalogEntryStatus

type CatalogEntryStatus string
const (
	CatalogEntryStatusEnabled  CatalogEntryStatus = "Enabled"
	CatalogEntryStatusDisabled CatalogEntryStatus = "Disabled"
)

type ClaimAccountHolderInvitationResult

type ClaimAccountHolderInvitationResult struct {
	Success        bool    `json:"success"`
	RelationshipID *string `json:"relationshipId"`
	ErrorCode      *string `json:"errorCode"`
}

ClaimAccountHolderInvitationResult -- DEC-032/BR-HLD-006.

type ClientConfig

type ClientConfig struct {
	BaseURL                     string
	Environment                 Environment
	APIKey                      string
	ConnectTimeout              time.Duration
	RequestTimeout              time.Duration
	RetryPolicy                 RetryPolicy
	UserAgent                   string
	LoggingEnabled              bool
	AllowInsecureTLSForLocalDev bool
}

ClientConfig -- single source of configuration. Built via applyOptions() from functional ClientOptions (idiomatic Go pattern) -- never scattered across individual resources.

func (ClientConfig) String

func (c ClientConfig) String() string

type ClientOption

type ClientOption func(*clientOptions)

ClientOption -- functional option (idiomatic Go pattern, equivalent to Java's builder / TypeScript-Python's factory).

func WithAPIKey

func WithAPIKey(apiKey string) ClientOption

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

func WithConnectTimeout

func WithConnectTimeout(d time.Duration) ClientOption

func WithEnvironment

func WithEnvironment(environment Environment) ClientOption

func WithInsecureTLSForLocalDevelopment

func WithInsecureTLSForLocalDevelopment(allow bool) ClientOption

WithInsecureTLSForLocalDevelopment -- never use against Sandbox/Production; buildConfig returns an error if combined with another Environment.

func WithLogging

func WithLogging(enabled bool) ClientOption

func WithRequestTimeout

func WithRequestTimeout(d time.Duration) ClientOption

func WithRetryPolicy

func WithRetryPolicy(policy RetryPolicy) ClientOption

func WithUserAgent

func WithUserAgent(userAgent string) ClientOption

type ConditionInput

type ConditionInput struct {
	Field         string            `json:"field"`
	Operator      ConditionOperator `json:"operator"`
	ExpectedValue string            `json:"expectedValue"`
}

type ConditionOperator

type ConditionOperator int
const (
	ConditionOperatorEquals             ConditionOperator = 1
	ConditionOperatorGreaterThanOrEqual ConditionOperator = 2
	ConditionOperatorLessThanOrEqual    ConditionOperator = 3
)

func (ConditionOperator) IsKnown

func (s ConditionOperator) IsKnown() bool

func (ConditionOperator) String

func (s ConditionOperator) String() string

type ConditionResponse

type ConditionResponse struct {
	Field         string            `json:"field"`
	Operator      ConditionOperator `json:"operator"`
	ExpectedValue string            `json:"expectedValue"`
}

type ConfigurationError

type ConfigurationError struct {
	Message string
}

ConfigurationError -- a client configuration error (never a network/API failure).

func (*ConfigurationError) Error

func (e *ConfigurationError) Error() string

type ConfigureWebhookEndpointResult

type ConfigureWebhookEndpointResult struct {
	WebhookEndpointID string `json:"webhookEndpointId"`
	Secret            string `json:"secret"`
}

type ConflictError

type ConflictError struct {
	// contains filtered or unexported fields
}

ConflictError -- 409, any conflict Code except IDEMPOTENCY_KEY_CONFLICT.

func (ConflictError) Code

func (e ConflictError) Code() string

func (ConflictError) Details

func (e ConflictError) Details() any

func (ConflictError) Error

func (e ConflictError) Error() string

func (ConflictError) HTTPStatus

func (e ConflictError) HTTPStatus() int

func (ConflictError) RequestID

func (e ConflictError) RequestID() string

func (ConflictError) Retryable

func (e ConflictError) Retryable() bool

func (ConflictError) Unwrap

func (e ConflictError) Unwrap() error

type CreateAccountHolderInvitationResult

type CreateAccountHolderInvitationResult struct {
	InvitationID   string    `json:"invitationId"`
	PlainTextToken string    `json:"plainTextToken"`
	ExpiresAt      time.Time `json:"expiresAt"`
}

CreateAccountHolderInvitationResult -- DEC-032/BR-HLD-005. PlainTextToken only exists in this response, once -- treat it as a secret (never log it, deliver it to the holder over a secure channel outside the API).

type CreateAccountResult

type CreateAccountResult struct {
	AccountID string `json:"accountId"`
}

type CreateEventTypeResult

type CreateEventTypeResult struct {
	EventTypeID string `json:"eventTypeId"`
}

type CreatePaymentIntentResult

type CreatePaymentIntentResult struct {
	PaymentIntentID string `json:"paymentIntentId"`
}

type CreatePayoutBatchResult added in v0.1.3

type CreatePayoutBatchResult struct {
	PayoutBatchID string `json:"payoutBatchId"`
}

CreatePayoutBatchResult -- PayoutBatchID is empty when there were no eligible candidates (204 No Content, a legitimate no-op -- never an error).

type CreateRuleResult

type CreateRuleResult struct {
	RuleID string `json:"ruleId"`
}

type CreateSigningRequestResult

type CreateSigningRequestResult struct {
	SigningRequestID string `json:"signingRequestId"`
}

type CreateTransactionResult

type CreateTransactionResult struct {
	TransactionID string `json:"transactionId"`
}

type CreateWithdrawalDestinationResult

type CreateWithdrawalDestinationResult struct {
	WithdrawalDestinationID string `json:"withdrawalDestinationId"`
}

type CreateWorkflowResult

type CreateWorkflowResult struct {
	WorkflowID string `json:"workflowId"`
}

type CreateWorkflowVersionResult

type CreateWorkflowVersionResult struct {
	WorkflowVersionID string `json:"workflowVersionId"`
}

type CreatedResourceResponse

type CreatedResourceResponse struct {
	ID string `json:"id"`
}

type DepositResponse

type DepositResponse struct {
	DepositID               string          `json:"depositId"`
	PaymentIntentID         string          `json:"paymentIntentId"`
	TechnicalReference      string          `json:"technicalReference"`
	Amount                  decimal.Decimal `json:"amount"`
	Status                  DepositStatus   `json:"status"`
	ConfirmationCount       int             `json:"confirmationCount"`
	WasConfirmedBeforeReorg bool            `json:"wasConfirmedBeforeReorg"`
	IsLate                  bool            `json:"isLate"`
	CreatedAt               time.Time       `json:"createdAt"`
}

type DepositStatus

type DepositStatus int
const (
	DepositStatusDetected      DepositStatus = 0
	DepositStatusConfirming    DepositStatus = 1
	DepositStatusConfirmed     DepositStatus = 2
	DepositStatusUnderReview   DepositStatus = 3
	DepositStatusReorgDetected DepositStatus = 4
	DepositStatusRejected      DepositStatus = 5
)

func (DepositStatus) IsKnown

func (s DepositStatus) IsKnown() bool

func (DepositStatus) String

func (s DepositStatus) String() string

type DepositsResource

type DepositsResource struct {
	// contains filtered or unexported fields
}

DepositsResource -- Data Plane -- Deposits (3 rotas reais).

func (*DepositsResource) CreatePaymentIntent

func (r *DepositsResource) CreatePaymentIntent(
	ctx context.Context, organizationID, transactionID, assetNetworkID string, amount decimal.Decimal,
	expiresAt *string, idempotencyKey ...string,
) (CreatePaymentIntentResult, error)

CreatePaymentIntent -- DepositAddress real so e exposto pelo GET dedicado (GetPaymentIntent) em seguida.

func (*DepositsResource) GetDeposit

func (r *DepositsResource) GetDeposit(ctx context.Context, depositID string) (DepositResponse, error)

func (*DepositsResource) GetPaymentIntent

func (r *DepositsResource) GetPaymentIntent(ctx context.Context, paymentIntentID string) (PaymentIntentResponse, error)

type DerivationScheme

type DerivationScheme int

DerivationScheme -- SPEC-018/021 -- the only real scheme today (self-custody wallet/signing, checkpoint 11). Same integer wire value as Java/TypeScript/Python.

const (
	DerivationSchemeTronBIP44HardenedAccount DerivationScheme = 1
)

func (DerivationScheme) IsKnown

func (s DerivationScheme) IsKnown() bool

func (DerivationScheme) String

func (s DerivationScheme) String() string

type EasyPaymentResult

type EasyPaymentResult struct {
	TransactionID       string
	PaymentIntentID     string
	TransactionStatus   TransactionStatus
	PaymentIntentStatus PaymentIntentStatus
	DepositAddress      string
	Amount              decimal.Decimal
}

EasyPaymentResult -- return of Easy Mode ReceivePayment()/GetPayment()/WaitForPayment().

type EasyWithdrawResult

type EasyWithdrawResult struct {
	WithdrawalID             string
	RequestedAmount          decimal.Decimal
	EstimatedNetworkFee      *decimal.Decimal
	EstimatedRecipientAmount decimal.Decimal
	NetworkExecutionCost     *decimal.Decimal
	Status                   WithdrawalStatus
}

EasyWithdrawResult -- return of Easy Mode Withdraw() -- never hides the network cost. Deprecated: EstimatedNetworkFee is vestigial under SelfCustody, always nil. Use NetworkExecutionCost.

type EntryNature

type EntryNature int
const (
	EntryNatureAvailable EntryNature = 0
	EntryNaturePending   EntryNature = 1
	EntryNatureReserved  EntryNature = 2
)

func (EntryNature) IsKnown

func (s EntryNature) IsKnown() bool

func (EntryNature) String

func (s EntryNature) String() string

type Environment

type Environment string

Environment -- the project's official environments (CLAUDE.md): Local, Sandbox, Production.

const (
	Local      Environment = "local"
	Sandbox    Environment = "sandbox"
	Production Environment = "production"
)

type EnvironmentType

type EnvironmentType int

EnvironmentType -- only used in REQUEST (CreateEnvironment) -- there is no real EnvironmentResponse in the API.

const (
	EnvironmentTypeSandbox    EnvironmentType = 1
	EnvironmentTypeProduction EnvironmentType = 2
)

type EnvironmentsResource

type EnvironmentsResource struct {
	// contains filtered or unexported fields
}

EnvironmentsResource -- Control Plane -- Environments (2 real routes -- there's no real get/list route for the Environment itself).

func (*EnvironmentsResource) GenerateApiKey

func (r *EnvironmentsResource) GenerateApiKey(ctx context.Context, environmentID string) (GenerateApiKeyResult, error)

GenerateApiKey -- PlainTextKey only ever appears in this response -- never retrievable afterward.

func (*EnvironmentsResource) ListApiKeys

func (r *EnvironmentsResource) ListApiKeys(ctx context.Context, environmentID string) ([]ApiKeyMetadataResponse, error)

type EventIngestionResult

type EventIngestionResult struct {
	EventID         string `json:"eventId"`
	Outcome         string `json:"outcome"`
	RejectionReason string `json:"rejectionReason"`
	FromStateID     string `json:"fromStateId"`
	ToStateID       string `json:"toStateId"`
	RuleID          string `json:"ruleId"`
}

type EventSource

type EventSource int
const (
	EventSourceApplication   EventSource = 1
	EventSourcePlatformTimer EventSource = 2
	EventSourceManualReview  EventSource = 3
)

func (EventSource) IsKnown

func (s EventSource) IsKnown() bool

func (EventSource) String

func (s EventSource) String() string

type EventTypeResponse

type EventTypeResponse struct {
	EventTypeID    string    `json:"eventTypeId"`
	OrganizationID string    `json:"organizationId"`
	Name           string    `json:"name"`
	CreatedAt      time.Time `json:"createdAt"`
}

type EventTypesResource

type EventTypesResource struct {
	// contains filtered or unexported fields
}

EventTypesResource -- Data Plane -- EventTypes (2 real routes, same WorkflowRules module).

func (*EventTypesResource) Create

func (r *EventTypesResource) Create(ctx context.Context, organizationID, name string) (CreateEventTypeResult, error)

func (*EventTypesResource) List

func (r *EventTypesResource) List(ctx context.Context, organizationID string) ([]EventTypeResponse, error)

type EventsResource

type EventsResource struct {
	// contains filtered or unexported fields
}

EventsResource -- Data Plane -- Events (1 real route: ingestion, same WorkflowRules module).

func (*EventsResource) Ingest

func (r *EventsResource) Ingest(
	ctx context.Context, applicationID, workflowVersionID, currentStateID, transactionReference, eventTypeID string,
	eventSource EventSource, payload map[string]string, idempotencyKey ...string,
) (EventIngestionResult, error)

type ExecuteRefundResult

type ExecuteRefundResult struct {
	RefundID string `json:"refundId"`
}

type ExecuteSettlementResult

type ExecuteSettlementResult struct {
	SettlementID string `json:"settlementId"`
}

type ExecutionDestinationsResource added in v0.1.2

type ExecutionDestinationsResource struct {
	// contains filtered or unexported fields
}

ExecutionDestinationsResource -- Data Plane -- ExecutionCustody ExecutionDestinations (DEC-037, CUSTODY-EXECUTION-MODES.md). Registers the on-chain address a beneficiary Account actually receives funds at, for a given AssetNetwork -- required before a Settlement involving that Account can execute under SelfCustody (the backend fails fast, before Signing/Broadcast, if none is registered).

func (*ExecutionDestinationsResource) Register added in v0.1.2

func (r *ExecutionDestinationsResource) Register(
	ctx context.Context, organizationID, accountID, assetNetworkID, address string,
) (RegisterExecutionDestinationResult, error)

type ExecutionLegInput

type ExecutionLegInput struct {
	Role               string
	DestinationAddress string
	Amount             decimal.Decimal
}

ExecutionLegInput -- a leg already calculated by the caller (Settlement/Withdrawal, DEC-025) -- never recomputed by the SDK.

func (ExecutionLegInput) MarshalJSON

func (l ExecutionLegInput) MarshalJSON() ([]byte, error)

MarshalJSON -- Amount emitted via rawDecimal (raw number, not a quoted string) -- same need as decimal_json.go, local to this type because ExecutionLegInput is an exported field that the integrator constructs directly (never goes through toRawDecimal explicitly).

type ExecutionLegResponse

type ExecutionLegResponse struct {
	ExecutionLegID     string          `json:"executionLegId"`
	Role               string          `json:"role"`
	DestinationAddress string          `json:"destinationAddress"`
	Amount             decimal.Decimal `json:"amount"`
	CanonicalHash      string          `json:"canonicalHash"`
	Status             string          `json:"status"`
	MismatchReason     *string         `json:"mismatchReason"`
	BroadcastReference *string         `json:"broadcastReference"`
}

ExecutionLegResponse -- Status/MismatchReason/BroadcastReference are raw strings in the real JSON (Group A) -- the possible values (PendingSignature/Verified/MismatchDetected/Broadcast/ ...) don't yet have a closed catalog documented outside the backend source code.

type ExecutionResponse added in v0.1.5

type ExecutionResponse struct {
	ExecutionID          string          `json:"executionId"`
	TransactionID        string          `json:"transactionId"`
	OrganizationID       string          `json:"organizationId"`
	Status               ExecutionStatus `json:"status"`
	PreparedAt           time.Time       `json:"preparedAt"`
	GracePeriodExpiresAt time.Time       `json:"gracePeriodExpiresAt"`
	ExecutedAt           *time.Time      `json:"executedAt"`
	SettlementID         *string         `json:"settlementId"`
}

ExecutionResponse -- PROMPT 5 section 9 (G.7) -- GET /v1/organizations/{organizationId}/executions. The only real remediation for an AwaitingSignature/Overdue Execution is the settlement flow (non-custodial model -- there is no cancel path for an Execution).

type ExecutionSourcesResource added in v0.1.3

type ExecutionSourcesResource struct {
	// contains filtered or unexported fields
}

ExecutionSourcesResource -- Data Plane -- ExecutionCustody ExecutionSources (CUSTODY-EXECUTION-MODES.md, SPEC-ADDRESSPOOL-001). Registers the address ExecutionCustody signs FROM to pay network cost for a given AssetNetwork -- required, together with a NetworkCostPayerAccountsResource, before the first self-custody Withdrawal/Payout on that AssetNetwork (the backend fails fast if none is registered).

func (*ExecutionSourcesResource) Register added in v0.1.3

func (r *ExecutionSourcesResource) Register(
	ctx context.Context, organizationID, environmentID, assetNetworkID, walletID string,
	derivationReference int64, address string,
) (RegisterExecutionSourceResult, error)

func (*ExecutionSourcesResource) SyncResourceStake added in v0.1.4

func (r *ExecutionSourcesResource) SyncResourceStake(
	ctx context.Context, organizationID, executionSourceID string,
	availableNativeAmount, availableEnergy, availableBandwidth decimal.Decimal,
) error

SyncResourceStake -- F.18 -- self-reported (no on-chain verification in this version) declaration of the on-chain resource capacity available to the Wallet backing this ExecutionSource. Required before CUSTOMER_RESOURCES (Self) mode can ever succeed for it -- the platform checks this declared stake for sufficiency at quote time. Safe to call again any time to re-sync (no first-registration-wins restriction, unlike Register).

type ExecutionStatus added in v0.1.5

type ExecutionStatus int

ExecutionStatus -- PROMPT 5 section 9 (G.7) -- mirrors Transactions.Contracts.Enums.ExecutionStatus.

const (
	ExecutionStatusPrepared          ExecutionStatus = 0
	ExecutionStatusAwaitingSignature ExecutionStatus = 1
	ExecutionStatusExecuted          ExecutionStatus = 2
	ExecutionStatusFailed            ExecutionStatus = 3
	ExecutionStatusExpired           ExecutionStatus = 4
	ExecutionStatusOverdue           ExecutionStatus = 5
)

func (ExecutionStatus) IsKnown added in v0.1.5

func (s ExecutionStatus) IsKnown() bool

func (ExecutionStatus) String added in v0.1.5

func (s ExecutionStatus) String() string

type GenerateApiKeyResult

type GenerateApiKeyResult struct {
	ApiKeyID     string `json:"apiKeyId"`
	PlainTextKey string `json:"plainTextKey"`
}

type GeneratedWallet

type GeneratedWallet struct {
	Wallet   Wallet
	Signer   *InMemorySigner
	Mnemonic string
}

GeneratedWallet -- result of GenerateWallet/RestoreWallet -- bundles the PUBLIC Wallet, the ready-to-use InMemorySigner, and the recovery mnemonic.

The mnemonic is NEVER persisted or transmitted by this SDK on its own -- exporting it is always an explicit, local, opt-in action by the integrator (SPEC-018 brief section 9: "Secret export: explicit, local, opt-in. Never automatic. Never sent to the API.").

func GenerateWallet

func GenerateWallet() (GeneratedWallet, error)

GenerateWallet -- generates a new wallet (BIP39 24 words, 256 bits of entropy), no passphrase.

func RestoreWallet

func RestoreWallet(mnemonic, passphrase string) (GeneratedWallet, error)

RestoreWallet -- restores an existing wallet from a BIP39 mnemonic (checksum validated) and an optional passphrase (BIP39, not to be confused with an at-rest encryption password).

type IdempotencyConflictError

type IdempotencyConflictError struct {
	// contains filtered or unexported fields
}

IdempotencyConflictError -- 409, Code=IDEMPOTENCY_KEY_CONFLICT (same key resent with a payload different from the original).

func (IdempotencyConflictError) Code

func (e IdempotencyConflictError) Code() string

func (IdempotencyConflictError) Details

func (e IdempotencyConflictError) Details() any

func (IdempotencyConflictError) Error

func (e IdempotencyConflictError) Error() string

func (IdempotencyConflictError) HTTPStatus

func (e IdempotencyConflictError) HTTPStatus() int

func (IdempotencyConflictError) RequestID

func (e IdempotencyConflictError) RequestID() string

func (IdempotencyConflictError) Retryable

func (e IdempotencyConflictError) Retryable() bool

func (IdempotencyConflictError) Unwrap

func (e IdempotencyConflictError) Unwrap() error

type InMemorySigner

type InMemorySigner struct {
	// contains filtered or unexported fields
}

InMemorySigner -- reference implementation -- keeps the account private key in plain memory for the lifetime of the process. **Documented as unsafe for Production** (no encryption at rest, no OS protection). The private key never leaves this struct (never serialized, never logged, never sent to the Ishtaran API -- INV-SC-01).

func (*InMemorySigner) AccountExtendedPublicKey

func (s *InMemorySigner) AccountExtendedPublicKey() (string, error)

AccountExtendedPublicKey -- account-level xpub (Base58Check, mainnet -- reused purely as the standard BIP32 serialization, see the equivalent TDR-017).

func (*InMemorySigner) Sign

func (s *InMemorySigner) Sign(derivationIndex uint32, canonicalHash []byte) ([]byte, error)

Sign -- signs the canonical hash (32 bytes, SHA-256 digest) at the given derivation index (change fixed at 0, same path as TronAddress/DeriveTronAddress). Returns DER (SEQUENCE(INTEGER r, INTEGER s)) -- the same format IAddressDerivationProvider.VerifySignature (backend, ECDSASignature.FromDER) expects.

type InviteMemberResult

type InviteMemberResult struct {
	MemberID             string `json:"memberId"`
	PlainTextInviteToken string `json:"plainTextInviteToken"`
}

type IshtaranClient

type IshtaranClient struct {
	Auth                AuthResource
	Organizations       OrganizationsResource
	Applications        ApplicationsResource
	Environments        EnvironmentsResource
	ApiKeys             ApiKeysResource
	Members             MembersResource
	AssetNetworkCatalog AssetNetworkCatalogResource
	Accounts            AccountsResource
	// AccountHolders -- DEC-032 -- self-service, isolated AccountHolder session (never shares
	// a token with the Member/API Key of this same instance).
	AccountHolders    AccountHoldersResource
	Transactions      TransactionsResource
	Deposits          DepositsResource
	Ledger            LedgerResource
	Settlements       SettlementsResource
	Refunds           RefundsResource
	Withdrawals       WithdrawalsResource
	Workflows         WorkflowsResource
	EventTypes        EventTypesResource
	Events            EventsResource
	Sandbox           SandboxResource
	WebhookEndpoints  WebhookEndpointsResource
	WebhookDeliveries WebhookDeliveriesResource
	// Wallets/SigningRequests -- SPEC-021 checkpoint 11 -- HTTP client for the self-custody
	// protocol. Generation/derivation/signing itself (GenerateWallet/RestoreWallet/
	// DeriveTronAddress/InMemorySigner) is local, no network call, and lives outside this
	// client.
	Wallets                  WalletsResource
	SigningRequests          SigningRequestsResource
	ExecutionDestinations    ExecutionDestinationsResource
	ExecutionSources         ExecutionSourcesResource
	NetworkCostPayerAccounts NetworkCostPayerAccountsResource
	NetworkExecution         NetworkExecutionResource
	Payout                   PayoutResource
	// WalletBalance -- the wallet's own on-chain balance, never the Ledger (see WalletBalanceResource's own doc).
	WalletBalance WalletBalanceResource
}

IshtaranClient -- single public facade of the SDK. Composes Core (resources) and Easy Mode over the SAME HTTP transport -- Easy Mode never duplicates business logic, it only combines Core calls (see SDK_CAPABILITY_SPEC.md section 5).

func NewClient

func NewClient(opts ...ClientOption) (*IshtaranClient, error)

NewClient -- production constructor -- assembles httpTransportImpl -> authenticatingTransport -> retryingTransport (+ optional loggingTransport), from functional ClientOptions.

func NewClientForTesting

func NewClientForTesting(rawTransport transport) *IshtaranClient

NewClientForTesting -- injects a fake transport (no network), no retry (each layer already has its own dedicated suite).

func (*IshtaranClient) GetBalance

func (c *IshtaranClient) GetBalance(ctx context.Context, accountID, assetNetworkID string) (BalanceResponse, error)

GetBalance -- direct pass-through to Ledger.GetBalance() -- no business transformation.

func (*IshtaranClient) GetPayment

func (c *IshtaranClient) GetPayment(ctx context.Context, transactionID, paymentIntentID string) (EasyPaymentResult, error)

func (*IshtaranClient) ReceivePayment

func (c *IshtaranClient) ReceivePayment(
	ctx context.Context, organizationID, applicationID, payerAccountID, recipientAccountID, assetNetworkID string,
	amount decimal.Decimal,
) (EasyPaymentResult, error)

ReceivePayment -- composes Transactions.Create() + Deposits.CreatePaymentIntent() + follow-up GET.

func (*IshtaranClient) VerifyWebhookSignature

func (c *IshtaranClient) VerifyWebhookSignature(rawBody, signatureHeader, timestampHeader, endpointSecret string) bool

VerifyWebhookSignature -- no HTTP call -- local computation.

func (*IshtaranClient) WaitForPayment

func (c *IshtaranClient) WaitForPayment(ctx context.Context, transactionID, paymentIntentID string, pollInterval time.Duration) (EasyPaymentResult, error)

WaitForPayment -- safe polling, never infinite -- the timeout comes from ctx's deadline (idiomatic Go; see SDK_CAPABILITY_SPEC.md section 15). Ends when the Payment Intent leaves Pending/PartiallyPaid.

func (*IshtaranClient) Withdraw

func (c *IshtaranClient) Withdraw(
	ctx context.Context, organizationID, environmentID, accountID, assetNetworkID string, amount decimal.Decimal,
	destinationAddress, existingDestinationID string,
) (EasyWithdrawResult, error)

Withdraw -- composes Withdrawals.CreateDestination() (if needed) + .Request() -- never hides the estimated Network Fee. Pass existingDestinationID="" to create a new destination.

type IshtaranError

type IshtaranError interface {
	error
	HTTPStatus() int   // 0 when there was no HTTP response (NetworkError/TimeoutError)
	Code() string      // stable key (e.g. "VALIDATION_ERROR") -- empty when not applicable
	RequestID() string // always empty today -- the real API has no correlation ID mechanism (section 12.1)
	Details() any      // raw error body, when present
	Retryable() bool
}

IshtaranError -- conceptual base of every real API error raised by the SDK (see SDK_CAPABILITY_SPEC.md section 6.4). Not a concrete type directly instantiable -- each subtype below implements this interface; use errors.As to check the specific subtype.

type LedgerEntryResponse

type LedgerEntryResponse struct {
	EntryID                string          `json:"entryId"`
	LedgerAccountID        string          `json:"ledgerAccountId"`
	EntryGroupID           string          `json:"entryGroupId"`
	Nature                 EntryNature     `json:"nature"`
	Amount                 decimal.Decimal `json:"amount"`
	OriginReference        string          `json:"originReference"`
	ReversalOfEntryGroupID string          `json:"reversalOfEntryGroupId"`
	CreatedAt              time.Time       `json:"createdAt"`
}

type LedgerResource

type LedgerResource struct {
	// contains filtered or unexported fields
}

LedgerResource -- Data Plane -- Ledger (2 real routes, both read).

func (*LedgerResource) GetBalance

func (r *LedgerResource) GetBalance(ctx context.Context, accountID, assetNetworkID string) (BalanceResponse, error)

func (*LedgerResource) ListAllEntries

func (r *LedgerResource) ListAllEntries(ctx context.Context, accountID, assetNetworkID string, pageSize int, opts ListEntriesOptions) iter.Seq2[LedgerEntryResponse, error]

ListAllEntries -- lazy iterator (iter.Seq2) -- see SDK_CAPABILITY_SPEC.md section 12.7.

func (*LedgerResource) ListEntries

func (r *LedgerResource) ListEntries(ctx context.Context, accountID, assetNetworkID string, skip, take int, opts ListEntriesOptions) ([]LedgerEntryResponse, error)

ListEntries -- skip/take are real pagination (see SDK_CAPABILITY_SPEC.md section 12.7). Every query value goes through url.Values.Encode() -- never concatenated raw (see SECURITY_REVIEW.md).

type ListEntriesOptions

type ListEntriesOptions struct {
	Nature   *EntryNature
	DateFrom string
	DateTo   string
}

ListEntriesOptions -- optional ListEntries/ListAllEntries filters.

type ListWithdrawalsOptions

type ListWithdrawalsOptions struct {
	Status   *WithdrawalStatus
	DateFrom string
	DateTo   string
	Skip     *int
	Take     *int
}

ListWithdrawalsOptions -- optional List/ListAll filters.

type MemberResponse

type MemberResponse struct {
	MemberID       string     `json:"memberId"`
	OrganizationID string     `json:"organizationId"`
	Email          string     `json:"email"`
	Role           string     `json:"role"`
	Status         string     `json:"status"`
	CreatedAt      time.Time  `json:"createdAt"`
	ActivatedAt    *time.Time `json:"activatedAt"`
	LastLoginAt    *time.Time `json:"lastLoginAt"`
}

type MemberRoleRequest

type MemberRoleRequest int

MemberRoleRequest -- only used in REQUEST (Invite/AssignRole) -- the response is Group A (string).

const (
	MemberRoleRequestOwner    MemberRoleRequest = 1
	MemberRoleRequestAdmin    MemberRoleRequest = 2
	MemberRoleRequestFinance  MemberRoleRequest = 3
	MemberRoleRequestReadOnly MemberRoleRequest = 4
)

type MemberStatus

type MemberStatus string
const (
	MemberStatusInvited   MemberStatus = "Invited"
	MemberStatusActive    MemberStatus = "Active"
	MemberStatusSuspended MemberStatus = "Suspended"
	MemberStatusRemoved   MemberStatus = "Removed"
)

type MembersResource

type MembersResource struct {
	// contains filtered or unexported fields
}

MembersResource -- Control Plane -- Members (7 real routes, IdentityAccess).

func (*MembersResource) AcceptInvite

func (r *MembersResource) AcceptInvite(ctx context.Context, inviteToken, password string) (TokenResult, error)

AcceptInvite returns the real access token -- the same mechanism as Auth.Login() fills the client's session.

func (*MembersResource) AssignRole

func (r *MembersResource) AssignRole(ctx context.Context, memberID string, newRole MemberRoleRequest) error

func (*MembersResource) Invite

func (r *MembersResource) Invite(ctx context.Context, organizationID, email string, role MemberRoleRequest) (InviteMemberResult, error)

func (*MembersResource) List

func (r *MembersResource) List(ctx context.Context, organizationID string) ([]MemberResponse, error)

func (*MembersResource) Reactivate

func (r *MembersResource) Reactivate(ctx context.Context, memberID string) error

func (*MembersResource) Remove

func (r *MembersResource) Remove(ctx context.Context, memberID string) error

func (*MembersResource) Suspend

func (r *MembersResource) Suspend(ctx context.Context, memberID, reason string) error

type NetworkCostPayer added in v0.1.3

type NetworkCostPayer int

NetworkCostPayer -- ExecutionCustody.Contracts.Enums.NetworkCostPayer (SPEC-NETEXEC-001) -- who is charged for the quoted network cost.

const (
	NetworkCostPayerIntegrator NetworkCostPayer = 0
	NetworkCostPayerRequester  NetworkCostPayer = 1
)

func (NetworkCostPayer) IsKnown added in v0.1.3

func (s NetworkCostPayer) IsKnown() bool

func (NetworkCostPayer) String added in v0.1.3

func (s NetworkCostPayer) String() string

type NetworkCostPayerAccountsResource added in v0.1.3

type NetworkCostPayerAccountsResource struct {
	// contains filtered or unexported fields
}

NetworkCostPayerAccountsResource -- Data Plane -- ExecutionCustody NetworkCostPayerAccounts (SPEC-NETEXEC-001). Registers the Account debited for the *charged* network cost of a NetworkExecutionQuote (TotalCharged, in QuoteCurrency). accountID must belong to the caller's own Organization -- a cross-tenant Account is rejected. First-registration-wins per (organizationID, assetNetworkID).

func (*NetworkCostPayerAccountsResource) Register added in v0.1.3

func (r *NetworkCostPayerAccountsResource) Register(
	ctx context.Context, organizationID, assetNetworkID, accountID string,
) (RegisterNetworkCostPayerAccountResult, error)

func (*NetworkCostPayerAccountsResource) UpdateResourcePreference added in v0.1.4

func (r *NetworkCostPayerAccountsResource) UpdateResourcePreference(
	ctx context.Context, organizationID, assetNetworkID string,
	resourcePreference NetworkResourceSource, allowFallbackToIshtaranResources bool,
) error

UpdateResourcePreference -- F.18 -- switches this Organization's Network Execution mode for assetNetworkID between NetworkResourceSourceSelf (CUSTOMER_RESOURCES, the integrator's own on-chain resources) and NetworkResourceSourceIshtaranSponsored (the default). allowFallbackToIshtaranResources only matters when resourcePreference is Self -- it decides whether an insufficient CUSTOMER_RESOURCES balance falls back to ISHTARAN_RESOURCES instead of failing closed. Requires a NetworkCostPayerAccount already registered for this (organizationID, assetNetworkID) pair via Register.

type NetworkError

type NetworkError struct {
	// contains filtered or unexported fields
}

NetworkError -- transport failure, no HTTP response at all. Always retryable.

func (NetworkError) Code

func (e NetworkError) Code() string

func (NetworkError) Details

func (e NetworkError) Details() any

func (NetworkError) Error

func (e NetworkError) Error() string

func (NetworkError) HTTPStatus

func (e NetworkError) HTTPStatus() int

func (NetworkError) RequestID

func (e NetworkError) RequestID() string

func (NetworkError) Retryable

func (e NetworkError) Retryable() bool

func (NetworkError) Unwrap

func (e NetworkError) Unwrap() error

type NetworkExecutionCostStatus added in v0.1.3

type NetworkExecutionCostStatus int

NetworkExecutionCostStatus -- Withdrawals.Contracts.Enums.NetworkExecutionCostStatus (SPEC-026 Descoberta 8) -- derived from Withdrawal.Status, never its own persisted state.

const (
	NetworkExecutionCostStatusReserved               NetworkExecutionCostStatus = 0
	NetworkExecutionCostStatusSettled                NetworkExecutionCostStatus = 1
	NetworkExecutionCostStatusReleased               NetworkExecutionCostStatus = 2
	NetworkExecutionCostStatusRequiresReconciliation NetworkExecutionCostStatus = 3
)

func (NetworkExecutionCostStatus) IsKnown added in v0.1.3

func (s NetworkExecutionCostStatus) IsKnown() bool

func (NetworkExecutionCostStatus) String added in v0.1.3

type NetworkExecutionOperationInput added in v0.1.3

type NetworkExecutionOperationInput struct {
	DestinationAddress string
	Amount             decimal.Decimal
	Kind               NetworkOperationKind
	Reference          string
}

NetworkExecutionOperationInput -- a single physical operation to be priced -- input to NetworkExecutionResource.Quote(), never interpreted by the caller.

func (NetworkExecutionOperationInput) MarshalJSON added in v0.1.3

func (o NetworkExecutionOperationInput) MarshalJSON() ([]byte, error)

MarshalJSON -- Amount emitted via rawDecimal (raw number, not a quoted string) -- same reasoning as ExecutionLegInput.MarshalJSON.

type NetworkExecutionPlanResponse added in v0.1.3

type NetworkExecutionPlanResponse struct {
	AssetNetworkID string                                `json:"assetNetworkId"`
	Transactions   []NetworkExecutionTransactionResponse `json:"transactions"`
}

NetworkExecutionPlanResponse -- SPEC-NETEXEC-001 BL-NET-002 -- structured result of INetworkExecutionPlanner.Plan(...), never flattened into loose fields.

type NetworkExecutionQuoteResponse added in v0.1.3

type NetworkExecutionQuoteResponse struct {
	Network                  string                          `json:"network"`
	Plan                     NetworkExecutionPlanResponse    `json:"plan"`
	EstimatedResources       NetworkResourceEstimateResponse `json:"estimatedResources"`
	NativeExecutionCost      decimal.Decimal                 `json:"nativeExecutionCost"`
	ResourceAssetNetworkID   string                          `json:"resourceAssetNetworkId"`
	QuoteCurrency            string                          `json:"quoteCurrency"`
	FX                       decimal.Decimal                 `json:"fx"`
	SafetyBuffer             decimal.Decimal                 `json:"safetyBuffer"`
	ResourceSource           NetworkResourceSource           `json:"resourceSource"`
	ReplenishmentRequirement *decimal.Decimal                `json:"replenishmentRequirement"`
	ConversionOverhead       decimal.Decimal                 `json:"conversionOverhead"`
	ExpiresAt                time.Time                       `json:"expiresAt"`
	TotalCharged             decimal.Decimal                 `json:"totalCharged"`
	NetworkCostPayer         NetworkCostPayer                `json:"networkCostPayer"`
	AuthorizedNativeCost     decimal.Decimal                 `json:"authorizedNativeCost"`
	Margin                   decimal.Decimal                 `json:"margin"`
}

NetworkExecutionQuoteResponse -- SPEC-NETEXEC-001 (brief section 13) -- mirror of ExecutionCustody.Domain.ValueObjects.NetworkExecutionQuote. NativeExecutionCost/ AuthorizedNativeCost are always in the RESOURCE asset's native units (ResourceAssetNetworkID or AssetNetworkID); TotalCharged is always in QuoteCurrency (the CHARGED asset) -- TotalCharged = (NativeExecutionCost * FX) + SafetyBuffer + ReplenishmentRequirement + ConversionOverhead. AuthorizedNativeCost is the number actually reserved for execution (>= the sum of every physical operation's cost, INC-18) -- never compare a caller-supplied estimate directly against NativeExecutionCost alone. Margin is the Ishtaran markup applied in ISHTARAN_RESOURCES mode (always 0 in CUSTOMER_RESOURCES mode).

type NetworkExecutionQuoteSnapshotResponse added in v0.1.3

type NetworkExecutionQuoteSnapshotResponse struct {
	Network                string          `json:"network"`
	NativeExecutionCost    decimal.Decimal `json:"nativeExecutionCost"`
	ResourceAssetNetworkID string          `json:"resourceAssetNetworkId"`
	QuoteCurrency          string          `json:"quoteCurrency"`
	FX                     decimal.Decimal `json:"fx"`
	TotalCharged           decimal.Decimal `json:"totalCharged"`
	AuthorizedNativeCost   decimal.Decimal `json:"authorizedNativeCost"`
	ExpiresAt              time.Time       `json:"expiresAt"`
}

NetworkExecutionQuoteSnapshotResponse -- SPEC-025 Descoberta 6/7 -- always the frozen copy captured at reservation time, never recomputed/reread on every read.

type NetworkExecutionResource added in v0.1.3

type NetworkExecutionResource struct {
	// contains filtered or unexported fields
}

NetworkExecutionResource -- Data Plane -- ExecutionCustody Network Execution Engine (SPEC-NETEXEC-001). A quote is a priced, time-boxed plan for 1..N physical on-chain operations; it never writes anything by itself (Settlement/Withdrawal/Payout each get/re-get their own quote internally at execution time -- preview quote != execution quote, never reuse this response as a price guarantee).

func (*NetworkExecutionResource) Quote added in v0.1.3

func (r *NetworkExecutionResource) Quote(
	ctx context.Context, environmentID, assetNetworkID string,
	operations []NetworkExecutionOperationInput, networkCostPayer NetworkCostPayer,
) (NetworkExecutionQuoteResponse, error)

type NetworkExecutionTransactionResponse added in v0.1.3

type NetworkExecutionTransactionResponse struct {
	Transfers []NetworkExecutionTransferResponse `json:"transfers"`
}

type NetworkExecutionTransferResponse added in v0.1.3

type NetworkExecutionTransferResponse struct {
	DestinationAddress       string          `json:"destinationAddress"`
	Amount                   decimal.Decimal `json:"amount"`
	SourceOperationReference string          `json:"sourceOperationReference"`
}

NetworkExecutionTransferResponse -- SPEC-NETEXEC-001 Descoberta 2 -- the physical unit (what will be one real on-chain transaction), grouping 1..N transfers.

type NetworkOperationKind added in v0.1.3

type NetworkOperationKind int

NetworkOperationKind -- ExecutionCustody.Contracts.Enums.NetworkOperationKind (SPEC-NETEXEC-001) -- the kind of physical on-chain operation a NetworkExecutionQuote is priced for.

const (
	NetworkOperationKindTransfer   NetworkOperationKind = 0
	NetworkOperationKindSwap       NetworkOperationKind = 1
	NetworkOperationKindStake      NetworkOperationKind = 2
	NetworkOperationKindUnstake    NetworkOperationKind = 3
	NetworkOperationKindDelegate   NetworkOperationKind = 4
	NetworkOperationKindUndelegate NetworkOperationKind = 5
)

func (NetworkOperationKind) IsKnown added in v0.1.3

func (s NetworkOperationKind) IsKnown() bool

func (NetworkOperationKind) String added in v0.1.3

func (s NetworkOperationKind) String() string

type NetworkResourceEstimateResponse added in v0.1.3

type NetworkResourceEstimateResponse struct {
	Lines []NetworkResourceLineResponse `json:"lines"`
}

type NetworkResourceLineResponse added in v0.1.3

type NetworkResourceLineResponse struct {
	ResourceCode string          `json:"resourceCode"`
	Quantity     decimal.Decimal `json:"quantity"`
	Unit         string          `json:"unit"`
}

NetworkResourceLineResponse -- SPEC-NETEXEC-001 Descoberta 6/BR-NET-008 -- ResourceCode is opaque (string), never interpreted by the generic caller.

type NetworkResourceSource added in v0.1.3

type NetworkResourceSource int

NetworkResourceSource -- ExecutionCustody.Contracts.Enums.NetworkResourceSource (SPEC-TRON-RESOURCE-001) -- where the physical network resource (e.g. TRON Energy/Bandwidth) came from.

const (
	NetworkResourceSourceNotEvaluated      NetworkResourceSource = 0
	NetworkResourceSourceSelf              NetworkResourceSource = 1
	NetworkResourceSourceIshtaranSponsored NetworkResourceSource = 2
	NetworkResourceSourcePeer              NetworkResourceSource = 3
	NetworkResourceSourceExternal          NetworkResourceSource = 4
)

func (NetworkResourceSource) IsKnown added in v0.1.3

func (s NetworkResourceSource) IsKnown() bool

func (NetworkResourceSource) String added in v0.1.3

func (s NetworkResourceSource) String() string

type NetworkResponse

type NetworkResponse struct {
	NetworkID string    `json:"networkId"`
	Code      string    `json:"code"`
	Name      string    `json:"name"`
	ChainID   *int      `json:"chainId"`
	IsTestnet bool      `json:"isTestnet"`
	Status    string    `json:"status"`
	CreatedAt time.Time `json:"createdAt"`
}

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

NotFoundError -- 404, Code=NOT_FOUND.

func (NotFoundError) Code

func (e NotFoundError) Code() string

func (NotFoundError) Details

func (e NotFoundError) Details() any

func (NotFoundError) Error

func (e NotFoundError) Error() string

func (NotFoundError) HTTPStatus

func (e NotFoundError) HTTPStatus() int

func (NotFoundError) RequestID

func (e NotFoundError) RequestID() string

func (NotFoundError) Retryable

func (e NotFoundError) Retryable() bool

func (NotFoundError) Unwrap

func (e NotFoundError) Unwrap() error

type OrganizationAccountResponse

type OrganizationAccountResponse struct {
	RelationshipID           string    `json:"relationshipId"`
	AccountID                string    `json:"accountId"`
	AccountHolderID          string    `json:"accountHolderId"`
	ExternalID               *string   `json:"externalId"`
	RelationshipStatus       string    `json:"relationshipStatus"`
	AccountStatus            string    `json:"accountStatus"`
	CreatedAt                time.Time `json:"createdAt"`
	AuthorizedApplicationIDs []string  `json:"authorizedApplicationIds"`
}

OrganizationAccountResponse -- DEC-032: an explicit link (never ownership) between an Organization and an AccountHolder/Account. AuthorizedApplicationIDs is scoped to THIS Relationship -- never leaks to another Organization related to the same AccountHolder. Returned by AccountsResource.List.

type OrganizationResponse

type OrganizationResponse struct {
	OrganizationID string    `json:"organizationId"`
	Name           string    `json:"name"`
	Status         string    `json:"status"`
	CreatedAt      time.Time `json:"createdAt"`
}

type OrganizationStatus

type OrganizationStatus string
const (
	OrganizationStatusActive    OrganizationStatus = "Active"
	OrganizationStatusSuspended OrganizationStatus = "Suspended"
	OrganizationStatusClosed    OrganizationStatus = "Closed"
)

type OrganizationsResource

type OrganizationsResource struct {
	// contains filtered or unexported fields
}

OrganizationsResource -- Control Plane -- Organizations (6 real routes). Always Member JWT. Create/CreateApplication use idempotency via the Idempotency-Key HEADER -- unlike the body-field pattern of the financial modules (see SDK_CAPABILITY_SPEC.md section 9).

func (*OrganizationsResource) Create

func (r *OrganizationsResource) Create(ctx context.Context, name string, idempotencyKey ...string) (CreatedResourceResponse, error)

func (*OrganizationsResource) CreateApplication

func (r *OrganizationsResource) CreateApplication(ctx context.Context, organizationID, name string, idempotencyKey ...string) (CreatedResourceResponse, error)

func (*OrganizationsResource) Get

func (r *OrganizationsResource) Get(ctx context.Context, organizationID string) (OrganizationResponse, error)

func (*OrganizationsResource) ListApplications

func (r *OrganizationsResource) ListApplications(ctx context.Context, organizationID string) ([]ApplicationResponse, error)

func (*OrganizationsResource) Reactivate

func (r *OrganizationsResource) Reactivate(ctx context.Context, organizationID string) error

func (*OrganizationsResource) Suspend

func (r *OrganizationsResource) Suspend(ctx context.Context, organizationID, reason string) error

type ParticipantInput

type ParticipantInput struct {
	AccountID       string
	Role            string
	IsPayer         bool
	SplitPercentage *decimal.Decimal
}

ParticipantInput -- a REQUEST type (never used to parse a response -- see ParticipantResponse), constructed directly by the integrator as part of Transactions.Create's body. SplitPercentage is a normal *decimal.Decimal here -- MarshalJSON below emits it via rawDecimal (a raw number, never a quoted string, which the real API expects) instead of decimal.Decimal's own default quoted-string encoding, the same need as ExecutionLegInput.

func (ParticipantInput) MarshalJSON added in v0.1.3

func (p ParticipantInput) MarshalJSON() ([]byte, error)

type ParticipantResponse

type ParticipantResponse struct {
	ParticipantID   string           `json:"participantId"`
	AccountID       string           `json:"accountId"`
	Role            string           `json:"role"`
	IsPayer         bool             `json:"isPayer"`
	SplitPercentage *decimal.Decimal `json:"splitPercentage"`
}

type PayableSummaryResponse added in v0.1.3

type PayableSummaryResponse struct {
	Accrued           decimal.Decimal `json:"accrued"`
	ReservedForPayout decimal.Decimal `json:"reservedForPayout"`
	Paid              decimal.Decimal `json:"paid"`
}

PayableSummaryResponse -- SPEC-024 BL-PAY-004/BR-PAY-002 -- "a receber" per beneficiary, never confused with the Account's on-chain (Available) balance. Accrued = sum of Payable; ReservedForPayout = sum of open PayoutBatches; Paid = cumulative delivered history (never confused with Available).

type PaymentIntentResponse

type PaymentIntentResponse struct {
	PaymentIntentID string              `json:"paymentIntentId"`
	OrganizationID  string              `json:"organizationId"`
	TransactionID   string              `json:"transactionId"`
	AssetNetworkID  string              `json:"assetNetworkId"`
	Amount          decimal.Decimal     `json:"amount"`
	Status          PaymentIntentStatus `json:"status"`
	ExpiresAt       *time.Time          `json:"expiresAt"`
	DepositAddress  string              `json:"depositAddress"`
	Deposits        []DepositResponse   `json:"deposits"`
	CreatedAt       time.Time           `json:"createdAt"`
}

type PaymentIntentStatus

type PaymentIntentStatus int
const (
	PaymentIntentStatusPending       PaymentIntentStatus = 0
	PaymentIntentStatusPartiallyPaid PaymentIntentStatus = 1
	PaymentIntentStatusPaid          PaymentIntentStatus = 2
	PaymentIntentStatusExpired       PaymentIntentStatus = 3
	PaymentIntentStatusCancelled     PaymentIntentStatus = 4
)

func (PaymentIntentStatus) IsKnown

func (s PaymentIntentStatus) IsKnown() bool

func (PaymentIntentStatus) String

func (s PaymentIntentStatus) String() string

type PayoutBatchObligationResponse added in v0.1.3

type PayoutBatchObligationResponse struct {
	OwnerID            string                                `json:"ownerId"`
	Amount             decimal.Decimal                       `json:"amount"`
	SourceObligations  []PayoutBatchSourceObligationResponse `json:"sourceObligations"`
	DestinationAddress string                                `json:"destinationAddress"`
	Status             PayoutBatchObligationStatus           `json:"status"`
}

type PayoutBatchObligationStatus added in v0.1.3

type PayoutBatchObligationStatus int

PayoutBatchObligationStatus -- Payout.Contracts.Enums.PayoutBatchObligationStatus (SPEC-025).

const (
	PayoutBatchObligationStatusIncluded               PayoutBatchObligationStatus = 0
	PayoutBatchObligationStatusConfirmed              PayoutBatchObligationStatus = 1
	PayoutBatchObligationStatusFailed                 PayoutBatchObligationStatus = 2
	PayoutBatchObligationStatusRequiresReconciliation PayoutBatchObligationStatus = 3
)

func (PayoutBatchObligationStatus) IsKnown added in v0.1.3

func (s PayoutBatchObligationStatus) IsKnown() bool

func (PayoutBatchObligationStatus) String added in v0.1.3

type PayoutBatchResponse added in v0.1.3

type PayoutBatchResponse struct {
	PayoutBatchID                 string                                `json:"payoutBatchId"`
	OrganizationID                string                                `json:"organizationId"`
	EnvironmentID                 string                                `json:"environmentId"`
	AssetNetworkID                string                                `json:"assetNetworkId"`
	Trigger                       PayoutBatchTrigger                    `json:"trigger"`
	Status                        PayoutBatchStatus                     `json:"status"`
	Obligations                   []PayoutBatchObligationResponse       `json:"obligations"`
	NetworkExecutionQuoteSnapshot NetworkExecutionQuoteSnapshotResponse `json:"networkExecutionQuoteSnapshot"`
	SigningRequestID              string                                `json:"signingRequestId"`
	CreatedAt                     time.Time                             `json:"createdAt"`
}

PayoutBatchResponse -- SPEC-025 -- a batched payout execution grouping N beneficiary obligations under a single NetworkExecutionQuote. This SDK slice only ever creates batches with Trigger = PayoutBatchTriggerManual (the public route accepts no other trigger yet -- ThresholdCrossed/Scheduled exist in the domain but aren't reachable through the public API today).

type PayoutBatchSourceObligationResponse added in v0.1.3

type PayoutBatchSourceObligationResponse struct {
	OriginReference string          `json:"originReference"`
	Amount          decimal.Decimal `json:"amount"`
}

type PayoutBatchStatus added in v0.1.3

type PayoutBatchStatus int

PayoutBatchStatus -- Payout.Contracts.Enums.PayoutBatchStatus (SPEC-025).

const (
	PayoutBatchStatusCreated         PayoutBatchStatus = 0
	PayoutBatchStatusReserved        PayoutBatchStatus = 1
	PayoutBatchStatusExecuting       PayoutBatchStatus = 2
	PayoutBatchStatusCompleted       PayoutBatchStatus = 3
	PayoutBatchStatusPartiallyFailed PayoutBatchStatus = 4
	PayoutBatchStatusFailed          PayoutBatchStatus = 5
)

func (PayoutBatchStatus) IsKnown added in v0.1.3

func (s PayoutBatchStatus) IsKnown() bool

func (PayoutBatchStatus) String added in v0.1.3

func (s PayoutBatchStatus) String() string

type PayoutBatchTrigger added in v0.1.3

type PayoutBatchTrigger int

PayoutBatchTrigger -- Payout.Contracts.Enums.PayoutBatchTrigger (SPEC-025) -- this SDK slice only ever sends Manual (CreatePayoutBatchCommand accepts no other trigger via the public route yet).

const (
	PayoutBatchTriggerThresholdCrossed PayoutBatchTrigger = 0
	PayoutBatchTriggerScheduled        PayoutBatchTrigger = 1
	PayoutBatchTriggerManual           PayoutBatchTrigger = 2
)

func (PayoutBatchTrigger) IsKnown added in v0.1.3

func (s PayoutBatchTrigger) IsKnown() bool

func (PayoutBatchTrigger) String added in v0.1.3

func (s PayoutBatchTrigger) String() string

type PayoutResource added in v0.1.3

type PayoutResource struct {
	// contains filtered or unexported fields
}

PayoutResource -- Data Plane -- Payout (SPEC-024/SPEC-025). Under PayoutPolicy.IMMEDIATE a beneficiary's Payable is settled the same moment as the Settlement itself (no PayoutBatch involved); under a batched policy the beneficiary only has an economic Receivable (GetPayableSummary) until a PayoutBatch actually executes. This SDK slice only ever creates batches with Trigger = PayoutBatchTriggerManual (the public route accepts no other trigger yet).

func (*PayoutResource) CreateBatch added in v0.1.3

func (r *PayoutResource) CreateBatch(
	ctx context.Context, organizationID, environmentID, assetNetworkID string,
	explicitOwnerIDs []string, idempotencyKey ...string,
) (CreatePayoutBatchResult, error)

CreateBatch -- PayoutBatchID in the result is empty when there were no eligible candidates (204 No Content, a legitimate no-op).

func (*PayoutResource) GetBatch added in v0.1.3

func (r *PayoutResource) GetBatch(ctx context.Context, organizationID, payoutBatchID string) (PayoutBatchResponse, error)

func (*PayoutResource) GetPayableSummary added in v0.1.3

func (r *PayoutResource) GetPayableSummary(ctx context.Context, accountID, assetNetworkID string) (PayableSummaryResponse, error)

type RateLimitError

type RateLimitError struct {
	RetryAfterSeconds int
	// contains filtered or unexported fields
}

RateLimitError -- 429, Code=RATE_LIMITED. Always retryable -- exposes RetryAfterSeconds from the real header.

func (RateLimitError) Code

func (e RateLimitError) Code() string

func (RateLimitError) Details

func (e RateLimitError) Details() any

func (RateLimitError) Error

func (e RateLimitError) Error() string

func (RateLimitError) HTTPStatus

func (e RateLimitError) HTTPStatus() int

func (RateLimitError) RequestID

func (e RateLimitError) RequestID() string

func (RateLimitError) Retryable

func (e RateLimitError) Retryable() bool

func (RateLimitError) Unwrap

func (e RateLimitError) Unwrap() error

type RedeliverWebhookResult

type RedeliverWebhookResult struct {
	WebhookDeliveryID string `json:"webhookDeliveryId"`
}

type RefundResponse

type RefundResponse struct {
	RefundID       string          `json:"refundId"`
	TransactionID  string          `json:"transactionId"`
	OrganizationID string          `json:"organizationId"`
	Amount         decimal.Decimal `json:"amount"`
	Reason         string          `json:"reason"`
	Status         RefundStatus    `json:"status"`
	EntryGroupID   string          `json:"entryGroupId"`
	CreatedAt      time.Time       `json:"createdAt"`
	ExecutedAt     *time.Time      `json:"executedAt"`
}

type RefundStatus

type RefundStatus int
const (
	RefundStatusRequested RefundStatus = 0
	RefundStatusApproved  RefundStatus = 1
	RefundStatusExecuted  RefundStatus = 2
	RefundStatusRejected  RefundStatus = 3
)

func (RefundStatus) IsKnown

func (s RefundStatus) IsKnown() bool

func (RefundStatus) String

func (s RefundStatus) String() string

type RefundsResource

type RefundsResource struct {
	// contains filtered or unexported fields
}

RefundsResource -- Data Plane -- Refunds (3 real routes, under the same real Settlement module).

func (*RefundsResource) ExecuteRefund

func (r *RefundsResource) ExecuteRefund(ctx context.Context, transactionID string, amount *decimal.Decimal, reason string, idempotencyKey ...string) (ExecuteRefundResult, error)

ExecuteRefund -- amount nil = full refund.

func (*RefundsResource) Get

func (r *RefundsResource) Get(ctx context.Context, refundID string) (RefundResponse, error)

func (*RefundsResource) ListByTransaction

func (r *RefundsResource) ListByTransaction(ctx context.Context, transactionID string) ([]RefundResponse, error)

type RegisterExecutionDestinationResult added in v0.1.2

type RegisterExecutionDestinationResult struct {
	ExecutionDestinationID string `json:"executionDestinationId"`
}

RegisterExecutionDestinationResult -- DEC-037, CUSTODY-EXECUTION-MODES.md -- a beneficiary's valid on-chain receiving address for a given AssetNetwork, consumed by SelfCustodySettlementExecutionStrategy when building an ExecutionLeg. Deliberately NOT WithdrawalDestination -- no whitelist/cooldown policy, first-registration-wins (a second registration for the same AccountID+AssetNetworkID is rejected, never silently overwritten).

type RegisterExecutionSourceResult added in v0.1.3

type RegisterExecutionSourceResult struct {
	ExecutionSourceID string `json:"executionSourceId"`
}

RegisterExecutionSourceResult -- SPEC-ADDRESSPOOL-001, CUSTODY-EXECUTION-MODES.md -- the outbound-only counterpart of a Wallet derivation: the address ExecutionCustody signs FROM to pay network cost (Energy/Bandwidth/gas), never confused with an ExecutionDestination (a beneficiary's inbound address). Must be registered before the first self-custody Withdrawal/Payout on a given AssetNetwork -- see docs/specs/execution-custody/README.md "Bootstrap obrigatório" for the required order (Wallet -> ExecutionSource -> NetworkCostPayerAccount).

type RegisterNetworkCostPayerAccountResult added in v0.1.3

type RegisterNetworkCostPayerAccountResult struct {
	NetworkCostPayerAccountID string `json:"networkCostPayerAccountId"`
}

RegisterNetworkCostPayerAccountResult -- SPEC-NETEXEC-001 -- the Account debited for the *charged* network cost (TotalCharged, in QuoteCurrency) once a NetworkExecutionQuote is authorized. First-registration-wins per (organizationID, assetNetworkID), same as ExecutionDestination -- never silently overwritten. Must belong to the same Organization as the caller (a cross-tenant accountID is rejected).

type RegisterWalletResult

type RegisterWalletResult struct {
	WalletID string `json:"walletId"`
}

type ReserveTransactionResult

type ReserveTransactionResult struct {
	EntryGroupID string `json:"entryGroupId"`
}

type RetryPolicy

type RetryPolicy struct {
	MaxRetries        int
	BaseBackoff       time.Duration
	BackoffMultiplier float64
	MaxBackoff        time.Duration
}

RetryPolicy -- see SDK_CAPABILITY_SPEC.md section 8. Retries only on connection failure, 429 (respecting Retry-After), and 5xx when the call has an Idempotency-Key. Never on a deterministic 4xx.

func DefaultRetryPolicy

func DefaultRetryPolicy() RetryPolicy

func DisabledRetryPolicy

func DisabledRetryPolicy() RetryPolicy

type RotateApiKeyResult

type RotateApiKeyResult struct {
	NewApiKeyID  string `json:"newApiKeyId"`
	PlainTextKey string `json:"plainTextKey"`
}

type RotateWebhookEndpointSecretResult

type RotateWebhookEndpointSecretResult struct {
	WebhookEndpointID string `json:"webhookEndpointId"`
	Secret            string `json:"secret"`
}

type RuleResponse

type RuleResponse struct {
	RuleID      string              `json:"ruleId"`
	FromStateID string              `json:"fromStateId"`
	ToStateID   string              `json:"toStateId"`
	EventTypeID string              `json:"eventTypeId"`
	Conditions  []ConditionResponse `json:"conditions"`
}

type SandboxBroadcastAttemptResponse

type SandboxBroadcastAttemptResponse struct {
	SandboxBroadcastAttemptID string          `json:"sandboxBroadcastAttemptId"`
	DestinationAddress        string          `json:"destinationAddress"`
	Amount                    decimal.Decimal `json:"amount"`
	AssetNetworkID            string          `json:"assetNetworkId"`
	Status                    string          `json:"status"`
	TechnicalReference        string          `json:"technicalReference"`
	CreatedAt                 time.Time       `json:"createdAt"`
}

type SandboxBroadcastAttemptResult

type SandboxBroadcastAttemptResult struct {
	SandboxBroadcastAttemptID string `json:"sandboxBroadcastAttemptId"`
}

type SandboxObservedAddressResponse

type SandboxObservedAddressResponse struct {
	SandboxObservedAddressID string    `json:"sandboxObservedAddressId"`
	Address                  string    `json:"address"`
	AssetNetworkID           string    `json:"assetNetworkId"`
	LastObservedReference    string    `json:"lastObservedReference"`
	LastConfirmationCount    *int      `json:"lastConfirmationCount"`
	CreatedAt                time.Time `json:"createdAt"`
}

type SandboxObservedAddressResult

type SandboxObservedAddressResult struct {
	SandboxObservedAddressID string `json:"sandboxObservedAddressId"`
}

type SandboxResource

type SandboxResource struct {
	// contains filtered or unexported fields
}

SandboxResource -- Data Plane, exclusive to Environments of type Sandbox -- Sandbox (9 real routes). Never available/valid against Production (the backend rejects it with 422 if the Environment isn't Sandbox).

func (*SandboxResource) Faucet

func (r *SandboxResource) Faucet(ctx context.Context, environmentID, depositAddress, assetNetworkID string, amount decimal.Decimal) (SandboxObservedAddressResult, error)

func (*SandboxResource) GetBroadcastAttempt

func (r *SandboxResource) GetBroadcastAttempt(ctx context.Context, environmentID, id string) (SandboxBroadcastAttemptResponse, error)

func (*SandboxResource) GetObservedAddress

func (r *SandboxResource) GetObservedAddress(ctx context.Context, environmentID, id string) (SandboxObservedAddressResponse, error)

func (*SandboxResource) GetTreasuryBalance

func (r *SandboxResource) GetTreasuryBalance(ctx context.Context, environmentID, assetNetworkID string) (SandboxTreasuryObservedBalanceResponse, error)

func (*SandboxResource) SetObservedTreasuryBalance

func (r *SandboxResource) SetObservedTreasuryBalance(ctx context.Context, environmentID, assetNetworkID string, balance decimal.Decimal) error

func (*SandboxResource) SimulateBroadcastConfirmation

func (r *SandboxResource) SimulateBroadcastConfirmation(ctx context.Context, environmentID, broadcastAttemptID string, additionalConfirmations int, isFinal bool) error

func (*SandboxResource) SimulateConfirmation

func (r *SandboxResource) SimulateConfirmation(ctx context.Context, environmentID, sandboxObservedAddressID string, additionalConfirmations int, isFinal bool) error

func (*SandboxResource) SimulateDeposit

func (r *SandboxResource) SimulateDeposit(ctx context.Context, environmentID, depositAddress, assetNetworkID string, amount decimal.Decimal) (SandboxObservedAddressResult, error)

func (*SandboxResource) SimulateWithdrawal

func (r *SandboxResource) SimulateWithdrawal(
	ctx context.Context, environmentID, destinationAddress string, amount decimal.Decimal, assetNetworkID string,
	outcome SimulatedBroadcastOutcome, failureReason string,
) (SandboxBroadcastAttemptResult, error)

type SandboxTreasuryObservedBalanceResponse

type SandboxTreasuryObservedBalanceResponse struct {
	AssetNetworkID string          `json:"assetNetworkId"`
	Balance        decimal.Decimal `json:"balance"`
	UpdatedAt      time.Time       `json:"updatedAt"`
}

type SearchExecutionsOptions added in v0.1.5

type SearchExecutionsOptions struct {
	Status        *ExecutionStatus
	TransactionID string
	SettlementID  string
	DateFrom      string
	DateTo        string
	Skip          *int
	Take          *int
}

SearchExecutionsOptions -- optional SearchExecutions/SearchExecutionsAll filters.

type SettlementResponse

type SettlementResponse struct {
	SettlementID             string           `json:"settlementId"`
	TransactionID            string           `json:"transactionId"`
	OrganizationID           string           `json:"organizationId"`
	ApplicationID            string           `json:"applicationId"`
	AssetNetworkID           string           `json:"assetNetworkId"`
	GrossAmount              decimal.Decimal  `json:"grossAmount"`
	PlatformFeeAmount        decimal.Decimal  `json:"platformFeeAmount"`
	DistributableAmount      decimal.Decimal  `json:"distributableAmount"`
	FeePercentageApplied     decimal.Decimal  `json:"feePercentageApplied"`
	PlatformRevenueAccountID string           `json:"platformRevenueAccountId"`
	PricingPolicyID          string           `json:"pricingPolicyId"`
	Status                   SettlementStatus `json:"status"`
	EntryGroupID             string           `json:"entryGroupId"`
	// SigningRequestID -- DEC-037 -- populated only under SelfCustody, once
	// SelfCustodySettlementExecutionStrategy creates a real SigningRequest (never under
	// ManagedCustody, never before there's something to sign). Fetch it via
	// client.SigningRequests.Get(ctx, signingRequestID) to sign locally. Compatibility field --
	// always the first entry of SigningRequestIDs (or empty); for a Settlement funded by more
	// than one physical source, prefer SigningRequestIDs.
	SigningRequestID string `json:"signingRequestId"`
	// SigningRequestIDs -- SPEC-ADDRESSPOOL-001 (multi-source funding) -- one SigningRequest per
	// physical funding source frozen for this Settlement; usually a single entry, more than one
	// only when the underlying Transaction was funded by more than one confirmed deposit address.
	SigningRequestIDs []string                            `json:"signingRequestIds"`
	SplitAllocations  []SettlementSplitAllocationResponse `json:"splitAllocations"`
	CreatedAt         time.Time                           `json:"createdAt"`
	ExecutedAt        *time.Time                          `json:"executedAt"`
}

type SettlementSplitAllocationResponse

type SettlementSplitAllocationResponse struct {
	SplitAllocationID string                `json:"splitAllocationId"`
	ParticipantID     string                `json:"participantId"`
	AccountID         string                `json:"accountId"`
	Amount            decimal.Decimal       `json:"amount"`
	Status            SplitAllocationStatus `json:"status"`
	RetentionReason   *SplitRetentionReason `json:"retentionReason"`
	ReleasedAt        *time.Time            `json:"releasedAt"`
}

type SettlementStatus

type SettlementStatus int
const (
	SettlementStatusPending   SettlementStatus = 0
	SettlementStatusExecuting SettlementStatus = 1
	SettlementStatusCompleted SettlementStatus = 2
	SettlementStatusFailed    SettlementStatus = 3
)

func (SettlementStatus) IsKnown

func (s SettlementStatus) IsKnown() bool

func (SettlementStatus) String

func (s SettlementStatus) String() string

type SettlementsResource

type SettlementsResource struct {
	// contains filtered or unexported fields
}

SettlementsResource -- Data Plane -- Settlement (5 rotas reais; Refunds em RefundsResource).

func (*SettlementsResource) ExecuteSettlement

func (r *SettlementsResource) ExecuteSettlement(ctx context.Context, transactionID string, amount *decimal.Decimal, idempotencyKey ...string) (ExecuteSettlementResult, error)

ExecuteSettlement -- amount nil liquida todo o remaining reservado (comportamento inalterado); informado liquida exatamente esse valor (BL-STL-008, ativado 2026-08-26) -- chamável repetidamente sobre a mesma Transaction até o remaining reservado chegar a zero, cada chamada calculando seu próprio Platform Fee sobre o Gross daquela chamada.

func (*SettlementsResource) Get

func (r *SettlementsResource) Get(ctx context.Context, settlementID string) (SettlementResponse, error)

func (*SettlementsResource) GetSummary

func (*SettlementsResource) ListByTransaction

func (r *SettlementsResource) ListByTransaction(ctx context.Context, transactionID string) ([]SettlementResponse, error)

func (*SettlementsResource) ReleaseRetainedSplit

func (r *SettlementsResource) ReleaseRetainedSplit(ctx context.Context, settlementID, allocationID string, idempotencyKey ...string) error

type SignUpAndClaimAccountHolderInvitationResult

type SignUpAndClaimAccountHolderInvitationResult struct {
	Success        bool                      `json:"success"`
	RelationshipID *string                   `json:"relationshipId"`
	Token          *AccountHolderTokenResult `json:"token"`
	ErrorCode      *string                   `json:"errorCode"`
}

SignUpAndClaimAccountHolderInvitationResult -- DEC-032/BR-HLD-005/006 -- the "new AccountHolder" path: atomic signup + claim.

type SignUpResponse

type SignUpResponse struct {
	OrganizationID  string      `json:"organizationId"`
	MemberID        string      `json:"memberId"`
	Token           TokenResult `json:"token"`
	ApplicationID   string      `json:"applicationId"`
	EnvironmentID   string      `json:"environmentId"`
	ApiKeyPlainText *string     `json:"apiKeyPlainText"`
}

type Signer

type Signer interface {
	Sign(derivationIndex uint32, canonicalHash []byte) ([]byte, error)
}

Signer -- pluggable signing interface (SPEC-021). An integrator who needs real security (Vault/KMS/HSM/Secret Manager/Keychain) implements this interface without changing any other SDK contract -- InMemorySigner is only the reference implementation.

type SigningRequestResponse

type SigningRequestResponse struct {
	SigningRequestID    string                 `json:"signingRequestId"`
	ApplicationID       string                 `json:"applicationId"`
	EnvironmentID       string                 `json:"environmentId"`
	NetworkID           string                 `json:"networkId"`
	WalletID            string                 `json:"walletId"`
	DerivationReference uint32                 `json:"derivationReference"`
	OriginReference     string                 `json:"originReference"`
	AssetNetworkID      string                 `json:"assetNetworkId"`
	SourceAddress       string                 `json:"sourceAddress"`
	ProtocolVersion     int                    `json:"protocolVersion"`
	Legs                []ExecutionLegResponse `json:"legs"`
	CreatedAt           time.Time              `json:"createdAt"`
	ExpiresAt           time.Time              `json:"expiresAt"`
	IsExpired           bool                   `json:"isExpired"`
}

type SigningRequestsResource

type SigningRequestsResource struct {
	// contains filtered or unexported fields
}

SigningRequestsResource -- Data Plane -- ExecutionCustody SigningRequests (SPEC-019/020/021, checkpoint 11). The SDK never computes the canonical hash on create -- the backend computes it and returns it on Get; the SDK only signs it locally (Signer) and submits it back.

func (*SigningRequestsResource) Create

func (r *SigningRequestsResource) Create(
	ctx context.Context, environmentID, walletID string, derivationReference uint32, originReference,
	assetNetworkID, sourceAddress string, legs []ExecutionLegInput, expiresAt time.Time, idempotencyKey ...string,
) (CreateSigningRequestResult, error)

func (*SigningRequestsResource) Get

func (r *SigningRequestsResource) Get(ctx context.Context, signingRequestID string) (SigningRequestResponse, error)

func (*SigningRequestsResource) SubmitSignedTransaction

func (r *SigningRequestsResource) SubmitSignedTransaction(
	ctx context.Context, signingRequestID, executionLegID, submittedCanonicalHash, signatureHex string,
) (SubmitSignedTransactionResult, error)

SubmitSignedTransaction -- SPEC-020/INV-SC-03 -- submittedCanonicalHash must be exactly the CanonicalHash returned by Get for that Leg (compared byte for byte by the backend before verifying the signature, fail fast). signatureHex is the output of Signer.Sign(...), uppercase hex.

type SimulatedBroadcastOutcome

type SimulatedBroadcastOutcome int
const (
	SimulatedBroadcastOutcomeAccepted SimulatedBroadcastOutcome = 1
	SimulatedBroadcastOutcomeFailed   SimulatedBroadcastOutcome = 2
)

func (SimulatedBroadcastOutcome) IsKnown

func (s SimulatedBroadcastOutcome) IsKnown() bool

func (SimulatedBroadcastOutcome) String

func (s SimulatedBroadcastOutcome) String() string

type SplitAllocationStatus

type SplitAllocationStatus int
const (
	SplitAllocationStatusExecuted SplitAllocationStatus = 0
	SplitAllocationStatusRetained SplitAllocationStatus = 1
	SplitAllocationStatusReleased SplitAllocationStatus = 2
)

func (SplitAllocationStatus) IsKnown

func (s SplitAllocationStatus) IsKnown() bool

func (SplitAllocationStatus) String

func (s SplitAllocationStatus) String() string

type SplitRetentionReason

type SplitRetentionReason int
const (
	SplitRetentionReasonAccountNotFound                    SplitRetentionReason = 0
	SplitRetentionReasonAccountNotActive                   SplitRetentionReason = 1
	SplitRetentionReasonAccountNotAuthorizedForApplication SplitRetentionReason = 2
)

func (SplitRetentionReason) IsKnown

func (s SplitRetentionReason) IsKnown() bool

func (SplitRetentionReason) String

func (s SplitRetentionReason) String() string

type StateInput

type StateInput struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	IsInitial bool   `json:"isInitial"`
	IsFinal   bool   `json:"isFinal"`
}

type StateResponse

type StateResponse struct {
	StateID   string `json:"stateId"`
	Name      string `json:"name"`
	IsInitial bool   `json:"isInitial"`
	IsFinal   bool   `json:"isFinal"`
}

type SubmitSignedTransactionResult

type SubmitSignedTransactionResult struct {
	ExecutionLegID  string  `json:"executionLegId"`
	Verified        bool    `json:"verified"`
	MismatchReason  *string `json:"mismatchReason"`
	AllLegsVerified bool    `json:"allLegsVerified"`
}

SubmitSignedTransactionResult -- Verified=false corresponds to the public code SIGNED_TRANSACTION_MISMATCH (backend SPEC-020 Errors) -- never broadcast (INV-SC-03). AllLegsVerified=true means the broadcast of ALL Legs has already fired within the same Command (all-signatures gate).

type TimeoutError

type TimeoutError struct {
	// contains filtered or unexported fields
}

TimeoutError -- connect/request timeout exceeded, or WaitFor exceeding its deadline. Always retryable.

func (TimeoutError) Code

func (e TimeoutError) Code() string

func (TimeoutError) Details

func (e TimeoutError) Details() any

func (TimeoutError) Error

func (e TimeoutError) Error() string

func (TimeoutError) HTTPStatus

func (e TimeoutError) HTTPStatus() int

func (TimeoutError) RequestID

func (e TimeoutError) RequestID() string

func (TimeoutError) Retryable

func (e TimeoutError) Retryable() bool

func (TimeoutError) Unwrap

func (e TimeoutError) Unwrap() error

type TokenResult

type TokenResult struct {
	Success      bool       `json:"success"`
	AccessToken  string     `json:"accessToken"`
	RefreshToken string     `json:"refreshToken"`
	ExpiresAt    *time.Time `json:"expiresAt"`
	ErrorCode    string     `json:"errorCode"`
}

type TransactionResponse

type TransactionResponse struct {
	TransactionID          string                `json:"transactionId"`
	OrganizationID         string                `json:"organizationId"`
	ApplicationID          string                `json:"applicationId"`
	WorkflowVersionID      string                `json:"workflowVersionId"`
	CurrentWorkflowStateID string                `json:"currentWorkflowStateId"`
	AssetNetworkID         string                `json:"assetNetworkId"`
	Amount                 decimal.Decimal       `json:"amount"`
	Status                 TransactionStatus     `json:"status"`
	PayerAccountID         string                `json:"payerAccountId"`
	Participants           []ParticipantResponse `json:"participants"`
	CreatedAt              time.Time             `json:"createdAt"`
	SettledAmount          decimal.Decimal       `json:"settledAmount"`
	RefundedAmount         decimal.Decimal       `json:"refundedAmount"`
}

type TransactionSettlementSummaryResponse

type TransactionSettlementSummaryResponse struct {
	TransactionID           string          `json:"transactionId"`
	SettledAmount           decimal.Decimal `json:"settledAmount"`
	RefundedAmount          decimal.Decimal `json:"refundedAmount"`
	RemainingReservedAmount decimal.Decimal `json:"remainingReservedAmount"`
	RetainedAmount          decimal.Decimal `json:"retainedAmount"`
}

type TransactionStateResponse

type TransactionStateResponse struct {
	Status                 TransactionStatus `json:"status"`
	WorkflowVersionID      string            `json:"workflowVersionId"`
	CurrentWorkflowStateID string            `json:"currentWorkflowStateId"`
}

type TransactionStatus

type TransactionStatus int
const (
	TransactionStatusCreated           TransactionStatus = 0
	TransactionStatusAwaitingFunds     TransactionStatus = 1
	TransactionStatusFunded            TransactionStatus = 2
	TransactionStatusReserved          TransactionStatus = 3
	TransactionStatusSettled           TransactionStatus = 4
	TransactionStatusPartiallyRefunded TransactionStatus = 5
	TransactionStatusRefunded          TransactionStatus = 6
	TransactionStatusFrozen            TransactionStatus = 7
	TransactionStatusCancelled         TransactionStatus = 8
	TransactionStatusPartiallySettled  TransactionStatus = 9
)

func (TransactionStatus) IsKnown

func (s TransactionStatus) IsKnown() bool

func (TransactionStatus) String

func (s TransactionStatus) String() string

type TransactionsResource

type TransactionsResource struct {
	// contains filtered or unexported fields
}

TransactionsResource -- Data Plane -- Transactions (7 real routes).

func (*TransactionsResource) Cancel

func (r *TransactionsResource) Cancel(ctx context.Context, transactionID, reason string) error

func (*TransactionsResource) Create

func (r *TransactionsResource) Create(
	ctx context.Context, organizationID, applicationID string, workflowVersionID *string, assetNetworkID string,
	amount decimal.Decimal, participants []ParticipantInput, idempotencyKey ...string,
) (CreateTransactionResult, error)

func (*TransactionsResource) Freeze

func (r *TransactionsResource) Freeze(ctx context.Context, transactionID, reason string) error

func (*TransactionsResource) Get

func (r *TransactionsResource) Get(ctx context.Context, transactionID string) (TransactionResponse, error)

func (*TransactionsResource) GetState

func (r *TransactionsResource) GetState(ctx context.Context, transactionID string) (TransactionStateResponse, error)

func (*TransactionsResource) Reserve

func (r *TransactionsResource) Reserve(ctx context.Context, transactionID string) (ReserveTransactionResult, error)

func (*TransactionsResource) SearchExecutions added in v0.1.5

func (r *TransactionsResource) SearchExecutions(ctx context.Context, organizationID string, opts SearchExecutionsOptions) ([]ExecutionResponse, error)

SearchExecutions -- PROMPT 5 section 9 (G.7) -- discoverability for outstanding/overdue Executions. The safety rule that makes an Organization settlement-restricted on an overdue Execution stays -- this closes the operational hole of finding which Execution caused it. Scoped by organizationID, same authorization model as every other /v1/organizations/{organizationId}/... route -- never cross-tenant. Every query value goes through url.Values.Encode() -- never concatenated raw (same discipline as List above).

func (*TransactionsResource) SearchExecutionsAll added in v0.1.5

func (r *TransactionsResource) SearchExecutionsAll(ctx context.Context, organizationID string, pageSize int, opts SearchExecutionsOptions) iter.Seq2[ExecutionResponse, error]

SearchExecutionsAll -- lazy iterator -- see SDK_CAPABILITY_SPEC.md section 12.7.

func (*TransactionsResource) Unfreeze

func (r *TransactionsResource) Unfreeze(ctx context.Context, transactionID string) error

func (*TransactionsResource) WaitFor

func (r *TransactionsResource) WaitFor(ctx context.Context, transactionID string, pollInterval time.Duration) (TransactionResponse, error)

WaitFor -- safe polling, never infinite -- the timeout comes from ctx's deadline (idiomatic Go; see SDK_CAPABILITY_SPEC.md section 15). Ends at Settled/Refunded/Cancelled.

type TransitionInput

type TransitionInput struct {
	ID          string `json:"id"`
	FromStateID string `json:"fromStateId"`
	ToStateID   string `json:"toStateId"`
}

type TransitionResponse

type TransitionResponse struct {
	TransitionID string `json:"transitionId"`
	FromStateID  string `json:"fromStateId"`
	ToStateID    string `json:"toStateId"`
}

type ValidationError

type ValidationError struct {
	// contains filtered or unexported fields
}

ValidationError -- 400, Code=VALIDATION_ERROR. Message() is a SINGLE string with all errors joined by "; " -- the real API (FluentValidation) doesn't expose a per-field array.

func (ValidationError) Code

func (e ValidationError) Code() string

func (ValidationError) Details

func (e ValidationError) Details() any

func (ValidationError) Error

func (e ValidationError) Error() string

func (ValidationError) HTTPStatus

func (e ValidationError) HTTPStatus() int

func (ValidationError) RequestID

func (e ValidationError) RequestID() string

func (ValidationError) Retryable

func (e ValidationError) Retryable() bool

func (ValidationError) Unwrap

func (e ValidationError) Unwrap() error

type Wallet

type Wallet struct {
	Scheme                   DerivationScheme
	AccountExtendedPublicKey string
}

Wallet -- PUBLIC material of a self-custody wallet -- safe to register via the API (WalletsResource.Register). Never contains a private key (INV-SC-01).

type WalletAssetBalanceResponse added in v0.1.4

type WalletAssetBalanceResponse struct {
	AssetID          string                         `json:"assetId"`
	AssetSymbol      string                         `json:"assetSymbol"`
	AggregateBalance decimal.Decimal                `json:"aggregateBalance"`
	NetworkBalances  []WalletNetworkBalanceResponse `json:"networkBalances"`
}

WalletAssetBalanceResponse -- a single Asset's balance aggregated across the AssetNetworks the caller asked about -- never summed across different Assets (e.g. USDT never added to ETH).

type WalletBalanceResource added in v0.1.4

type WalletBalanceResource struct {
	// contains filtered or unexported fields
}

WalletBalanceResource -- Ishtaran Wallet Balance / On-Chain Balance capability. The wallet's own on-chain balance -- NEVER the Ledger (LedgerResource.GetBalance, a fundamentally different question: "what does Ishtaran's own accounting say" vs "how many tokens actually sit at this address"). AccountID is the walletID throughout -- ExecutionDestination already ties one Account to one registered self-custody address per AssetNetwork, so no separate wallet-registration concept exists (a distinct WalletsResource already exists for ExecutionCustody's own execution/signing wallets -- an unrelated concept, deliberately not reused here to avoid confusing the two).

GetBalance is always cheap -- it never calls a blockchain/RPC provider, only returns the last known snapshot. Call RefreshBalance to request a real, authoritative check; the platform enforces its own freshness window (currently 30s) and single-flight guard server-side, so calling it more often than needed is always safe (never causes extra provider cost, never an error) -- check RefreshSuppressed/Stale/NextRefreshAllowedAt on the result rather than polling blindly.

func (*WalletBalanceResource) GetAssetBalances added in v0.1.4

func (r *WalletBalanceResource) GetAssetBalances(ctx context.Context, accountID, environmentID string, assetNetworkIDs []string) ([]WalletAssetBalanceResponse, error)

GetAssetBalances aggregates balance across the given AssetNetworks, grouped by Asset (e.g. USDT total across TRON + Ethereum) -- assetNetworkIDs are candidates the caller already knows about (from AssetNetworkCatalogResource.ListAssetNetworks, say); any candidate this Account has no registered address for is simply omitted from the result, never an error.

func (*WalletBalanceResource) GetBalance added in v0.1.4

func (r *WalletBalanceResource) GetBalance(ctx context.Context, accountID, environmentID, assetNetworkID string) (WalletBalanceResponse, error)

func (*WalletBalanceResource) RefreshBalance added in v0.1.4

func (r *WalletBalanceResource) RefreshBalance(ctx context.Context, accountID, environmentID, assetNetworkID string) (WalletBalanceResponse, error)

RefreshBalance never informs what the new balance should be -- only asks the platform to check, authoritatively, itself.

type WalletBalanceResponse added in v0.1.4

type WalletBalanceResponse struct {
	AccountID      string          `json:"accountId"`
	AssetNetworkID string          `json:"assetNetworkId"`
	Address        string          `json:"address"`
	Balance        decimal.Decimal `json:"balance"`
	// ObservedAt is nil if this wallet has never been successfully observed yet -- Balance is 0 in that case, never a lie.
	ObservedAt     *time.Time `json:"observedAt"`
	BlockReference *string    `json:"blockReference"`
	// Source is e.g. "sandbox" | "trongrid" -- whichever provider actually answered, reported honestly by the adapter itself.
	Source string `json:"source"`
	// Stale is true if ObservedAt is nil or older than the platform's freshness window (currently 30s).
	Stale                bool       `json:"stale"`
	NextRefreshAllowedAt *time.Time `json:"nextRefreshAllowedAt"`
	// RefreshSuppressed is true if a RefreshBalance call was suppressed by the freshness window or single-flight guard -- never an error.
	RefreshSuppressed bool `json:"refreshSuppressed"`
	// RefreshFailureReason is set only when the most recent refresh attempt failed -- Balance/ObservedAt above remain the last successfully observed values, never zeroed out.
	RefreshFailureReason *string `json:"refreshFailureReason"`
}

WalletBalanceResponse -- Ishtaran Wallet Balance / On-Chain Balance capability -- the wallet's own on-chain balance, NEVER the Ledger (LedgerResource.GetBalance). AccountID throughout this SDK surface is the walletID: ExecutionDestination (the registered self-custody address) is already the platform's real 1:1 (AccountID, AssetNetworkID) -> address source of truth, so no separate "wallet registration" concept was introduced -- see WalletBalanceResource's own doc.

type WalletNetworkBalanceResponse added in v0.1.4

type WalletNetworkBalanceResponse struct {
	AssetNetworkID string          `json:"assetNetworkId"`
	NetworkCode    string          `json:"networkCode"`
	Balance        decimal.Decimal `json:"balance"`
	ObservedAt     *time.Time      `json:"observedAt"`
	Stale          bool            `json:"stale"`
}

WalletNetworkBalanceResponse -- one AssetNetwork's contribution to a WalletAssetBalanceResponse.

type WalletPublicMaterialResult

type WalletPublicMaterialResult struct {
	PublicDerivationMaterial string `json:"publicDerivationMaterial"`
}

WalletPublicMaterialResult -- the only legitimate place derivation material is exposed (Confidential, never Secret).

type WalletResponse

type WalletResponse struct {
	WalletID            string           `json:"walletId"`
	ApplicationID       string           `json:"applicationId"`
	NetworkID           string           `json:"networkId"`
	Scheme              DerivationScheme `json:"scheme"`
	NextDerivationIndex uint32           `json:"nextDerivationIndex"`
	RegisteredAt        time.Time        `json:"registeredAt"`
}

WalletResponse -- BR-WLT-002 -- never includes the derivation material (dedicated route, see WalletPublicMaterialResult).

type WalletsResource

type WalletsResource struct {
	// contains filtered or unexported fields
}

WalletsResource -- Data Plane -- ExecutionCustody Wallets (SPEC-018/021, checkpoint 11). The SDK only ever sends the PUBLIC extended key (publicDerivationMaterial) -- generated locally by GenerateWallet/RestoreWallet -- never the private key/mnemonic (INV-SC-01).

func (*WalletsResource) AllocateDepositAddress

func (r *WalletsResource) AllocateDepositAddress(ctx context.Context, applicationID, networkID string) (AllocatedDepositAddressResult, error)

AllocateDepositAddress -- SPEC-018 BR-WLT-001 -- each call allocates a NEW index by design, no idempotencyKey; never retry-reuse it automatically.

func (*WalletsResource) Get

func (r *WalletsResource) Get(ctx context.Context, walletID string) (WalletResponse, error)

Get -- BR-WLT-002 -- never includes publicDerivationMaterial; see GetPublicMaterial.

func (*WalletsResource) GetPublicMaterial

func (r *WalletsResource) GetPublicMaterial(ctx context.Context, walletID string) (WalletPublicMaterialResult, error)

func (*WalletsResource) Register

func (r *WalletsResource) Register(
	ctx context.Context, applicationID, networkID string, scheme DerivationScheme, publicDerivationMaterial string, idempotencyKey ...string,
) (RegisterWalletResult, error)

type WebhookDeliveriesResource

type WebhookDeliveriesResource struct {
	// contains filtered or unexported fields
}

WebhookDeliveriesResource -- Control Plane (management) -- WebhookDeliveries (2 real routes, same Notifications module).

func (*WebhookDeliveriesResource) Get

func (*WebhookDeliveriesResource) Redeliver

func (r *WebhookDeliveriesResource) Redeliver(ctx context.Context, webhookDeliveryID string) (RedeliverWebhookResult, error)

type WebhookDeliveryResponse

type WebhookDeliveryResponse struct {
	WebhookDeliveryID string                `json:"webhookDeliveryId"`
	WebhookEndpointID string                `json:"webhookEndpointId"`
	EventType         string                `json:"eventType"`
	SequenceNumber    int64                 `json:"sequenceNumber"`
	Status            WebhookDeliveryStatus `json:"status"`
	AttemptCount      int                   `json:"attemptCount"`
	MaxAttempts       int                   `json:"maxAttempts"`
	NextAttemptAt     *time.Time            `json:"nextAttemptAt"`
	LastAttemptAt     *time.Time            `json:"lastAttemptAt"`
	LastError         string                `json:"lastError"`
	RedeliveredFromID string                `json:"redeliveredFromId"`
	CreatedAt         time.Time             `json:"createdAt"`
}

type WebhookDeliveryStatus

type WebhookDeliveryStatus int
const (
	WebhookDeliveryStatusPending    WebhookDeliveryStatus = 0
	WebhookDeliveryStatusDelivering WebhookDeliveryStatus = 1
	WebhookDeliveryStatusDelivered  WebhookDeliveryStatus = 2
	WebhookDeliveryStatusRetrying   WebhookDeliveryStatus = 3
	WebhookDeliveryStatusDeadLetter WebhookDeliveryStatus = 4
	WebhookDeliveryStatusCancelled  WebhookDeliveryStatus = 5
)

func (WebhookDeliveryStatus) IsKnown

func (s WebhookDeliveryStatus) IsKnown() bool

func (WebhookDeliveryStatus) String

func (s WebhookDeliveryStatus) String() string

type WebhookEndpointResponse

type WebhookEndpointResponse struct {
	WebhookEndpointID string                `json:"webhookEndpointId"`
	OrganizationID    string                `json:"organizationId"`
	URL               string                `json:"url"`
	Status            WebhookEndpointStatus `json:"status"`
	CreatedAt         time.Time             `json:"createdAt"`
}

type WebhookEndpointStatus

type WebhookEndpointStatus int
const (
	WebhookEndpointStatusActive   WebhookEndpointStatus = 0
	WebhookEndpointStatusInactive WebhookEndpointStatus = 1
)

func (WebhookEndpointStatus) IsKnown

func (s WebhookEndpointStatus) IsKnown() bool

func (WebhookEndpointStatus) String

func (s WebhookEndpointStatus) String() string

type WebhookEndpointsResource

type WebhookEndpointsResource struct {
	// contains filtered or unexported fields
}

WebhookEndpointsResource -- Control Plane (management) -- WebhookEndpoints (6 real routes). Always Member JWT -- doesn't accept an API Key today (a real Known Gap, see SDK_CAPABILITY_SPEC.md section 12.4).

func (*WebhookEndpointsResource) Create

func (r *WebhookEndpointsResource) Create(ctx context.Context, organizationID, endpointURL string) (ConfigureWebhookEndpointResult, error)

Create -- the Secret is only ever returned here -- save it immediately, it can never be retrieved later.

func (*WebhookEndpointsResource) Deactivate

func (r *WebhookEndpointsResource) Deactivate(ctx context.Context, webhookEndpointID string) error

func (*WebhookEndpointsResource) Get

func (r *WebhookEndpointsResource) Get(ctx context.Context, webhookEndpointID string) (WebhookEndpointResponse, error)

func (*WebhookEndpointsResource) List

func (r *WebhookEndpointsResource) List(ctx context.Context, organizationID string) ([]WebhookEndpointResponse, error)

func (*WebhookEndpointsResource) ListDeliveries

func (r *WebhookEndpointsResource) ListDeliveries(ctx context.Context, webhookEndpointID, eventType string, status *WebhookDeliveryStatus) ([]WebhookDeliveryResponse, error)

ListDeliveries -- status is sent as the NAME (string, case-insensitive) in the query string -- unlike AssetNetworkCatalog's filter (integer). Confirmed in source: Enum.Parse <WebhookDeliveryStatus>(status, ignoreCase: true). Every query goes through url.Values.Encode() -- never concatenated raw. Pass status=nil to not filter by status.

func (*WebhookEndpointsResource) RotateSecret

func (r *WebhookEndpointsResource) RotateSecret(ctx context.Context, webhookEndpointID string) (RotateWebhookEndpointSecretResult, error)

RotateSecret -- new secret -- the previous one stops validating signatures immediately.

type WithdrawalQuoteResponse

type WithdrawalQuoteResponse struct {
	AccountID               string          `json:"accountId"`
	WithdrawalDestinationID string          `json:"withdrawalDestinationId"`
	AssetNetworkID          string          `json:"assetNetworkId"`
	RequestedAmount         decimal.Decimal `json:"requestedAmount"`
	// Deprecated: vestigial under SelfCustody, always nil. Use NetworkExecutionCost.
	EstimatedNetworkFee      *decimal.Decimal `json:"estimatedNetworkFee"`
	EstimatedRecipientAmount decimal.Decimal  `json:"estimatedRecipientAmount"`
	NetworkExecutionCost     decimal.Decimal  `json:"networkExecutionCost"`
	ExpiresAt                time.Time        `json:"expiresAt"`
}

WithdrawalQuoteResponse -- SPEC-026 Descoberta 7/8 -- EstimatedNetworkFee is deprecated and always nil under SelfCustody (the only reachable path today, DEC-041): the beneficiary always receives the full RequestedAmount, never Amount-Fee. NetworkExecutionCost is the new source of truth for network cost (SPEC-NETEXEC-001). Preview quote != execution quote -- Request() always re-quotes from zero via EnsureViableAsync, never reuses this response as a price guarantee.

type WithdrawalResponse

type WithdrawalResponse struct {
	WithdrawalID            string          `json:"withdrawalId"`
	OrganizationID          string          `json:"organizationId"`
	EnvironmentID           string          `json:"environmentId"`
	AccountID               string          `json:"accountId"`
	WithdrawalDestinationID string          `json:"withdrawalDestinationId"`
	AssetNetworkID          string          `json:"assetNetworkId"`
	Amount                  decimal.Decimal `json:"amount"`
	// Deprecated: vestigial under SelfCustody, always nil. Use NetworkExecutionCost.
	EstimatedNetworkFee      *decimal.Decimal `json:"estimatedNetworkFee"`
	EstimatedRecipientAmount decimal.Decimal  `json:"estimatedRecipientAmount"`
	// Deprecated: vestigial under SelfCustody, always nil. Use NetworkExecutionCost.
	FinalNetworkFee            *decimal.Decimal            `json:"finalNetworkFee"`
	FinalRecipientAmount       *decimal.Decimal            `json:"finalRecipientAmount"`
	Status                     WithdrawalStatus            `json:"status"`
	EntryGroupID               string                      `json:"entryGroupId"`
	TechnicalReference         string                      `json:"technicalReference"`
	SigningRequestID           *string                     `json:"signingRequestId"`
	NetworkExecutionCost       *decimal.Decimal            `json:"networkExecutionCost"`
	NetworkExecutionCostStatus *NetworkExecutionCostStatus `json:"networkExecutionCostStatus"`
	CreatedAt                  time.Time                   `json:"createdAt"`
}

WithdrawalResponse -- SPEC-026 Descoberta 8 -- same EstimatedNetworkFee/FinalNetworkFee deprecation as WithdrawalQuoteResponse. SigningRequestID is populated only under SelfCustody, once there's something to sign (same role as SettlementResponse.SigningRequestID). NetworkExecutionCost/NetworkExecutionCostStatus are the new source of truth for network cost, via NetworkExecutionCostSettlementService (SPEC-NETEXEC-002); both nil before a network cost has been reserved yet.

type WithdrawalStatus

type WithdrawalStatus int
const (
	WithdrawalStatusRequested       WithdrawalStatus = 0
	WithdrawalStatusValidating      WithdrawalStatus = 1
	WithdrawalStatusPendingApproval WithdrawalStatus = 2
	WithdrawalStatusApproved        WithdrawalStatus = 3
	WithdrawalStatusRejected        WithdrawalStatus = 4
	WithdrawalStatusBroadcasting    WithdrawalStatus = 5
	WithdrawalStatusBroadcastFailed WithdrawalStatus = 6
	WithdrawalStatusConfirming      WithdrawalStatus = 7
	WithdrawalStatusCompleted       WithdrawalStatus = 8
	WithdrawalStatusCancelled       WithdrawalStatus = 9
)

func (WithdrawalStatus) IsKnown

func (s WithdrawalStatus) IsKnown() bool

func (WithdrawalStatus) String

func (s WithdrawalStatus) String() string

type WithdrawalsResource

type WithdrawalsResource struct {
	// contains filtered or unexported fields
}

WithdrawalsResource -- Data Plane -- Withdrawals (7 real routes). Quote never writes anything (pure read); Request always exposes EstimatedNetworkFee/EstimatedRecipientAmount in the response.

func (*WithdrawalsResource) Cancel

func (r *WithdrawalsResource) Cancel(ctx context.Context, withdrawalID, reason string) error

func (*WithdrawalsResource) CreateDestination

func (r *WithdrawalsResource) CreateDestination(ctx context.Context, organizationID, address, assetNetworkID string) (CreateWithdrawalDestinationResult, error)

func (*WithdrawalsResource) Get

func (r *WithdrawalsResource) Get(ctx context.Context, withdrawalID string) (WithdrawalResponse, error)

func (*WithdrawalsResource) List

List -- Skip/Take are real pagination (one of the SDK's only 2 endpoints with genuine pagination). Every query value goes through url.Values.Encode() -- never concatenated raw.

func (*WithdrawalsResource) ListAll

func (r *WithdrawalsResource) ListAll(ctx context.Context, organizationID string, pageSize int, opts ListWithdrawalsOptions) iter.Seq2[WithdrawalResponse, error]

ListAll -- lazy iterator -- see SDK_CAPABILITY_SPEC.md section 12.7.

func (*WithdrawalsResource) Quote

func (r *WithdrawalsResource) Quote(ctx context.Context, organizationID, environmentID, accountID, withdrawalDestinationID, assetNetworkID string, amount decimal.Decimal) (WithdrawalQuoteResponse, error)

func (*WithdrawalsResource) Request

func (r *WithdrawalsResource) Request(
	ctx context.Context, organizationID, environmentID, accountID, withdrawalDestinationID, assetNetworkID string,
	amount decimal.Decimal, idempotencyKey ...string,
) (WithdrawalResponse, error)

func (*WithdrawalsResource) RetryBroadcast

func (r *WithdrawalsResource) RetryBroadcast(ctx context.Context, withdrawalID string) error

func (*WithdrawalsResource) WaitFor

func (r *WithdrawalsResource) WaitFor(ctx context.Context, withdrawalID string, pollInterval time.Duration) (WithdrawalResponse, error)

WaitFor -- safe polling, never infinite -- the timeout comes from ctx's deadline. Ends at Completed/Rejected/Cancelled/BroadcastFailed.

type WorkflowResponse

type WorkflowResponse struct {
	WorkflowID     string    `json:"workflowId"`
	OrganizationID string    `json:"organizationId"`
	Name           string    `json:"name"`
	Status         string    `json:"status"`
	CreatedAt      time.Time `json:"createdAt"`
	VersionIDs     []string  `json:"versionIds"`
}

type WorkflowStatus

type WorkflowStatus string
const (
	WorkflowStatusDraft      WorkflowStatus = "Draft"
	WorkflowStatusPublished  WorkflowStatus = "Published"
	WorkflowStatusDeprecated WorkflowStatus = "Deprecated"
)

type WorkflowVersionResponse

type WorkflowVersionResponse struct {
	WorkflowVersionID string               `json:"workflowVersionId"`
	WorkflowID        string               `json:"workflowId"`
	Status            string               `json:"status"`
	CreatedAt         time.Time            `json:"createdAt"`
	PublishedAt       *time.Time           `json:"publishedAt"`
	States            []StateResponse      `json:"states"`
	Transitions       []TransitionResponse `json:"transitions"`
	Rules             []RuleResponse       `json:"rules"`
}

type WorkflowsResource

type WorkflowsResource struct {
	// contains filtered or unexported fields
}

WorkflowsResource -- Data Plane -- WorkflowRules (7 rotas de Workflow/Version/Rule; Events/EventTypes em recursos proprios).

func (*WorkflowsResource) Create

func (r *WorkflowsResource) Create(ctx context.Context, organizationID, name string) (CreateWorkflowResult, error)

func (*WorkflowsResource) CreateRule

func (r *WorkflowsResource) CreateRule(ctx context.Context, workflowID, workflowVersionID, fromStateID, toStateID, eventTypeID string, conditions []ConditionInput) (CreateRuleResult, error)

func (*WorkflowsResource) CreateVersion

func (r *WorkflowsResource) CreateVersion(ctx context.Context, workflowID string, states []StateInput, transitions []TransitionInput) (CreateWorkflowVersionResult, error)

func (*WorkflowsResource) Get

func (r *WorkflowsResource) Get(ctx context.Context, workflowID string) (WorkflowResponse, error)

func (*WorkflowsResource) GetVersion

func (r *WorkflowsResource) GetVersion(ctx context.Context, workflowID, workflowVersionID string) (WorkflowVersionResponse, error)

func (*WorkflowsResource) List

func (r *WorkflowsResource) List(ctx context.Context, organizationID string) ([]WorkflowResponse, error)

func (*WorkflowsResource) PublishVersion

func (r *WorkflowsResource) PublishVersion(ctx context.Context, workflowID, workflowVersionID string) error

Directories

Path Synopsis
examples
01_auth command
01 -- Quickstart minimo: API key -> client -> primeira chamada util.
01 -- Quickstart minimo: API key -> client -> primeira chamada util.
02_create_account command
02 -- Create an Account and fetch it back (Core API).
02 -- Create an Account and fetch it back (Core API).
03_receive_payment_easy command
03 -- Receive a payment via Easy Mode: composes Transaction + Payment Intent, returns the real DepositAddress along with the real Core IDs for debugging.
03 -- Receive a payment via Easy Mode: composes Transaction + Payment Intent, returns the real DepositAddress along with the real Core IDs for debugging.
04_create_transaction_core command
04 -- Create a Transaction via the Core API, with granular control over participants.
04 -- Create a Transaction via the Core API, with granular control over participants.
05_payment_intent_core command
05 -- Create a Payment Intent via the Core API.
05 -- Create a Payment Intent via the Core API.
06_settlement command
06 -- Settle a funded Transaction (Settlement) and query the summary.
06 -- Settle a funded Transaction (Settlement) and query the summary.
07_withdrawal_quote command
07 -- Quote a withdrawal BEFORE committing the amount (pure read, never reserves balance).
07 -- Quote a withdrawal BEFORE committing the amount (pure read, never reserves balance).
08_withdrawal command
08 -- Execute a withdrawal via Easy Mode and wait (with a timeout via context.Context) until a terminal state.
08 -- Execute a withdrawal via Easy Mode and wait (with a timeout via context.Context) until a terminal state.
09_ledger command
09 -- Query balance and Ledger Entry history (with real pagination via a lazy iter.Seq2).
09 -- Query balance and Ledger Entry history (with real pagination via a lazy iter.Seq2).
10_webhook_verification command
10 -- Webhook signature verification.
10 -- Webhook signature verification.
11_sandbox command
11 -- Full Sandbox flow: credits test balance via Faucet and confirms it.
11 -- Full Sandbox flow: credits test balance via Faucet and confirms it.
12_account_holder_invitation command
12 -- Invite an AccountHolder to link with an Organization, and claim the invitation from the holder's side (DEC-032).
12 -- Invite an AccountHolder to link with an Organization, and claim the invitation from the holder's side (DEC-032).
13_self_custody_signing command
13 -- Self-custody wallet/signing end to end (SPEC-017-021, checkpoint 11): generates the wallet LOCALLY (ishtaran.GenerateWallet()), registers only the public key, allocates a real deposit address, creates a 2-leg SigningRequest, signs each canonical hash returned by the API with the private key (which NEVER leaves this process -- INV-SC-01), and submits it back.
13 -- Self-custody wallet/signing end to end (SPEC-017-021, checkpoint 11): generates the wallet LOCALLY (ishtaran.GenerateWallet()), registers only the public key, allocates a real deposit address, creates a 2-leg SigningRequest, signs each canonical hash returned by the API with the private key (which NEVER leaves this process -- INV-SC-01), and submits it back.
14_marketplace_journey command
14 -- End-to-end marketplace journey, re-verified live 2026-08-31 against the Network Execution Engine: a buyer pays into a marketplace that holds its own self-custody execution wallet, a seller signs up as their own AccountHolder to receive the payout, and the marketplace signs the real payout itself -- Ishtaran never sees a private key.
14 -- End-to-end marketplace journey, re-verified live 2026-08-31 against the Network Execution Engine: a buyer pays into a marketplace that holds its own self-custody execution wallet, a seller signs up as their own AccountHolder to receive the payout, and the marketplace signs the real payout itself -- Ishtaran never sees a private key.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL