Documentation
¶
Index ¶
- Constants
- func ComputeCanonicalHash(protocolVersion int, environmentID, walletID string, derivationReference int, ...) (string, error)
- func ComputeWebhookSignature(unixTimestampSeconds int64, rawBody, endpointSecret string) string
- func DeriveTronAddress(accountExtendedPublicKey string, index uint32) (string, error)
- func GenerateIdempotencyKey() string
- func VerifyWebhookSignature(rawBody, signatureHeader, timestampHeader, endpointSecret string) bool
- func VerifyWebhookSignatureWithTolerance(rawBody, signatureHeader, timestampHeader, endpointSecret string, ...) bool
- type AccountHolderResponse
- type AccountHolderTokenResult
- type AccountHoldersResource
- func (r *AccountHoldersResource) ClaimInvitation(ctx context.Context, plainTextToken string) (ClaimAccountHolderInvitationResult, error)
- func (r *AccountHoldersResource) Login(ctx context.Context, email, password string) (AccountHolderTokenResult, error)
- func (r *AccountHoldersResource) Logout()
- func (r *AccountHoldersResource) Me(ctx context.Context) (AccountHolderResponse, error)
- func (r *AccountHoldersResource) SetAccessToken(accessToken string)
- func (r *AccountHoldersResource) SignUp(ctx context.Context, email, password string) (AccountHolderTokenResult, error)
- func (r *AccountHoldersResource) SignUpAndClaimInvitation(ctx context.Context, plainTextToken, email, password string) (SignUpAndClaimAccountHolderInvitationResult, error)
- type AccountResponse
- type AccountStatus
- type AccountsResource
- func (r *AccountsResource) AuthorizeApplication(ctx context.Context, organizationID, accountID, applicationID string) error
- func (r *AccountsResource) Close(ctx context.Context, accountID string) error
- func (r *AccountsResource) Create(ctx context.Context, organizationID, externalID string) (CreateAccountResult, error)
- func (r *AccountsResource) CreateAccountHolderInvitation(ctx context.Context, organizationID, externalID string) (CreateAccountHolderInvitationResult, error)
- func (r *AccountsResource) Freeze(ctx context.Context, accountID, reason string) error
- func (r *AccountsResource) Get(ctx context.Context, accountID string) (AccountResponse, error)
- func (r *AccountsResource) List(ctx context.Context, organizationID string) ([]OrganizationAccountResponse, error)
- func (r *AccountsResource) RevokeRelationship(ctx context.Context, organizationID, relationshipID string) error
- func (r *AccountsResource) Unfreeze(ctx context.Context, accountID string) error
- type AllocatedDepositAddressResult
- type ApiError
- type ApiKeyMetadataResponse
- type ApiKeysResource
- type ApplicationResponse
- type ApplicationStatus
- type ApplicationsResource
- func (r *ApplicationsResource) Archive(ctx context.Context, applicationID string) error
- func (r *ApplicationsResource) CreateEnvironment(ctx context.Context, applicationID string, environmentType EnvironmentType) (CreatedResourceResponse, error)
- func (r *ApplicationsResource) Reactivate(ctx context.Context, applicationID string) error
- func (r *ApplicationsResource) Suspend(ctx context.Context, applicationID, reason string) error
- type AssetKind
- type AssetNetworkCatalogResource
- func (r *AssetNetworkCatalogResource) GetAsset(ctx context.Context, assetID string) (AssetResponse, error)
- func (r *AssetNetworkCatalogResource) GetAssetNetwork(ctx context.Context, assetNetworkID string) (AssetNetworkResponse, error)
- func (r *AssetNetworkCatalogResource) GetNetwork(ctx context.Context, networkID string) (NetworkResponse, error)
- func (r *AssetNetworkCatalogResource) ListAssetNetworks(ctx context.Context, status AssetNetworkStatus) ([]AssetNetworkResponse, error)
- func (r *AssetNetworkCatalogResource) ListAssets(ctx context.Context) ([]AssetResponse, error)
- func (r *AssetNetworkCatalogResource) ListNetworks(ctx context.Context) ([]NetworkResponse, error)
- type AssetNetworkResponse
- type AssetNetworkStatus
- type AssetResponse
- type AuthResource
- func (r *AuthResource) ConfirmPasswordReset(ctx context.Context, resetToken, newPassword string) error
- func (r *AuthResource) Login(ctx context.Context, email, password string) (TokenResult, error)
- func (r *AuthResource) Logout()
- func (r *AuthResource) Refresh(ctx context.Context, refreshToken string) (TokenResult, error)
- func (r *AuthResource) RequestPasswordReset(ctx context.Context, email string) error
- func (r *AuthResource) SignUp(ctx context.Context, organizationName, email, password string, ...) (SignUpResponse, error)
- type AuthenticationError
- func (e AuthenticationError) Code() string
- func (e AuthenticationError) Details() any
- func (e AuthenticationError) Error() string
- func (e AuthenticationError) HTTPStatus() int
- func (e AuthenticationError) RequestID() string
- func (e AuthenticationError) Retryable() bool
- func (e AuthenticationError) Unwrap() error
- type AuthorizationError
- func (e AuthorizationError) Code() string
- func (e AuthorizationError) Details() any
- func (e AuthorizationError) Error() string
- func (e AuthorizationError) HTTPStatus() int
- func (e AuthorizationError) RequestID() string
- func (e AuthorizationError) Retryable() bool
- func (e AuthorizationError) Unwrap() error
- type BalanceResponse
- type CatalogEntryStatus
- type ClaimAccountHolderInvitationResult
- type ClientConfig
- type ClientOption
- func WithAPIKey(apiKey string) ClientOption
- func WithBaseURL(baseURL string) ClientOption
- func WithConnectTimeout(d time.Duration) ClientOption
- func WithEnvironment(environment Environment) ClientOption
- func WithInsecureTLSForLocalDevelopment(allow bool) ClientOption
- func WithLogging(enabled bool) ClientOption
- func WithRequestTimeout(d time.Duration) ClientOption
- func WithRetryPolicy(policy RetryPolicy) ClientOption
- func WithUserAgent(userAgent string) ClientOption
- type ConditionInput
- type ConditionOperator
- type ConditionResponse
- type ConfigurationError
- type ConfigureWebhookEndpointResult
- type ConflictError
- type CreateAccountHolderInvitationResult
- type CreateAccountResult
- type CreateEventTypeResult
- type CreatePaymentIntentResult
- type CreatePayoutBatchResult
- type CreateRuleResult
- type CreateSigningRequestResult
- type CreateTransactionResult
- type CreateWithdrawalDestinationResult
- type CreateWorkflowResult
- type CreateWorkflowVersionResult
- type CreatedResourceResponse
- type DepositResponse
- type DepositStatus
- type DepositsResource
- func (r *DepositsResource) CreatePaymentIntent(ctx context.Context, organizationID, transactionID, assetNetworkID string, ...) (CreatePaymentIntentResult, error)
- func (r *DepositsResource) GetDeposit(ctx context.Context, depositID string) (DepositResponse, error)
- func (r *DepositsResource) GetPaymentIntent(ctx context.Context, paymentIntentID string) (PaymentIntentResponse, error)
- type DerivationScheme
- type EasyPaymentResult
- type EasyWithdrawResult
- type EntryNature
- type Environment
- type EnvironmentType
- type EnvironmentsResource
- type EventIngestionResult
- type EventSource
- type EventTypeResponse
- type EventTypesResource
- type EventsResource
- type ExecuteRefundResult
- type ExecuteSettlementResult
- type ExecutionDestinationsResource
- type ExecutionLegInput
- type ExecutionLegResponse
- type ExecutionSourcesResource
- type GenerateApiKeyResult
- type GeneratedWallet
- type IdempotencyConflictError
- func (e IdempotencyConflictError) Code() string
- func (e IdempotencyConflictError) Details() any
- func (e IdempotencyConflictError) Error() string
- func (e IdempotencyConflictError) HTTPStatus() int
- func (e IdempotencyConflictError) RequestID() string
- func (e IdempotencyConflictError) Retryable() bool
- func (e IdempotencyConflictError) Unwrap() error
- type InMemorySigner
- type InviteMemberResult
- type IshtaranClient
- func (c *IshtaranClient) GetBalance(ctx context.Context, accountID, assetNetworkID string) (BalanceResponse, error)
- func (c *IshtaranClient) GetPayment(ctx context.Context, transactionID, paymentIntentID string) (EasyPaymentResult, error)
- func (c *IshtaranClient) ReceivePayment(ctx context.Context, ...) (EasyPaymentResult, error)
- func (c *IshtaranClient) VerifyWebhookSignature(rawBody, signatureHeader, timestampHeader, endpointSecret string) bool
- func (c *IshtaranClient) WaitForPayment(ctx context.Context, transactionID, paymentIntentID string, ...) (EasyPaymentResult, error)
- func (c *IshtaranClient) Withdraw(ctx context.Context, ...) (EasyWithdrawResult, error)
- type IshtaranError
- type LedgerEntryResponse
- type LedgerResource
- func (r *LedgerResource) GetBalance(ctx context.Context, accountID, assetNetworkID string) (BalanceResponse, error)
- func (r *LedgerResource) ListAllEntries(ctx context.Context, accountID, assetNetworkID string, pageSize int, ...) iter.Seq2[LedgerEntryResponse, error]
- func (r *LedgerResource) ListEntries(ctx context.Context, accountID, assetNetworkID string, skip, take int, ...) ([]LedgerEntryResponse, error)
- type ListEntriesOptions
- type ListWithdrawalsOptions
- type MemberResponse
- type MemberRoleRequest
- type MemberStatus
- type MembersResource
- func (r *MembersResource) AcceptInvite(ctx context.Context, inviteToken, password string) (TokenResult, error)
- func (r *MembersResource) AssignRole(ctx context.Context, memberID string, newRole MemberRoleRequest) error
- func (r *MembersResource) Invite(ctx context.Context, organizationID, email string, role MemberRoleRequest) (InviteMemberResult, error)
- func (r *MembersResource) List(ctx context.Context, organizationID string) ([]MemberResponse, error)
- func (r *MembersResource) Reactivate(ctx context.Context, memberID string) error
- func (r *MembersResource) Remove(ctx context.Context, memberID string) error
- func (r *MembersResource) Suspend(ctx context.Context, memberID, reason string) error
- type NetworkCostPayer
- type NetworkCostPayerAccountsResource
- func (r *NetworkCostPayerAccountsResource) Register(ctx context.Context, organizationID, assetNetworkID, accountID string) (RegisterNetworkCostPayerAccountResult, error)
- func (r *NetworkCostPayerAccountsResource) UpdateResourcePreference(ctx context.Context, organizationID, assetNetworkID string, ...) error
- type NetworkError
- type NetworkExecutionCostStatus
- type NetworkExecutionOperationInput
- type NetworkExecutionPlanResponse
- type NetworkExecutionQuoteResponse
- type NetworkExecutionQuoteSnapshotResponse
- type NetworkExecutionResource
- type NetworkExecutionTransactionResponse
- type NetworkExecutionTransferResponse
- type NetworkOperationKind
- type NetworkResourceEstimateResponse
- type NetworkResourceLineResponse
- type NetworkResourceSource
- type NetworkResponse
- type NotFoundError
- type OrganizationAccountResponse
- type OrganizationResponse
- type OrganizationStatus
- type OrganizationsResource
- func (r *OrganizationsResource) Create(ctx context.Context, name string, idempotencyKey ...string) (CreatedResourceResponse, error)
- func (r *OrganizationsResource) CreateApplication(ctx context.Context, organizationID, name string, idempotencyKey ...string) (CreatedResourceResponse, error)
- func (r *OrganizationsResource) Get(ctx context.Context, organizationID string) (OrganizationResponse, error)
- func (r *OrganizationsResource) ListApplications(ctx context.Context, organizationID string) ([]ApplicationResponse, error)
- func (r *OrganizationsResource) Reactivate(ctx context.Context, organizationID string) error
- func (r *OrganizationsResource) Suspend(ctx context.Context, organizationID, reason string) error
- type ParticipantInput
- type ParticipantResponse
- type PayableSummaryResponse
- type PaymentIntentResponse
- type PaymentIntentStatus
- type PayoutBatchObligationResponse
- type PayoutBatchObligationStatus
- type PayoutBatchResponse
- type PayoutBatchSourceObligationResponse
- type PayoutBatchStatus
- type PayoutBatchTrigger
- type PayoutResource
- func (r *PayoutResource) CreateBatch(ctx context.Context, organizationID, environmentID, assetNetworkID string, ...) (CreatePayoutBatchResult, error)
- func (r *PayoutResource) GetBatch(ctx context.Context, organizationID, payoutBatchID string) (PayoutBatchResponse, error)
- func (r *PayoutResource) GetPayableSummary(ctx context.Context, accountID, assetNetworkID string) (PayableSummaryResponse, error)
- type RateLimitError
- type RedeliverWebhookResult
- type RefundResponse
- type RefundStatus
- type RefundsResource
- func (r *RefundsResource) ExecuteRefund(ctx context.Context, transactionID string, amount *decimal.Decimal, ...) (ExecuteRefundResult, error)
- func (r *RefundsResource) Get(ctx context.Context, refundID string) (RefundResponse, error)
- func (r *RefundsResource) ListByTransaction(ctx context.Context, transactionID string) ([]RefundResponse, error)
- type RegisterExecutionDestinationResult
- type RegisterExecutionSourceResult
- type RegisterNetworkCostPayerAccountResult
- type RegisterWalletResult
- type ReserveTransactionResult
- type RetryPolicy
- type RotateApiKeyResult
- type RotateWebhookEndpointSecretResult
- type RuleResponse
- type SandboxBroadcastAttemptResponse
- type SandboxBroadcastAttemptResult
- type SandboxObservedAddressResponse
- type SandboxObservedAddressResult
- type SandboxResource
- func (r *SandboxResource) Faucet(ctx context.Context, environmentID, depositAddress, assetNetworkID string, ...) (SandboxObservedAddressResult, error)
- func (r *SandboxResource) GetBroadcastAttempt(ctx context.Context, environmentID, id string) (SandboxBroadcastAttemptResponse, error)
- func (r *SandboxResource) GetObservedAddress(ctx context.Context, environmentID, id string) (SandboxObservedAddressResponse, error)
- func (r *SandboxResource) GetTreasuryBalance(ctx context.Context, environmentID, assetNetworkID string) (SandboxTreasuryObservedBalanceResponse, error)
- func (r *SandboxResource) SetObservedTreasuryBalance(ctx context.Context, environmentID, assetNetworkID string, ...) error
- func (r *SandboxResource) SimulateBroadcastConfirmation(ctx context.Context, environmentID, broadcastAttemptID string, ...) error
- func (r *SandboxResource) SimulateConfirmation(ctx context.Context, environmentID, sandboxObservedAddressID string, ...) error
- func (r *SandboxResource) SimulateDeposit(ctx context.Context, environmentID, depositAddress, assetNetworkID string, ...) (SandboxObservedAddressResult, error)
- func (r *SandboxResource) SimulateWithdrawal(ctx context.Context, environmentID, destinationAddress string, ...) (SandboxBroadcastAttemptResult, error)
- type SandboxTreasuryObservedBalanceResponse
- type SettlementResponse
- type SettlementSplitAllocationResponse
- type SettlementStatus
- type SettlementsResource
- func (r *SettlementsResource) ExecuteSettlement(ctx context.Context, transactionID string, amount *decimal.Decimal, ...) (ExecuteSettlementResult, error)
- func (r *SettlementsResource) Get(ctx context.Context, settlementID string) (SettlementResponse, error)
- func (r *SettlementsResource) GetSummary(ctx context.Context, transactionID string) (TransactionSettlementSummaryResponse, error)
- func (r *SettlementsResource) ListByTransaction(ctx context.Context, transactionID string) ([]SettlementResponse, error)
- func (r *SettlementsResource) ReleaseRetainedSplit(ctx context.Context, settlementID, allocationID string, ...) error
- type SignUpAndClaimAccountHolderInvitationResult
- type SignUpResponse
- type Signer
- type SigningRequestResponse
- type SigningRequestsResource
- func (r *SigningRequestsResource) Create(ctx context.Context, environmentID, walletID string, ...) (CreateSigningRequestResult, error)
- func (r *SigningRequestsResource) Get(ctx context.Context, signingRequestID string) (SigningRequestResponse, error)
- func (r *SigningRequestsResource) SubmitSignedTransaction(ctx context.Context, ...) (SubmitSignedTransactionResult, error)
- type SimulatedBroadcastOutcome
- type SplitAllocationStatus
- type SplitRetentionReason
- type StateInput
- type StateResponse
- type SubmitSignedTransactionResult
- type TimeoutError
- type TokenResult
- type TransactionResponse
- type TransactionSettlementSummaryResponse
- type TransactionStateResponse
- type TransactionStatus
- type TransactionsResource
- func (r *TransactionsResource) Cancel(ctx context.Context, transactionID, reason string) error
- func (r *TransactionsResource) Create(ctx context.Context, organizationID, applicationID string, ...) (CreateTransactionResult, error)
- func (r *TransactionsResource) Freeze(ctx context.Context, transactionID, reason string) error
- func (r *TransactionsResource) Get(ctx context.Context, transactionID string) (TransactionResponse, error)
- func (r *TransactionsResource) GetState(ctx context.Context, transactionID string) (TransactionStateResponse, error)
- func (r *TransactionsResource) Reserve(ctx context.Context, transactionID string) (ReserveTransactionResult, error)
- func (r *TransactionsResource) Unfreeze(ctx context.Context, transactionID string) error
- func (r *TransactionsResource) WaitFor(ctx context.Context, transactionID string, pollInterval time.Duration) (TransactionResponse, error)
- type TransitionInput
- type TransitionResponse
- type ValidationError
- type Wallet
- type WalletAssetBalanceResponse
- type WalletBalanceResource
- func (r *WalletBalanceResource) GetAssetBalances(ctx context.Context, accountID, environmentID string, assetNetworkIDs []string) ([]WalletAssetBalanceResponse, error)
- func (r *WalletBalanceResource) GetBalance(ctx context.Context, accountID, environmentID, assetNetworkID string) (WalletBalanceResponse, error)
- func (r *WalletBalanceResource) RefreshBalance(ctx context.Context, accountID, environmentID, assetNetworkID string) (WalletBalanceResponse, error)
- type WalletBalanceResponse
- type WalletNetworkBalanceResponse
- type WalletPublicMaterialResult
- type WalletResponse
- type WalletsResource
- func (r *WalletsResource) AllocateDepositAddress(ctx context.Context, applicationID, networkID string) (AllocatedDepositAddressResult, error)
- func (r *WalletsResource) Get(ctx context.Context, walletID string) (WalletResponse, error)
- func (r *WalletsResource) GetPublicMaterial(ctx context.Context, walletID string) (WalletPublicMaterialResult, error)
- func (r *WalletsResource) Register(ctx context.Context, applicationID, networkID string, scheme DerivationScheme, ...) (RegisterWalletResult, error)
- type WebhookDeliveriesResource
- type WebhookDeliveryResponse
- type WebhookDeliveryStatus
- type WebhookEndpointResponse
- type WebhookEndpointStatus
- type WebhookEndpointsResource
- func (r *WebhookEndpointsResource) Create(ctx context.Context, organizationID, endpointURL string) (ConfigureWebhookEndpointResult, error)
- func (r *WebhookEndpointsResource) Deactivate(ctx context.Context, webhookEndpointID string) error
- func (r *WebhookEndpointsResource) Get(ctx context.Context, webhookEndpointID string) (WebhookEndpointResponse, error)
- func (r *WebhookEndpointsResource) List(ctx context.Context, organizationID string) ([]WebhookEndpointResponse, error)
- func (r *WebhookEndpointsResource) ListDeliveries(ctx context.Context, webhookEndpointID, eventType string, ...) ([]WebhookDeliveryResponse, error)
- func (r *WebhookEndpointsResource) RotateSecret(ctx context.Context, webhookEndpointID string) (RotateWebhookEndpointSecretResult, error)
- type WithdrawalQuoteResponse
- type WithdrawalResponse
- type WithdrawalStatus
- type WithdrawalsResource
- func (r *WithdrawalsResource) Cancel(ctx context.Context, withdrawalID, reason string) error
- func (r *WithdrawalsResource) CreateDestination(ctx context.Context, organizationID, address, assetNetworkID string) (CreateWithdrawalDestinationResult, error)
- func (r *WithdrawalsResource) Get(ctx context.Context, withdrawalID string) (WithdrawalResponse, error)
- func (r *WithdrawalsResource) List(ctx context.Context, organizationID string, opts ListWithdrawalsOptions) ([]WithdrawalResponse, error)
- func (r *WithdrawalsResource) ListAll(ctx context.Context, organizationID string, pageSize int, ...) iter.Seq2[WithdrawalResponse, error]
- func (r *WithdrawalsResource) Quote(ctx context.Context, ...) (WithdrawalQuoteResponse, error)
- func (r *WithdrawalsResource) Request(ctx context.Context, ...) (WithdrawalResponse, error)
- func (r *WithdrawalsResource) RetryBroadcast(ctx context.Context, withdrawalID string) error
- func (r *WithdrawalsResource) WaitFor(ctx context.Context, withdrawalID string, pollInterval time.Duration) (WithdrawalResponse, error)
- type WorkflowResponse
- type WorkflowStatus
- type WorkflowVersionResponse
- type WorkflowsResource
- func (r *WorkflowsResource) Create(ctx context.Context, organizationID, name string) (CreateWorkflowResult, error)
- func (r *WorkflowsResource) CreateRule(ctx context.Context, ...) (CreateRuleResult, error)
- func (r *WorkflowsResource) CreateVersion(ctx context.Context, workflowID string, states []StateInput, ...) (CreateWorkflowVersionResult, error)
- func (r *WorkflowsResource) Get(ctx context.Context, workflowID string) (WorkflowResponse, error)
- func (r *WorkflowsResource) GetVersion(ctx context.Context, workflowID, workflowVersionID string) (WorkflowVersionResponse, error)
- func (r *WorkflowsResource) List(ctx context.Context, organizationID string) ([]WorkflowResponse, error)
- func (r *WorkflowsResource) PublishVersion(ctx context.Context, workflowID, workflowVersionID string) error
Constants ¶
const ( SDKVersion = "0.1.3" DefaultUserAgent = "ishtaran-go/" + SDKVersion )
SDKVersion and DefaultUserAgent -- fixed format ishtaran-go/<version> -- never contains personal data (a brief rule).
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.
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 ¶
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 ¶
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 ¶
VerifyWebhookSignature uses rawBody exactly as received -- never reserializes the JSON before computing. Real constant-time comparison (crypto/subtle).
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 ¶
func (r *AccountHoldersResource) Me(ctx context.Context) (AccountHolderResponse, error)
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.
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) HTTPStatus ¶
func (e ApiError) HTTPStatus() int
type ApiKeyMetadataResponse ¶
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 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
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 (r *AssetNetworkCatalogResource) GetAsset(ctx context.Context, assetID string) (AssetResponse, error)
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 ¶
func (r *AssetNetworkCatalogResource) ListAssetNetworks(ctx context.Context, status AssetNetworkStatus) ([]AssetNetworkResponse, error)
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 (r *AssetNetworkCatalogResource) ListAssets(ctx context.Context) ([]AssetResponse, error)
func (*AssetNetworkCatalogResource) ListNetworks ¶
func (r *AssetNetworkCatalogResource) ListNetworks(ctx context.Context) ([]NetworkResponse, error)
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 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) HTTPStatus ¶
func (e AuthenticationError) HTTPStatus() int
type AuthorizationError ¶
type AuthorizationError struct {
// contains filtered or unexported fields
}
AuthorizationError -- 403, no JSON body (see section 6.3).
func (AuthorizationError) HTTPStatus ¶
func (e AuthorizationError) HTTPStatus() int
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 ConflictError ¶
type ConflictError struct {
// contains filtered or unexported fields
}
ConflictError -- 409, any conflict Code except IDEMPOTENCY_KEY_CONFLICT.
func (ConflictError) HTTPStatus ¶
func (e ConflictError) HTTPStatus() int
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 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 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 ¶
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 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 GenerateApiKeyResult ¶
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) HTTPStatus ¶
func (e IdempotencyConflictError) HTTPStatus() int
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 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
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) HTTPStatus ¶
func (e NetworkError) HTTPStatus() int
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
func (s NetworkExecutionCostStatus) String() string
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 NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError -- 404, Code=NOT_FOUND.
func (NotFoundError) HTTPStatus ¶
func (e NotFoundError) HTTPStatus() int
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 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
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 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
func (s PayoutBatchObligationStatus) String() string
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 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) HTTPStatus ¶
func (e RateLimitError) HTTPStatus() int
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 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 (*SandboxResource) SimulateBroadcastConfirmation ¶
func (*SandboxResource) SimulateConfirmation ¶
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 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 (r *SettlementsResource) GetSummary(ctx context.Context, transactionID string) (TransactionSettlementSummaryResponse, error)
func (*SettlementsResource) ListByTransaction ¶
func (r *SettlementsResource) ListByTransaction(ctx context.Context, transactionID string) ([]SettlementResponse, error)
func (*SettlementsResource) ReleaseRetainedSplit ¶
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 Signer ¶
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 StateResponse ¶
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) HTTPStatus ¶
func (e TimeoutError) HTTPStatus() int
type TokenResult ¶
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) 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 TransitionResponse ¶
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) HTTPStatus ¶
func (e ValidationError) HTTPStatus() int
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 (r *WebhookDeliveriesResource) Get(ctx context.Context, webhookDeliveryID string) (WebhookDeliveryResponse, error)
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 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 ¶
func (r *WithdrawalsResource) List(ctx context.Context, organizationID string, opts ListWithdrawalsOptions) ([]WithdrawalResponse, error)
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 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
Source Files
¶
- authenticating_transport.go
- canonical_hash.go
- client.go
- config.go
- decimal_json.go
- dotnet_timespan.go
- enums.go
- environment.go
- error_mapper.go
- errors.go
- http_transport.go
- idempotency.go
- logging_transport.go
- model_account_holders.go
- model_control_plane.go
- model_data_plane.go
- model_deposits.go
- model_execution_custody.go
- model_payout.go
- model_sandbox.go
- model_settlement.go
- model_wallet_balance.go
- model_webhook_endpoints.go
- model_workflow.go
- pagination.go
- polling.go
- redactor.go
- resource_account_holders.go
- resource_accounts.go
- resource_api_keys.go
- resource_applications.go
- resource_asset_network_catalog.go
- resource_auth.go
- resource_deposits.go
- resource_environments.go
- resource_event_types.go
- resource_events.go
- resource_execution_destinations.go
- resource_execution_sources.go
- resource_ledger.go
- resource_members.go
- resource_network_cost_payer_accounts.go
- resource_network_execution.go
- resource_organizations.go
- resource_payout.go
- resource_refunds.go
- resource_sandbox.go
- resource_settlements.go
- resource_signing_requests.go
- resource_support.go
- resource_transactions.go
- resource_wallet_balance.go
- resource_wallets.go
- resource_webhook_deliveries.go
- resource_webhook_endpoints.go
- resource_withdrawals.go
- resource_workflows.go
- retry_policy.go
- retrying_transport.go
- signer.go
- transport.go
- tron_address.go
- user_agent.go
- wallet_factory.go
- webhook.go
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. |