squarefi-bff-api-module 1.36.68 → 1.36.70
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.
- package/dist/api/frontend.d.ts +4 -0
- package/dist/api/frontend.js +5 -0
- package/dist/api/types/autogen/apiV1External.types.d.ts +1 -1
- package/dist/api/types/autogen/apiV1Frontend.types.d.ts +230 -8
- package/dist/api/types/types.d.ts +33 -0
- package/dist/api/user.d.ts +4 -0
- package/dist/api/user.js +10 -0
- package/dist/api/wallets.d.ts +4 -0
- package/dist/api/wallets.js +12 -0
- package/dist/utils/apiClientFactory.js +4 -0
- package/package.json +1 -1
package/dist/api/frontend.d.ts
CHANGED
|
@@ -67,4 +67,8 @@ export declare const frontend: {
|
|
|
67
67
|
list: (params?: API.Frontend.Reference.ExchangeRates.List.Request) => Promise<API.Frontend.Reference.ExchangeRates.List.Response>;
|
|
68
68
|
};
|
|
69
69
|
};
|
|
70
|
+
notificationPreferences: {
|
|
71
|
+
get: () => Promise<API.Frontend.NotificationPreferences.Get.Response>;
|
|
72
|
+
update: (data: API.Frontend.NotificationPreferences.Update.Request) => Promise<API.Frontend.NotificationPreferences.Update.Response>;
|
|
73
|
+
};
|
|
70
74
|
};
|
package/dist/api/frontend.js
CHANGED
|
@@ -138,4 +138,9 @@ export const frontend = {
|
|
|
138
138
|
list: (params = {}) => apiClientV1Frontend.getRequest('/frontend/reference/exchange_rates', { params }),
|
|
139
139
|
},
|
|
140
140
|
},
|
|
141
|
+
// IN_APP stays on (400 INBOX_CHANNEL_LOCKED); channels vary by tenant (TELEGRAM needs a bot); PUT upserts any subset.
|
|
142
|
+
notificationPreferences: {
|
|
143
|
+
get: () => apiClientV1Frontend.getRequest('/frontend/notification-preferences'),
|
|
144
|
+
update: (data) => apiClientV1Frontend.putRequest('/frontend/notification-preferences', { data }),
|
|
145
|
+
},
|
|
141
146
|
};
|
|
@@ -1996,7 +1996,7 @@ export interface paths {
|
|
|
1996
1996
|
"application/json": components["schemas"]["ApiErrorResponse"];
|
|
1997
1997
|
};
|
|
1998
1998
|
};
|
|
1999
|
-
/** @description
|
|
1999
|
+
/** @description A cardholder already exists for this person in this wallet + issuing_program — the member named by `user_data_id` already holds one, or one carries this email. `error.details.cardholder_id` names it (when it could be resolved) so the client can adopt it instead of dead-ending. When `user_data_id` names a member who may adopt the row, the row is first completed from that member's KYC dossier: empty identity fields and document photos of a type it does not hold are filled in, and nothing already on it is changed.
|
|
2000
2000
|
* */
|
|
2001
2001
|
409: {
|
|
2002
2002
|
headers: {
|
|
@@ -5438,7 +5438,7 @@ export interface paths {
|
|
|
5438
5438
|
};
|
|
5439
5439
|
content?: never;
|
|
5440
5440
|
};
|
|
5441
|
-
/** @description
|
|
5441
|
+
/** @description A cardholder already exists for this person in this wallet + issuing_program — the member named by `user_data_id` already holds one, or one carries this email. `error.details.cardholder_id` names it (when it could be resolved) so the client can adopt it instead of dead-ending. When `user_data_id` names a member who may adopt the row, the row is first completed from that member's KYC dossier: empty identity fields and document photos of a type it does not hold are filled in, and nothing already on it is changed. Re-read the row for its refreshed `missing_kyc_fields`.
|
|
5442
5442
|
* */
|
|
5443
5443
|
409: {
|
|
5444
5444
|
headers: {
|
|
@@ -5749,6 +5749,13 @@ export interface paths {
|
|
|
5749
5749
|
* demands (a required document — usually the selfie — was never captured). Read
|
|
5750
5750
|
* `required_level` to name the bar ("requires FULL verification"). Same remediation as
|
|
5751
5751
|
* `NEEDS_VERIFICATION`, run to add the missing step.
|
|
5752
|
+
* - `NEEDS_COMPLETION` — an ACTIVE cardholder is linked (`cardholder_id`), but it does not
|
|
5753
|
+
* hold what the program's ISSUANCE bar asks for — typically one written before that bar
|
|
5754
|
+
* existed. Creating a card now is refused with `400`; `will_require` names the same
|
|
5755
|
+
* fields that 400 would. Nothing is submitted again: `PATCH` the fields, and for the
|
|
5756
|
+
* document photos call `POST /cardholders` with the member's `user_data_id` — it answers
|
|
5757
|
+
* `409` with this `cardholder_id` after completing the row from the member's KYC
|
|
5758
|
+
* dossier. When the member has not passed that verification, run it first.
|
|
5752
5759
|
* - `NEEDS_RESUBMIT` — the VENDOR's review of the cardholder came back rejected (or asked
|
|
5753
5760
|
* for part of the dossier again). Not a dead end: fix what `reject_reason` names —
|
|
5754
5761
|
* `PATCH` the field, or re-upload and re-attach the document — then call
|
|
@@ -5767,7 +5774,8 @@ export interface paths {
|
|
|
5767
5774
|
*
|
|
5768
5775
|
* **`will_require`**: fields the client should expect to collect BY HAND (same vocabulary
|
|
5769
5776
|
* as the submit 400 `missing` list, e.g. `address.line1`, `tax_identification_number`,
|
|
5770
|
-
* `email or phone`). For `DRAFT` it is the draft's actual leftovers; for `
|
|
5777
|
+
* `email or phone`). For `DRAFT` it is the draft's actual leftovers; for `NEEDS_COMPLETION`
|
|
5778
|
+
* it is what the card create refuses the row over; for `CAN_CREATE` it
|
|
5771
5779
|
* is a projection that assumes the KYC dossier covers what it usually covers — the created
|
|
5772
5780
|
* draft's `missing_kyc_fields` is the authoritative version.
|
|
5773
5781
|
*
|
|
@@ -5813,10 +5821,10 @@ export interface paths {
|
|
|
5813
5821
|
/** Format: uuid */
|
|
5814
5822
|
user_data_id: string;
|
|
5815
5823
|
/** @enum {string} */
|
|
5816
|
-
verdict: "READY" | "DRAFT" | "CAN_CREATE" | "PENDING" | "NEEDS_VERIFICATION" | "NEEDS_VERIFICATION_UPGRADE" | "NEEDS_RESUBMIT" | "ISSUER_REVIEW_PENDING" | "REJECTED" | "NOT_MEMBER";
|
|
5824
|
+
verdict: "READY" | "DRAFT" | "CAN_CREATE" | "PENDING" | "NEEDS_VERIFICATION" | "NEEDS_VERIFICATION_UPGRADE" | "NEEDS_COMPLETION" | "NEEDS_RESUBMIT" | "ISSUER_REVIEW_PENDING" | "REJECTED" | "NOT_MEMBER";
|
|
5817
5825
|
/**
|
|
5818
5826
|
* Format: uuid
|
|
5819
|
-
* @description The linked cardholder for READY / DRAFT / NEEDS_RESUBMIT / ISSUER_REVIEW_PENDING verdicts
|
|
5827
|
+
* @description The linked cardholder for READY / DRAFT / NEEDS_COMPLETION / NEEDS_RESUBMIT / ISSUER_REVIEW_PENDING verdicts
|
|
5820
5828
|
*
|
|
5821
5829
|
*/
|
|
5822
5830
|
cardholder_id: string | null;
|
|
@@ -12715,11 +12723,11 @@ export interface paths {
|
|
|
12715
12723
|
* **Access Control**: Any active wallet member. The response shape depends on the caller's role and
|
|
12716
12724
|
* is told apart by `access_role`:
|
|
12717
12725
|
* - `owner` / `admin` / `auditor` — the full wallet (`WalletDetails`): identity, KYC, `balance`,
|
|
12718
|
-
* `fiat_accounts`, `base_currency
|
|
12726
|
+
* `fiat_accounts`, `base_currency`, the totals and `api_access_enabled`.
|
|
12719
12727
|
* - `user` — a shell-only wallet (`WalletDetailsScopedUser`): `uuid`, `id`, `name`, `display_name`,
|
|
12720
12728
|
* `tenant_id`, `kyc_entity_id`, `kyc_info`, `created_at` + the role fields. `logo_url`, `balance`, `fiat_accounts`,
|
|
12721
|
-
* `base_currency`, `fiat_total`, `crypto_total`, `pending_balance` and `
|
|
12722
|
-
* (not null) for that role — check `access_role` before reading them.
|
|
12729
|
+
* `base_currency`, `fiat_total`, `crypto_total`, `pending_balance`, `total_amount` and `api_access_enabled`
|
|
12730
|
+
* are absent (not null) for that role — check `access_role` before reading them.
|
|
12723
12731
|
*
|
|
12724
12732
|
*/
|
|
12725
12733
|
get: {
|
|
@@ -12882,6 +12890,215 @@ export interface paths {
|
|
|
12882
12890
|
};
|
|
12883
12891
|
trace?: never;
|
|
12884
12892
|
};
|
|
12893
|
+
"/frontend/wallets/{wallet_id}/logo": {
|
|
12894
|
+
parameters: {
|
|
12895
|
+
query?: never;
|
|
12896
|
+
header?: never;
|
|
12897
|
+
path?: never;
|
|
12898
|
+
cookie?: never;
|
|
12899
|
+
};
|
|
12900
|
+
get?: never;
|
|
12901
|
+
put?: never;
|
|
12902
|
+
/**
|
|
12903
|
+
* Upload wallet logo
|
|
12904
|
+
* @description Uploads the company logo of the wallet and points `logo_url` at it. Replaces the legacy
|
|
12905
|
+
* `POST /wallets/{wallet_id}/logo`, which answered `{ fullPath }`: this endpoint answers with the
|
|
12906
|
+
* updated wallet — read the new URL from `data.logo_url`.
|
|
12907
|
+
*
|
|
12908
|
+
* The file is checked by its content: PNG, JPEG or WebP, at most 1 MB. SVG is refused.
|
|
12909
|
+
* The previous logo file is kept in storage; only the wallet's pointer changes.
|
|
12910
|
+
*
|
|
12911
|
+
* **Rate limit**: 10 uploads per hour per wallet; over it the endpoint answers `429 RATE_LIMIT_EXCEEDED`.
|
|
12912
|
+
*
|
|
12913
|
+
* **Authentication**: Bearer token with x-tenant-id header required
|
|
12914
|
+
*
|
|
12915
|
+
* **Access Control**: Owner or admin of the wallet; wallet KYC must be APPROVED
|
|
12916
|
+
*
|
|
12917
|
+
*/
|
|
12918
|
+
post: {
|
|
12919
|
+
parameters: {
|
|
12920
|
+
query?: never;
|
|
12921
|
+
header?: never;
|
|
12922
|
+
path: {
|
|
12923
|
+
/** @description The ID of the wallet */
|
|
12924
|
+
wallet_id: string;
|
|
12925
|
+
};
|
|
12926
|
+
cookie?: never;
|
|
12927
|
+
};
|
|
12928
|
+
requestBody: {
|
|
12929
|
+
content: {
|
|
12930
|
+
"multipart/form-data": {
|
|
12931
|
+
/**
|
|
12932
|
+
* Format: binary
|
|
12933
|
+
* @description PNG, JPEG or WebP image, at most 1 MB.
|
|
12934
|
+
*/
|
|
12935
|
+
file: string;
|
|
12936
|
+
};
|
|
12937
|
+
};
|
|
12938
|
+
};
|
|
12939
|
+
responses: {
|
|
12940
|
+
/** @description Logo uploaded. `data` is the updated wallet, the same shape `PATCH /frontend/wallets/{wallet_id}` returns. */
|
|
12941
|
+
200: {
|
|
12942
|
+
headers: {
|
|
12943
|
+
[name: string]: unknown;
|
|
12944
|
+
};
|
|
12945
|
+
content: {
|
|
12946
|
+
"application/json": {
|
|
12947
|
+
/** @example true */
|
|
12948
|
+
success: boolean;
|
|
12949
|
+
data: {
|
|
12950
|
+
/** Format: uuid */
|
|
12951
|
+
uuid: string;
|
|
12952
|
+
name: string | null;
|
|
12953
|
+
/** @description Computed label — wallet name, else KYC-derived (business_name / first+last), else "New account". Always present. */
|
|
12954
|
+
display_name: string;
|
|
12955
|
+
/**
|
|
12956
|
+
* @description Public URL of the uploaded logo.
|
|
12957
|
+
* @example https://api.example.com/storage/logo/0b5c2f4e-6a1d-4c8e-9f3a-2d7b1e5c8a90/7f1e2d3c-4b5a-4968-8776-5a4b3c2d1e0f.png
|
|
12958
|
+
*/
|
|
12959
|
+
logo_url: string;
|
|
12960
|
+
/** Format: uuid */
|
|
12961
|
+
tenant_id: string;
|
|
12962
|
+
/** Format: date-time */
|
|
12963
|
+
created_at: string;
|
|
12964
|
+
/** Format: uuid */
|
|
12965
|
+
kyc_entity_id: string | null;
|
|
12966
|
+
kyc_info: components["schemas"]["WalletKycInfo"] | null;
|
|
12967
|
+
};
|
|
12968
|
+
/** @example Wallet logo uploaded successfully */
|
|
12969
|
+
message: string;
|
|
12970
|
+
};
|
|
12971
|
+
};
|
|
12972
|
+
};
|
|
12973
|
+
/** @description No file, more than one file, a file over 1 MB, or content that is not a PNG, JPEG or WebP image
|
|
12974
|
+
* (`INVALID_WALLET_LOGO`).
|
|
12975
|
+
* */
|
|
12976
|
+
400: {
|
|
12977
|
+
headers: {
|
|
12978
|
+
[name: string]: unknown;
|
|
12979
|
+
};
|
|
12980
|
+
content?: never;
|
|
12981
|
+
};
|
|
12982
|
+
/** @description Caller is not owner/admin of the wallet, or wallet KYC not approved */
|
|
12983
|
+
403: {
|
|
12984
|
+
headers: {
|
|
12985
|
+
[name: string]: unknown;
|
|
12986
|
+
};
|
|
12987
|
+
content?: never;
|
|
12988
|
+
};
|
|
12989
|
+
/** @description Wallet not found */
|
|
12990
|
+
404: {
|
|
12991
|
+
headers: {
|
|
12992
|
+
[name: string]: unknown;
|
|
12993
|
+
};
|
|
12994
|
+
content?: never;
|
|
12995
|
+
};
|
|
12996
|
+
/** @description More than 10 logo uploads for this wallet within the last hour (`RATE_LIMIT_EXCEEDED`) */
|
|
12997
|
+
429: {
|
|
12998
|
+
headers: {
|
|
12999
|
+
[name: string]: unknown;
|
|
13000
|
+
};
|
|
13001
|
+
content?: never;
|
|
13002
|
+
};
|
|
13003
|
+
/** @description Server error */
|
|
13004
|
+
500: {
|
|
13005
|
+
headers: {
|
|
13006
|
+
[name: string]: unknown;
|
|
13007
|
+
};
|
|
13008
|
+
content?: never;
|
|
13009
|
+
};
|
|
13010
|
+
/** @description Logo upload is not configured on this server */
|
|
13011
|
+
503: {
|
|
13012
|
+
headers: {
|
|
13013
|
+
[name: string]: unknown;
|
|
13014
|
+
};
|
|
13015
|
+
content?: never;
|
|
13016
|
+
};
|
|
13017
|
+
};
|
|
13018
|
+
};
|
|
13019
|
+
/**
|
|
13020
|
+
* Reset wallet logo
|
|
13021
|
+
* @description Removes the company logo of the wallet: `logo_url` becomes `null`. Idempotent — resetting a wallet
|
|
13022
|
+
* without a logo succeeds the same way.
|
|
13023
|
+
*
|
|
13024
|
+
* **Authentication**: Bearer token with x-tenant-id header required
|
|
13025
|
+
*
|
|
13026
|
+
* **Access Control**: Owner or admin of the wallet; wallet KYC must be APPROVED
|
|
13027
|
+
*
|
|
13028
|
+
*/
|
|
13029
|
+
delete: {
|
|
13030
|
+
parameters: {
|
|
13031
|
+
query?: never;
|
|
13032
|
+
header?: never;
|
|
13033
|
+
path: {
|
|
13034
|
+
/** @description The ID of the wallet */
|
|
13035
|
+
wallet_id: string;
|
|
13036
|
+
};
|
|
13037
|
+
cookie?: never;
|
|
13038
|
+
};
|
|
13039
|
+
requestBody?: never;
|
|
13040
|
+
responses: {
|
|
13041
|
+
/** @description Logo removed. `data` is the updated wallet, the same shape `PATCH /frontend/wallets/{wallet_id}` returns. */
|
|
13042
|
+
200: {
|
|
13043
|
+
headers: {
|
|
13044
|
+
[name: string]: unknown;
|
|
13045
|
+
};
|
|
13046
|
+
content: {
|
|
13047
|
+
"application/json": {
|
|
13048
|
+
/** @example true */
|
|
13049
|
+
success: boolean;
|
|
13050
|
+
data: {
|
|
13051
|
+
/** Format: uuid */
|
|
13052
|
+
uuid: string;
|
|
13053
|
+
name: string | null;
|
|
13054
|
+
/** @description Computed label — wallet name, else KYC-derived (business_name / first+last), else "New account". Always present. */
|
|
13055
|
+
display_name: string;
|
|
13056
|
+
/**
|
|
13057
|
+
* @description Always `null` after a reset.
|
|
13058
|
+
* @example null
|
|
13059
|
+
*/
|
|
13060
|
+
logo_url: string | null;
|
|
13061
|
+
/** Format: uuid */
|
|
13062
|
+
tenant_id: string;
|
|
13063
|
+
/** Format: date-time */
|
|
13064
|
+
created_at: string;
|
|
13065
|
+
/** Format: uuid */
|
|
13066
|
+
kyc_entity_id: string | null;
|
|
13067
|
+
kyc_info: components["schemas"]["WalletKycInfo"] | null;
|
|
13068
|
+
};
|
|
13069
|
+
/** @example Wallet logo removed successfully */
|
|
13070
|
+
message: string;
|
|
13071
|
+
};
|
|
13072
|
+
};
|
|
13073
|
+
};
|
|
13074
|
+
/** @description Caller is not owner/admin of the wallet, or wallet KYC not approved */
|
|
13075
|
+
403: {
|
|
13076
|
+
headers: {
|
|
13077
|
+
[name: string]: unknown;
|
|
13078
|
+
};
|
|
13079
|
+
content?: never;
|
|
13080
|
+
};
|
|
13081
|
+
/** @description Wallet not found */
|
|
13082
|
+
404: {
|
|
13083
|
+
headers: {
|
|
13084
|
+
[name: string]: unknown;
|
|
13085
|
+
};
|
|
13086
|
+
content?: never;
|
|
13087
|
+
};
|
|
13088
|
+
/** @description Server error */
|
|
13089
|
+
500: {
|
|
13090
|
+
headers: {
|
|
13091
|
+
[name: string]: unknown;
|
|
13092
|
+
};
|
|
13093
|
+
content?: never;
|
|
13094
|
+
};
|
|
13095
|
+
};
|
|
13096
|
+
};
|
|
13097
|
+
options?: never;
|
|
13098
|
+
head?: never;
|
|
13099
|
+
patch?: never;
|
|
13100
|
+
trace?: never;
|
|
13101
|
+
};
|
|
12885
13102
|
"/frontend/wallets/{wallet_id}/balance": {
|
|
12886
13103
|
parameters: {
|
|
12887
13104
|
query?: never;
|
|
@@ -16288,6 +16505,11 @@ export interface components {
|
|
|
16288
16505
|
crypto_total: number;
|
|
16289
16506
|
pending_balance: number;
|
|
16290
16507
|
total_amount: number;
|
|
16508
|
+
/**
|
|
16509
|
+
* @description Whether the wallet may use the developer API (`/api/*` with a wallet-bound key). Off by default; only a platform owner switches it. While `false`, API keys of this wallet are refused with `403 WALLET_API_DISABLED`.
|
|
16510
|
+
* @example false
|
|
16511
|
+
*/
|
|
16512
|
+
api_access_enabled: boolean;
|
|
16291
16513
|
/**
|
|
16292
16514
|
* @description The caller's role for this wallet. Never `user` on this shape. (enum property replaced by openapi-typescript)
|
|
16293
16515
|
* @enum {string}
|
|
@@ -16301,7 +16523,7 @@ export interface components {
|
|
|
16301
16523
|
/** @description `true` exactly when `access_role` is `owner`. */
|
|
16302
16524
|
is_owner: boolean;
|
|
16303
16525
|
};
|
|
16304
|
-
/** @description Shell-only wallet read for the scoped `user` role: identity, KYC and display name. No main-account financials are ever included — `logo_url`, `balance`, `fiat_accounts`, `base_currency`, `fiat_total`, `crypto_total`, `pending_balance` and `
|
|
16526
|
+
/** @description Shell-only wallet read for the scoped `user` role: identity, KYC and display name. No main-account financials are ever included — `logo_url`, `balance`, `fiat_accounts`, `base_currency`, `fiat_total`, `crypto_total`, `pending_balance`, `total_amount` and `api_access_enabled` are absent, not null. Check `access_role` before reading balances. */
|
|
16305
16527
|
WalletDetailsScopedUser: {
|
|
16306
16528
|
/** Format: uuid */
|
|
16307
16529
|
uuid: string;
|
|
@@ -762,6 +762,21 @@ export declare namespace API {
|
|
|
762
762
|
export {};
|
|
763
763
|
}
|
|
764
764
|
}
|
|
765
|
+
namespace NotificationPreferences {
|
|
766
|
+
type NotificationPreferencesRoot = pathsV1Frontend['/frontend/notification-preferences'];
|
|
767
|
+
export type ChannelPreference = componentsV1Frontend['schemas']['NotificationPreference'];
|
|
768
|
+
export type CategoryPreference = componentsV1Frontend['schemas']['NotificationCategoryPreference'];
|
|
769
|
+
export type Channel = ChannelPreference['channel'];
|
|
770
|
+
export type Category = CategoryPreference['category'];
|
|
771
|
+
export namespace Get {
|
|
772
|
+
type Response = NotificationPreferencesRoot['get']['responses'][200]['content']['application/json'];
|
|
773
|
+
}
|
|
774
|
+
export namespace Update {
|
|
775
|
+
type Request = NotificationPreferencesRoot['put']['requestBody']['content']['application/json'];
|
|
776
|
+
type Response = NotificationPreferencesRoot['put']['responses'][200]['content']['application/json'];
|
|
777
|
+
}
|
|
778
|
+
export {};
|
|
779
|
+
}
|
|
765
780
|
namespace Issuing {
|
|
766
781
|
type CardsRoot = pathsV1Frontend['/frontend/issuing/cards'];
|
|
767
782
|
type CardRoot = pathsV1Frontend['/frontend/issuing/cards/{card_id}'];
|
|
@@ -2940,6 +2955,11 @@ export declare namespace API {
|
|
|
2940
2955
|
type Request = operations['UserController_updateMyUserData']['requestBody']['content']['application/json'];
|
|
2941
2956
|
type Response = operations['UserController_updateMyUserData']['responses']['200']['content']['application/json'];
|
|
2942
2957
|
}
|
|
2958
|
+
namespace Logo {
|
|
2959
|
+
namespace Upload {
|
|
2960
|
+
type Response = operations['UserController_uploadLogoFile']['responses']['200']['content']['application/json'];
|
|
2961
|
+
}
|
|
2962
|
+
}
|
|
2943
2963
|
}
|
|
2944
2964
|
namespace Verification {
|
|
2945
2965
|
type Flow = components['schemas']['UserVerificationFlow'];
|
|
@@ -2960,6 +2980,7 @@ export declare namespace API {
|
|
|
2960
2980
|
}
|
|
2961
2981
|
type WalletsRoot = pathsV1Frontend['/frontend/wallets'];
|
|
2962
2982
|
type WalletByIdRoot = pathsV1Frontend['/frontend/wallets/{wallet_id}'];
|
|
2983
|
+
type WalletLogoRoot = pathsV1Frontend['/frontend/wallets/{wallet_id}/logo'];
|
|
2963
2984
|
type WalletBalanceRoot = pathsV1Frontend['/frontend/wallets/{wallet_id}/balance'];
|
|
2964
2985
|
type WalletDashboardRoot = pathsV1Frontend['/frontend/wallets/{wallet_id}/dashboard'];
|
|
2965
2986
|
type WalletAddressesRoot = pathsV1Frontend['/frontend/wallets/{wallet_id}/addresses'];
|
|
@@ -2996,6 +3017,18 @@ export declare namespace API {
|
|
|
2996
3017
|
type Response = WalletByIdRoot['patch']['responses']['200']['content']['application/json'];
|
|
2997
3018
|
}
|
|
2998
3019
|
}
|
|
3020
|
+
export namespace Logo {
|
|
3021
|
+
namespace Upload {
|
|
3022
|
+
type Request = WalletLogoRoot['post']['parameters']['path'] & {
|
|
3023
|
+
file: File;
|
|
3024
|
+
};
|
|
3025
|
+
type Response = WalletLogoRoot['post']['responses']['200']['content']['application/json'];
|
|
3026
|
+
}
|
|
3027
|
+
namespace Delete {
|
|
3028
|
+
type Request = WalletLogoRoot['delete']['parameters']['path'];
|
|
3029
|
+
type Response = WalletLogoRoot['delete']['responses']['200']['content']['application/json'];
|
|
3030
|
+
}
|
|
3031
|
+
}
|
|
2999
3032
|
export namespace Balance {
|
|
3000
3033
|
type Request = WalletBalanceRoot['get']['parameters']['path'] & NonNullable<WalletBalanceRoot['get']['parameters']['query']>;
|
|
3001
3034
|
type Response = WalletBalanceRoot['get']['responses']['200']['content']['application/json'];
|
package/dist/api/user.d.ts
CHANGED
|
@@ -6,6 +6,10 @@ export declare const user: {
|
|
|
6
6
|
userData: {
|
|
7
7
|
get: (options?: GetUserDataOptions) => Promise<API.User.UserData.Get.Response>;
|
|
8
8
|
update: (data: API.User.UserData.Update.Request) => Promise<API.User.UserData.Update.Response>;
|
|
9
|
+
logo: {
|
|
10
|
+
upload: (file: File) => Promise<API.User.UserData.Logo.Upload.Response>;
|
|
11
|
+
delete: () => Promise<void>;
|
|
12
|
+
};
|
|
9
13
|
};
|
|
10
14
|
verification: {
|
|
11
15
|
init: (data: API.User.Verification.Init.Request) => Promise<API.User.Verification.Init.Response>;
|
package/dist/api/user.js
CHANGED
|
@@ -3,6 +3,16 @@ export const user = {
|
|
|
3
3
|
userData: {
|
|
4
4
|
get: (options) => apiClientV2.getRequest('/user/user-data', options?.bypassUnauthorizedHandler ? { context: { bypassUnauthorizedHandler: true } } : undefined),
|
|
5
5
|
update: (data) => apiClientV2.patchRequest('/user/user-data', { data }),
|
|
6
|
+
logo: {
|
|
7
|
+
upload: (file) => {
|
|
8
|
+
const formData = new FormData();
|
|
9
|
+
formData.append('file', file);
|
|
10
|
+
return apiClientV2.postRequest('/user/user-data/logo', {
|
|
11
|
+
data: formData,
|
|
12
|
+
});
|
|
13
|
+
},
|
|
14
|
+
delete: () => apiClientV2.deleteRequest('/user/user-data/logo'),
|
|
15
|
+
},
|
|
6
16
|
},
|
|
7
17
|
verification: {
|
|
8
18
|
// Starts (or moves up) the per-user Sumsub level for the requested step and returns the WebSDK
|
package/dist/api/wallets.d.ts
CHANGED
|
@@ -4,6 +4,10 @@ export declare const wallets: {
|
|
|
4
4
|
getAll: (params?: API.Wallets.WalletsList.Request) => Promise<API.Wallets.WalletsList.Response>;
|
|
5
5
|
getByUuid: ({ wallet_id, ...params }: API.Wallets.Wallet.GetByUuid.Request) => Promise<API.Wallets.Wallet.GetByUuid.Response>;
|
|
6
6
|
update: ({ wallet_id, ...data }: API.Wallets.Wallet.Update.Request) => Promise<API.Wallets.Wallet.Update.Response>;
|
|
7
|
+
logo: {
|
|
8
|
+
upload: ({ wallet_id, file }: API.Wallets.Logo.Upload.Request) => Promise<API.Wallets.Logo.Upload.Response>;
|
|
9
|
+
delete: ({ wallet_id }: API.Wallets.Logo.Delete.Request) => Promise<API.Wallets.Logo.Delete.Response>;
|
|
10
|
+
};
|
|
7
11
|
getBalance: ({ wallet_id, ...params }: API.Wallets.Balance.Request) => Promise<API.Wallets.Balance.Response>;
|
|
8
12
|
getDashboard: ({ wallet_id, ...params }: API.Wallets.Dashboard.Request) => Promise<API.Wallets.Dashboard.Response>;
|
|
9
13
|
addresses: {
|
package/dist/api/wallets.js
CHANGED
|
@@ -9,6 +9,18 @@ export const wallets = {
|
|
|
9
9
|
update: ({ wallet_id, ...data }) => apiClientV1Frontend.patchRequest(`/frontend/wallets/${wallet_id}`, {
|
|
10
10
|
data,
|
|
11
11
|
}),
|
|
12
|
+
// Company logo. Both calls answer with the updated wallet (read `data.logo_url`), unlike the legacy apiV2
|
|
13
|
+
// `POST /wallets/{wallet_id}/logo` and its `{ fullPath }`. Owner/admin only; the wallet's KYC must be APPROVED.
|
|
14
|
+
logo: {
|
|
15
|
+
upload: ({ wallet_id, file }) => {
|
|
16
|
+
const formData = new FormData();
|
|
17
|
+
formData.append('file', file);
|
|
18
|
+
return apiClientV1Frontend.postRequest(`/frontend/wallets/${wallet_id}/logo`, {
|
|
19
|
+
data: formData,
|
|
20
|
+
});
|
|
21
|
+
},
|
|
22
|
+
delete: ({ wallet_id }) => apiClientV1Frontend.deleteRequest(`/frontend/wallets/${wallet_id}/logo`),
|
|
23
|
+
},
|
|
12
24
|
getBalance: ({ wallet_id, ...params }) => apiClientV1Frontend.getRequest(`/frontend/wallets/${wallet_id}/balance`, { params }),
|
|
13
25
|
getDashboard: ({ wallet_id, ...params }) => apiClientV1Frontend.getRequest(`/frontend/wallets/${wallet_id}/dashboard`, { params }),
|
|
14
26
|
addresses: {
|
|
@@ -47,6 +47,10 @@ export const createApiClient = ({ baseURL, isBearerToken, tenantId }) => {
|
|
|
47
47
|
};
|
|
48
48
|
});
|
|
49
49
|
instance.interceptors.response.use((response) => response, (error) => {
|
|
50
|
+
// A request the caller aborted (e.g. `useOrderCalc` superseding a stale calc) is not a failure.
|
|
51
|
+
if (axios.isCancel(error)) {
|
|
52
|
+
return Promise.reject(error);
|
|
53
|
+
}
|
|
50
54
|
if (typeof window === 'undefined') {
|
|
51
55
|
return Promise.reject(error);
|
|
52
56
|
}
|