squarefi-bff-api-module 1.36.63 → 1.36.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4703,6 +4703,8 @@ export interface paths {
4703
4703
  /**
4704
4704
  * Calculate order
4705
4705
  * @description Pre-calculates order amounts, fees and exchange rates without creating an order.
4706
+ * The quote is priced for the wallet bound to the API key; a `wallet_id` in the
4707
+ * query is ignored.
4706
4708
  *
4707
4709
  * **Authentication**: x-api-key header required
4708
4710
  *
@@ -4716,6 +4718,9 @@ export interface paths {
4716
4718
  to_currency_id: string;
4717
4719
  /** @description If `true`, calculates inputs needed to receive the given amount. */
4718
4720
  is_reverse?: "true" | "false";
4721
+ /** @description If `true` (default), the network fee is subtracted from `result_amount`. If `false`, the fee is added on top of `from_amount` and the recipient gets the full converted amount. Ignored for reverse calculations.
4722
+ * */
4723
+ is_subtract?: "true" | "false";
4719
4724
  /** @description Destination address (for crypto withdrawals; affects network fee estimation). */
4720
4725
  to_address?: string;
4721
4726
  };
@@ -4734,30 +4739,7 @@ export interface paths {
4734
4739
  "application/json": {
4735
4740
  /** @example true */
4736
4741
  success?: boolean;
4737
- data?: {
4738
- from_amount?: number;
4739
- to_amount?: number;
4740
- rate?: number;
4741
- fee?: number;
4742
- /** Format: uuid */
4743
- fee_currency?: string;
4744
- network_fee?: number | null;
4745
- /** Format: uuid */
4746
- network_fee_currency?: string | null;
4747
- total_amount?: number;
4748
- from_currency?: {
4749
- /** Format: uuid */
4750
- uuid?: string;
4751
- symbol?: string;
4752
- name?: string;
4753
- };
4754
- to_currency?: {
4755
- /** Format: uuid */
4756
- uuid?: string;
4757
- symbol?: string;
4758
- name?: string;
4759
- };
4760
- };
4742
+ data?: components["schemas"]["OrderCalculation"];
4761
4743
  };
4762
4744
  };
4763
4745
  };
@@ -4770,6 +4752,15 @@ export interface paths {
4770
4752
  "application/json": components["schemas"]["ApiErrorResponse"];
4771
4753
  };
4772
4754
  };
4755
+ /** @description The wallet's KYC status does not allow the operation (`KYC_REQUIREMENTS_NOT_MET`) */
4756
+ 403: {
4757
+ headers: {
4758
+ [name: string]: unknown;
4759
+ };
4760
+ content: {
4761
+ "application/json": components["schemas"]["ApiErrorResponse"];
4762
+ };
4763
+ };
4773
4764
  };
4774
4765
  };
4775
4766
  put?: never;
@@ -7141,6 +7132,144 @@ export interface components {
7141
7132
  * @enum {string}
7142
7133
  */
7143
7134
  OrderTypeId: "EXCHANGE_OMNI" | "EXCHANGE_OMNI_ONRAMP" | "EXCHANGE_OMNI_OFFRAMP" | "EXCHANGE_OMNI_CRYPTO" | "EXCHANGE_CRYPTO_INTERNAL" | "L2F_ACH_ONRAMP" | "L2F_ACH_OFFRAMP" | "L2F_SEPA_ONRAMP" | "L2F_SEPA_OFFRAMP" | "L2F_SWIFT_ONRAMP" | "L2F_SWIFT_OFFRAMP" | "L2F_WIRE_ONRAMP" | "L2F_WIRE_OFFRAMP" | "L2F_CHAPS_ONRAMP" | "L2F_CHAPS_OFFRAMP" | "L2F_FPS_ONRAMP" | "L2F_FPS_OFFRAMP" | "BRL_WIRE_ONRAMP" | "BRL_WIRE_OFFRAMP" | "BRL_ACH_ONRAMP" | "BRL_ACH_OFFRAMP" | "BRL_RTP_OFFRAMP" | "DLS_WIRE_ONRAMP" | "DLS_WIRE_OFFRAMP" | "DLS_ACH_ONRAMP" | "DLS_ACH_OFFRAMP" | "DLS_SEPA_ONRAMP" | "DLS_SEPA_OFFRAMP" | "DLS_SWIFT_ONRAMP" | "DLS_SWIFT_OFFRAMP" | "BC1_SEPA_ONRAMP" | "BC1_SEPA_OFFRAMP" | "BC1_SWIFT_ONRAMP" | "BC1_SWIFT_OFFRAMP" | "BC3_SEPA_ONRAMP" | "BC3_SEPA_OFFRAMP" | "RPP_SWIFT_OFFRAMP" | "RPP_SEPA_OFFRAMP" | "RPP_FPS_OFFRAMP" | "RPP_ACH_OFFRAMP" | "OMNIBUS_CRYPTO_TRANSFER" | "OMNIBUS_CRYPTO_WITHDRAWAL" | "OMNIBUS_INTERNAL_TRANSFER" | "SEGREGATED_CRYPTO_TRANSFER" | "TRANSFER_INTERNAL" | "TRANSFER_CARD_PREPAID" | "TRANSFER_CARD_SUBACCOUNT" | "TRANSFER_CARD_WHOLESALE" | "WITHDRAW_CARD_PREPAID" | "WITHDRAW_CARD_SUBACCOUNT" | "REFUND_CARD_PREPAID" | "REFUND_CARD_SUBACCOUNT" | "RN_CARDS_OFFRAMP" | "CARD_ISSUING_FEE" | "MONTHLY_FEE";
7135
+ OrderCalculation: {
7136
+ /**
7137
+ * Format: uuid
7138
+ * @description Source currency UUID.
7139
+ */
7140
+ from_currency: string;
7141
+ /**
7142
+ * Format: uuid
7143
+ * @description Destination currency UUID.
7144
+ */
7145
+ to_currency: string;
7146
+ /**
7147
+ * @description Source currency symbol.
7148
+ * @example USDT
7149
+ */
7150
+ from_symbol: string;
7151
+ /**
7152
+ * @description Destination currency symbol.
7153
+ * @example USD
7154
+ */
7155
+ to_symbol: string;
7156
+ /**
7157
+ * @description Decimals the source-currency amounts are truncated to.
7158
+ * @example 6
7159
+ */
7160
+ from_decimals: number;
7161
+ /**
7162
+ * @description Decimals the destination-currency amounts are truncated to.
7163
+ * @example 2
7164
+ */
7165
+ to_decimals: number;
7166
+ /**
7167
+ * @description Amount to be spent in the source currency.
7168
+ * @example 100
7169
+ */
7170
+ from_amount: number;
7171
+ /**
7172
+ * @description Amount to be received in the destination currency.
7173
+ * @example 98.5
7174
+ */
7175
+ result_amount: number;
7176
+ /**
7177
+ * @description Amount converted before fees, in the destination currency.
7178
+ * @example 100
7179
+ */
7180
+ net_amount: number;
7181
+ /**
7182
+ * @description Total fees (`comission` + `network_fee`), in the source currency.
7183
+ * @example 1.5
7184
+ */
7185
+ fees: number;
7186
+ /**
7187
+ * @description Service commission excluding the network fee (wire name is intentionally `comission`).
7188
+ * @example 1.5
7189
+ */
7190
+ comission: number;
7191
+ /**
7192
+ * Format: uuid
7193
+ * @description Currency UUID `comission` is denominated in. Omitted by older engines — then it is the same currency on both sides.
7194
+ */
7195
+ commission_currency?: string;
7196
+ /**
7197
+ * @description Percentage part of the commission, in the commission currency.
7198
+ * @example 1
7199
+ */
7200
+ percent_commission: number;
7201
+ /**
7202
+ * @description Fixed part of the commission, in the commission currency.
7203
+ * @example 0.5
7204
+ */
7205
+ fixed_commission: number;
7206
+ /**
7207
+ * @description Markup applied, in whole percent.
7208
+ * @example 1.5
7209
+ */
7210
+ base_markup: number;
7211
+ /**
7212
+ * @description Estimated blockchain network fee in the source currency (crypto withdrawals only, otherwise 0).
7213
+ * @example 0
7214
+ */
7215
+ network_fee: number;
7216
+ /**
7217
+ * @description Network fee in the chain native currency (ETH, BNB, …), 18 decimals.
7218
+ * @example 0
7219
+ */
7220
+ network_fee_native: number;
7221
+ /**
7222
+ * @description Network fee in USD, 8 decimals.
7223
+ * @example 0
7224
+ */
7225
+ network_fee_usd: number;
7226
+ /**
7227
+ * @description Transaction fee. Always 0 for now.
7228
+ * @example 0
7229
+ */
7230
+ transaction_fee: number;
7231
+ /**
7232
+ * @description Exchange rate applied (source → destination), 6 decimals. Includes the tenant FX spread.
7233
+ * @example 0.985
7234
+ */
7235
+ rate: number;
7236
+ /**
7237
+ * @description Market rate before the tenant FX spread. Equal to `rate` when no spread applies.
7238
+ * @example 1
7239
+ */
7240
+ base_rate: number;
7241
+ /**
7242
+ * @description Tenant FX spread already taken off `rate`, in whole percent.
7243
+ * @example 1.5
7244
+ */
7245
+ fx_spread: number;
7246
+ /**
7247
+ * @description Percent markup of the applied tariff.
7248
+ * @example 1.5
7249
+ */
7250
+ markup: number;
7251
+ /**
7252
+ * @description Fixed USD markup of the applied tariff.
7253
+ * @example 0.5
7254
+ */
7255
+ markup_usd: number;
7256
+ /**
7257
+ * @description Percent markup on the network fee.
7258
+ * @example 0
7259
+ */
7260
+ gas_markup: number;
7261
+ /**
7262
+ * @description Percent discount on the network fee.
7263
+ * @example 0
7264
+ */
7265
+ gas_discount: number;
7266
+ /** @description Whether the order type is an internal (on-platform) operation. */
7267
+ is_internal: boolean;
7268
+ /** @description Whether the operation is allowed for the caller with these inputs. */
7269
+ allowed: boolean;
7270
+ /** @description Calculation error text, `null` on success. */
7271
+ error: string | null;
7272
+ };
7144
7273
  /** @description Card object with all properties */
7145
7274
  IssuingCard: {
7146
7275
  /**
@@ -12013,7 +12013,16 @@ export interface paths {
12013
12013
  };
12014
12014
  /**
12015
12015
  * List crypto addresses
12016
- * @description Retrieves a list of crypto addresses associated with a wallet.
12016
+ * @description Retrieves the crypto addresses of a wallet, newest first.
12017
+ *
12018
+ * Every item embeds the full network object in `chain` (schema `Chain`) — read `chain.id`
12019
+ * for the numeric chain ID. The single-address endpoints
12020
+ * (`GET` / `POST /frontend/wallets/{wallet_id}/addresses/{chain}`) return the same row with
12021
+ * `chain` as that number instead. Match an address across endpoints by `uuid`.
12022
+ *
12023
+ * Without `is_active` only active addresses are returned. Creation is idempotent per chain,
12024
+ * so a wallet normally holds one active address per chain; should several be active, the
12025
+ * first item with a given `chain.id` is the one `GET …/addresses/{chain}` returns for it.
12017
12026
  *
12018
12027
  * **Authentication**: Bearer token with x-tenant-id header required
12019
12028
  *
@@ -12023,9 +12032,9 @@ export interface paths {
12023
12032
  get: {
12024
12033
  parameters: {
12025
12034
  query?: {
12026
- /** @description Filter by blockchain (chain ID) */
12027
- chain?: string;
12028
- /** @description Filter by active status */
12035
+ /** @description Filter by numeric chain ID (`chain.id` of the items) */
12036
+ chain?: number;
12037
+ /** @description Filter by active status. Omitted → active addresses only. */
12029
12038
  is_active?: boolean;
12030
12039
  /** @description Number of items to skip */
12031
12040
  offset?: number;
@@ -12050,22 +12059,7 @@ export interface paths {
12050
12059
  "application/json": {
12051
12060
  /** @example true */
12052
12061
  success: boolean;
12053
- data: {
12054
- /** Format: uuid */
12055
- uuid: string;
12056
- /** @description The blockchain address */
12057
- address: string;
12058
- /** @description Numeric chain ID */
12059
- chain: number;
12060
- /** Format: uuid */
12061
- wallet_uuid: string;
12062
- is_active: boolean;
12063
- label: string | null;
12064
- /** @enum {string} */
12065
- type: "utila" | "processing";
12066
- /** Format: date-time */
12067
- created_at: string;
12068
- }[];
12062
+ data: components["schemas"]["CryptoAddressListItem"][];
12069
12063
  pagination: {
12070
12064
  offset: number;
12071
12065
  limit: number;
@@ -12108,10 +12102,15 @@ export interface paths {
12108
12102
  };
12109
12103
  /**
12110
12104
  * Get crypto address by chain
12111
- * @description Returns the single crypto address for the given wallet and chain.
12105
+ * @description Returns the active crypto address of the wallet on the given chain.
12112
12106
  * Useful when the caller already knows which chain they need and wants
12113
12107
  * to avoid paginated list traversal.
12114
12108
  *
12109
+ * `chain` in the response is the numeric chain ID — no network object is embedded
12110
+ * (unlike the items of `GET /frontend/wallets/{wallet_id}/addresses`). Should the wallet
12111
+ * hold several active addresses on the chain, the newest is returned — the same row the
12112
+ * list shows first for that `chain.id`.
12113
+ *
12115
12114
  * **Authentication**: Bearer token with x-tenant-id header required
12116
12115
  *
12117
12116
  * **Access Control**: Any owner/admin/auditor member of the wallet (the scoped `user` role is rejected with 403); wallet KYC must be APPROVED or HOLD
@@ -12140,20 +12139,7 @@ export interface paths {
12140
12139
  "application/json": {
12141
12140
  /** @example true */
12142
12141
  success: boolean;
12143
- data: {
12144
- /** Format: uuid */
12145
- uuid: string;
12146
- address: string;
12147
- chain: number;
12148
- /** Format: uuid */
12149
- wallet_uuid: string;
12150
- is_active: boolean;
12151
- label: string | null;
12152
- /** @enum {string} */
12153
- type: "utila" | "processing";
12154
- /** Format: date-time */
12155
- created_at: string;
12156
- };
12142
+ data: components["schemas"]["CryptoAddress"];
12157
12143
  };
12158
12144
  };
12159
12145
  };
@@ -12183,7 +12169,11 @@ export interface paths {
12183
12169
  put?: never;
12184
12170
  /**
12185
12171
  * Create crypto address
12186
- * @description Creates a new crypto address for a specific blockchain.
12172
+ * @description Creates a crypto address for a specific blockchain. Idempotent per chain: if the wallet
12173
+ * already holds an active address on that chain, that address is returned (the same row
12174
+ * `GET /frontend/wallets/{wallet_id}/addresses/{chain}` gives) and nothing is provisioned.
12175
+ *
12176
+ * `chain` in the response is the numeric chain ID — no network object is embedded.
12187
12177
  *
12188
12178
  * **Authentication**: Bearer token with x-tenant-id header required
12189
12179
  *
@@ -12225,21 +12215,7 @@ export interface paths {
12225
12215
  "application/json": {
12226
12216
  /** @example true */
12227
12217
  success: boolean;
12228
- data: {
12229
- /** Format: uuid */
12230
- uuid: string;
12231
- /** @description The blockchain address */
12232
- address: string;
12233
- chain: number;
12234
- /** Format: uuid */
12235
- wallet_uuid: string;
12236
- is_active: boolean;
12237
- label: string | null;
12238
- /** @enum {string} */
12239
- type: "utila" | "processing";
12240
- /** Format: date-time */
12241
- created_at: string;
12242
- };
12218
+ data: components["schemas"]["CryptoAddress"];
12243
12219
  /** @example Crypto address created successfully */
12244
12220
  message: string;
12245
12221
  };
@@ -14274,6 +14250,84 @@ export interface components {
14274
14250
  /** Format: date-time */
14275
14251
  created_at?: string;
14276
14252
  };
14253
+ /** @description Blockchain network as stored in the `chain` reference table. Embedded whole into every item of `GET /frontend/wallets/{wallet_id}/addresses`; `GET /frontend/reference/chains` returns the `id` / `name` / `symbol` / `enabled` subset of the same rows. Rely on those four fields — the rest is the raw reference row and is not a stable contract. */
14254
+ Chain: {
14255
+ /**
14256
+ * @description Numeric chain ID — the value `chain` carries on the single-address endpoints and in the `{chain}` path parameter
14257
+ * @example 1
14258
+ */
14259
+ id: number;
14260
+ /** @example Tron */
14261
+ name: string | null;
14262
+ /** @example TRON */
14263
+ symbol: string | null;
14264
+ /** @description Whether new addresses can be created on this network */
14265
+ enabled: boolean;
14266
+ is_beta?: boolean | null;
14267
+ is_testnet?: boolean | null;
14268
+ /** @description Public RPC endpoint of the network */
14269
+ rpc_url?: string | null;
14270
+ /** @description Network identifier at the custody provider (e.g. `tron-mainnet`) */
14271
+ utila_name?: string | null;
14272
+ /** @description Gas units of a token transfer */
14273
+ token_transfer_gas?: number | null;
14274
+ /** @description Gas units of a native-coin transfer */
14275
+ native_transfer_gas?: number | null;
14276
+ };
14277
+ /** @description Fields shared by every representation of a wallet crypto address (a `crypto_addresses` row). */
14278
+ CryptoAddressBase: {
14279
+ /**
14280
+ * @description Numeric row ID. Identify an address across endpoints by `uuid`, not by this number.
14281
+ * @example 2405
14282
+ */
14283
+ id: number;
14284
+ /**
14285
+ * Format: uuid
14286
+ * @description Stable address identifier — the same value on the list and on the single-address endpoints. `null` only on a few legacy `processing` rows.
14287
+ */
14288
+ uuid: string | null;
14289
+ /**
14290
+ * @description The on-chain address
14291
+ * @example TN3W4H6rK2ce4vX9YnFQhwKENnHjoxb3m9
14292
+ */
14293
+ address: string;
14294
+ /**
14295
+ * Format: uuid
14296
+ * @description Owning wallet
14297
+ */
14298
+ wallet_uuid: string;
14299
+ is_active: boolean;
14300
+ /**
14301
+ * @description Free-form label: the one passed on creation (clients send e.g. `default` or `VA`), otherwise `<chain name> Address`.
14302
+ * @example default
14303
+ */
14304
+ label: string | null;
14305
+ /** @description Derivation index of the legacy `processing` provider; always `null` for `utila` addresses */
14306
+ index_id: number | null;
14307
+ /**
14308
+ * @description Provisioning provider. New addresses are always `utila`; `processing` rows are legacy and read-only.
14309
+ * @enum {string}
14310
+ */
14311
+ type: "utila" | "processing";
14312
+ /** @description Provider bookkeeping (network name, integration and address IDs at the custody provider). Not a stable contract. */
14313
+ meta: {
14314
+ [key: string]: unknown;
14315
+ } | null;
14316
+ /** Format: date-time */
14317
+ created_at: string;
14318
+ };
14319
+ /** @description A single wallet crypto address as returned by `GET` and `POST /frontend/wallets/{wallet_id}/addresses/{chain}`. `chain` is the numeric chain ID; no network object is embedded. */
14320
+ CryptoAddress: components["schemas"]["CryptoAddressBase"] & {
14321
+ /**
14322
+ * @description Numeric chain ID (see `GET /frontend/reference/chains`)
14323
+ * @example 1
14324
+ */
14325
+ chain: number;
14326
+ };
14327
+ /** @description An item of `GET /frontend/wallets/{wallet_id}/addresses`. The same row as `CryptoAddress`, but `chain` is the embedded network object — read `chain.id` to get the numeric chain ID used everywhere else. */
14328
+ CryptoAddressListItem: components["schemas"]["CryptoAddressBase"] & {
14329
+ chain: components["schemas"]["Chain"];
14330
+ };
14277
14331
  CryptoWalletDeleteResponse: {
14278
14332
  /**
14279
14333
  * Format: uuid