import { CantonConnector, CantonHolding, CantonInstrument } from "../../core/types/canton"; import { CantonWallet, ConnectorID } from "../../core/types/wallet"; /** * Format a Canton connector into a Squid {@link CantonWallet}. Shared by the * announce-discovery and injected-provider paths. */ export declare function formatCantonWallet({ connectorId, name, icon, connector, }: { connectorId: ConnectorID; name: string; icon: string | undefined; connector: CantonConnector; }): CantonWallet; /** * Append injected wallets that aren't already covered by an announce-discovered * wallet with the same connectorId (in case a wallet later does both). */ export declare function mergeInjectedCantonWallets(announced: CantonWallet[], injected: CantonWallet[]): CantonWallet[]; export declare const CANTON_PARTY_ID_SEPARATOR = "::"; /** Canton Coin's well-known token-standard instrument id (its address carries no id prefix). */ export declare const CANTON_AMULET_INSTRUMENT_ID = "Amulet"; export declare function isCantonAddressValid(address: string): boolean; /** * Splice token-standard Holding interface id. A party's balance for an * instrument is the sum of `amount` across active contracts implementing this interface. */ export declare const CANTON_HOLDING_INTERFACE_ID = "#splice-api-token-holding-v1:Splice.Api.Token.HoldingV1:Holding"; /** * Derive the token-standard instrument `{ admin, id }` from a Squid Canton token * address (use the case-sensitive `originalAddress`), or `null` when the address * is not a valid Canton token address. * * The admin party is the last two `::` segments (`name::fingerprint`); the * instrument id is everything before that. Canton Coin has no id prefix * (`DSO::1220…`) and uses the well-known id `Amulet`. * - `DSO::1220…` -> { admin: "DSO::1220…", id: "Amulet" } * - `USDCx::decentralized-usdc-…::12208…` -> { admin: "decentralized-usdc-…::12208…", id: "USDCx" } */ export declare function parseCantonInstrument(address: string): CantonInstrument | null; /** * Body for `POST /v2/state/active-contracts`, filtered to the party's Holding * contracts with the interface view included (so we can read amount/instrument). * * ACS: Active Contract Set — the ledger's currently-active contracts (created and * not yet archived) as of a ledger offset. */ export declare function buildHoldingsAcsRequestBody(partyId: string, activeAtOffset: string): { activeAtOffset: string; eventFormat: { verbose: boolean; filtersByParty: { [x: string]: { cumulative: { identifierFilter: { InterfaceFilter: { value: { interfaceId: string; includeInterfaceView: boolean; includeCreatedEventBlob: boolean; }; }; }; }[]; }; }; }; }; /** * Parse the party's Holding contracts (with contract ids) from a raw * `/v2/state/active-contracts` response * Defensive: skips entries it can't parse. */ export declare function parseCantonHoldings(acsResponse: unknown): CantonHolding[]; export declare function cantonInstrumentKey(instrument: CantonInstrument): string; /** * Group the (unlocked) Holding amounts by instrument from a raw * `/v2/state/active-contracts` response. Returns a map of instrument key * (`admin|id`) -> human-readable decimal string (the token-standard `amount` * is already a Decimal, not base units). */ export declare function groupCantonHoldingBalances(acsResponse: unknown): Record;