/** * Generate a cryptographically random PKCE code verifier (RFC 7636). * Returns a base64url-encoded string of 32 random bytes (256 bits of entropy). * The caller is responsible for storing this until the callback. * @group Auth * @category Functions */ declare const randomPKCECodeVerifier: () => string; /** * Derive the S256 code challenge from a code verifier. * Synchronous. Returns a base64url-encoded SHA-256 hash. * @group Auth * @category Functions */ declare const calculatePKCECodeChallenge: (codeVerifier: string) => string; /** * Generate a new PKCE code verifier and its corresponding challenge. * @group Auth * @category Functions */ declare const generatePKCE: () => { codeVerifier: string; codeChallenge: string; }; interface ParsedAuthorizationResponse { code?: string; state?: string; error?: string; errorDescription?: string; } /** * Parse a callback URL or query string into structured fields. * * - Returns an empty object if none of the expected parameters are present. * - Check for the presence of `code` or `error` to determine if the URL * contains an OAuth2 authorization response. * * @example * const { code, error } = parseAuthorizationResponse(req.url); * const { code, error } = parseAuthorizationResponse('?code=abc&state=xyz'); * @group Auth * @category Functions */ declare const parseAuthorizationResponse: (input: string) => ParsedAuthorizationResponse; /** * Single source of truth for all supported EVM chain pairs. * * Each entry is a { production, sandbox } pair sharing the same network family. * * ── Adding a new EVM chain ──────────────────────────────────────────────────── * Add ONE entry to EVM_CHAIN_PAIRS below. All types (ProductionChain, * SandboxChain, EvmChainId) and all lookup maps (chainIdToName, * validEvmChainNames, productionToSandbox) are derived automatically. * ───────────────────────────────────────────────────────────────────────────── */ declare const EVM_CHAIN_PAIRS: readonly [{ readonly production: { readonly id: "ethereum"; readonly chainId: 1; }; readonly sandbox: { readonly id: "sepolia"; readonly chainId: 11155111; }; }, { readonly production: { readonly id: "gnosis"; readonly chainId: 100; }; readonly sandbox: { readonly id: "chiado"; readonly chainId: 10200; }; }, { readonly production: { readonly id: "polygon"; readonly chainId: 137; }; readonly sandbox: { readonly id: "amoy"; readonly chainId: 80002; }; }, { readonly production: { readonly id: "arbitrum"; readonly chainId: 42161; }; readonly sandbox: { readonly id: "arbitrumsepolia"; readonly chainId: 421614; }; }, { readonly production: { readonly id: "linea"; readonly chainId: 59144; }; readonly sandbox: { readonly id: "lineasepolia"; readonly chainId: 59141; }; }, { readonly production: { readonly id: "scroll"; readonly chainId: 534352; }; readonly sandbox: { readonly id: "scrollsepolia"; readonly chainId: 534351; }; }, { readonly production: { readonly id: "base"; readonly chainId: 8453; }; readonly sandbox: { readonly id: "basesepolia"; readonly chainId: 84532; }; }, { readonly production: { readonly id: "camino"; readonly chainId: 500; }; readonly sandbox: { readonly id: "columbus"; readonly chainId: 501; }; }]; /** * All supported production chain names. * @group Primitives */ type ProductionChain = 'ethereum' | 'gnosis' | 'polygon' | 'arbitrum' | 'linea' | 'scroll' | 'base' | 'camino' | 'noble'; /** * All supported sandbox chain names. * @group Primitives */ type SandboxChain = 'sepolia' | 'chiado' | 'amoy' | 'arbitrumsepolia' | 'lineasepolia' | 'scrollsepolia' | 'basesepolia' | 'columbus' | 'grand'; /** * All known EVM chain IDs. The union extends `number` for backwards * compatibility — known values are listed in EVM_CHAIN_PAIRS above. * @group Primitives */ type EvmChainId = number | (typeof EVM_CHAIN_PAIRS)[number]['production' | 'sandbox']['chainId']; /** * @group Primitives */ type Chain = ProductionChain | SandboxChain; /** * @group Primitives */ type ChainId = EvmChainId | CosmosChainId; /** * @group Primitives */ type CosmosChainId = 'noble-1' | 'grand-1' | 'florin-1'; /** * @group Primitives */ type Environment = { name: ENV; api: string; web: string; }; /** * @group Primitives */ type Config = { environments: { production: Environment; sandbox: Environment; }; }; /** * @group Primitives */ type ENV = 'sandbox' | 'production'; /** * @group Tokens */ declare enum Currency { eur = "eur", usd = "usd", gbp = "gbp", isk = "isk" } /** * @group Tokens */ type TokenSymbol = 'EURe' | 'GBPe' | 'USDe' | 'ISKe'; /** * @group Tokens */ type Ticker = 'EUR' | 'GBP' | 'USD' | 'ISK'; /** * @group Tokens */ type CurrencyCode = 'eur' | 'gbp' | 'usd' | 'isk'; /** * Information about the EURe token on different networks. * @group Tokens */ interface Token { currency: Currency; ticker: Ticker; symbol: TokenSymbol; chain: Chain; /** The address of the EURe contract on this network */ address: string; /** How many decimals this token supports */ decimals: number; } /** * Returned by all auth grant functions. Store server-side — never in the browser. * @group Auth * @category Types */ interface BearerProfile { access_token: string; token_type: string; expires_in: number; refresh_token: string; profile: string; userId: string; } /** * @group Profiles */ type Method = 'password' | 'resource' | 'jwt' | 'apiKey' | 'bearer'; /** * @group Profiles */ type ProfileKind = 'corporate' | 'personal'; /** * @ignore * @deprecated Use ProfileKind instead * */ declare enum ProfileType { corporate = "corporate", personal = "personal" } /** * @group Profiles */ type Permission = 'read' | 'write'; /** * The state of the profile lifecycle. * @group Profiles */ type ProfileState = 'created' | 'incomplete' | 'pending' | 'approved' | 'rejected'; /** * KYC details section with its current state. * * @group Profiles */ interface ProfileDetailsState { state: ProfileState; } /** * Additional data section used for risk calculations. * * @group Profiles */ interface ProfileFormState { state: ProfileState; } /** * The type of personal profile verification. * * @group Profiles */ type PersonalVerificationKind = 'idDocument' | 'facialSimilarity' | 'proofOfResidency' | 'sourceOfFunds'; /** * The type of corporate profile verification. * * @group Profiles */ type CorporateVerificationKind = 'sourceOfFunds' | 'corporateName' | 'corporateAddress' | 'registrationNumber' | 'dateOfRegistration' | 'beneficialOwnership' | 'powerOfAttorney'; /** * Verification items required for this profile, each with its current state. * * @group Profiles */ interface ProfileVerificationState { kind: PersonalVerificationKind | CorporateVerificationKind; state: ProfileState; } /** * The type of ID document. Passports, National ID cards, and driving licenses are supported. * The ID document must verify the person's name, birthday, and nationality. * @group Profiles */ type IdDocumentKind = 'passport' | 'nationalIdentityCard' | 'drivingLicense'; /** * @group Profiles */ interface AuthContext { userId: string; email: string; name: string; roles?: string[]; auth: { method: Method; subject: string; verified: boolean; invited?: boolean; }; defaultProfile: string; profiles: { id: string; kind: ProfileKind | 'unknown'; name: string; perms: Permission[]; }[]; } /** * @group Profiles */ interface ProfilesResponse { profiles: Omit[]; } /** * @group Profiles */ interface Profile { /** Unique identifier of the profile. The Profile ID is the main identifier used to represent ownership of other API resources */ id: string; /** String identifier specifying the type of the profile. */ kind: ProfileKind; /** The Profile name. This can be a corporate or an individual. */ name: string; /** The state of the profile lifecycle. */ state: ProfileState; /** KYC details section with its current state. */ details?: ProfileDetailsState; /** The form data for the profile. */ form?: ProfileFormState; /** Verification items required for this profile, each with its current state. */ verifications?: ProfileVerificationState[]; } /** * @group Profiles */ interface GetProfilesParams { /** Filter the list on the state of profiles */ state?: ProfileState; /** Filter the list on the kind of profiles*/ kind?: ProfileKind; } /** * @group Profiles */ interface PersonalProfileDetails { idDocument: { /** The document number. */ number: string; /** The type of ID document. Must verify the person's name, birthday, and nationality */ kind: IdDocumentKind; }; firstName: string; lastName: string; /** Street and building number where the person lives. */ address: string; /** Postal code where the person lives. */ postalCode: string; /** City where the person lives. */ city: string; /**Two-letter country code [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) where the person lives */ country: string; /** State/County where the person lives. */ countryState?: string; /** Two-letter country code [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) for the person's nationality. */ nationality: string; /** The person's date of birth in `YYYY-MM-DD format. */ birthday: string; /** The person's phone number. */ phone: string; /** The person's email address. */ email: string; } /** * @group Profiles */ type Representative = PersonalProfileDetails; /** * @group Profiles */ type Beneficiary = Omit & { /** Ownership in % that is between 25% and 100%. */ ownershipPercentage: number; }; /** * @group Profiles */ type Director = Omit; /** * @group Profiles */ interface CorporateProfileDetails { name: string; registrationNumber: string; /** The company's registration date in the `YYYY-MM-DD` format. */ registrationDate?: string; /** The company's VAT number */ vatNumber?: string; /** The company's website */ website?: string; /** Street and building number where the corporate is located. */ address: string; /** Postal code where the corporate is located. */ postalCode: string; /** City where the corporate is located. */ city: string; /** Two-letter country code [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) where the corporate is located */ country: string; /** State/County where the corporate is located. */ countryState: string; /** List of individuals representing the company and authorized to act on it's behalf. */ representatives: Representative[]; /** List of beneficial owner that owns 25% or more in a corporation. */ finalBeneficiaries: Beneficiary[]; /** List of Individual who has powers to legally bind the company (power of procuration). */ directors: Director[]; } /** * @group Profiles */ type UpdateProfileDetailsInput = { /** The profile ID to update. */ profile: string; personal: PersonalProfileDetails; } | { /** The profile ID to update. */ profile: string; corporate: CorporateProfileDetails; }; /** * @group Profiles */ type PersonalProfileForm = { /** The occupation code representing the individual's current employment status. */ occupation: 'OCCUPATION_STUDENT' | 'OCCUPATION_EMPLOYED' | 'OCCUPATION_SELF_EMPLOYED' | 'OCCUPATION_UNEMPLOYED' | 'OCCUPATION_RETIRED'; /** The profession code representing the individual's professional field. */ profession: 'PROF_ACCOUNTANCY' | 'PROF_ADMINISTRATIVE' | 'PROF_AGRICULTURE' | 'PROF_ARTS_MEDIA' | 'PROF_BROKER_DEALER' | 'PROF_CATERING_HOSPITALITY' | 'PROF_CHARITY' | 'PROF_CONSTRUCTION_REAL_ESTATE' | 'PROF_DEALER_HIGH_VALUE_GOODS' | 'PROF_DEALER_PRECIOUS_METALS' | 'PROF_EDUCATION' | 'PROF_EMERGENCY_SERVICES' | 'PROF_EXTRACTIVE_INDUSTRY' | 'PROF_FIN_SERVICES_BANKING' | 'PROF_FIN_SERVICES_INSURANCE' | 'PROF_FIN_SERVICES_OTHER' | 'PROF_FIN_SERVICES_PRIVATE_BANKING' | 'PROF_GAMBLING' | 'PROF_GOVERNMENT' | 'PROF_HEALTHCARE_MEDICAL' | 'PROF_INFORMATION_TECHNOLOGY' | 'PROF_LEGAL' | 'PROF_MANUFACTURING' | 'PROF_MARKETING' | 'PROF_MILITARY_DEFENCE' | 'PROF_MONEY_SERVICE_BUSINESS' | 'PROF_PENSIONER' | 'PROF_PUBLIC_PROCUREMENT' | 'PROF_RETAIL_SALES'; /** The origin of the fund code representing the source of the individual's funds. */ fundOrigin: 'FUND_ORIGIN_SALARY' | 'FUND_ORIGIN_DIVIDENDS' | 'FUND_ORIGIN_INHERITANCE' | 'FUND_ORIGIN_SAVINGS' | 'FUND_ORIGIN_INVESTMENT' | 'FUND_ORIGIN_GIFT' | 'FUND_ORIGIN_MINING' | 'FUND_ORIGIN_REAL_ESTATE' | 'FUND_ORIGIN_LOAN'; /** The code representing the individual's annual income range. */ annualIncome: 'ANNUAL_INCOME_UNDER_10K' | 'ANNUAL_INCOME_10K_TO_50K' | 'ANNUAL_INCOME_50K_TO_150K' | 'ANNUAL_INCOME_150K_TO_300K' | 'ANNUAL_INCOME_OVER_300K'; /** The code representing the individual's monthly turnover range. */ monthlyTurnover: 'TURNOVER_UNDER_10K' | 'TURNOVER_10K_TO_50K' | 'TURNOVER_50K_TO_150K' | 'TURNOVER_150K_TO_500K' | 'TURNOVER_OVER_500K'; /** The code representing the number of transactions the individual makes each month. */ monthlyTransactionCount: 'TRANSACTION_COUNT_LESS_THAN_5' | 'TRANSACTION_COUNT_5_TO_50' | 'TRANSACTION_COUNT_50_TO_100' | 'TRANSACTION_COUNT_100_TO_200' | 'TRANSACTION_COUNT_OVER_200'; /** List of codes representing the individual's financial activities. */ activities: ('ACTIVITY_COMMERCE_SELLING' | 'ACTIVITY_COMMERCE_BUYING' | 'ACTIVITY_INVESTING_CRYPTO' | 'ACTIVITY_OTHER')[]; /** A description of the other activity if the code `ACTIVITY_OTHER` is chosen. */ activityOther?: string; /** Indicates whether the individual holds a politically exposed person (PEP) status. */ publicFunction: boolean; /** Indicates whether the individual is the owner of the funds. */ fundOwner: boolean; /** Indicates whether the individual is a United States citizen. */ usCitizen: boolean; /** Indicates whether the individual is subject to US tax obligations (e.g. holds a US tax identification number or is a US resident for tax purposes). */ usTaxPerson: boolean; /** Tax Identification Number (TIN) assigned by the individual's tax authority. Format varies by country (e.g. SSN in the US, NI number in the UK). */ tin: string; /** Two-letter country code ISO 3166-1 alpha-2 for the tax residency. */ taxResidenceCountry: string; }; /** * Form for a company * @group Profiles */ type CorporateProfileForm = { /** A brief description of the company's services. */ service: string; }; /** * @group Profiles */ type UpdateProfileFormInput = { /** The profile ID to update. */ profile: string; personal: PersonalProfileForm; } | { /** The profile ID to update. */ profile: string; corporate: CorporateProfileForm; }; /** * @group Profiles */ interface CreateProfileInput { /** Determines whether the profile is personal or corporate, and which body structure to use in subsequent PATCH endpoints. */ kind: ProfileKind; /** Optional partner-supplied profile ID. */ id?: string; } /** * @group Profiles */ type KYCProvider = 'sumsub'; /** * @group Profiles */ interface ShareProfileKYCInput { /** Id of the profile to share. */ profile: string; /** Determines whether the profile is personal or corporate, and which body structure to use in subsequent PATCH endpoints. */ provider: KYCProvider; /** Token for a personal profile applicant. */ personal: { /** Provider-issued applicant token. */ token: string; }; } /** * @group Profiles */ interface PersonalProfileVerification { /** The type of the verification. */ kind: PersonalVerificationKind; /** ID of a previously uploaded file associated with this verification. */ fileId: string; } /** * @group Profiles */ interface CorporateProfileVerification { /** The type of the verification. */ kind: CorporateVerificationKind; /** ID of a previously uploaded file associated with this verification. */ fileId: string; } /** * @group Profiles */ type UpdateProfileVerificationsInput = { /** The profile ID to update. */ profile: string; personal: PersonalProfileVerification[]; } | { /** The profile ID to update. */ profile: string; corporate: CorporateProfileVerification[]; }; /** * @group Addresses */ interface AddressesQueryParams { /** Filter the list by profile */ profile?: string; /** Filter the list by chain */ chain?: Chain | ChainId; } /** * @group Addresses */ interface Address { /** The id of the profile the address belongs to. */ profile: string; /** The address */ address: string; /** Which chains is the address linked on. */ chains: Chain[]; } /** * @group Addresses */ interface AddressesResponse { addresses: Address[]; } /** * @group Addresses */ interface CurrencyBalance { currency: Currency; amount: string; } /** * @group Addresses */ interface GetBalancesParams { address: string; chain: Chain | ChainId; currencies?: Currency | Currency[]; } /** * @group Addresses */ interface Balances { id: string; address: string; chain: Chain; balances: CurrencyBalance[]; } /** * @group Orders */ type PaymentStandard = 'iban' | 'scan' | 'chain' | 'account'; /** * @group Orders */ interface Identifier { standard: PaymentStandard; bic?: string; } /** * @group Orders */ type OrderKind = 'issue' | 'redeem'; /** * @group Orders */ type OrderState = 'placed' | 'pending' | 'processed' | 'rejected'; /** * @group Orders */ interface Fee { provider: 'satchel'; currency: Currency; amount: string; } /** * @group Orders */ interface IBANIdentifier extends Identifier { standard: 'iban'; iban: string; } /** * @group Orders */ interface CrossChainIdentifier extends Identifier { standard: 'chain'; /** The receivers address */ address: string; /** The receivers network */ chain: Chain | ChainId; } /** * @group Orders */ interface BankAccountIdentifier extends Identifier { /** The standard of the bank account. This is used to identify generic bank account. */ standard: 'account'; /** The account number of the bank account. */ accountNumber: number; /** The address of the bank account holder. */ address: string; } /** * @group Orders */ interface SCANIdentifier extends Identifier { standard: 'scan'; sortCode: string; accountNumber: string; } /** * @group Orders */ interface Individual extends CounterpartDetails { firstName?: string; lastName?: string; address?: string; } /** * @group Orders */ interface Corporation extends CounterpartDetails { companyName: string; } /** * @group Orders */ interface Issuer { /** The sender name. This can be a corporate or an individual. */ name: string; } /** * @group Orders */ interface Counterpart { identifier: IBANIdentifier | SCANIdentifier | CrossChainIdentifier | BankAccountIdentifier; details: Individual | Corporation | Issuer; } /** * @group Orders */ interface CounterpartDetails { name?: string; bank?: CounterpartBank; country?: string; } /** * @group Orders */ interface CounterpartBank { name?: string; address?: string; bic?: string; } /** * @group Orders */ interface OrderMetadata { placedAt: string; processedAt?: string; rejectedReason?: string; txHashes?: string[]; supportingDocumentId?: string; } /** * @group Orders */ interface OrderParams { address?: string; txHash?: string; profile?: string; memo?: string; accountId?: string; state?: OrderState; } /** * @group Orders */ interface Order { id: string; profile: string; address: string; kind: OrderKind; chain: Chain; amount: string; currency: Currency; counterpart: Counterpart; memo: string; referenceNumber?: string; meta: OrderMetadata; state: OrderState; } /** * @group Orders */ interface OrdersResponse { orders: Order[]; } /** * The direction of a payment relative to the order. * * @group Orders */ type PaymentDirection = 'in' | 'out'; /** * The state of a payment: * * - `recorded`: The payment has been submitted and waits further processing. * - `review`: The payment is under review. * - `initiated`: The payment is guaranteed to have an associated order but the provider has not been called yet. * - `pending`: The provider has been called to process the payment. * - `declined`: The payment has been rejected by the payment provider or rejected for incoming payments. * - `processed`: The payment is fully processed. * * @group Orders */ type PaymentState = 'recorded' | 'review' | 'initiated' | 'pending' | 'declined' | 'processed'; /** * @group Orders */ interface PaymentMetadata { /** The payment provider handling the payment. */ provider: string; state: PaymentState; /** When the payment was processed. Only present once the payment has been processed. */ processedAt?: string; } /** * Payment provider-specific details, such as identifiers used in the * provider's payment instruction format. * * @group Orders */ interface PaymentProviderDetails { paymentType?: string; uetr?: string; instructionId?: string; } /** * A payment processed by the payment provider for an order. * * @group Orders */ interface Payment { id: string; orderId: string; direction: PaymentDirection; currency: Currency; amount: string; counterpart: Counterpart; details?: PaymentProviderDetails; memo: string; /** Structured SEPA reference (max 35 characters). */ referenceNumber?: string; /** * Bank-assigned transaction reference. Populated by the payment provider for * incoming payments, e.g. the Account Servicer Reference (`AcctSvcrRef`) from * LHV transaction notifications. See the * [LHV account reports](https://docs.lhv.com/home/connect/services/account-reports/transaction-notification). */ reference?: string; /** Reason the payment was declined. Only present when `meta.state` is `declined`. */ declinedReason?: string; meta: PaymentMetadata; } /** * Response shape of {@link MoneriumApiClient.getOrderPayments}. * * @group Orders */ interface OrderPaymentsResponse { payments: Payment[]; total: number; } /** * @group Orders */ interface PlaceOrderInput { /** The unique identifier of the order */ address: string; /** The senders network */ chain: Chain | ChainId; id?: string; amount: string; signature: string; currency: Currency; counterpart: Counterpart; message: string; memo?: string; supportingDocumentId?: string; } /** * @group Files */ interface SupportingDocMetadata { uploadedBy: string; createdAt: string; updatedAt: string; } /** * @group Files */ interface FilesResponse { id: string; name: string; type: string; size: number; hash: string; meta: SupportingDocMetadata; } /** * @group Addresses */ interface LinkAddressInput { /** Profile ID that owns the address. */ profile?: string; /** The public key of the blockchain account. */ address: string; /** * Fixed message to be signed with the private key corresponding to the given address. * * `I hereby declare that I am the address owner.` */ message?: string; /** * The signature hash of signing the `message` with the private key associated with the given address. * For signing on-chain with ERC1271 contracts, use `0x`, visit the documentation for further details. * https://docs.monerium.com/api#tag/addresses/operation/link-address */ signature: string; chain: Chain | ChainId; } /** * @group Addresses */ interface LinkAddressResponse { profile: string; address: string; state: string; meta: { linkedBy: string; linkedAt: string; }; } type LinkAddress = LinkAddressResponse; /** * @group IBANs */ type IBANState = 'requested' | 'approved' | 'pending' | 'rejected' | 'closed'; /** * @group IBANs */ interface RequestIbanInput { /** the address to request the IBAN. */ address: string; /** the chain to request the IBAN. */ chain: Chain | ChainId; /** payment email notifications sent to customers, `true` by default. */ emailNotifications?: boolean; } /** * @group IBANs */ interface IbansParams { profile?: string; chain?: Chain | ChainId; } /** * @group IBANs */ interface IBAN { /** The IBAN is a unique identifier for a bank account across different countries and includes a two-letter country code, two check digits, and a number of alphanumeric characters. It may include spaces for readability but should be stored without spaces. */ iban: string; /** Bank Identifier Code (BIC) of the bank associated with this IBAN. */ bic: string; /** The profile id that owns the IBAN */ profile: string; /** The address that this IBAN is connected to */ address: string; /** The chain that this IBAN is connected to */ chain: Chain; name: string; state: IBANState; emailNotifications: boolean; } /** * @group IBANs */ interface IBANsResponse { ibans: IBAN[]; } /** * @group IBANs */ interface MoveIbanInput { iban: string; /** the address to move iban to */ address: string; /** the chain to move iban to */ chain: Chain | ChainId; } /** * @group Primitives * @internal */ type AcceptedResponse = { code: 202; status: 'Accepted'; }; /** * Type of pending signature * @group Signatures */ type PendingSignatureKind = 'linkAddress' | 'order'; /** * Base interface for pending signatures * @group Signatures */ interface PendingSignatureBase { kind: PendingSignatureKind; chain: Chain; address: string; createdAt: string; } /** * Pending signature for an order * @group Signatures */ interface PendingOrderSignature extends PendingSignatureBase { id: string; kind: 'order'; amount: string; counterpart: Counterpart; currency: Currency; } /** * Pending signature for linking an address * @group Signatures */ interface PendingLinkAddressSignature extends PendingSignatureBase { kind: 'linkAddress'; } /** * Union type for all pending signature types * @group Signatures */ type PendingSignature = PendingOrderSignature | PendingLinkAddressSignature; /** * Query parameters for fetching pending signatures * @group Signatures */ interface SignaturesParams { /** Filter by blockchain address */ address?: string; /** Filter by blockchain network */ chain?: Chain | ChainId; /** Filter by signature request kind */ kind?: PendingSignatureKind; /** UUID of the profile (defaults to authenticated user's default profile) */ profile?: string; } /** * Response from the signatures endpoint * @group Signatures */ interface SignaturesResponse { /** Array of pending signatures */ pending: PendingSignature[]; /** Total number of pending signatures */ total: number; } /** * @group Webhooks */ type WebhookSubscriptionState = 'active' | 'inactive'; /** * @group Webhooks */ type WebhookEventType = 'iban.updated' | 'order.created' | 'order.updated' | 'profile.updated'; /** * @group Webhooks */ interface WebhookSubscription { id: string; url: string; types: WebhookEventType[]; state: WebhookSubscriptionState; } /** * @group Webhooks */ interface WebhookSubscriptionsResponse { subscriptions: WebhookSubscription[]; } /** * @group Webhooks */ interface CreateWebhookSubscriptionInput { url: string; secret: string; types?: WebhookEventType[]; } /** * @group Webhooks */ interface UpdateWebhookSubscriptionInput { subscription: string; state?: WebhookSubscriptionState; types?: WebhookEventType[]; } /** * @group Auth * @category Types */ interface BuildAuthorizationUrlOptions { clientId: string; redirectUri: string; codeChallenge: string; state?: string; email?: string; skipKyc?: boolean; authMode?: 'login' | 'signup'; } /** * @group Auth * @category Types */ interface BuildSiweAuthorizationUrlOptions { clientId: string; redirectUri: string; codeChallenge: string; message: string; signature: string; state?: string; } /** * @group Auth * @category Types */ interface AuthorizationCodeGrantOptions { clientId: string; redirectUri: string; code: string; codeVerifier: string; } /** * @category Types */ interface RefreshTokenGrantOptions { clientId: string; refreshToken: string; } /** * @category Types */ interface ClientCredentialsGrantOptions { clientId: string; clientSecret: string; } /** * Get Environment configuration for the given environment. Defaults to 'sandbox' if not specified. * @param env - The target environment (`'sandbox'` or `'production'`). Defaults to `'sandbox'`. * @returns Environment configuration */ declare function getEnv(env?: ENV): Environment; /** * @group Transport * @category Types */ type TransportRequest = { method: string; url: string; headers: Record; body?: BodyInit | string; signal?: AbortSignal; }; /** * @group Transport * @category Types */ type TransportResponse = { status: number; headers?: Record; bodyText: string; }; /** * Replaces the internal `fetch` call. Headers (`Authorization`, `Content-Type`, * `Accept`) are pre-populated. Must return a `Promise` resolving with the raw * response `status` and `bodyText`. Throw on network-level failures. * The SDK owns JSON parsing and error normalisation. * @group Transport * @category Types */ type Transport = (request: TransportRequest) => Promise; interface MoneriumApiClientOptions { environment?: ENV; getAccessToken: () => Promise | string | undefined; transport?: Transport; } /** * Base abstract client containing the shared configuration and request logic. * * @abstract * @internal * @ignore */ declare abstract class MoneriumBaseClient { protected options: MoneriumApiClientOptions; protected env: ReturnType; protected transport: Transport; constructor(options: MoneriumApiClientOptions); protected getToken(): Promise; protected request(method: string, path: string, body?: unknown, contentType?: string): Promise; protected requestFormData(method: string, path: string, form: FormData): Promise; /** * Get the current auth context. * * @see {@link https://docs.monerium.com/api#tag/auth/operation/auth-context | API Documentation} */ getAuthContext(): Promise; /** * Get a profile by its id. * * @param profileId - The id of the profile to fetch. * @see {@link https://docs.monerium.com/api#tag/profiles/operation/profile | API Documentation} */ getProfile(profileId: string): Promise; /** * Get all profiles. * * @see {@link https://docs.monerium.com/api#tag/profiles/operation/profiles | API Documentation} */ getProfiles(params?: GetProfilesParams): Promise; /** * Get details for a single address after it has been linked to Monerium. * @param address - The public key of the blockchain account. * * @see {@link https://docs.monerium.com/api#tag/addresses/operation/address | API Documentation} */ getAddress(address: string): Promise
; /** * Get a list of all addresses linked to the profile. * * @see {@link https://docs.monerium.com/api#tag/addresses/operation/addresses | API Documentation} */ getAddresses(params?: AddressesQueryParams): Promise; /** * Add a new address to the profile. * * @see {@link https://docs.monerium.com/api#tag/addresses/operation/link-address | API Documentation} * @returns {LinkAddressResponse | AcceptedResponse} - The address was linked successfully or an accepted response if the address is being processed asynchronously. */ linkAddress(body: LinkAddressInput): Promise; /** * Get the balances for a given address on a specific chain. * * @see {@link https://docs.monerium.com/api#tag/addresses/operation/balances | API Documentation} */ getBalances(params: GetBalancesParams): Promise; /** * Fetch details about a single IBAN. * @param iban - The IBAN to fetch. * * @see {@link https://docs.monerium.com/api#tag/ibans/operation/iban | API Documentation} */ getIban(iban: string): Promise; /** * Fetch all IBANs for the profile. * * @see {@link https://docs.monerium.com/api#tag/ibans/operation/ibans | API Documentation} */ getIbans(params?: IbansParams): Promise; /** * Request an IBAN for the profile. * * @see {@link https://docs.monerium.com/api#tag/ibans/operation/request-iban | API Documentation} */ requestIban(input: RequestIbanInput): Promise; /** * Move an IBAN to a different address and chain. * * @see {@link https://docs.monerium.com/api#tag/ibans/operation/move-iban | API Documentation} */ moveIban(input: MoveIbanInput): Promise; /** * Get an order by its ID. * * @see {@link https://docs.monerium.com/api/#tag/orders/operation/order | API Documentation} */ getOrder(orderId: string): Promise; /** * Get the payments processed by the payment provider for a given order. * * @see {@link https://docs.monerium.com/api/#tag/orders/operation/order-payments | API Documentation} */ getOrderPayments(orderId: string): Promise; /** * Get a list of orders. * * @see {@link https://docs.monerium.com/api/#tag/orders/operation/orders | API Documentation} */ getOrders(params?: OrderParams): Promise; /** * Place a new order. * * **Note:** For multi-signature orders, the API returns a 202 Accepted response * with `{ status: 202, statusText: "Accepted" }` instead of the full Order object. * * @returns `Order` for regular orders; `AcceptedResponse` for multi-sig orders. * @see {@link https://docs.monerium.com/api#tag/orders/operation/post-orders | API Documentation} */ placeOrder(input: PlaceOrderInput): Promise; /** * Get Monerium tokens with contract addresses and chain details. * * @see {@link https://docs.monerium.com/api#tag/tokens | API Documentation} */ getTokens(): Promise; /** * Get pending signatures for the authenticated user. * * @see {@link https://docs.monerium.com/api#tag/signatures/operation/get-signatures | API Documentation} */ getSignatures(params?: SignaturesParams): Promise; /** * Upload a supporting document for KYC onboarding or order support using `multipart/form-data`. * * Accepts binary data in multiple formats and normalizes it to a {@link Blob} * internally before sending the request. * * @param file - The document to upload. Can be a {@link Blob}, {@link Uint8Array}, or {@link ArrayBuffer}. * @param filename - Optional filename to associate with the uploaded file. * If not provided, a default name will be inferred when possible, otherwise `"document"` is used. * @see {@link https://docs.monerium.com/api/#tag/files | API Documentation} * @remarks * This method constructs a {@link FormData} payload internally and sends it to the `POST /files` endpoint. * Consumers do not need to manually create or manage multipart form data. */ uploadSupportingDocument(file: Blob | Uint8Array | ArrayBuffer, filename?: string): Promise; } /** * Server-side client containing operations that require client secrets. * Must never be used in a browser context. */ declare abstract class MoneriumServerClient extends MoneriumBaseClient { /** * Get an access token using client credentials. Server-side only. * clientSecret must never be used in a browser context. * */ clientCredentialsGrant(clientId: string, clientSecret: string): Promise; /** * List all webhook subscriptions for the authenticated user. * * @group Webhooks * * @see {@link https://docs.monerium.com/api#tag/webhooks/operation/list-subscriptions | API Documentation} */ getSubscriptions(): Promise; /** * Create webhook subscription. * * @group Webhooks * * @see {@link https://docs.monerium.com/api#tag/webhooks/operation/create-subscription | API Documentation} */ createSubscription(input: CreateWebhookSubscriptionInput): Promise; /** * Update an existing webhook subscription. * * @group Webhooks * * @see {@link https://docs.monerium.com/api#tag/webhooks/operation/update-subscription | API Documentation} */ updateSubscription(input: UpdateWebhookSubscriptionInput): Promise; } declare class MoneriumPrivateClient extends MoneriumServerClient { } declare class MoneriumOAuthClient extends MoneriumBaseClient { /** * Build the authorization redirect URL. * Returns a URL string — the caller navigates to it. * The SDK does not redirect. */ buildAuthorizationUrl(options: Omit): string; /** * Build the SIWE authorization redirect URL. * Returns a URL string — the caller navigates to it. * The SDK does not redirect. * */ buildSiweAuthorizationUrl(options: Omit): string; /** * Exchange an authorization code for tokens. * The caller stores the returned BearerProfile — the SDK does not write to any storage. * */ authorizationCodeGrant(options: Omit): Promise; /** * Get a new access token using a refresh token. * The caller stores the returned BearerProfile — the SDK does not write to any storage. */ refreshTokenGrant(options: Omit): Promise; /** * Parse a callback URL or query string into structured fields. * * - Returns an empty object if none of the expected parameters are present. * - Check for the presence of `code` or `error` to determine if the URL * contains an OAuth2 authorization response. * * @example * const { code, error } = client.parseAuthorizationResponse(req.url); * const { code, error } = client.parseAuthorizationResponse('?code=abc&state=xyz'); */ parseAuthorizationResponse(input: string): ParsedAuthorizationResponse; } declare class MoneriumWhitelabelClient extends MoneriumServerClient { /** * Creates a new profile. * * @see {@link https://docs.monerium.com/api#tag/profiles/operation/create-profile | API Documentation} */ createProfile(input: CreateProfileInput): Promise; /** * Share KYC data * * @returns {Promise} The KYC data import has been initiated. Subscribe to `profile.update` webhook to monitor the progress. * @see {@link https://docs.monerium.com/api#tag/profiles/operation/share-profile-kyc | API Documentation} * * @ignore NOT YET LIVE */ shareProfileKYC(input: ShareProfileKYCInput): Promise; /** * Submit the compliance details for a profile. Updates only the `details` section without affecting other sections. * * > **KYC reliance model only.** Most integrations should use `shareProfileKYC()` to populate details via Sumsub instead. * * @see {@link https://docs.monerium.com/api#tag/profiles/operation/patch-profile-details | API Documentation} * @returns {Promise} The applicant details have been received and will be processed by Monerium. */ updateProfileDetails(input: UpdateProfileDetailsInput): Promise; /** * Submit additional data for a profile used for risk calculations (e.g. purpose of account, source of funds). Updates only the `form` section without affecting other sections. * * @see {@link https://docs.monerium.com/api#tag/profiles/operation/patch-profile-form | API Documentation} * @returns {Promise} The profile form has been received and will be processed by Monerium. */ updateProfileForm(input: UpdateProfileFormInput): Promise; /** * Submit verifications for a profile. Only the verifications provided are updated. `sourceOfFunds` is submitted here by all partners when required; other verification kinds are populated automatically when using the Sumsub share flow. * * @see {@link https://docs.monerium.com/api#tag/profiles/operation/patch-profile-verifications | API Documentation} * @returns {Promise} The verification data has been received and will be processed by Monerium. */ updateProfileVerifications(input: UpdateProfileVerificationsInput): Promise; } /** * Thrown when the Monerium API returns a non-2xx response. * Fields map directly to the API response body — nothing is translated or normalised. * * @example * try { * await client.getProfiles(); * } catch (err) { * if (err instanceof MoneriumApiError) { * console.log(err.code); // 401 * console.log(err.status); // "Unauthorized" * console.log(err.message); // "Not authenticated" * console.log(err.errors); // field-level validation errors, if present * } * } * @group Errors */ declare class MoneriumApiError extends Error { code: number; status: string; errors?: Record; details?: unknown; constructor(body: { code: number; status: string; message: string; errors?: Record; details?: unknown; }); } /** * @group Errors */ type MoneriumSdkErrorType = 'network_error' | 'authentication_required' | 'invalid_configuration'; /** * Thrown for SDK-level failures — no HTTP response involved. * * @example * try { * await client.getProfiles(); * } catch (err) { * if (err instanceof MoneriumSdkError) { * console.log(err.type); // 'network_error' | 'authentication_required' | ... * console.log(err.cause); // underlying fetch error, if type === 'network_error' * } * } * @group Errors */ declare class MoneriumSdkError extends Error { type: MoneriumSdkErrorType; cause?: unknown; constructor(type: MoneriumSdkErrorType, message: string, cause?: unknown); } /** * @group Utilities */ declare const _default: { /** * The message used to link addresses. */ LINK_MESSAGE: string; }; /** * @param d Date to be formatted * @returns RFC3339 date format. * @example 2023-04-30T12:00:00+01:00 * @example 2023-04-30T02:08:15Z * @group Utilities */ declare const rfc3339: (d: Date) => string; /** * This will resolve the chainId number to the corresponding chain name. * @param chain The chainId of the network * @returns chain name, 'ethereum', 'polygon', 'gnosis', etc. * @group Utilities */ declare const parseChain: (chain: Chain | ChainId) => Chain; /** * The message to be signed when placing an order. * @param amount The amount to be sent * @param currency The currency to be sent * @param receiver The receiver of the funds * @param chain The chainId of the network if it's a cross-chain transaction * @returns * cross-chain: * ```ts * Send {CURRENCY} {AMOUNT} to {RECEIVER} on {CHAIN} at {DATE}` * ``` * * off-ramp: * ```ts * Send {CURRENCY} {AMOUNT} to {RECEIVER} at {DATE} * ``` * @example `Send EUR 1 to 0x1234123412341234123412341234123412341234 on ethereum at 2023-04-30T12:00:00+01:00` * * @example `Send EUR 1 to IS1234123412341234 at 2023-04-30T12:00:00+01:00` * @group Utilities */ declare const placeOrderMessage: (amount: string | number, currency: Currency, receiver: string, chain?: ChainId | Chain) => string; /** * Construct an EIP-4361 SIWE message for use with {@link buildSiweAuthorizationUrl}. * @see https://monerium.com/siwe * @group Utilities */ declare const siweMessage: ({ domain, address, appName, redirectUri, chainId, issuedAt, expiryAt, privacyPolicyUrl, termsOfServiceUrl, }: { domain: string; address: string; appName: string; redirectUri: string; chainId: EvmChainId; issuedAt?: string; expiryAt?: string; privacyPolicyUrl: string; termsOfServiceUrl: string; }) => string; /** * This will resolve the chainId number to the corresponding chain name. * @param chainId The chainId of the network * @returns chain name * @example * ```ts * getChain(1) // 'ethereum' * getChain(11155111) // 'sepolia' * * getChain(100) // 'gnosis' * getChain(10200) // 'chiado' * * getChain(137) // 'polygon' * getChain(80002) // 'amoy' * ``` * @group Utilities */ declare const getChain: (chainId: number) => Chain; /** * Shorten an IBAN for display: `GB29...2917` * @group Utilities */ declare const shortenIban: (iban?: string) => string | undefined; /** * Shorten a blockchain address for display: `0x1234...abcd` * @group Utilities */ declare const shortenAddress: (address?: string) => string | undefined; export { type AcceptedResponse, type Address, type AddressesQueryParams, type AddressesResponse, type AuthContext, type AuthorizationCodeGrantOptions, type Balances, type BankAccountIdentifier, type BearerProfile, type Beneficiary, type BuildAuthorizationUrlOptions, type BuildSiweAuthorizationUrlOptions, type Chain, type ChainId, type ClientCredentialsGrantOptions, type Config, type CorporateProfileDetails, type CorporateProfileForm, type CorporateProfileVerification, type CorporateVerificationKind, type Corporation, type Counterpart, type CounterpartBank, type CounterpartDetails, type CreateProfileInput, type CreateWebhookSubscriptionInput, type CrossChainIdentifier, Currency, type CurrencyBalance, type CurrencyCode, type Director, type ENV, type Environment, type Fee, type FilesResponse, type GetBalancesParams, type GetProfilesParams, type IBAN, type IBANIdentifier, type IBANState, type IBANsResponse, type IbansParams, type IdDocumentKind, type Identifier, type Individual, type Issuer, type KYCProvider, type LinkAddress, type LinkAddressInput, type LinkAddressResponse, type Method, type MoneriumApiClientOptions, MoneriumApiError, MoneriumBaseClient, MoneriumOAuthClient, MoneriumPrivateClient, MoneriumSdkError, type MoneriumSdkErrorType, MoneriumServerClient, MoneriumWhitelabelClient, type MoveIbanInput, type Order, type OrderKind, type OrderMetadata, type OrderParams, type OrderPaymentsResponse, type OrderState, type OrdersResponse, type ParsedAuthorizationResponse, type Payment, type PaymentDirection, type PaymentMetadata, type PaymentProviderDetails, type PaymentStandard, type PaymentState, type PendingLinkAddressSignature, type PendingOrderSignature, type PendingSignature, type PendingSignatureKind, type Permission, type PersonalProfileDetails, type PersonalProfileForm, type PersonalProfileVerification, type PersonalVerificationKind, type PlaceOrderInput, type ProductionChain, type Profile, type ProfileDetailsState, type ProfileFormState, type ProfileKind, type ProfileState, ProfileType, type ProfileVerificationState, type ProfilesResponse, type RefreshTokenGrantOptions, type Representative, type RequestIbanInput, type SCANIdentifier, type SandboxChain, type ShareProfileKYCInput, type SignaturesParams, type SignaturesResponse, type SupportingDocMetadata, type Ticker, type Token, type TokenSymbol, type Transport, type TransportRequest, type TransportResponse, type UpdateProfileDetailsInput, type UpdateProfileFormInput, type UpdateProfileVerificationsInput, type UpdateWebhookSubscriptionInput, type WebhookEventType, type WebhookSubscription, type WebhookSubscriptionState, type WebhookSubscriptionsResponse, calculatePKCECodeChallenge, _default as constants, generatePKCE, getChain, parseAuthorizationResponse, parseChain, placeOrderMessage, randomPKCECodeVerifier, rfc3339, shortenAddress, shortenIban, siweMessage };