wallaby-cash 2.3.0-alpha.2 → 2.3.2
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/README.md +69 -0
- package/dist/generated/api.d.ts +1369 -2674
- package/dist/helpers/base64.base.d.ts +12 -0
- package/dist/helpers/base64.d.ts +6 -0
- package/dist/helpers/base64.native.d.ts +6 -0
- package/dist/helpers/normalize-storage-keys.d.ts +8 -0
- package/dist/index.cjs.js +1049 -605
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.esm.js +1049 -605
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1212 -645
- package/dist/index.js.map +1 -1
- package/dist/lib/auth/auth.service.d.ts +1 -1
- package/dist/lib/auth/authenticator.d.ts +3 -3
- package/dist/lib/auth/authenticator.native.d.ts +36 -0
- package/dist/lib/auth/passkey.model.d.ts +10 -3
- package/dist/lib/auth/passkey.service.base.d.ts +76 -0
- package/dist/lib/auth/passkey.service.d.ts +1 -76
- package/dist/lib/auth/passkey.service.native.d.ts +4 -0
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/swap/index.d.ts +36 -0
- package/dist/lib/system/index.d.ts +14 -4
- package/dist/lib/transactions/index.d.ts +4 -2
- package/dist/lib/utils/constants.d.ts +1 -1
- package/dist/lib/wallet/wallet-data.service.d.ts +8 -6
- package/dist/package.json +23 -12
- package/dist/routes/index.d.ts +1 -0
- package/dist/routes/swap.d.ts +24 -0
- package/dist/types/auth.d.ts +152 -4
- package/dist/types/common.d.ts +3 -0
- package/dist/types/error-response-codes.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/swap.d.ts +95 -0
- package/dist/types/transactions.d.ts +1 -0
- package/dist/types/wallet.d.ts +2 -4
- package/package.json +23 -12
package/dist/index.js
CHANGED
|
@@ -2,8 +2,9 @@ import { v4 } from 'uuid';
|
|
|
2
2
|
import log from 'loglevel';
|
|
3
3
|
import { AES, enc } from 'crypto-js';
|
|
4
4
|
import { jwtDecode } from 'jwt-decode';
|
|
5
|
+
import * as NativeWebAuthn from 'react-native-passkey';
|
|
5
6
|
import { omit } from 'lodash';
|
|
6
|
-
import
|
|
7
|
+
import { toUint8Array, atob } from 'js-base64';
|
|
7
8
|
|
|
8
9
|
/******************************************************************************
|
|
9
10
|
Copyright (c) Microsoft Corporation.
|
|
@@ -362,6 +363,7 @@ var ErrorResponseCodes;
|
|
|
362
363
|
ErrorResponseCodes["sdk_missing_parameter"] = "sdk_missing_parameter";
|
|
363
364
|
ErrorResponseCodes["sdk_invalid_parameter"] = "sdk_invalid_parameter";
|
|
364
365
|
ErrorResponseCodes["sdk_wrong_password"] = "sdk_wrong_password";
|
|
366
|
+
ErrorResponseCodes["sdk_no_valid_seed_option"] = "sdk_no_valid_seed_option";
|
|
365
367
|
// passkey errors
|
|
366
368
|
ErrorResponseCodes["sdk_passkey_prf_not_available"] = "sdk_passkey_prf_not_available";
|
|
367
369
|
ErrorResponseCodes["sdk_passkey_challenge_unavailable"] = "sdk_passkey_challenge_unavailable";
|
|
@@ -656,7 +658,7 @@ Item.prototype.run = function () {
|
|
|
656
658
|
var title = 'browser';
|
|
657
659
|
var platform = 'browser';
|
|
658
660
|
var browser = true;
|
|
659
|
-
var env = {};
|
|
661
|
+
var env$1 = {};
|
|
660
662
|
var argv = [];
|
|
661
663
|
var version = ''; // empty string to avoid regexp issues
|
|
662
664
|
var versions = {};
|
|
@@ -720,7 +722,7 @@ var browser$1 = {
|
|
|
720
722
|
nextTick: nextTick,
|
|
721
723
|
title: title,
|
|
722
724
|
browser: browser,
|
|
723
|
-
env: env,
|
|
725
|
+
env: env$1,
|
|
724
726
|
argv: argv,
|
|
725
727
|
version: version,
|
|
726
728
|
versions: versions,
|
|
@@ -768,14 +770,31 @@ const MASTER_ENCRYPTION_KEY = '9fa9d3f3c77c20d3a50a08e5299644be29f6e6206ef3479fe
|
|
|
768
770
|
In particular, RS256 is necessary for compatibility with Microsoft Windows platform authenticators.
|
|
769
771
|
ES256 is a widely supported algorithm and is compatible with most other platform authenticators and roaming authenticators.
|
|
770
772
|
Therefore a Relying Party that uses an algorithm identifier list that omits either of those values will see registration failures when users attempt to use incompatible authenticators.
|
|
771
|
-
|
|
773
|
+
|
|
772
774
|
https://chromium.googlesource.com/chromium/src/+/main/content/browser/webauth/pub_key_cred_params.md
|
|
773
775
|
*/
|
|
774
776
|
[
|
|
775
777
|
{ type: 'public-key', alg: PublicKeyCredentialAlgorithm.RS256 },
|
|
776
778
|
{ type: 'public-key', alg: PublicKeyCredentialAlgorithm.ES256 },
|
|
777
779
|
];
|
|
778
|
-
const
|
|
780
|
+
const isWeb = typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
781
|
+
const env = {
|
|
782
|
+
env: browser$1.env.NODE_ENV,
|
|
783
|
+
platform: 'web',
|
|
784
|
+
isNative: false,
|
|
785
|
+
isServer: false,
|
|
786
|
+
isWeb,
|
|
787
|
+
};
|
|
788
|
+
const currentPackageVersion = "2.3.2" ;
|
|
789
|
+
|
|
790
|
+
/**
|
|
791
|
+
* Storage keys adapter for Storage interface across different platforms.
|
|
792
|
+
*
|
|
793
|
+
* This sdk uses keys like "wsdk:version:key-name" but `SecureStore` doesn't allow colons in key names,
|
|
794
|
+
* Valid SecureStore key characters: alphanumeric, ".", "-", "_"
|
|
795
|
+
*
|
|
796
|
+
*/
|
|
797
|
+
const normalizeKey = (key) => key.replace(/:/g, '_');
|
|
779
798
|
|
|
780
799
|
const crypto = typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined;
|
|
781
800
|
|
|
@@ -5037,6 +5056,9 @@ class StorageService {
|
|
|
5037
5056
|
else {
|
|
5038
5057
|
storageKey = `wsdk:v2:${this.shortenedEnv}:${key}:${this.userId}`;
|
|
5039
5058
|
}
|
|
5059
|
+
if (!isWeb) {
|
|
5060
|
+
storageKey = normalizeKey(storageKey);
|
|
5061
|
+
}
|
|
5040
5062
|
const item = await this.getItem(storageKey);
|
|
5041
5063
|
if (!item) {
|
|
5042
5064
|
logger.debug(`(404): Item with key ${storageKey} was not found in storage.`);
|
|
@@ -5070,6 +5092,9 @@ class StorageService {
|
|
|
5070
5092
|
else {
|
|
5071
5093
|
storageKey = `wsdk:v2:${this.shortenedEnv}:${key}:${this.userId}`;
|
|
5072
5094
|
}
|
|
5095
|
+
if (!isWeb) {
|
|
5096
|
+
storageKey = normalizeKey(storageKey);
|
|
5097
|
+
}
|
|
5073
5098
|
let valueToStore;
|
|
5074
5099
|
if (this._keysProtectedByMasterKey.includes(key)) {
|
|
5075
5100
|
const wrappedByMasterKey = this.cipher.encryptWithMasterKey({ data: value });
|
|
@@ -5094,6 +5119,9 @@ class StorageService {
|
|
|
5094
5119
|
else {
|
|
5095
5120
|
storageKey = `wsdk:v2:${this.shortenedEnv}:${key}:${this.userId}`;
|
|
5096
5121
|
}
|
|
5122
|
+
if (!isWeb) {
|
|
5123
|
+
storageKey = normalizeKey(storageKey);
|
|
5124
|
+
}
|
|
5097
5125
|
return await this.removeItem(storageKey);
|
|
5098
5126
|
}
|
|
5099
5127
|
setItem(key, value) {
|
|
@@ -5591,7 +5619,7 @@ var ContentType;
|
|
|
5591
5619
|
})(ContentType || (ContentType = {}));
|
|
5592
5620
|
class HttpClient {
|
|
5593
5621
|
constructor(apiConfig = {}) {
|
|
5594
|
-
this.baseUrl = "
|
|
5622
|
+
this.baseUrl = "";
|
|
5595
5623
|
this.securityData = null;
|
|
5596
5624
|
this.abortControllers = new Map();
|
|
5597
5625
|
this.customFetch = (...fetchParams) => fetch(...fetchParams);
|
|
@@ -5724,15 +5752,31 @@ class HttpClient {
|
|
|
5724
5752
|
}
|
|
5725
5753
|
}
|
|
5726
5754
|
/**
|
|
5727
|
-
* @title
|
|
5728
|
-
* @version 1.0
|
|
5729
|
-
* @baseUrl https://staging-testnet.wallaby.cash
|
|
5755
|
+
* @title Wallaby API Service
|
|
5756
|
+
* @version 1.0.0
|
|
5730
5757
|
* @contact
|
|
5731
5758
|
*
|
|
5732
|
-
*
|
|
5759
|
+
* NCW Wallets Service API Documentation
|
|
5733
5760
|
*/
|
|
5734
5761
|
class Api {
|
|
5735
5762
|
constructor(http) {
|
|
5763
|
+
/**
|
|
5764
|
+
* No description
|
|
5765
|
+
*
|
|
5766
|
+
* @name DashboardControllerGetDashboardData
|
|
5767
|
+
* @summary Create new merchant. This endpoint is only available for super admin and republic admin
|
|
5768
|
+
* @request GET:/dashboard
|
|
5769
|
+
* @secure
|
|
5770
|
+
*/
|
|
5771
|
+
this.dashboardControllerGetDashboardData = (params = {}) => this.http.request(Object.assign({ path: `/dashboard`, method: "GET", secure: true }, params));
|
|
5772
|
+
/**
|
|
5773
|
+
* No description
|
|
5774
|
+
*
|
|
5775
|
+
* @name GetActivitiees
|
|
5776
|
+
* @summary Get all activities. This endpoint is only available for super admin and republic admin
|
|
5777
|
+
* @request GET:/users-activities
|
|
5778
|
+
*/
|
|
5779
|
+
this.getActivitiees = (query, params = {}) => this.http.request(Object.assign({ path: `/users-activities`, method: "GET", query: query }, params));
|
|
5736
5780
|
this.health = {
|
|
5737
5781
|
/**
|
|
5738
5782
|
* No description
|
|
@@ -5741,9 +5785,8 @@ class Api {
|
|
|
5741
5785
|
* @name GetHello
|
|
5742
5786
|
* @summary Health Check API
|
|
5743
5787
|
* @request GET:/
|
|
5744
|
-
* @secure
|
|
5745
5788
|
*/
|
|
5746
|
-
getHello: (params = {}) => this.http.request(Object.assign({ path: `/`, method: "GET"
|
|
5789
|
+
getHello: (params = {}) => this.http.request(Object.assign({ path: `/`, method: "GET" }, params)),
|
|
5747
5790
|
/**
|
|
5748
5791
|
* No description
|
|
5749
5792
|
*
|
|
@@ -5751,9 +5794,8 @@ class Api {
|
|
|
5751
5794
|
* @name GetHealthCheck
|
|
5752
5795
|
* @summary Service API status check
|
|
5753
5796
|
* @request GET:/healthz
|
|
5754
|
-
* @secure
|
|
5755
5797
|
*/
|
|
5756
|
-
getHealthCheck: (params = {}) => this.http.request(Object.assign({ path: `/healthz`, method: "GET"
|
|
5798
|
+
getHealthCheck: (params = {}) => this.http.request(Object.assign({ path: `/healthz`, method: "GET" }, params)),
|
|
5757
5799
|
};
|
|
5758
5800
|
this.auth = {
|
|
5759
5801
|
/**
|
|
@@ -5762,91 +5804,86 @@ class Api {
|
|
|
5762
5804
|
* @tags Auth
|
|
5763
5805
|
* @name GenerateExternalSignatureMessage
|
|
5764
5806
|
* @summary The returned message will be used for sign up and sign in signature
|
|
5765
|
-
* @request POST:/
|
|
5766
|
-
* @secure
|
|
5807
|
+
* @request POST:/auth/signature-message/external
|
|
5767
5808
|
*/
|
|
5768
|
-
generateExternalSignatureMessage: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
5809
|
+
generateExternalSignatureMessage: (data, params = {}) => this.http.request(Object.assign({ path: `/auth/signature-message/external`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
5769
5810
|
/**
|
|
5770
5811
|
* No description
|
|
5771
5812
|
*
|
|
5772
5813
|
* @tags Auth
|
|
5773
5814
|
* @name GenerateSignatureMessage
|
|
5774
5815
|
* @summary The returned message will be used for sign up and sign in signature
|
|
5775
|
-
* @request POST:/
|
|
5776
|
-
* @secure
|
|
5816
|
+
* @request POST:/auth/signature-message
|
|
5777
5817
|
*/
|
|
5778
|
-
generateSignatureMessage: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
5818
|
+
generateSignatureMessage: (data, params = {}) => this.http.request(Object.assign({ path: `/auth/signature-message`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
5779
5819
|
/**
|
|
5780
5820
|
* No description
|
|
5781
5821
|
*
|
|
5782
5822
|
* @tags Auth
|
|
5783
5823
|
* @name SignUp
|
|
5784
5824
|
* @summary Users will be able to sign up by providing a signature and message. Message to sign can be retrieved from /api/auth/signature-message
|
|
5785
|
-
* @request POST:/
|
|
5786
|
-
* @secure
|
|
5825
|
+
* @request POST:/auth/sign-up
|
|
5787
5826
|
*/
|
|
5788
|
-
signUp: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
5827
|
+
signUp: (data, params = {}) => this.http.request(Object.assign({ path: `/auth/sign-up`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
5789
5828
|
/**
|
|
5790
5829
|
* No description
|
|
5791
5830
|
*
|
|
5792
5831
|
* @tags Auth
|
|
5793
5832
|
* @name SignUpExternal
|
|
5794
5833
|
* @summary Users will be able to sign up by providing a signature and message. Message to sign can be retrieved from /api/auth/signature-message
|
|
5795
|
-
* @request POST:/
|
|
5796
|
-
* @secure
|
|
5834
|
+
* @request POST:/auth/sign-up/external
|
|
5797
5835
|
*/
|
|
5798
|
-
signUpExternal: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
5836
|
+
signUpExternal: (data, params = {}) => this.http.request(Object.assign({ path: `/auth/sign-up/external`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
5799
5837
|
/**
|
|
5800
5838
|
* No description
|
|
5801
5839
|
*
|
|
5802
5840
|
* @tags Auth
|
|
5803
5841
|
* @name SignIn
|
|
5804
5842
|
* @summary Users will be able to sign up by providing a signature and message. Use the same pair keys used on sign up
|
|
5805
|
-
* @request POST:/
|
|
5806
|
-
* @secure
|
|
5843
|
+
* @request POST:/auth/sign-in
|
|
5807
5844
|
*/
|
|
5808
|
-
signIn: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
5845
|
+
signIn: (data, params = {}) => this.http.request(Object.assign({ path: `/auth/sign-in`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
5809
5846
|
/**
|
|
5810
5847
|
* No description
|
|
5811
5848
|
*
|
|
5812
5849
|
* @tags Auth
|
|
5813
5850
|
* @name RefreshAccessToken
|
|
5814
5851
|
* @summary Users will be able to sign up by providing a signature and message. Use the same pair keys used on sign up
|
|
5815
|
-
* @request POST:/
|
|
5852
|
+
* @request POST:/auth/refresh-access-token
|
|
5816
5853
|
* @deprecated
|
|
5817
5854
|
* @secure
|
|
5818
5855
|
*/
|
|
5819
|
-
refreshAccessToken: (params = {}) => this.http.request(Object.assign({ path: `/
|
|
5856
|
+
refreshAccessToken: (params = {}) => this.http.request(Object.assign({ path: `/auth/refresh-access-token`, method: "POST", secure: true, format: "json" }, params)),
|
|
5820
5857
|
/**
|
|
5821
5858
|
* No description
|
|
5822
5859
|
*
|
|
5823
5860
|
* @tags Auth
|
|
5824
5861
|
* @name ChangeAuthPublicKey
|
|
5825
5862
|
* @summary Change user authentication public key
|
|
5826
|
-
* @request PUT:/
|
|
5863
|
+
* @request PUT:/auth/client-auth-pubkey
|
|
5827
5864
|
* @secure
|
|
5828
5865
|
*/
|
|
5829
|
-
changeAuthPublicKey: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
5866
|
+
changeAuthPublicKey: (data, params = {}) => this.http.request(Object.assign({ path: `/auth/client-auth-pubkey`, method: "PUT", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
5830
5867
|
/**
|
|
5831
5868
|
* No description
|
|
5832
5869
|
*
|
|
5833
5870
|
* @tags Auth
|
|
5834
5871
|
* @name GetWallabyAuthPubKey
|
|
5835
5872
|
* @summary Get user public key
|
|
5836
|
-
* @request POST:/
|
|
5873
|
+
* @request POST:/auth/wallaby-auth-pubkey
|
|
5837
5874
|
* @secure
|
|
5838
5875
|
*/
|
|
5839
|
-
getWallabyAuthPubKey: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
5876
|
+
getWallabyAuthPubKey: (data, params = {}) => this.http.request(Object.assign({ path: `/auth/wallaby-auth-pubkey`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
5840
5877
|
/**
|
|
5841
5878
|
* No description
|
|
5842
5879
|
*
|
|
5843
5880
|
* @tags Auth
|
|
5844
5881
|
* @name GetPasskeyCredentials
|
|
5845
5882
|
* @summary Get user passkey credentials
|
|
5846
|
-
* @request GET:/
|
|
5883
|
+
* @request GET:/auth/passkey-credentials
|
|
5847
5884
|
* @secure
|
|
5848
5885
|
*/
|
|
5849
|
-
getPasskeyCredentials: (params = {}) => this.http.request(Object.assign({ path: `/
|
|
5886
|
+
getPasskeyCredentials: (params = {}) => this.http.request(Object.assign({ path: `/auth/passkey-credentials`, method: "GET", secure: true, format: "json" }, params)),
|
|
5850
5887
|
};
|
|
5851
5888
|
this.chains = {
|
|
5852
5889
|
/**
|
|
@@ -5855,33 +5892,31 @@ class Api {
|
|
|
5855
5892
|
* @tags Chains
|
|
5856
5893
|
* @name GetAllChains
|
|
5857
5894
|
* @summary Get all supported chains
|
|
5858
|
-
* @request GET:/
|
|
5895
|
+
* @request GET:/chains
|
|
5859
5896
|
* @secure
|
|
5860
5897
|
*/
|
|
5861
|
-
getAllChains: (query, params = {}) => this.http.request(Object.assign({ path: `/
|
|
5898
|
+
getAllChains: (query, params = {}) => this.http.request(Object.assign({ path: `/chains`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
5862
5899
|
/**
|
|
5863
5900
|
* No description
|
|
5864
5901
|
*
|
|
5865
5902
|
* @tags Chains
|
|
5866
5903
|
* @name CreateChain
|
|
5867
5904
|
* @summary Create new chain. This endpoint is only available for super admin and republic admin
|
|
5868
|
-
* @request POST:/
|
|
5869
|
-
* @secure
|
|
5905
|
+
* @request POST:/chains
|
|
5870
5906
|
*/
|
|
5871
|
-
createChain: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
5907
|
+
createChain: (data, params = {}) => this.http.request(Object.assign({ path: `/chains`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
5872
5908
|
/**
|
|
5873
5909
|
* No description
|
|
5874
5910
|
*
|
|
5875
5911
|
* @tags Chains
|
|
5876
5912
|
* @name UpdateChain
|
|
5877
5913
|
* @summary Update the chain public data
|
|
5878
|
-
* @request PUT:/
|
|
5879
|
-
* @secure
|
|
5914
|
+
* @request PUT:/chains/{chainId}
|
|
5880
5915
|
*/
|
|
5881
5916
|
updateChain: (_a, data, params) => {
|
|
5882
5917
|
var { chainId } = _a; __rest(_a, ["chainId"]);
|
|
5883
5918
|
if (params === void 0) { params = {}; }
|
|
5884
|
-
return this.http.request(Object.assign({ path: `/
|
|
5919
|
+
return this.http.request(Object.assign({ path: `/chains/${chainId}`, method: "PUT", body: data, type: ContentType.Json, format: "json" }, params));
|
|
5885
5920
|
},
|
|
5886
5921
|
};
|
|
5887
5922
|
this.assets = {
|
|
@@ -5891,33 +5926,33 @@ class Api {
|
|
|
5891
5926
|
* @tags Assets
|
|
5892
5927
|
* @name GetAssetsConfigurations
|
|
5893
5928
|
* @summary Get all supported assets configuration that can be imported into a merchant or a user wallet
|
|
5894
|
-
* @request GET:/
|
|
5929
|
+
* @request GET:/assets/configurations
|
|
5895
5930
|
* @secure
|
|
5896
5931
|
*/
|
|
5897
|
-
getAssetsConfigurations: (query, params = {}) => this.http.request(Object.assign({ path: `/
|
|
5932
|
+
getAssetsConfigurations: (query, params = {}) => this.http.request(Object.assign({ path: `/assets/configurations`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
5898
5933
|
/**
|
|
5899
5934
|
* No description
|
|
5900
5935
|
*
|
|
5901
5936
|
* @tags Assets
|
|
5902
5937
|
* @name CreateAssetConfig
|
|
5903
5938
|
* @summary Create new asset configuration that can be imported later into a merchant or a user wallet. This endpoint is only available for super admin and republic admin
|
|
5904
|
-
* @request POST:/
|
|
5939
|
+
* @request POST:/assets/configurations
|
|
5905
5940
|
* @secure
|
|
5906
5941
|
*/
|
|
5907
|
-
createAssetConfig: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
5942
|
+
createAssetConfig: (data, params = {}) => this.http.request(Object.assign({ path: `/assets/configurations`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
5908
5943
|
/**
|
|
5909
5944
|
* No description
|
|
5910
5945
|
*
|
|
5911
5946
|
* @tags Assets
|
|
5912
5947
|
* @name UpdateAssetConfig
|
|
5913
5948
|
* @summary Update asset configuration that can be imported later into a merchant or a user wallet. This endpoint is only available for owner, super admin and republic admin
|
|
5914
|
-
* @request PUT:/
|
|
5949
|
+
* @request PUT:/assets/configurations/{assetConfigId}
|
|
5915
5950
|
* @secure
|
|
5916
5951
|
*/
|
|
5917
5952
|
updateAssetConfig: (_a, data, params) => {
|
|
5918
5953
|
var { assetConfigId } = _a; __rest(_a, ["assetConfigId"]);
|
|
5919
5954
|
if (params === void 0) { params = {}; }
|
|
5920
|
-
return this.http.request(Object.assign({ path: `/
|
|
5955
|
+
return this.http.request(Object.assign({ path: `/assets/configurations/${assetConfigId}`, method: "PUT", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
|
|
5921
5956
|
},
|
|
5922
5957
|
/**
|
|
5923
5958
|
* No description
|
|
@@ -5925,13 +5960,13 @@ class Api {
|
|
|
5925
5960
|
* @tags Assets
|
|
5926
5961
|
* @name VerifyAsset
|
|
5927
5962
|
* @summary Verify asset configuration details.
|
|
5928
|
-
* @request POST:/
|
|
5963
|
+
* @request POST:/assets/configurations/{assetConfigId}/verify
|
|
5929
5964
|
* @secure
|
|
5930
5965
|
*/
|
|
5931
5966
|
verifyAsset: (_a, params) => {
|
|
5932
5967
|
var { assetConfigId } = _a; __rest(_a, ["assetConfigId"]);
|
|
5933
5968
|
if (params === void 0) { params = {}; }
|
|
5934
|
-
return this.http.request(Object.assign({ path: `/
|
|
5969
|
+
return this.http.request(Object.assign({ path: `/assets/configurations/${assetConfigId}/verify`, method: "POST", secure: true, format: "json" }, params));
|
|
5935
5970
|
},
|
|
5936
5971
|
/**
|
|
5937
5972
|
* No description
|
|
@@ -5939,13 +5974,13 @@ class Api {
|
|
|
5939
5974
|
* @tags Assets
|
|
5940
5975
|
* @name UnverifyAsset
|
|
5941
5976
|
* @summary Unverify asset configuration
|
|
5942
|
-
* @request DELETE:/
|
|
5977
|
+
* @request DELETE:/assets/configurations/{assetConfigId}/unverify
|
|
5943
5978
|
* @secure
|
|
5944
5979
|
*/
|
|
5945
5980
|
unverifyAsset: (_a, params) => {
|
|
5946
5981
|
var { assetConfigId } = _a; __rest(_a, ["assetConfigId"]);
|
|
5947
5982
|
if (params === void 0) { params = {}; }
|
|
5948
|
-
return this.http.request(Object.assign({ path: `/
|
|
5983
|
+
return this.http.request(Object.assign({ path: `/assets/configurations/${assetConfigId}/unverify`, method: "DELETE", secure: true, format: "json" }, params));
|
|
5949
5984
|
},
|
|
5950
5985
|
/**
|
|
5951
5986
|
* No description
|
|
@@ -5953,13 +5988,13 @@ class Api {
|
|
|
5953
5988
|
* @tags Assets
|
|
5954
5989
|
* @name ArchiveAsset
|
|
5955
5990
|
* @summary Archive an asset configuration
|
|
5956
|
-
* @request POST:/
|
|
5991
|
+
* @request POST:/assets/configurations/{assetConfigId}/archive
|
|
5957
5992
|
* @secure
|
|
5958
5993
|
*/
|
|
5959
5994
|
archiveAsset: (_a, params) => {
|
|
5960
5995
|
var { assetConfigId } = _a; __rest(_a, ["assetConfigId"]);
|
|
5961
5996
|
if (params === void 0) { params = {}; }
|
|
5962
|
-
return this.http.request(Object.assign({ path: `/
|
|
5997
|
+
return this.http.request(Object.assign({ path: `/assets/configurations/${assetConfigId}/archive`, method: "POST", secure: true, format: "json" }, params));
|
|
5963
5998
|
},
|
|
5964
5999
|
/**
|
|
5965
6000
|
* No description
|
|
@@ -5967,13 +6002,13 @@ class Api {
|
|
|
5967
6002
|
* @tags Assets
|
|
5968
6003
|
* @name UnarchiveAsset
|
|
5969
6004
|
* @summary Archive an asset configuration
|
|
5970
|
-
* @request POST:/
|
|
6005
|
+
* @request POST:/assets/configurations/{assetConfigId}/unarchive
|
|
5971
6006
|
* @secure
|
|
5972
6007
|
*/
|
|
5973
6008
|
unarchiveAsset: (_a, params) => {
|
|
5974
6009
|
var { assetConfigId } = _a; __rest(_a, ["assetConfigId"]);
|
|
5975
6010
|
if (params === void 0) { params = {}; }
|
|
5976
|
-
return this.http.request(Object.assign({ path: `/
|
|
6011
|
+
return this.http.request(Object.assign({ path: `/assets/configurations/${assetConfigId}/unarchive`, method: "POST", secure: true, format: "json" }, params));
|
|
5977
6012
|
},
|
|
5978
6013
|
};
|
|
5979
6014
|
this.merchants = {
|
|
@@ -5983,33 +6018,32 @@ class Api {
|
|
|
5983
6018
|
* @tags Merchants
|
|
5984
6019
|
* @name GetAllMerchants
|
|
5985
6020
|
* @summary Get all merchants
|
|
5986
|
-
* @request GET:/
|
|
5987
|
-
* @secure
|
|
6021
|
+
* @request GET:/merchants
|
|
5988
6022
|
*/
|
|
5989
|
-
getAllMerchants: (query, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6023
|
+
getAllMerchants: (query, params = {}) => this.http.request(Object.assign({ path: `/merchants`, method: "GET", query: query, format: "json" }, params)),
|
|
5990
6024
|
/**
|
|
5991
6025
|
* No description
|
|
5992
6026
|
*
|
|
5993
6027
|
* @tags Merchants
|
|
5994
6028
|
* @name CreateMerchant
|
|
5995
6029
|
* @summary Create new merchant. This endpoint is only available for super admin and republic admin
|
|
5996
|
-
* @request POST:/
|
|
6030
|
+
* @request POST:/merchants
|
|
5997
6031
|
* @secure
|
|
5998
6032
|
*/
|
|
5999
|
-
createMerchant: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6033
|
+
createMerchant: (data, params = {}) => this.http.request(Object.assign({ path: `/merchants`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6000
6034
|
/**
|
|
6001
6035
|
* No description
|
|
6002
6036
|
*
|
|
6003
6037
|
* @tags Merchants
|
|
6004
6038
|
* @name UpdateMerchant
|
|
6005
6039
|
* @summary Update merchant. This endpoint is only available for super admin and republic admin
|
|
6006
|
-
* @request PUT:/
|
|
6040
|
+
* @request PUT:/merchants/{merchantId}
|
|
6007
6041
|
* @secure
|
|
6008
6042
|
*/
|
|
6009
6043
|
updateMerchant: (_a, data, params) => {
|
|
6010
6044
|
var { merchantId } = _a; __rest(_a, ["merchantId"]);
|
|
6011
6045
|
if (params === void 0) { params = {}; }
|
|
6012
|
-
return this.http.request(Object.assign({ path: `/
|
|
6046
|
+
return this.http.request(Object.assign({ path: `/merchants/${merchantId}`, method: "PUT", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
|
|
6013
6047
|
},
|
|
6014
6048
|
/**
|
|
6015
6049
|
* No description
|
|
@@ -6017,13 +6051,12 @@ class Api {
|
|
|
6017
6051
|
* @tags Merchants
|
|
6018
6052
|
* @name GetOneMerchant
|
|
6019
6053
|
* @summary Get one merchant by id with counts
|
|
6020
|
-
* @request GET:/
|
|
6021
|
-
* @secure
|
|
6054
|
+
* @request GET:/merchants/{merchantId}
|
|
6022
6055
|
*/
|
|
6023
6056
|
getOneMerchant: (_a, params) => {
|
|
6024
6057
|
var { merchantId } = _a; __rest(_a, ["merchantId"]);
|
|
6025
6058
|
if (params === void 0) { params = {}; }
|
|
6026
|
-
return this.http.request(Object.assign({ path: `/
|
|
6059
|
+
return this.http.request(Object.assign({ path: `/merchants/${merchantId}`, method: "GET", format: "json" }, params));
|
|
6027
6060
|
},
|
|
6028
6061
|
/**
|
|
6029
6062
|
* No description
|
|
@@ -6031,13 +6064,12 @@ class Api {
|
|
|
6031
6064
|
* @tags Merchants
|
|
6032
6065
|
* @name GetMerchantAssets
|
|
6033
6066
|
* @summary Get merchant assets by merchant id
|
|
6034
|
-
* @request GET:/
|
|
6035
|
-
* @secure
|
|
6067
|
+
* @request GET:/merchants/{merchantId}/assets
|
|
6036
6068
|
*/
|
|
6037
6069
|
getMerchantAssets: (_a, params) => {
|
|
6038
6070
|
var { merchantId } = _a, query = __rest(_a, ["merchantId"]);
|
|
6039
6071
|
if (params === void 0) { params = {}; }
|
|
6040
|
-
return this.http.request(Object.assign({ path: `/
|
|
6072
|
+
return this.http.request(Object.assign({ path: `/merchants/${merchantId}/assets`, method: "GET", query: query, format: "json" }, params));
|
|
6041
6073
|
},
|
|
6042
6074
|
/**
|
|
6043
6075
|
* No description
|
|
@@ -6045,13 +6077,13 @@ class Api {
|
|
|
6045
6077
|
* @tags Merchants
|
|
6046
6078
|
* @name GetMerchantUsers
|
|
6047
6079
|
* @summary Get merchant users by merchant id
|
|
6048
|
-
* @request GET:/
|
|
6080
|
+
* @request GET:/merchants/{merchantId}/users
|
|
6049
6081
|
* @secure
|
|
6050
6082
|
*/
|
|
6051
6083
|
getMerchantUsers: (_a, params) => {
|
|
6052
6084
|
var { merchantId } = _a, query = __rest(_a, ["merchantId"]);
|
|
6053
6085
|
if (params === void 0) { params = {}; }
|
|
6054
|
-
return this.http.request(Object.assign({ path: `/
|
|
6086
|
+
return this.http.request(Object.assign({ path: `/merchants/${merchantId}/users`, method: "GET", query: query, secure: true, format: "json" }, params));
|
|
6055
6087
|
},
|
|
6056
6088
|
/**
|
|
6057
6089
|
* No description
|
|
@@ -6059,13 +6091,13 @@ class Api {
|
|
|
6059
6091
|
* @tags Merchants
|
|
6060
6092
|
* @name GetMerchantAdmins
|
|
6061
6093
|
* @summary Get merchant admins by merchant id
|
|
6062
|
-
* @request GET:/
|
|
6094
|
+
* @request GET:/merchants/{merchantId}/admins
|
|
6063
6095
|
* @secure
|
|
6064
6096
|
*/
|
|
6065
6097
|
getMerchantAdmins: (_a, params) => {
|
|
6066
6098
|
var { merchantId } = _a, query = __rest(_a, ["merchantId"]);
|
|
6067
6099
|
if (params === void 0) { params = {}; }
|
|
6068
|
-
return this.http.request(Object.assign({ path: `/
|
|
6100
|
+
return this.http.request(Object.assign({ path: `/merchants/${merchantId}/admins`, method: "GET", query: query, secure: true, format: "json" }, params));
|
|
6069
6101
|
},
|
|
6070
6102
|
/**
|
|
6071
6103
|
* No description
|
|
@@ -6073,23 +6105,23 @@ class Api {
|
|
|
6073
6105
|
* @tags Merchants
|
|
6074
6106
|
* @name InviteMerchantAdmins
|
|
6075
6107
|
* @summary Invite merchant admins by merchant id
|
|
6076
|
-
* @request POST:/
|
|
6108
|
+
* @request POST:/merchants/admins/invite
|
|
6077
6109
|
* @secure
|
|
6078
6110
|
*/
|
|
6079
|
-
inviteMerchantAdmins: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6111
|
+
inviteMerchantAdmins: (data, params = {}) => this.http.request(Object.assign({ path: `/merchants/admins/invite`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6080
6112
|
/**
|
|
6081
6113
|
* No description
|
|
6082
6114
|
*
|
|
6083
6115
|
* @tags Merchants
|
|
6084
6116
|
* @name RevokeMerchantAdmins
|
|
6085
6117
|
* @summary Invite merchant admins by merchant id
|
|
6086
|
-
* @request DELETE:/
|
|
6118
|
+
* @request DELETE:/merchants/{merchantId}/admins/{userId}
|
|
6087
6119
|
* @secure
|
|
6088
6120
|
*/
|
|
6089
6121
|
revokeMerchantAdmins: (_a, params) => {
|
|
6090
6122
|
var { merchantId, userId } = _a; __rest(_a, ["merchantId", "userId"]);
|
|
6091
6123
|
if (params === void 0) { params = {}; }
|
|
6092
|
-
return this.http.request(Object.assign({ path: `/
|
|
6124
|
+
return this.http.request(Object.assign({ path: `/merchants/${merchantId}/admins/${userId}`, method: "DELETE", secure: true, format: "json" }, params));
|
|
6093
6125
|
},
|
|
6094
6126
|
/**
|
|
6095
6127
|
* No description
|
|
@@ -6097,13 +6129,13 @@ class Api {
|
|
|
6097
6129
|
* @tags Merchants
|
|
6098
6130
|
* @name GetMerchantWallets
|
|
6099
6131
|
* @summary Get merchant wallets by merchant id
|
|
6100
|
-
* @request GET:/
|
|
6132
|
+
* @request GET:/merchants/{merchantId}/wallets
|
|
6101
6133
|
* @secure
|
|
6102
6134
|
*/
|
|
6103
6135
|
getMerchantWallets: (_a, params) => {
|
|
6104
6136
|
var { merchantId } = _a, query = __rest(_a, ["merchantId"]);
|
|
6105
6137
|
if (params === void 0) { params = {}; }
|
|
6106
|
-
return this.http.request(Object.assign({ path: `/
|
|
6138
|
+
return this.http.request(Object.assign({ path: `/merchants/${merchantId}/wallets`, method: "GET", query: query, secure: true, format: "json" }, params));
|
|
6107
6139
|
},
|
|
6108
6140
|
/**
|
|
6109
6141
|
* No description
|
|
@@ -6111,70 +6143,70 @@ class Api {
|
|
|
6111
6143
|
* @tags Merchants
|
|
6112
6144
|
* @name AddMerchantWalletAssets
|
|
6113
6145
|
* @summary Add assets to merchant wallets by merchant id
|
|
6114
|
-
* @request POST:/
|
|
6146
|
+
* @request POST:/merchants/wallets/add-assets
|
|
6115
6147
|
* @secure
|
|
6116
6148
|
*/
|
|
6117
|
-
addMerchantWalletAssets: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6149
|
+
addMerchantWalletAssets: (data, params = {}) => this.http.request(Object.assign({ path: `/merchants/wallets/add-assets`, method: "POST", body: data, secure: true, type: ContentType.Json }, params)),
|
|
6118
6150
|
/**
|
|
6119
6151
|
* No description
|
|
6120
6152
|
*
|
|
6121
6153
|
* @tags Merchants
|
|
6122
6154
|
* @name AddNewAsset
|
|
6123
6155
|
* @summary Add new asset to merchant based on the asset configuration
|
|
6124
|
-
* @request POST:/
|
|
6156
|
+
* @request POST:/merchants/assets/add
|
|
6125
6157
|
* @secure
|
|
6126
6158
|
*/
|
|
6127
|
-
addNewAsset: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6159
|
+
addNewAsset: (data, params = {}) => this.http.request(Object.assign({ path: `/merchants/assets/add`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6128
6160
|
/**
|
|
6129
6161
|
* No description
|
|
6130
6162
|
*
|
|
6131
6163
|
* @tags Merchants
|
|
6132
6164
|
* @name RemoveAsset
|
|
6133
6165
|
* @summary Remove asset from merchant based on the asset configuration
|
|
6134
|
-
* @request DELETE:/
|
|
6166
|
+
* @request DELETE:/merchants/assets/delete
|
|
6135
6167
|
* @secure
|
|
6136
6168
|
*/
|
|
6137
|
-
removeAsset: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6169
|
+
removeAsset: (data, params = {}) => this.http.request(Object.assign({ path: `/merchants/assets/delete`, method: "DELETE", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6138
6170
|
/**
|
|
6139
6171
|
* No description
|
|
6140
6172
|
*
|
|
6141
6173
|
* @tags Merchants
|
|
6142
6174
|
* @name ShowMerchantAssetToWalletHolders
|
|
6143
6175
|
* @summary Show merchant asset to wallet holders based on the asset configuration
|
|
6144
|
-
* @request POST:/
|
|
6176
|
+
* @request POST:/merchants/assets/update-visibility
|
|
6145
6177
|
* @secure
|
|
6146
6178
|
*/
|
|
6147
|
-
showMerchantAssetToWalletHolders: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6179
|
+
showMerchantAssetToWalletHolders: (data, params = {}) => this.http.request(Object.assign({ path: `/merchants/assets/update-visibility`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6148
6180
|
/**
|
|
6149
6181
|
* No description
|
|
6150
6182
|
*
|
|
6151
6183
|
* @tags Merchants
|
|
6152
6184
|
* @name ChangeMerchantAssetDefaultStatus
|
|
6153
6185
|
* @summary Change merchant asset default status
|
|
6154
|
-
* @request POST:/
|
|
6186
|
+
* @request POST:/merchants/assets/update-default-status
|
|
6155
6187
|
* @secure
|
|
6156
6188
|
*/
|
|
6157
|
-
changeMerchantAssetDefaultStatus: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6189
|
+
changeMerchantAssetDefaultStatus: (data, params = {}) => this.http.request(Object.assign({ path: `/merchants/assets/update-default-status`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6158
6190
|
/**
|
|
6159
6191
|
* No description
|
|
6160
6192
|
*
|
|
6161
6193
|
* @tags Merchants
|
|
6162
6194
|
* @name CreateApiKey
|
|
6163
6195
|
* @summary Create new API Key
|
|
6164
|
-
* @request POST:/
|
|
6196
|
+
* @request POST:/merchants/api-keys/new
|
|
6165
6197
|
* @secure
|
|
6166
6198
|
*/
|
|
6167
|
-
createApiKey: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6199
|
+
createApiKey: (data, params = {}) => this.http.request(Object.assign({ path: `/merchants/api-keys/new`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6168
6200
|
/**
|
|
6169
6201
|
* No description
|
|
6170
6202
|
*
|
|
6171
6203
|
* @tags Merchants
|
|
6172
6204
|
* @name WhitelistApiKeyOrigins
|
|
6173
6205
|
* @summary Whitelist API Key's origins
|
|
6174
|
-
* @request POST:/
|
|
6206
|
+
* @request POST:/merchants/api-keys/whitelist-origins
|
|
6175
6207
|
* @secure
|
|
6176
6208
|
*/
|
|
6177
|
-
whitelistApiKeyOrigins: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6209
|
+
whitelistApiKeyOrigins: (data, params = {}) => this.http.request(Object.assign({ path: `/merchants/api-keys/whitelist-origins`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6178
6210
|
};
|
|
6179
6211
|
this.wallets = {
|
|
6180
6212
|
/**
|
|
@@ -6183,133 +6215,133 @@ class Api {
|
|
|
6183
6215
|
* @tags Wallets
|
|
6184
6216
|
* @name GetAllUsers
|
|
6185
6217
|
* @summary Get all wallets by the admin
|
|
6186
|
-
* @request GET:/
|
|
6218
|
+
* @request GET:/wallets
|
|
6187
6219
|
* @secure
|
|
6188
6220
|
*/
|
|
6189
|
-
getAllUsers: (query, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6221
|
+
getAllUsers: (query, params = {}) => this.http.request(Object.assign({ path: `/wallets`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6190
6222
|
/**
|
|
6191
6223
|
* No description
|
|
6192
6224
|
*
|
|
6193
6225
|
* @tags Wallets
|
|
6194
6226
|
* @name CreateWallet
|
|
6195
6227
|
* @summary Create a newly fresh wallet, returns asset list and encrypted seed
|
|
6196
|
-
* @request POST:/
|
|
6228
|
+
* @request POST:/wallets/create
|
|
6197
6229
|
* @secure
|
|
6198
6230
|
*/
|
|
6199
|
-
createWallet: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6231
|
+
createWallet: (data, params = {}) => this.http.request(Object.assign({ path: `/wallets/create`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6200
6232
|
/**
|
|
6201
6233
|
* No description
|
|
6202
6234
|
*
|
|
6203
6235
|
* @tags Wallets
|
|
6204
6236
|
* @name VerifyAccess
|
|
6205
6237
|
* @summary Verify that the user still has the ability to transact with the wallet
|
|
6206
|
-
* @request POST:/
|
|
6238
|
+
* @request POST:/wallets/verify-access
|
|
6207
6239
|
* @secure
|
|
6208
6240
|
*/
|
|
6209
|
-
verifyAccess: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6241
|
+
verifyAccess: (data, params = {}) => this.http.request(Object.assign({ path: `/wallets/verify-access`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6210
6242
|
/**
|
|
6211
6243
|
* No description
|
|
6212
6244
|
*
|
|
6213
6245
|
* @tags Wallets
|
|
6214
6246
|
* @name CreateAdminWallet
|
|
6215
6247
|
* @summary Create a server side admin wallet where encryptedSeed will be opaque to the caller
|
|
6216
|
-
* @request POST:/
|
|
6248
|
+
* @request POST:/wallets/create-admin-server-wallet
|
|
6217
6249
|
* @secure
|
|
6218
6250
|
*/
|
|
6219
|
-
createAdminWallet: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6251
|
+
createAdminWallet: (data, params = {}) => this.http.request(Object.assign({ path: `/wallets/create-admin-server-wallet`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6220
6252
|
/**
|
|
6221
6253
|
* No description
|
|
6222
6254
|
*
|
|
6223
6255
|
* @tags Wallets, MPC
|
|
6224
6256
|
* @name CreateWalletV2
|
|
6225
6257
|
* @summary Create a newly fresh wallet, returns asset list and encrypted seed, shares, or both
|
|
6226
|
-
* @request POST:/
|
|
6258
|
+
* @request POST:/wallets/create-with-shares
|
|
6227
6259
|
* @secure
|
|
6228
6260
|
*/
|
|
6229
|
-
createWalletV2: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6261
|
+
createWalletV2: (data, params = {}) => this.http.request(Object.assign({ path: `/wallets/create-with-shares`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6230
6262
|
/**
|
|
6231
6263
|
* No description
|
|
6232
6264
|
*
|
|
6233
6265
|
* @tags Wallets, MPC
|
|
6234
6266
|
* @name ImportWalletSeedPhraseV2
|
|
6235
6267
|
* @summary Import an existing wallet seed phrase into wallaby system directly
|
|
6236
|
-
* @request POST:/
|
|
6268
|
+
* @request POST:/wallets/create-shares-based-wallet-from-seed
|
|
6237
6269
|
* @secure
|
|
6238
6270
|
*/
|
|
6239
|
-
importWalletSeedPhraseV2: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6271
|
+
importWalletSeedPhraseV2: (data, params = {}) => this.http.request(Object.assign({ path: `/wallets/create-shares-based-wallet-from-seed`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6240
6272
|
/**
|
|
6241
6273
|
* No description
|
|
6242
6274
|
*
|
|
6243
6275
|
* @tags Wallets, MPC
|
|
6244
6276
|
* @name RetrieveShares
|
|
6245
6277
|
* @summary Retrieve shares which belong to the user on a specified wallet
|
|
6246
|
-
* @request POST:/
|
|
6278
|
+
* @request POST:/wallets/retrieve-shares
|
|
6247
6279
|
* @secure
|
|
6248
6280
|
*/
|
|
6249
|
-
retrieveShares: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6281
|
+
retrieveShares: (data, params = {}) => this.http.request(Object.assign({ path: `/wallets/retrieve-shares`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6250
6282
|
/**
|
|
6251
6283
|
* No description
|
|
6252
6284
|
*
|
|
6253
6285
|
* @tags Wallets, MPC
|
|
6254
6286
|
* @name ShareWallet
|
|
6255
6287
|
* @summary Share an entity wallet with another user
|
|
6256
|
-
* @request POST:/
|
|
6288
|
+
* @request POST:/wallets/initiate-share-wallet
|
|
6257
6289
|
* @secure
|
|
6258
6290
|
*/
|
|
6259
|
-
shareWallet: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6291
|
+
shareWallet: (data, params = {}) => this.http.request(Object.assign({ path: `/wallets/initiate-share-wallet`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6260
6292
|
/**
|
|
6261
6293
|
* No description
|
|
6262
6294
|
*
|
|
6263
6295
|
* @tags Wallets, MPC
|
|
6264
6296
|
* @name UnshareWallet
|
|
6265
6297
|
* @summary Unshare an entity wallet with a user previously granted access
|
|
6266
|
-
* @request POST:/
|
|
6298
|
+
* @request POST:/wallets/unshare-wallet
|
|
6267
6299
|
* @secure
|
|
6268
6300
|
*/
|
|
6269
|
-
unshareWallet: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6301
|
+
unshareWallet: (data, params = {}) => this.http.request(Object.assign({ path: `/wallets/unshare-wallet`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6270
6302
|
/**
|
|
6271
6303
|
* No description
|
|
6272
6304
|
*
|
|
6273
6305
|
* @tags Wallets
|
|
6274
6306
|
* @name AddNewDevice
|
|
6275
6307
|
* @summary This endpoint will be called by the new device after it receives a Wallaby wrapped share
|
|
6276
|
-
* @request POST:/
|
|
6308
|
+
* @request POST:/wallets/add-new-device
|
|
6277
6309
|
* @secure
|
|
6278
6310
|
*/
|
|
6279
|
-
addNewDevice: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6311
|
+
addNewDevice: (data, params = {}) => this.http.request(Object.assign({ path: `/wallets/add-new-device`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6280
6312
|
/**
|
|
6281
6313
|
* No description
|
|
6282
6314
|
*
|
|
6283
6315
|
* @tags Wallets
|
|
6284
6316
|
* @name ImportWalletSeedPhrase
|
|
6285
6317
|
* @summary Import an existing wallet seed phrase into wallaby system directly
|
|
6286
|
-
* @request POST:/
|
|
6318
|
+
* @request POST:/wallets/import-seed-phrase
|
|
6287
6319
|
* @secure
|
|
6288
6320
|
*/
|
|
6289
|
-
importWalletSeedPhrase: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6321
|
+
importWalletSeedPhrase: (data, params = {}) => this.http.request(Object.assign({ path: `/wallets/import-seed-phrase`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6290
6322
|
/**
|
|
6291
6323
|
* No description
|
|
6292
6324
|
*
|
|
6293
6325
|
* @tags Wallets
|
|
6294
6326
|
* @name GenerateMissingAddresses
|
|
6295
6327
|
* @summary Generates missing wallet addresses for a user's wallet
|
|
6296
|
-
* @request POST:/
|
|
6328
|
+
* @request POST:/wallets/generate-wallet-addresses
|
|
6297
6329
|
* @secure
|
|
6298
6330
|
*/
|
|
6299
|
-
generateMissingAddresses: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6331
|
+
generateMissingAddresses: (data, params = {}) => this.http.request(Object.assign({ path: `/wallets/generate-wallet-addresses`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6300
6332
|
/**
|
|
6301
6333
|
* No description
|
|
6302
6334
|
*
|
|
6303
6335
|
* @tags Wallets
|
|
6304
6336
|
* @name GetUserAssetsByWalletId
|
|
6305
6337
|
* @summary Get all assets that exist in a certain wallet, by specifying a wallet ID
|
|
6306
|
-
* @request GET:/
|
|
6338
|
+
* @request GET:/wallets/{walletId}/assets
|
|
6307
6339
|
* @secure
|
|
6308
6340
|
*/
|
|
6309
6341
|
getUserAssetsByWalletId: (_a, params) => {
|
|
6310
6342
|
var { walletId } = _a, query = __rest(_a, ["walletId"]);
|
|
6311
6343
|
if (params === void 0) { params = {}; }
|
|
6312
|
-
return this.http.request(Object.assign({ path: `/
|
|
6344
|
+
return this.http.request(Object.assign({ path: `/wallets/${walletId}/assets`, method: "GET", query: query, secure: true, format: "json" }, params));
|
|
6313
6345
|
},
|
|
6314
6346
|
/**
|
|
6315
6347
|
* No description
|
|
@@ -6317,277 +6349,443 @@ class Api {
|
|
|
6317
6349
|
* @tags Wallets
|
|
6318
6350
|
* @name GetUserAsset
|
|
6319
6351
|
* @summary Get one asset from a user's wallet
|
|
6320
|
-
* @request GET:/
|
|
6352
|
+
* @request GET:/wallets/asset
|
|
6321
6353
|
* @secure
|
|
6322
6354
|
*/
|
|
6323
|
-
getUserAsset: (query, data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6355
|
+
getUserAsset: (query, data, params = {}) => this.http.request(Object.assign({ path: `/wallets/asset`, method: "GET", query: query, body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6324
6356
|
/**
|
|
6325
6357
|
* No description
|
|
6326
6358
|
*
|
|
6327
6359
|
* @tags Wallets
|
|
6328
6360
|
* @name UpdateUserAsset
|
|
6329
6361
|
* @summary Update a specific asset in a wallet
|
|
6330
|
-
* @request PUT:/
|
|
6362
|
+
* @request PUT:/wallets/asset/update
|
|
6331
6363
|
* @secure
|
|
6332
6364
|
*/
|
|
6333
|
-
updateUserAsset: (query, data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6365
|
+
updateUserAsset: (query, data, params = {}) => this.http.request(Object.assign({ path: `/wallets/asset/update`, method: "PUT", query: query, body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6334
6366
|
/**
|
|
6335
6367
|
* No description
|
|
6336
6368
|
*
|
|
6337
6369
|
* @tags Wallets, Multisig
|
|
6338
6370
|
* @name CreateMultisigAsset
|
|
6339
6371
|
* @summary Initiate creation for a new multisig asset, by specifying participants and the threshold
|
|
6340
|
-
* @request POST:/
|
|
6372
|
+
* @request POST:/wallets/create-multisig-asset
|
|
6341
6373
|
* @secure
|
|
6342
6374
|
*/
|
|
6343
|
-
createMultisigAsset: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6375
|
+
createMultisigAsset: (data, params = {}) => this.http.request(Object.assign({ path: `/wallets/create-multisig-asset`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6344
6376
|
/**
|
|
6345
6377
|
* No description
|
|
6346
6378
|
*
|
|
6347
6379
|
* @tags Wallets, Recovery
|
|
6348
6380
|
* @name InitiateWalletRecovery
|
|
6349
6381
|
* @summary Wallet Recovery - Step 1: Initiate wallet recovery
|
|
6350
|
-
* @request POST:/
|
|
6382
|
+
* @request POST:/wallets/recover/init
|
|
6351
6383
|
* @secure
|
|
6352
6384
|
*/
|
|
6353
|
-
initiateWalletRecovery: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6385
|
+
initiateWalletRecovery: (data, params = {}) => this.http.request(Object.assign({ path: `/wallets/recover/init`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6354
6386
|
/**
|
|
6355
6387
|
* No description
|
|
6356
6388
|
*
|
|
6357
6389
|
* @tags Wallets, Recovery
|
|
6358
6390
|
* @name RecoverWallet
|
|
6359
6391
|
* @summary Wallet Recovery - Step 2 and final: Recover the lost wallet and its assets
|
|
6360
|
-
* @request POST:/
|
|
6392
|
+
* @request POST:/wallets/recover
|
|
6361
6393
|
* @secure
|
|
6362
6394
|
*/
|
|
6363
|
-
recoverWallet: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6395
|
+
recoverWallet: (data, params = {}) => this.http.request(Object.assign({ path: `/wallets/recover`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6364
6396
|
/**
|
|
6365
6397
|
* No description
|
|
6366
6398
|
*
|
|
6367
6399
|
* @tags Wallets, Algorand
|
|
6368
6400
|
* @name ConvertStandardPhraseToAlgoSpecific
|
|
6369
6401
|
* @summary Convert BIP39 Standard seed phrase to Algorand fixed 25 words mnemonic phrase
|
|
6370
|
-
* @request POST:/
|
|
6402
|
+
* @request POST:/wallets/convert-mnemonic-seed
|
|
6403
|
+
* @secure
|
|
6404
|
+
*/
|
|
6405
|
+
convertStandardPhraseToAlgoSpecific: (data, params = {}) => this.http.request(Object.assign({ path: `/wallets/convert-mnemonic-seed`, method: "POST", body: data, secure: true, type: ContentType.Json }, params)),
|
|
6406
|
+
};
|
|
6407
|
+
this.users = {
|
|
6408
|
+
/**
|
|
6409
|
+
* No description
|
|
6410
|
+
*
|
|
6411
|
+
* @tags Users
|
|
6412
|
+
* @name GetAllUsers
|
|
6413
|
+
* @summary Get all users by the admin
|
|
6414
|
+
* @request GET:/users
|
|
6415
|
+
* @secure
|
|
6416
|
+
*/
|
|
6417
|
+
getAllUsers: (query, params = {}) => this.http.request(Object.assign({ path: `/users`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6418
|
+
/**
|
|
6419
|
+
* No description
|
|
6420
|
+
*
|
|
6421
|
+
* @tags Users
|
|
6422
|
+
* @name UpdateProfile
|
|
6423
|
+
* @summary Update user profile info
|
|
6424
|
+
* @request PUT:/users/profile
|
|
6425
|
+
* @secure
|
|
6426
|
+
*/
|
|
6427
|
+
updateProfile: (data, params = {}) => this.http.request(Object.assign({ path: `/users/profile`, method: "PUT", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6428
|
+
/**
|
|
6429
|
+
* No description
|
|
6430
|
+
*
|
|
6431
|
+
* @tags Users
|
|
6432
|
+
* @name GetCurrentUser
|
|
6433
|
+
* @summary Returns current user data
|
|
6434
|
+
* @request GET:/users/profile
|
|
6435
|
+
* @secure
|
|
6436
|
+
*/
|
|
6437
|
+
getCurrentUser: (params = {}) => this.http.request(Object.assign({ path: `/users/profile`, method: "GET", secure: true, format: "json" }, params)),
|
|
6438
|
+
/**
|
|
6439
|
+
* No description
|
|
6440
|
+
*
|
|
6441
|
+
* @tags Users
|
|
6442
|
+
* @name GetCurrentUserSalt
|
|
6443
|
+
* @summary Get current user's client salt
|
|
6444
|
+
* @request GET:/users/salt
|
|
6445
|
+
* @secure
|
|
6446
|
+
*/
|
|
6447
|
+
getCurrentUserSalt: (params = {}) => this.http.request(Object.assign({ path: `/users/salt`, method: "GET", secure: true, format: "json" }, params)),
|
|
6448
|
+
/**
|
|
6449
|
+
* No description
|
|
6450
|
+
*
|
|
6451
|
+
* @tags Users
|
|
6452
|
+
* @name GetAllWalletsFromUserId
|
|
6453
|
+
* @summary Returns user wallets by specifying user id
|
|
6454
|
+
* @request GET:/users/{userId}/wallets
|
|
6455
|
+
* @secure
|
|
6456
|
+
*/
|
|
6457
|
+
getAllWalletsFromUserId: (_a, params) => {
|
|
6458
|
+
var { userId } = _a; __rest(_a, ["userId"]);
|
|
6459
|
+
if (params === void 0) { params = {}; }
|
|
6460
|
+
return this.http.request(Object.assign({ path: `/users/${userId}/wallets`, method: "GET", secure: true, format: "json" }, params));
|
|
6461
|
+
},
|
|
6462
|
+
/**
|
|
6463
|
+
* No description
|
|
6464
|
+
*
|
|
6465
|
+
* @tags Users
|
|
6466
|
+
* @name GetCurrentUserMerchantAssets
|
|
6467
|
+
* @summary Returns user's merchant assets
|
|
6468
|
+
* @request GET:/users/merchants/assets
|
|
6469
|
+
* @secure
|
|
6470
|
+
*/
|
|
6471
|
+
getCurrentUserMerchantAssets: (query, params = {}) => this.http.request(Object.assign({ path: `/users/merchants/assets`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6472
|
+
/**
|
|
6473
|
+
* No description
|
|
6474
|
+
*
|
|
6475
|
+
* @tags Users
|
|
6476
|
+
* @name GetCurrentUserMerchantAssets2
|
|
6477
|
+
* @summary Returns user's merchant assets
|
|
6478
|
+
* @request GET:/users/merchant/assets
|
|
6479
|
+
* @originalName getCurrentUserMerchantAssets
|
|
6480
|
+
* @duplicate
|
|
6481
|
+
* @secure
|
|
6482
|
+
*/
|
|
6483
|
+
getCurrentUserMerchantAssets2: (query, params = {}) => this.http.request(Object.assign({ path: `/users/merchant/assets`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6484
|
+
/**
|
|
6485
|
+
* No description
|
|
6486
|
+
*
|
|
6487
|
+
* @tags Users
|
|
6488
|
+
* @name GetAssetsByUserId
|
|
6489
|
+
* @summary Returns user assets by specifying user id
|
|
6490
|
+
* @request GET:/users/{userId}/assets
|
|
6491
|
+
* @secure
|
|
6492
|
+
*/
|
|
6493
|
+
getAssetsByUserId: (_a, params) => {
|
|
6494
|
+
var { userId } = _a, query = __rest(_a, ["userId"]);
|
|
6495
|
+
if (params === void 0) { params = {}; }
|
|
6496
|
+
return this.http.request(Object.assign({ path: `/users/${userId}/assets`, method: "GET", query: query, secure: true, format: "json" }, params));
|
|
6497
|
+
},
|
|
6498
|
+
/**
|
|
6499
|
+
* No description
|
|
6500
|
+
*
|
|
6501
|
+
* @tags Users
|
|
6502
|
+
* @name AddAssetToUser
|
|
6503
|
+
* @summary Add a new asset to the user's wallet based on the asset configuration
|
|
6504
|
+
* @request POST:/users/assets/add
|
|
6371
6505
|
* @secure
|
|
6372
6506
|
*/
|
|
6373
|
-
|
|
6507
|
+
addAssetToUser: (data, params = {}) => this.http.request(Object.assign({ path: `/users/assets/add`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6374
6508
|
/**
|
|
6375
6509
|
* No description
|
|
6376
6510
|
*
|
|
6377
|
-
* @tags
|
|
6378
|
-
* @name
|
|
6379
|
-
* @summary
|
|
6380
|
-
* @request
|
|
6511
|
+
* @tags Users
|
|
6512
|
+
* @name RemoveAssetFromUser
|
|
6513
|
+
* @summary Remove an asset from the user's wallet based on the asset configuration
|
|
6514
|
+
* @request DELETE:/users/{userId}/wallets/{walletId}/assets/{assetConfigId}
|
|
6381
6515
|
* @secure
|
|
6382
6516
|
*/
|
|
6383
|
-
|
|
6384
|
-
var { walletId } = _a; __rest(_a, ["walletId"]);
|
|
6517
|
+
removeAssetFromUser: (_a, params) => {
|
|
6518
|
+
var { assetConfigId, walletId, userId } = _a; __rest(_a, ["assetConfigId", "walletId", "userId"]);
|
|
6385
6519
|
if (params === void 0) { params = {}; }
|
|
6386
|
-
return this.http.request(Object.assign({ path: `/
|
|
6520
|
+
return this.http.request(Object.assign({ path: `/users/${userId}/wallets/${walletId}/assets/${assetConfigId}`, method: "DELETE", secure: true, format: "json" }, params));
|
|
6387
6521
|
},
|
|
6388
6522
|
/**
|
|
6389
6523
|
* No description
|
|
6390
6524
|
*
|
|
6391
|
-
* @tags
|
|
6392
|
-
* @name
|
|
6393
|
-
* @summary
|
|
6394
|
-
* @request GET:/
|
|
6525
|
+
* @tags Users
|
|
6526
|
+
* @name GetUserByUserId
|
|
6527
|
+
* @summary Returns user public data
|
|
6528
|
+
* @request GET:/users/{userId}
|
|
6395
6529
|
* @secure
|
|
6396
6530
|
*/
|
|
6397
|
-
|
|
6398
|
-
var {
|
|
6531
|
+
getUserByUserId: (_a, params) => {
|
|
6532
|
+
var { userId } = _a; __rest(_a, ["userId"]);
|
|
6533
|
+
if (params === void 0) { params = {}; }
|
|
6534
|
+
return this.http.request(Object.assign({ path: `/users/${userId}`, method: "GET", secure: true, format: "json" }, params));
|
|
6535
|
+
},
|
|
6536
|
+
/**
|
|
6537
|
+
* No description
|
|
6538
|
+
*
|
|
6539
|
+
* @tags Users
|
|
6540
|
+
* @name GetUserByExternalUserId
|
|
6541
|
+
* @request GET:/users/{externalUserId}/externalUserId
|
|
6542
|
+
* @secure
|
|
6543
|
+
*/
|
|
6544
|
+
getUserByExternalUserId: (_a, params) => {
|
|
6545
|
+
var { externalUserId } = _a; __rest(_a, ["externalUserId"]);
|
|
6399
6546
|
if (params === void 0) { params = {}; }
|
|
6400
|
-
return this.http.request(Object.assign({ path: `/
|
|
6547
|
+
return this.http.request(Object.assign({ path: `/users/${externalUserId}/externalUserId`, method: "GET", secure: true, format: "json" }, params));
|
|
6401
6548
|
},
|
|
6402
6549
|
/**
|
|
6403
6550
|
* No description
|
|
6404
6551
|
*
|
|
6405
|
-
* @tags
|
|
6406
|
-
* @name
|
|
6407
|
-
* @summary
|
|
6408
|
-
* @request GET:/
|
|
6552
|
+
* @tags Users
|
|
6553
|
+
* @name GetParticipantsByUserId
|
|
6554
|
+
* @summary Returns multisig participants by user id
|
|
6555
|
+
* @request GET:/users/{userId}/multisig-transactions
|
|
6409
6556
|
* @secure
|
|
6410
6557
|
*/
|
|
6411
|
-
|
|
6412
|
-
var {
|
|
6558
|
+
getParticipantsByUserId: (_a, params) => {
|
|
6559
|
+
var { userId } = _a, query = __rest(_a, ["userId"]);
|
|
6413
6560
|
if (params === void 0) { params = {}; }
|
|
6414
|
-
return this.http.request(Object.assign({ path: `/
|
|
6561
|
+
return this.http.request(Object.assign({ path: `/users/${userId}/multisig-transactions`, method: "GET", query: query, secure: true, format: "json" }, params));
|
|
6415
6562
|
},
|
|
6416
6563
|
};
|
|
6417
|
-
this.
|
|
6564
|
+
this.query = {
|
|
6418
6565
|
/**
|
|
6419
6566
|
* No description
|
|
6420
6567
|
*
|
|
6421
|
-
* @tags
|
|
6422
|
-
* @name
|
|
6423
|
-
* @summary
|
|
6424
|
-
* @request GET:/
|
|
6568
|
+
* @tags Query
|
|
6569
|
+
* @name FetchBalance
|
|
6570
|
+
* @summary Fetch asset balance by specifying the asset address and the asset symbol
|
|
6571
|
+
* @request GET:/query/assets/balance
|
|
6425
6572
|
* @secure
|
|
6426
6573
|
*/
|
|
6427
|
-
|
|
6574
|
+
fetchBalance: (query, params = {}) => this.http.request(Object.assign({ path: `/query/assets/balance`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6428
6575
|
/**
|
|
6429
6576
|
* No description
|
|
6430
6577
|
*
|
|
6431
|
-
* @tags
|
|
6432
|
-
* @name
|
|
6433
|
-
* @summary
|
|
6434
|
-
* @request GET:/
|
|
6578
|
+
* @tags Query
|
|
6579
|
+
* @name FetchOnlyBalance
|
|
6580
|
+
* @summary Fetch address balance by specifying the address and the asset symbol. This API works even for external assets addresses
|
|
6581
|
+
* @request GET:/query/address/balance
|
|
6582
|
+
* @secure
|
|
6583
|
+
*/
|
|
6584
|
+
fetchOnlyBalance: (query, params = {}) => this.http.request(Object.assign({ path: `/query/address/balance`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6585
|
+
/**
|
|
6586
|
+
* No description
|
|
6587
|
+
*
|
|
6588
|
+
* @tags Query
|
|
6589
|
+
* @name FetchBulkBalance
|
|
6590
|
+
* @summary Fetch assets' balance by providing an array of asset addresses and symbols
|
|
6591
|
+
* @request POST:/query/assets/bulk-balance
|
|
6592
|
+
* @secure
|
|
6593
|
+
*/
|
|
6594
|
+
fetchBulkBalance: (data, params = {}) => this.http.request(Object.assign({ path: `/query/assets/bulk-balance`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6595
|
+
/**
|
|
6596
|
+
* No description
|
|
6597
|
+
*
|
|
6598
|
+
* @tags Query
|
|
6599
|
+
* @name FetchWalletBulkBalance
|
|
6600
|
+
* @summary Fetch assets balances by specifying the wallet ID
|
|
6601
|
+
* @request POST:/query/assets/wallet-bulk-balance
|
|
6602
|
+
* @secure
|
|
6603
|
+
*/
|
|
6604
|
+
fetchWalletBulkBalance: (data, params = {}) => this.http.request(Object.assign({ path: `/query/assets/wallet-bulk-balance`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6605
|
+
/**
|
|
6606
|
+
* No description
|
|
6607
|
+
*
|
|
6608
|
+
* @tags Query
|
|
6609
|
+
* @name FetchTransactions
|
|
6610
|
+
* @summary Fetch the current address historical transactions
|
|
6611
|
+
* @request GET:/query/transactions
|
|
6612
|
+
*/
|
|
6613
|
+
fetchTransactions: (query, params = {}) => this.http.request(Object.assign({ path: `/query/transactions`, method: "GET", query: query, format: "json" }, params)),
|
|
6614
|
+
/**
|
|
6615
|
+
* No description
|
|
6616
|
+
*
|
|
6617
|
+
* @tags Query, Assets
|
|
6618
|
+
* @name FetchEvmTokenAssetInfo
|
|
6619
|
+
* @summary Request token asset info like decimals, name and symbol
|
|
6620
|
+
* @request GET:/query/fetch-token-info
|
|
6621
|
+
* @secure
|
|
6622
|
+
*/
|
|
6623
|
+
fetchEvmTokenAssetInfo: (query, params = {}) => this.http.request(Object.assign({ path: `/query/fetch-token-info`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6624
|
+
/**
|
|
6625
|
+
* No description
|
|
6626
|
+
*
|
|
6627
|
+
* @tags Query, Assets
|
|
6628
|
+
* @name FetchAssetPairPrice
|
|
6629
|
+
* @summary Fetch asset price by providing symbol pairing or a list of pairing symbols
|
|
6630
|
+
* @request GET:/query/get-asset-price
|
|
6435
6631
|
* @secure
|
|
6436
6632
|
*/
|
|
6437
|
-
|
|
6633
|
+
fetchAssetPairPrice: (query, params = {}) => this.http.request(Object.assign({ path: `/query/get-asset-price`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6634
|
+
};
|
|
6635
|
+
this.transactions = {
|
|
6438
6636
|
/**
|
|
6439
6637
|
* No description
|
|
6440
6638
|
*
|
|
6441
6639
|
* @tags Transactions
|
|
6442
|
-
* @name
|
|
6443
|
-
* @summary
|
|
6444
|
-
* @request
|
|
6640
|
+
* @name GetTransactions
|
|
6641
|
+
* @summary Get list of transactions
|
|
6642
|
+
* @request GET:/transactions
|
|
6445
6643
|
* @secure
|
|
6446
6644
|
*/
|
|
6447
|
-
|
|
6645
|
+
getTransactions: (query, params = {}) => this.http.request(Object.assign({ path: `/transactions`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6448
6646
|
/**
|
|
6449
6647
|
* No description
|
|
6450
6648
|
*
|
|
6451
6649
|
* @tags Transactions
|
|
6452
6650
|
* @name SendTransaction
|
|
6453
6651
|
* @summary Request transferring funds to a recipient address
|
|
6454
|
-
* @request POST:/
|
|
6652
|
+
* @request POST:/transactions/transfer
|
|
6455
6653
|
* @secure
|
|
6456
6654
|
*/
|
|
6457
|
-
sendTransaction: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6655
|
+
sendTransaction: (data, params = {}) => this.http.request(Object.assign({ path: `/transactions/transfer`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6458
6656
|
/**
|
|
6459
6657
|
* No description
|
|
6460
6658
|
*
|
|
6461
6659
|
* @tags Transactions
|
|
6462
6660
|
* @name SendV2Transaction
|
|
6463
6661
|
* @summary Request transferring funds to a recipient address
|
|
6464
|
-
* @request POST:/
|
|
6662
|
+
* @request POST:/transactions/transfer-with-shares
|
|
6465
6663
|
* @secure
|
|
6466
6664
|
*/
|
|
6467
|
-
sendV2Transaction: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6665
|
+
sendV2Transaction: (data, params = {}) => this.http.request(Object.assign({ path: `/transactions/transfer-with-shares`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6468
6666
|
/**
|
|
6469
6667
|
* No description
|
|
6470
6668
|
*
|
|
6471
6669
|
* @tags Transactions
|
|
6472
6670
|
* @name InitMultisigTransfer
|
|
6473
6671
|
* @summary User initiating and signing a multi-sig transfer request
|
|
6474
|
-
* @request POST:/
|
|
6672
|
+
* @request POST:/transactions/init-multisig-transfer
|
|
6475
6673
|
* @secure
|
|
6476
6674
|
*/
|
|
6477
|
-
initMultisigTransfer: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6675
|
+
initMultisigTransfer: (data, params = {}) => this.http.request(Object.assign({ path: `/transactions/init-multisig-transfer`, method: "POST", body: data, secure: true, type: ContentType.Json }, params)),
|
|
6478
6676
|
/**
|
|
6479
6677
|
* No description
|
|
6480
6678
|
*
|
|
6481
6679
|
* @tags Transactions, Multisig
|
|
6482
6680
|
* @name InitMultisigAssetOptin
|
|
6483
6681
|
* @summary User initiating a multi-sig asset optin request and subsequently signs the first signature on the request
|
|
6484
|
-
* @request POST:/
|
|
6682
|
+
* @request POST:/transactions/init-multisig-asset-optin
|
|
6485
6683
|
* @secure
|
|
6486
6684
|
*/
|
|
6487
|
-
initMultisigAssetOptin: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6685
|
+
initMultisigAssetOptin: (data, params = {}) => this.http.request(Object.assign({ path: `/transactions/init-multisig-asset-optin`, method: "POST", body: data, secure: true, type: ContentType.Json }, params)),
|
|
6488
6686
|
/**
|
|
6489
6687
|
* No description
|
|
6490
6688
|
*
|
|
6491
6689
|
* @tags Transactions, Multisig
|
|
6492
6690
|
* @name InitMultisigAppOptin
|
|
6493
6691
|
* @summary User initiating a multi-sig app optin request and subsequently signs the first signature on the request
|
|
6494
|
-
* @request POST:/
|
|
6692
|
+
* @request POST:/transactions/init-multisig-app-optin
|
|
6495
6693
|
* @secure
|
|
6496
6694
|
*/
|
|
6497
|
-
initMultisigAppOptin: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6695
|
+
initMultisigAppOptin: (data, params = {}) => this.http.request(Object.assign({ path: `/transactions/init-multisig-app-optin`, method: "POST", body: data, secure: true, type: ContentType.Json }, params)),
|
|
6498
6696
|
/**
|
|
6499
6697
|
* No description
|
|
6500
6698
|
*
|
|
6501
6699
|
* @tags Transactions, Multisig
|
|
6502
6700
|
* @name SignOnMultisigTransactionRequest
|
|
6503
6701
|
* @summary Append signature to an existing multisig transaction request: It can be a request to transfer, optin, etc, ...
|
|
6504
|
-
* @request POST:/
|
|
6702
|
+
* @request POST:/transactions/sign-multisig-request
|
|
6505
6703
|
* @secure
|
|
6506
6704
|
*/
|
|
6507
|
-
signOnMultisigTransactionRequest: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6705
|
+
signOnMultisigTransactionRequest: (data, params = {}) => this.http.request(Object.assign({ path: `/transactions/sign-multisig-request`, method: "POST", body: data, secure: true, type: ContentType.Json }, params)),
|
|
6508
6706
|
/**
|
|
6509
6707
|
* No description
|
|
6510
6708
|
*
|
|
6511
6709
|
* @tags Transactions, Optin
|
|
6512
6710
|
* @name AssetOptInTransaction
|
|
6513
6711
|
* @summary Transaction for optin to receive a specific asset in the future
|
|
6514
|
-
* @request POST:/
|
|
6712
|
+
* @request POST:/transactions/asset-optin
|
|
6515
6713
|
* @secure
|
|
6516
6714
|
*/
|
|
6517
|
-
assetOptInTransaction: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6715
|
+
assetOptInTransaction: (data, params = {}) => this.http.request(Object.assign({ path: `/transactions/asset-optin`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6518
6716
|
/**
|
|
6519
6717
|
* No description
|
|
6520
6718
|
*
|
|
6521
6719
|
* @tags Transactions, Optin
|
|
6522
6720
|
* @name AppOptInTransaction
|
|
6523
6721
|
* @summary Transaction for optin to interact with a specific app
|
|
6524
|
-
* @request POST:/
|
|
6722
|
+
* @request POST:/transactions/app-optin
|
|
6525
6723
|
* @secure
|
|
6526
6724
|
*/
|
|
6527
|
-
appOptInTransaction: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6725
|
+
appOptInTransaction: (data, params = {}) => this.http.request(Object.assign({ path: `/transactions/app-optin`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6528
6726
|
/**
|
|
6529
6727
|
* No description
|
|
6530
6728
|
*
|
|
6531
6729
|
* @tags Transactions
|
|
6532
6730
|
* @name GetEstimateFee
|
|
6533
6731
|
* @summary Request fee estimate for a particular transaction
|
|
6534
|
-
* @request GET:/
|
|
6732
|
+
* @request GET:/transactions/estimate-fee
|
|
6535
6733
|
* @secure
|
|
6536
6734
|
*/
|
|
6537
|
-
getEstimateFee: (query, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6735
|
+
getEstimateFee: (query, params = {}) => this.http.request(Object.assign({ path: `/transactions/estimate-fee`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6538
6736
|
/**
|
|
6539
6737
|
* @description The sign and broadcast transaction API was designed and implemented specifically for uses cases where the caller has their own custom raw transaction that is not yet currently supported by Wallaby
|
|
6540
6738
|
*
|
|
6541
6739
|
* @tags Transactions, Raw, Transactions
|
|
6542
6740
|
* @name SignAndBroadcastRawTx
|
|
6543
6741
|
* @summary Sign and broadcast raw transaction API
|
|
6544
|
-
* @request POST:/
|
|
6742
|
+
* @request POST:/transactions/sign-broadcast-rawtx
|
|
6545
6743
|
* @secure
|
|
6546
6744
|
*/
|
|
6547
|
-
signAndBroadcastRawTx: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6745
|
+
signAndBroadcastRawTx: (data, params = {}) => this.http.request(Object.assign({ path: `/transactions/sign-broadcast-rawtx`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6548
6746
|
/**
|
|
6549
6747
|
* No description
|
|
6550
6748
|
*
|
|
6551
6749
|
* @tags Transactions, Query
|
|
6552
6750
|
* @name FetchTransactionByHashOrReference
|
|
6553
6751
|
* @summary Fetch transaction status data using a reference or transaction hash
|
|
6554
|
-
* @request GET:/
|
|
6752
|
+
* @request GET:/transactions/status
|
|
6555
6753
|
* @secure
|
|
6556
6754
|
*/
|
|
6557
|
-
fetchTransactionByHashOrReference: (query, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6755
|
+
fetchTransactionByHashOrReference: (query, params = {}) => this.http.request(Object.assign({ path: `/transactions/status`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6558
6756
|
/**
|
|
6559
6757
|
* No description
|
|
6560
6758
|
*
|
|
6561
6759
|
* @tags Transactions, Transactions, Multisig, Raw
|
|
6562
6760
|
* @name InitMultisigRawTransaction
|
|
6563
6761
|
* @summary Initiate a multisig raw transaction and sign the first signature on that same transaction
|
|
6564
|
-
* @request POST:/
|
|
6762
|
+
* @request POST:/transactions/init-sign-broadcast-multisig-rawtx
|
|
6565
6763
|
* @secure
|
|
6566
6764
|
*/
|
|
6567
|
-
initMultisigRawTransaction: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6765
|
+
initMultisigRawTransaction: (data, params = {}) => this.http.request(Object.assign({ path: `/transactions/init-sign-broadcast-multisig-rawtx`, method: "POST", body: data, secure: true, type: ContentType.Json }, params)),
|
|
6568
6766
|
/**
|
|
6569
6767
|
* No description
|
|
6570
6768
|
*
|
|
6571
6769
|
* @tags Transactions, Query
|
|
6572
6770
|
* @name GetDetailedRawTransactionDataByReference
|
|
6573
6771
|
* @summary Fetch transaction in raw data format from the system persistence
|
|
6574
|
-
* @request GET:/
|
|
6772
|
+
* @request GET:/transactions/raw-status
|
|
6575
6773
|
* @secure
|
|
6576
6774
|
*/
|
|
6577
|
-
getDetailedRawTransactionDataByReference: (query, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6775
|
+
getDetailedRawTransactionDataByReference: (query, params = {}) => this.http.request(Object.assign({ path: `/transactions/raw-status`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6578
6776
|
/**
|
|
6579
6777
|
* No description
|
|
6580
6778
|
*
|
|
6581
6779
|
* @tags Transactions, Query
|
|
6582
6780
|
* @name FetchTransactionParticipants
|
|
6583
6781
|
* @summary Fetch transaction's participants
|
|
6584
|
-
* @request GET:/
|
|
6782
|
+
* @request GET:/transactions/{reference}/participants
|
|
6585
6783
|
* @secure
|
|
6586
6784
|
*/
|
|
6587
6785
|
fetchTransactionParticipants: (_a, params) => {
|
|
6588
6786
|
var { reference } = _a; __rest(_a, ["reference"]);
|
|
6589
6787
|
if (params === void 0) { params = {}; }
|
|
6590
|
-
return this.http.request(Object.assign({ path: `/
|
|
6788
|
+
return this.http.request(Object.assign({ path: `/transactions/${reference}/participants`, method: "GET", secure: true, format: "json" }, params));
|
|
6591
6789
|
},
|
|
6592
6790
|
/**
|
|
6593
6791
|
* No description
|
|
@@ -6595,425 +6793,192 @@ class Api {
|
|
|
6595
6793
|
* @tags Transactions, Transactions, ERC1404
|
|
6596
6794
|
* @name DetectTransferRestriction
|
|
6597
6795
|
* @summary Request to detect whether there is a transfer restriction on a particular transaction
|
|
6598
|
-
* @request GET:/
|
|
6796
|
+
* @request GET:/transactions/detect-transfers-restrictions
|
|
6599
6797
|
* @secure
|
|
6600
6798
|
*/
|
|
6601
|
-
detectTransferRestriction: (query, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6799
|
+
detectTransferRestriction: (query, params = {}) => this.http.request(Object.assign({ path: `/transactions/detect-transfers-restrictions`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6602
6800
|
/**
|
|
6603
6801
|
* No description
|
|
6604
6802
|
*
|
|
6605
6803
|
* @tags Transactions, Transactions, ERC1404
|
|
6606
6804
|
* @name FetchMessageForTransferRestriction
|
|
6607
6805
|
* @summary Request restriction message by providing a restriction code
|
|
6608
|
-
* @request GET:/
|
|
6806
|
+
* @request GET:/transactions/transfer-restriction-message
|
|
6609
6807
|
* @secure
|
|
6610
6808
|
*/
|
|
6611
|
-
fetchMessageForTransferRestriction: (query, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6809
|
+
fetchMessageForTransferRestriction: (query, params = {}) => this.http.request(Object.assign({ path: `/transactions/transfer-restriction-message`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6612
6810
|
/**
|
|
6613
6811
|
* No description
|
|
6614
6812
|
*
|
|
6615
6813
|
* @tags Transactions, Optin
|
|
6616
6814
|
* @name CheckAssetOptinForAddress
|
|
6617
6815
|
* @summary Get the list of all assets that the current account has opted into. This is only relevant for the Algorand chain
|
|
6618
|
-
* @request GET:/
|
|
6816
|
+
* @request GET:/transactions/check-asset-optin
|
|
6619
6817
|
* @secure
|
|
6620
6818
|
*/
|
|
6621
|
-
checkAssetOptinForAddress: (query, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6819
|
+
checkAssetOptinForAddress: (query, params = {}) => this.http.request(Object.assign({ path: `/transactions/check-asset-optin`, method: "GET", query: query, secure: true }, params)),
|
|
6622
6820
|
/**
|
|
6623
6821
|
* No description
|
|
6624
6822
|
*
|
|
6625
6823
|
* @tags Transactions, Optin
|
|
6626
6824
|
* @name CheckAppOptinForAddress
|
|
6627
6825
|
* @summary Get the list of all apps that the current account has opted into. This is only relevant for the Algorand chain
|
|
6628
|
-
* @request GET:/
|
|
6826
|
+
* @request GET:/transactions/check-app-optin
|
|
6629
6827
|
* @secure
|
|
6630
6828
|
*/
|
|
6631
|
-
checkAppOptinForAddress: (query, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6829
|
+
checkAppOptinForAddress: (query, params = {}) => this.http.request(Object.assign({ path: `/transactions/check-app-optin`, method: "GET", query: query, secure: true }, params)),
|
|
6632
6830
|
/**
|
|
6633
6831
|
* No description
|
|
6634
6832
|
*
|
|
6635
6833
|
* @tags Transactions, Allowance, Transaction
|
|
6636
6834
|
* @name CreateAllowanceTransaction
|
|
6637
6835
|
* @summary Create an allowance for others to spend on your behalf
|
|
6638
|
-
* @request POST:/
|
|
6836
|
+
* @request POST:/transactions/create-allowance
|
|
6639
6837
|
* @secure
|
|
6640
6838
|
*/
|
|
6641
|
-
createAllowanceTransaction: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6839
|
+
createAllowanceTransaction: (data, params = {}) => this.http.request(Object.assign({ path: `/transactions/create-allowance`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6642
6840
|
};
|
|
6643
|
-
this.
|
|
6841
|
+
this.mpc = {
|
|
6644
6842
|
/**
|
|
6645
6843
|
* No description
|
|
6646
6844
|
*
|
|
6647
|
-
* @tags
|
|
6648
|
-
* @name
|
|
6649
|
-
* @summary
|
|
6650
|
-
* @request
|
|
6651
|
-
* @secure
|
|
6845
|
+
* @tags Mpc
|
|
6846
|
+
* @name InitKeyExchange
|
|
6847
|
+
* @summary Initialize key exchange process, the keys exchanged will be later used for encryption/decryption of the payloads exchanged
|
|
6848
|
+
* @request POST:/mpc/init-key-exchange
|
|
6652
6849
|
*/
|
|
6653
|
-
|
|
6850
|
+
initKeyExchange: (data, params = {}) => this.http.request(Object.assign({ path: `/mpc/init-key-exchange`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
6654
6851
|
/**
|
|
6655
6852
|
* No description
|
|
6656
6853
|
*
|
|
6657
|
-
* @tags
|
|
6658
|
-
* @name
|
|
6659
|
-
* @summary
|
|
6660
|
-
* @request
|
|
6661
|
-
* @secure
|
|
6854
|
+
* @tags Mpc
|
|
6855
|
+
* @name RequestSeedphraseSplit
|
|
6856
|
+
* @summary Request seed phrase split and return shares that can be used later for recovery
|
|
6857
|
+
* @request POST:/mpc/request-seed-split
|
|
6662
6858
|
*/
|
|
6663
|
-
|
|
6859
|
+
requestSeedphraseSplit: (data, params = {}) => this.http.request(Object.assign({ path: `/mpc/request-seed-split`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
6664
6860
|
/**
|
|
6665
6861
|
* No description
|
|
6666
6862
|
*
|
|
6667
|
-
* @tags
|
|
6668
|
-
* @name
|
|
6669
|
-
* @summary
|
|
6670
|
-
* @request POST:/
|
|
6671
|
-
* @secure
|
|
6863
|
+
* @tags Mpc
|
|
6864
|
+
* @name ReconstructSeedPhrase
|
|
6865
|
+
* @summary Pass encrypted shares and return reconstructed encrypted seed phrase
|
|
6866
|
+
* @request POST:/mpc/reconstruct-seed-phrase
|
|
6672
6867
|
*/
|
|
6673
|
-
|
|
6868
|
+
reconstructSeedPhrase: (data, params = {}) => this.http.request(Object.assign({ path: `/mpc/reconstruct-seed-phrase`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
6869
|
+
};
|
|
6870
|
+
this.adminTransactions = {
|
|
6674
6871
|
/**
|
|
6675
6872
|
* No description
|
|
6676
6873
|
*
|
|
6677
|
-
* @tags
|
|
6678
|
-
* @name
|
|
6679
|
-
* @summary
|
|
6680
|
-
* @request POST:/
|
|
6874
|
+
* @tags Admin-Transactions
|
|
6875
|
+
* @name CreateReleaseSchedule
|
|
6876
|
+
* @summary Request the creation of a release schedule
|
|
6877
|
+
* @request POST:/transactions/admin/release-schedule
|
|
6681
6878
|
* @secure
|
|
6682
6879
|
*/
|
|
6683
|
-
|
|
6880
|
+
createReleaseSchedule: (data, params = {}) => this.http.request(Object.assign({ path: `/transactions/admin/release-schedule`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6684
6881
|
/**
|
|
6685
6882
|
* No description
|
|
6686
6883
|
*
|
|
6687
|
-
* @tags
|
|
6688
|
-
* @name
|
|
6689
|
-
* @summary
|
|
6690
|
-
* @request GET:/
|
|
6884
|
+
* @tags Admin-Transactions
|
|
6885
|
+
* @name ViewReleaseSchedule
|
|
6886
|
+
* @summary View a release schedule
|
|
6887
|
+
* @request GET:/transactions/admin/release-schedule
|
|
6691
6888
|
* @secure
|
|
6692
6889
|
*/
|
|
6693
|
-
|
|
6890
|
+
viewReleaseSchedule: (query, params = {}) => this.http.request(Object.assign({ path: `/transactions/admin/release-schedule`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6694
6891
|
/**
|
|
6695
6892
|
* No description
|
|
6696
6893
|
*
|
|
6697
|
-
* @tags
|
|
6698
|
-
* @name
|
|
6699
|
-
* @summary Request
|
|
6700
|
-
* @request
|
|
6894
|
+
* @tags Admin-Transactions
|
|
6895
|
+
* @name Mint
|
|
6896
|
+
* @summary Request the minting of an asset to addresses either via mint release schedule or directly
|
|
6897
|
+
* @request POST:/transactions/admin/mint
|
|
6701
6898
|
* @secure
|
|
6702
6899
|
*/
|
|
6703
|
-
|
|
6900
|
+
mint: (data, params = {}) => this.http.request(Object.assign({ path: `/transactions/admin/mint`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6704
6901
|
/**
|
|
6705
6902
|
* No description
|
|
6706
6903
|
*
|
|
6707
|
-
* @tags
|
|
6708
|
-
* @name
|
|
6709
|
-
* @summary
|
|
6710
|
-
* @request
|
|
6904
|
+
* @tags Admin-Transactions
|
|
6905
|
+
* @name Burn
|
|
6906
|
+
* @summary Request the burning of an asset to address(es) directly
|
|
6907
|
+
* @request POST:/transactions/admin/burn
|
|
6711
6908
|
* @secure
|
|
6712
6909
|
*/
|
|
6713
|
-
|
|
6714
|
-
};
|
|
6715
|
-
this.mpc = {
|
|
6910
|
+
burn: (data, params = {}) => this.http.request(Object.assign({ path: `/transactions/admin/burn`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6716
6911
|
/**
|
|
6717
6912
|
* No description
|
|
6718
6913
|
*
|
|
6719
|
-
* @tags
|
|
6720
|
-
* @name
|
|
6721
|
-
* @summary
|
|
6722
|
-
* @request POST:/
|
|
6914
|
+
* @tags Admin-Transactions
|
|
6915
|
+
* @name ExecutePurchase
|
|
6916
|
+
* @summary Request purchase on the purchase contract
|
|
6917
|
+
* @request POST:/transactions/admin/execute-purchase
|
|
6723
6918
|
* @secure
|
|
6724
6919
|
*/
|
|
6725
|
-
|
|
6726
|
-
/**
|
|
6727
|
-
* No description
|
|
6728
|
-
*
|
|
6729
|
-
* @tags Mpc
|
|
6730
|
-
* @name RequestSeedphraseSplit
|
|
6731
|
-
* @summary Request seed phrase split and return shares that can be used later for recovery
|
|
6732
|
-
* @request POST:/api/v1/mpc/request-seed-split
|
|
6733
|
-
* @secure
|
|
6734
|
-
*/
|
|
6735
|
-
requestSeedphraseSplit: (data, params = {}) => this.http.request(Object.assign({ path: `/api/v1/mpc/request-seed-split`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6736
|
-
/**
|
|
6737
|
-
* No description
|
|
6738
|
-
*
|
|
6739
|
-
* @tags Mpc
|
|
6740
|
-
* @name ReconstructSeedPhrase
|
|
6741
|
-
* @summary Pass encrypted shares and return reconstructed encrypted seed phrase
|
|
6742
|
-
* @request POST:/api/v1/mpc/reconstruct-seed-phrase
|
|
6743
|
-
* @secure
|
|
6744
|
-
*/
|
|
6745
|
-
reconstructSeedPhrase: (data, params = {}) => this.http.request(Object.assign({ path: `/api/v1/mpc/reconstruct-seed-phrase`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6746
|
-
};
|
|
6747
|
-
this.users = {
|
|
6748
|
-
/**
|
|
6749
|
-
* No description
|
|
6750
|
-
*
|
|
6751
|
-
* @tags Users
|
|
6752
|
-
* @name GetAllUsers
|
|
6753
|
-
* @summary Get all users by the admin
|
|
6754
|
-
* @request GET:/api/v1/users
|
|
6755
|
-
* @secure
|
|
6756
|
-
*/
|
|
6757
|
-
getAllUsers: (query, params = {}) => this.http.request(Object.assign({ path: `/api/v1/users`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6758
|
-
/**
|
|
6759
|
-
* No description
|
|
6760
|
-
*
|
|
6761
|
-
* @tags Users
|
|
6762
|
-
* @name UpdateProfile
|
|
6763
|
-
* @summary Update user profile info
|
|
6764
|
-
* @request PUT:/api/v1/users/profile
|
|
6765
|
-
* @secure
|
|
6766
|
-
*/
|
|
6767
|
-
updateProfile: (data, params = {}) => this.http.request(Object.assign({ path: `/api/v1/users/profile`, method: "PUT", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6768
|
-
/**
|
|
6769
|
-
* No description
|
|
6770
|
-
*
|
|
6771
|
-
* @tags Users
|
|
6772
|
-
* @name GetCurrentUser
|
|
6773
|
-
* @summary Returns current user data
|
|
6774
|
-
* @request GET:/api/v1/users/profile
|
|
6775
|
-
* @secure
|
|
6776
|
-
*/
|
|
6777
|
-
getCurrentUser: (params = {}) => this.http.request(Object.assign({ path: `/api/v1/users/profile`, method: "GET", secure: true, format: "json" }, params)),
|
|
6778
|
-
/**
|
|
6779
|
-
* No description
|
|
6780
|
-
*
|
|
6781
|
-
* @tags Users
|
|
6782
|
-
* @name GetCurrentUserSalt
|
|
6783
|
-
* @summary Get current user's client salt
|
|
6784
|
-
* @request GET:/api/v1/users/salt
|
|
6785
|
-
* @secure
|
|
6786
|
-
*/
|
|
6787
|
-
getCurrentUserSalt: (params = {}) => this.http.request(Object.assign({ path: `/api/v1/users/salt`, method: "GET", secure: true, format: "json" }, params)),
|
|
6788
|
-
/**
|
|
6789
|
-
* No description
|
|
6790
|
-
*
|
|
6791
|
-
* @tags Users
|
|
6792
|
-
* @name GetAllWalletsFromUserId
|
|
6793
|
-
* @summary Returns user wallets by specifying user id
|
|
6794
|
-
* @request GET:/api/v1/users/{userId}/wallets
|
|
6795
|
-
* @secure
|
|
6796
|
-
*/
|
|
6797
|
-
getAllWalletsFromUserId: (_a, params) => {
|
|
6798
|
-
var { userId } = _a; __rest(_a, ["userId"]);
|
|
6799
|
-
if (params === void 0) { params = {}; }
|
|
6800
|
-
return this.http.request(Object.assign({ path: `/api/v1/users/${userId}/wallets`, method: "GET", secure: true, format: "json" }, params));
|
|
6801
|
-
},
|
|
6802
|
-
/**
|
|
6803
|
-
* No description
|
|
6804
|
-
*
|
|
6805
|
-
* @tags Users
|
|
6806
|
-
* @name GetCurrentUserMerchantAssets
|
|
6807
|
-
* @summary Returns user's merchant assets
|
|
6808
|
-
* @request GET:/api/v1/users/merchants/assets
|
|
6809
|
-
* @secure
|
|
6810
|
-
*/
|
|
6811
|
-
getCurrentUserMerchantAssets: (query, params = {}) => this.http.request(Object.assign({ path: `/api/v1/users/merchants/assets`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6812
|
-
/**
|
|
6813
|
-
* No description
|
|
6814
|
-
*
|
|
6815
|
-
* @tags Users
|
|
6816
|
-
* @name GetCurrentUserMerchantAssets2
|
|
6817
|
-
* @summary Returns user's merchant assets
|
|
6818
|
-
* @request GET:/api/v1/users/merchant/assets
|
|
6819
|
-
* @originalName getCurrentUserMerchantAssets
|
|
6820
|
-
* @duplicate
|
|
6821
|
-
* @secure
|
|
6822
|
-
*/
|
|
6823
|
-
getCurrentUserMerchantAssets2: (query, params = {}) => this.http.request(Object.assign({ path: `/api/v1/users/merchant/assets`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6824
|
-
/**
|
|
6825
|
-
* No description
|
|
6826
|
-
*
|
|
6827
|
-
* @tags Users
|
|
6828
|
-
* @name GetAssetsByUserId
|
|
6829
|
-
* @summary Returns user assets by specifying user id
|
|
6830
|
-
* @request GET:/api/v1/users/{userId}/assets
|
|
6831
|
-
* @secure
|
|
6832
|
-
*/
|
|
6833
|
-
getAssetsByUserId: (_a, params) => {
|
|
6834
|
-
var { userId } = _a, query = __rest(_a, ["userId"]);
|
|
6835
|
-
if (params === void 0) { params = {}; }
|
|
6836
|
-
return this.http.request(Object.assign({ path: `/api/v1/users/${userId}/assets`, method: "GET", query: query, secure: true, format: "json" }, params));
|
|
6837
|
-
},
|
|
6838
|
-
/**
|
|
6839
|
-
* No description
|
|
6840
|
-
*
|
|
6841
|
-
* @tags Users
|
|
6842
|
-
* @name AddAssetToUser
|
|
6843
|
-
* @summary Add a new asset to the user's wallet based on the asset configuration
|
|
6844
|
-
* @request POST:/api/v1/users/assets/add
|
|
6845
|
-
* @secure
|
|
6846
|
-
*/
|
|
6847
|
-
addAssetToUser: (data, params = {}) => this.http.request(Object.assign({ path: `/api/v1/users/assets/add`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6848
|
-
/**
|
|
6849
|
-
* No description
|
|
6850
|
-
*
|
|
6851
|
-
* @tags Users
|
|
6852
|
-
* @name RemoveAssetFromUser
|
|
6853
|
-
* @summary Remove an asset from the user's wallet based on the asset configuration
|
|
6854
|
-
* @request DELETE:/api/v1/users/{userId}/wallets/{walletId}/assets/{assetConfigId}
|
|
6855
|
-
* @secure
|
|
6856
|
-
*/
|
|
6857
|
-
removeAssetFromUser: (_a, params) => {
|
|
6858
|
-
var { assetConfigId, walletId, userId } = _a; __rest(_a, ["assetConfigId", "walletId", "userId"]);
|
|
6859
|
-
if (params === void 0) { params = {}; }
|
|
6860
|
-
return this.http.request(Object.assign({ path: `/api/v1/users/${userId}/wallets/${walletId}/assets/${assetConfigId}`, method: "DELETE", secure: true, format: "json" }, params));
|
|
6861
|
-
},
|
|
6862
|
-
/**
|
|
6863
|
-
* No description
|
|
6864
|
-
*
|
|
6865
|
-
* @tags Users
|
|
6866
|
-
* @name GetUserByUserId
|
|
6867
|
-
* @summary Returns user public data
|
|
6868
|
-
* @request GET:/api/v1/users/{userId}
|
|
6869
|
-
* @secure
|
|
6870
|
-
*/
|
|
6871
|
-
getUserByUserId: (_a, params) => {
|
|
6872
|
-
var { userId } = _a; __rest(_a, ["userId"]);
|
|
6873
|
-
if (params === void 0) { params = {}; }
|
|
6874
|
-
return this.http.request(Object.assign({ path: `/api/v1/users/${userId}`, method: "GET", secure: true, format: "json" }, params));
|
|
6875
|
-
},
|
|
6876
|
-
/**
|
|
6877
|
-
* No description
|
|
6878
|
-
*
|
|
6879
|
-
* @tags Users
|
|
6880
|
-
* @name GetUserByExternalUserId
|
|
6881
|
-
* @request GET:/api/v1/users/{externalUserId}/externalUserId
|
|
6882
|
-
* @secure
|
|
6883
|
-
*/
|
|
6884
|
-
getUserByExternalUserId: (_a, params) => {
|
|
6885
|
-
var { externalUserId } = _a; __rest(_a, ["externalUserId"]);
|
|
6886
|
-
if (params === void 0) { params = {}; }
|
|
6887
|
-
return this.http.request(Object.assign({ path: `/api/v1/users/${externalUserId}/externalUserId`, method: "GET", secure: true, format: "json" }, params));
|
|
6888
|
-
},
|
|
6889
|
-
/**
|
|
6890
|
-
* No description
|
|
6891
|
-
*
|
|
6892
|
-
* @tags Users
|
|
6893
|
-
* @name GetParticipantsByUserId
|
|
6894
|
-
* @summary Returns multisig participants by user id
|
|
6895
|
-
* @request GET:/api/v1/users/{userId}/multisig-transactions
|
|
6896
|
-
* @secure
|
|
6897
|
-
*/
|
|
6898
|
-
getParticipantsByUserId: (_a, params) => {
|
|
6899
|
-
var { userId } = _a, query = __rest(_a, ["userId"]);
|
|
6900
|
-
if (params === void 0) { params = {}; }
|
|
6901
|
-
return this.http.request(Object.assign({ path: `/api/v1/users/${userId}/multisig-transactions`, method: "GET", query: query, secure: true, format: "json" }, params));
|
|
6902
|
-
},
|
|
6903
|
-
};
|
|
6904
|
-
this.adminTransactions = {
|
|
6905
|
-
/**
|
|
6906
|
-
* No description
|
|
6907
|
-
*
|
|
6908
|
-
* @tags Admin-Transactions
|
|
6909
|
-
* @name CreateReleaseSchedule
|
|
6910
|
-
* @summary Request the creation of a release schedule
|
|
6911
|
-
* @request POST:/api/v1/transactions/admin/release-schedule
|
|
6912
|
-
* @secure
|
|
6913
|
-
*/
|
|
6914
|
-
createReleaseSchedule: (data, params = {}) => this.http.request(Object.assign({ path: `/api/v1/transactions/admin/release-schedule`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6915
|
-
/**
|
|
6916
|
-
* No description
|
|
6917
|
-
*
|
|
6918
|
-
* @tags Admin-Transactions
|
|
6919
|
-
* @name ViewReleaseSchedule
|
|
6920
|
-
* @summary View a release schedule
|
|
6921
|
-
* @request GET:/api/v1/transactions/admin/release-schedule
|
|
6922
|
-
* @secure
|
|
6923
|
-
*/
|
|
6924
|
-
viewReleaseSchedule: (query, params = {}) => this.http.request(Object.assign({ path: `/api/v1/transactions/admin/release-schedule`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6925
|
-
/**
|
|
6926
|
-
* No description
|
|
6927
|
-
*
|
|
6928
|
-
* @tags Admin-Transactions
|
|
6929
|
-
* @name Mint
|
|
6930
|
-
* @summary Request the minting of an asset to addresses either via mint release schedule or directly
|
|
6931
|
-
* @request POST:/api/v1/transactions/admin/mint
|
|
6932
|
-
* @secure
|
|
6933
|
-
*/
|
|
6934
|
-
mint: (data, params = {}) => this.http.request(Object.assign({ path: `/api/v1/transactions/admin/mint`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6935
|
-
/**
|
|
6936
|
-
* No description
|
|
6937
|
-
*
|
|
6938
|
-
* @tags Admin-Transactions
|
|
6939
|
-
* @name Burn
|
|
6940
|
-
* @summary Request the burning of an asset to address(es) directly
|
|
6941
|
-
* @request POST:/api/v1/transactions/admin/burn
|
|
6942
|
-
* @secure
|
|
6943
|
-
*/
|
|
6944
|
-
burn: (data, params = {}) => this.http.request(Object.assign({ path: `/api/v1/transactions/admin/burn`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6945
|
-
/**
|
|
6946
|
-
* No description
|
|
6947
|
-
*
|
|
6948
|
-
* @tags Admin-Transactions
|
|
6949
|
-
* @name ExecutePurchase
|
|
6950
|
-
* @summary Request purchase on the purchase contract
|
|
6951
|
-
* @request POST:/api/v1/transactions/admin/execute-purchase
|
|
6952
|
-
* @secure
|
|
6953
|
-
*/
|
|
6954
|
-
executePurchase: (data, params = {}) => this.http.request(Object.assign({ path: `/api/v1/transactions/admin/execute-purchase`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6920
|
+
executePurchase: (data, params = {}) => this.http.request(Object.assign({ path: `/transactions/admin/execute-purchase`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6955
6921
|
/**
|
|
6956
6922
|
* No description
|
|
6957
6923
|
*
|
|
6958
6924
|
* @tags Admin-Transactions
|
|
6959
6925
|
* @name ExecutePurchaseWithInterest
|
|
6960
6926
|
* @summary Request purchase with interest on the purchase contract
|
|
6961
|
-
* @request POST:/
|
|
6927
|
+
* @request POST:/transactions/admin/execute-purchase-with-interest
|
|
6962
6928
|
* @secure
|
|
6963
6929
|
*/
|
|
6964
|
-
executePurchaseWithInterest: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6930
|
+
executePurchaseWithInterest: (data, params = {}) => this.http.request(Object.assign({ path: `/transactions/admin/execute-purchase-with-interest`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6965
6931
|
/**
|
|
6966
6932
|
* No description
|
|
6967
6933
|
*
|
|
6968
6934
|
* @tags Admin-Transactions
|
|
6969
6935
|
* @name SetIdentity
|
|
6970
6936
|
* @summary Set identity via the identity registry contract
|
|
6971
|
-
* @request POST:/
|
|
6937
|
+
* @request POST:/transactions/admin/set-identity
|
|
6972
6938
|
* @secure
|
|
6973
6939
|
*/
|
|
6974
|
-
setIdentity: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6940
|
+
setIdentity: (data, params = {}) => this.http.request(Object.assign({ path: `/transactions/admin/set-identity`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6975
6941
|
/**
|
|
6976
6942
|
* No description
|
|
6977
6943
|
*
|
|
6978
6944
|
* @tags Admin-Transactions
|
|
6979
6945
|
* @name ForceClaim
|
|
6980
6946
|
* @summary Force claim interest via the interest payment contract
|
|
6981
|
-
* @request POST:/
|
|
6947
|
+
* @request POST:/transactions/admin/force-claim
|
|
6982
6948
|
* @secure
|
|
6983
6949
|
*/
|
|
6984
|
-
forceClaim: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6950
|
+
forceClaim: (data, params = {}) => this.http.request(Object.assign({ path: `/transactions/admin/force-claim`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6985
6951
|
/**
|
|
6986
6952
|
* No description
|
|
6987
6953
|
*
|
|
6988
6954
|
* @tags Admin-Transactions
|
|
6989
6955
|
* @name ForceClaimPrincipal
|
|
6990
6956
|
* @summary Force claim principal via the interest payment contract
|
|
6991
|
-
* @request POST:/
|
|
6957
|
+
* @request POST:/transactions/admin/force-claim-principal
|
|
6992
6958
|
* @secure
|
|
6993
6959
|
*/
|
|
6994
|
-
forceClaimPrincipal: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6960
|
+
forceClaimPrincipal: (data, params = {}) => this.http.request(Object.assign({ path: `/transactions/admin/force-claim-principal`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6995
6961
|
/**
|
|
6996
6962
|
* No description
|
|
6997
6963
|
*
|
|
6998
6964
|
* @tags Admin-Transactions
|
|
6999
6965
|
* @name GetCallbackPublicKey
|
|
7000
|
-
* @request GET:/
|
|
7001
|
-
* @secure
|
|
6966
|
+
* @request GET:/transactions/admin/callback_pk
|
|
7002
6967
|
*/
|
|
7003
|
-
getCallbackPublicKey: (params = {}) => this.http.request(Object.assign({ path: `/
|
|
6968
|
+
getCallbackPublicKey: (params = {}) => this.http.request(Object.assign({ path: `/transactions/admin/callback_pk`, method: "GET" }, params)),
|
|
7004
6969
|
/**
|
|
7005
6970
|
* No description
|
|
7006
6971
|
*
|
|
7007
6972
|
* @tags Admin-Transactions
|
|
7008
6973
|
* @name ViewAdminTransaction
|
|
7009
6974
|
* @summary View an admin transaction
|
|
7010
|
-
* @request GET:/
|
|
6975
|
+
* @request GET:/transactions/admin/{referenceId}
|
|
7011
6976
|
* @secure
|
|
7012
6977
|
*/
|
|
7013
6978
|
viewAdminTransaction: (_a, params) => {
|
|
7014
6979
|
var { referenceId } = _a; __rest(_a, ["referenceId"]);
|
|
7015
6980
|
if (params === void 0) { params = {}; }
|
|
7016
|
-
return this.http.request(Object.assign({ path: `/
|
|
6981
|
+
return this.http.request(Object.assign({ path: `/transactions/admin/${referenceId}`, method: "GET", secure: true, format: "json" }, params));
|
|
7017
6982
|
},
|
|
7018
6983
|
/**
|
|
7019
6984
|
* No description
|
|
@@ -7021,30 +6986,9 @@ class Api {
|
|
|
7021
6986
|
* @tags Admin-Transactions
|
|
7022
6987
|
* @name UpsideCallback
|
|
7023
6988
|
* @summary Upside callback for release schedule
|
|
7024
|
-
* @request POST:/
|
|
7025
|
-
* @secure
|
|
6989
|
+
* @request POST:/transactions/admin/callback
|
|
7026
6990
|
*/
|
|
7027
|
-
upsideCallback: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
7028
|
-
};
|
|
7029
|
-
this.v1 = {
|
|
7030
|
-
/**
|
|
7031
|
-
* No description
|
|
7032
|
-
*
|
|
7033
|
-
* @name DashboardControllerGetDashboardData
|
|
7034
|
-
* @summary Create new merchant. This endpoint is only available for super admin and republic admin
|
|
7035
|
-
* @request GET:/api/v1/dashboard
|
|
7036
|
-
* @secure
|
|
7037
|
-
*/
|
|
7038
|
-
dashboardControllerGetDashboardData: (params = {}) => this.http.request(Object.assign({ path: `/api/v1/dashboard`, method: "GET", secure: true }, params)),
|
|
7039
|
-
/**
|
|
7040
|
-
* No description
|
|
7041
|
-
*
|
|
7042
|
-
* @name GetActivitiees
|
|
7043
|
-
* @summary Get all activities. This endpoint is only available for super admin and republic admin
|
|
7044
|
-
* @request GET:/api/v1/users-activities
|
|
7045
|
-
* @secure
|
|
7046
|
-
*/
|
|
7047
|
-
getActivitiees: (query, params = {}) => this.http.request(Object.assign({ path: `/api/v1/users-activities`, method: "GET", query: query, secure: true }, params)),
|
|
6991
|
+
upsideCallback: (data, params = {}) => this.http.request(Object.assign({ path: `/transactions/admin/callback`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
7048
6992
|
};
|
|
7049
6993
|
this.http = http;
|
|
7050
6994
|
}
|
|
@@ -7068,11 +7012,17 @@ function objectToQueryParams(obj) {
|
|
|
7068
7012
|
|
|
7069
7013
|
class Base {
|
|
7070
7014
|
constructor(config) {
|
|
7015
|
+
var _a, _b;
|
|
7071
7016
|
const sanitizedConfig = sanitizeConfig(config);
|
|
7072
7017
|
this.apiKey = sanitizedConfig.apiKey;
|
|
7073
7018
|
this.baseUrl = sanitizedConfig.baseUrl;
|
|
7074
7019
|
this.userId = sanitizedConfig.userId;
|
|
7075
7020
|
this.options = sanitizedConfig.options;
|
|
7021
|
+
if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.platform) {
|
|
7022
|
+
env.platform = this.options.platform;
|
|
7023
|
+
env.isNative = this.options.platform === 'ios' || this.options.platform === 'android';
|
|
7024
|
+
env.isWeb = !env.isNative;
|
|
7025
|
+
}
|
|
7076
7026
|
this.cipher = new Cipher();
|
|
7077
7027
|
this.lockManager = new LockManagerService();
|
|
7078
7028
|
this._initializeClientAuthToken(sanitizedConfig.clientAuthToken);
|
|
@@ -7117,10 +7067,7 @@ class Base {
|
|
|
7117
7067
|
}
|
|
7118
7068
|
};
|
|
7119
7069
|
this.api = new Api(httpClient);
|
|
7120
|
-
this.api.http.setSecurityData({
|
|
7121
|
-
'x-api-key': config.apiKey,
|
|
7122
|
-
'x-client-jwt': config.clientAuthToken,
|
|
7123
|
-
});
|
|
7070
|
+
this.api.http.setSecurityData(Object.assign({ 'x-api-key': config.apiKey, 'x-client-jwt': config.clientAuthToken }, (_b = this.options) === null || _b === void 0 ? void 0 : _b.headers));
|
|
7124
7071
|
}
|
|
7125
7072
|
set setClientAuthToken(token) {
|
|
7126
7073
|
this._initializeClientAuthToken(token);
|
|
@@ -7567,43 +7514,88 @@ const TransactionsRoutes = {
|
|
|
7567
7514
|
},
|
|
7568
7515
|
};
|
|
7569
7516
|
|
|
7570
|
-
|
|
7517
|
+
const SwapRoutes = {
|
|
7518
|
+
getQuote: {
|
|
7519
|
+
fullPath: ({ walletId }) => `/api/v1/wallets/${walletId}/swap/quote`,
|
|
7520
|
+
method: RequestMethod.Post,
|
|
7521
|
+
requiresAccessToken: true,
|
|
7522
|
+
},
|
|
7523
|
+
executeSwap: {
|
|
7524
|
+
fullPath: ({ walletId }) => `/api/v1/wallets/${walletId}/swap`,
|
|
7525
|
+
method: RequestMethod.Post,
|
|
7526
|
+
requiresAccessToken: true,
|
|
7527
|
+
},
|
|
7528
|
+
getSwaps: {
|
|
7529
|
+
fullPath: ({ walletId }) => `/api/v1/wallets/${walletId}/swaps`,
|
|
7530
|
+
method: RequestMethod.Get,
|
|
7531
|
+
requiresAccessToken: true,
|
|
7532
|
+
},
|
|
7533
|
+
};
|
|
7534
|
+
|
|
7571
7535
|
/**
|
|
7572
|
-
*
|
|
7536
|
+
* React Native Authenticator Implementation
|
|
7573
7537
|
*
|
|
7574
|
-
* This file contains the
|
|
7575
|
-
* It's automatically picked up by
|
|
7538
|
+
* This file contains the native-specific authenticator logic for iOS and Android.
|
|
7539
|
+
* It's automatically picked up by React Native Metro bundler when importing './authenticator'
|
|
7576
7540
|
*
|
|
7577
|
-
*
|
|
7541
|
+
* https://reactnative.dev/docs/platform-specific-code#native-specific-extensions-ie-sharing-code-with-nodejs-and-web
|
|
7578
7542
|
*/
|
|
7543
|
+
var AuthenticatorTransport;
|
|
7544
|
+
(function (AuthenticatorTransport) {
|
|
7545
|
+
AuthenticatorTransport["usb"] = "usb";
|
|
7546
|
+
AuthenticatorTransport["nfc"] = "nfc";
|
|
7547
|
+
AuthenticatorTransport["ble"] = "ble";
|
|
7548
|
+
AuthenticatorTransport["smartCard"] = "smart-card";
|
|
7549
|
+
AuthenticatorTransport["hybrid"] = "hybrid";
|
|
7550
|
+
AuthenticatorTransport["internal"] = "internal";
|
|
7551
|
+
})(AuthenticatorTransport || (AuthenticatorTransport = {}));
|
|
7579
7552
|
class Authenticator {
|
|
7580
7553
|
constructor() {
|
|
7581
|
-
|
|
7554
|
+
if (env.platform === 'ios' || env.platform === 'android') {
|
|
7555
|
+
this.platform = env.platform;
|
|
7556
|
+
}
|
|
7557
|
+
else {
|
|
7558
|
+
throw new Error('React Native platform not detected');
|
|
7559
|
+
}
|
|
7582
7560
|
}
|
|
7583
7561
|
async register({ optionsJSON }) {
|
|
7584
|
-
|
|
7585
|
-
|
|
7586
|
-
|
|
7587
|
-
|
|
7588
|
-
|
|
7589
|
-
|
|
7562
|
+
try {
|
|
7563
|
+
if (!NativeWebAuthn.Passkey.isSupported()) {
|
|
7564
|
+
if (this.platform === 'android') {
|
|
7565
|
+
throw new Error(AndroidVersionNotSupportedError.error);
|
|
7566
|
+
}
|
|
7567
|
+
else {
|
|
7568
|
+
throw new Error(IOSVersionNotSupportedError.error);
|
|
7569
|
+
}
|
|
7570
|
+
}
|
|
7571
|
+
// Those checks are only to satisfy the type conversion to `PasskeyCreateRequest`
|
|
7572
|
+
if (!optionsJSON.extensions) {
|
|
7573
|
+
throw new Error('Invalid passkey options. Required fields are missing.');
|
|
7574
|
+
}
|
|
7575
|
+
const passkeyMappedPayload = this.mapPasskeyCreationPayload(optionsJSON);
|
|
7576
|
+
const response = await NativeWebAuthn.Passkey.create(passkeyMappedPayload);
|
|
7577
|
+
// Map PasskeyCreateResult to RegistrationResponseJSON
|
|
7578
|
+
return this.mapPasskeyCreationResponse(response);
|
|
7579
|
+
}
|
|
7580
|
+
catch (error) {
|
|
7581
|
+
this.handlePasskeyError(error);
|
|
7582
|
+
throw error; // This will never be reached due to handlePasskeyError throwing, but satisfies TypeScript
|
|
7590
7583
|
}
|
|
7591
|
-
return await WebAuthn.startRegistration({ optionsJSON });
|
|
7592
7584
|
}
|
|
7593
|
-
async authenticate({ optionsJSON
|
|
7585
|
+
async authenticate({ optionsJSON }) {
|
|
7594
7586
|
try {
|
|
7595
|
-
if (
|
|
7596
|
-
|
|
7597
|
-
|
|
7598
|
-
|
|
7599
|
-
|
|
7600
|
-
|
|
7587
|
+
if (!NativeWebAuthn.Passkey.isSupported()) {
|
|
7588
|
+
if (this.platform === 'android') {
|
|
7589
|
+
throw new Error(AndroidVersionNotSupportedError.error);
|
|
7590
|
+
}
|
|
7591
|
+
else {
|
|
7592
|
+
throw new Error(IOSVersionNotSupportedError.error);
|
|
7593
|
+
}
|
|
7601
7594
|
}
|
|
7602
|
-
const
|
|
7603
|
-
|
|
7604
|
-
|
|
7605
|
-
|
|
7606
|
-
return response;
|
|
7595
|
+
const passkeyMappedPayload = this.mapPasskeyAuthenticationPayload(optionsJSON);
|
|
7596
|
+
const response = await NativeWebAuthn.Passkey.get(passkeyMappedPayload);
|
|
7597
|
+
// Map PasskeyGetResult to AuthenticationResponseJSON
|
|
7598
|
+
return this.mapPasskeyAuthenticationResponse(response);
|
|
7607
7599
|
}
|
|
7608
7600
|
catch (error) {
|
|
7609
7601
|
this.handlePasskeyError(error);
|
|
@@ -7612,48 +7604,169 @@ class Authenticator {
|
|
|
7612
7604
|
}
|
|
7613
7605
|
/**
|
|
7614
7606
|
* @description Handles the passkey error and throws a user-friendly error message.
|
|
7615
|
-
* @param {WebAuthnError | Error | any} error
|
|
7607
|
+
* @param {WebAuthnError | PasskeyError | Error | any} error
|
|
7616
7608
|
* @returns {Error} The error message.
|
|
7617
7609
|
*/
|
|
7618
7610
|
handlePasskeyError(error) {
|
|
7619
7611
|
logger.error('SDK::Authenticator::handlePasskeyError', error);
|
|
7620
|
-
if (error instanceof
|
|
7621
|
-
|
|
7622
|
-
return this.throwPasskeyError({ errorCode: error.code });
|
|
7623
|
-
}
|
|
7624
|
-
else if (error instanceof Error) {
|
|
7625
|
-
logger.debug('SDK::Authenticator::handlePasskeyError - Error', error);
|
|
7626
|
-
return this.throwPasskeyError({ errorMessage: error.message });
|
|
7612
|
+
if (error instanceof Error) {
|
|
7613
|
+
return this.throwPasskeyError(error.message.split(' ')[0]);
|
|
7627
7614
|
}
|
|
7628
7615
|
else if (typeof error === 'object' && error.error && error.message) {
|
|
7629
|
-
|
|
7630
|
-
return this.throwPasskeyError({ errorCode: error.error, errorMessage: error.message });
|
|
7616
|
+
return this.throwPasskeyError(error.error);
|
|
7631
7617
|
}
|
|
7632
7618
|
else if (typeof error === 'string') {
|
|
7633
|
-
|
|
7634
|
-
return this.throwPasskeyError({ errorMessage: error });
|
|
7619
|
+
return this.throwPasskeyError(error);
|
|
7635
7620
|
}
|
|
7636
7621
|
else {
|
|
7637
|
-
|
|
7638
|
-
return this.throwPasskeyError({});
|
|
7622
|
+
return this.throwPasskeyError();
|
|
7639
7623
|
}
|
|
7640
7624
|
}
|
|
7641
|
-
throwPasskeyError(
|
|
7642
|
-
var _a
|
|
7643
|
-
|
|
7625
|
+
throwPasskeyError(errorCode) {
|
|
7626
|
+
var _a;
|
|
7627
|
+
console.error('SDK::Authenticator::throwPasskeyError', errorCode);
|
|
7644
7628
|
const errorToThrow = PasskeyErrorCodes.find((error) => {
|
|
7645
7629
|
return error.error === errorCode;
|
|
7646
7630
|
});
|
|
7647
7631
|
logger.error('SDK::Authenticator::error', errorToThrow);
|
|
7648
|
-
throw new
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
|
|
7652
|
-
|
|
7632
|
+
throw new Error((_a = errorToThrow === null || errorToThrow === void 0 ? void 0 : errorToThrow.message) !== null && _a !== void 0 ? _a : UnknownError.message);
|
|
7633
|
+
}
|
|
7634
|
+
mapPasskeyCreationPayload(optionsJSON) {
|
|
7635
|
+
var _a, _b, _c;
|
|
7636
|
+
const authenticatorSelection = optionsJSON.authenticatorSelection;
|
|
7637
|
+
const requestedExtensions = optionsJSON.extensions;
|
|
7638
|
+
if (!((_a = requestedExtensions.prf.eval) === null || _a === void 0 ? void 0 : _a.first)) {
|
|
7639
|
+
throw new Error('Invalid passkey options. Required fields are missing.');
|
|
7640
|
+
}
|
|
7641
|
+
const prfFirstSalt = new Uint8Array(ArrayBuffer.isView(requestedExtensions.prf.eval.first)
|
|
7642
|
+
? requestedExtensions.prf.eval.first.buffer
|
|
7643
|
+
: requestedExtensions.prf.eval.first);
|
|
7644
|
+
return {
|
|
7645
|
+
user: {
|
|
7646
|
+
id: optionsJSON.user.id,
|
|
7647
|
+
name: optionsJSON.user.name,
|
|
7648
|
+
displayName: optionsJSON.user.displayName,
|
|
7649
|
+
},
|
|
7650
|
+
rp: {
|
|
7651
|
+
id: (_b = optionsJSON.rp.id) !== null && _b !== void 0 ? _b : '',
|
|
7652
|
+
name: optionsJSON.rp.name,
|
|
7653
|
+
},
|
|
7654
|
+
extensions: {
|
|
7655
|
+
largeBlob: { supported: false },
|
|
7656
|
+
prf: {
|
|
7657
|
+
eval: {
|
|
7658
|
+
first: prfFirstSalt,
|
|
7659
|
+
},
|
|
7660
|
+
},
|
|
7661
|
+
},
|
|
7662
|
+
authenticatorSelection: {
|
|
7663
|
+
authenticatorAttachment: authenticatorSelection === null || authenticatorSelection === void 0 ? void 0 : authenticatorSelection.authenticatorAttachment,
|
|
7664
|
+
requireResidentKey: (_c = authenticatorSelection === null || authenticatorSelection === void 0 ? void 0 : authenticatorSelection.requireResidentKey) !== null && _c !== void 0 ? _c : false,
|
|
7665
|
+
residentKey: authenticatorSelection === null || authenticatorSelection === void 0 ? void 0 : authenticatorSelection.residentKey,
|
|
7666
|
+
userVerification: authenticatorSelection === null || authenticatorSelection === void 0 ? void 0 : authenticatorSelection.userVerification,
|
|
7667
|
+
},
|
|
7668
|
+
challenge: optionsJSON.challenge,
|
|
7669
|
+
pubKeyCredParams: optionsJSON.pubKeyCredParams.map((param) => ({
|
|
7670
|
+
type: param.type,
|
|
7671
|
+
alg: param.alg,
|
|
7672
|
+
})),
|
|
7673
|
+
};
|
|
7674
|
+
}
|
|
7675
|
+
mapPasskeyCreationResponse(response) {
|
|
7676
|
+
var _a, _b, _c;
|
|
7677
|
+
// react-native-passkey returns clientExtensionResults at the top level (actual device behaviour),
|
|
7678
|
+
// despite its own TypeScript types nesting it under `extensions.clientExtensionResults`.
|
|
7679
|
+
// Try the actual (top-level) location first, fall back to the typed path.
|
|
7680
|
+
const topLevel = response.clientExtensionResults;
|
|
7681
|
+
const nested = (_a = response.extensions) === null || _a === void 0 ? void 0 : _a.clientExtensionResults;
|
|
7682
|
+
const prf = (_b = topLevel === null || topLevel === void 0 ? void 0 : topLevel.prf) !== null && _b !== void 0 ? _b : nested === null || nested === void 0 ? void 0 : nested.prf;
|
|
7683
|
+
logger.log('SDK::Authenticator::mapPasskeyCreationResponse', { id: response.id, hasPrf: !!prf });
|
|
7684
|
+
return {
|
|
7685
|
+
id: response.id,
|
|
7686
|
+
rawId: response.rawId,
|
|
7687
|
+
type: ((_c = response.type) !== null && _c !== void 0 ? _c : 'public-key'),
|
|
7688
|
+
response: response.response,
|
|
7689
|
+
clientExtensionResults: {
|
|
7690
|
+
credProps: { rk: true },
|
|
7691
|
+
prf,
|
|
7692
|
+
},
|
|
7693
|
+
};
|
|
7694
|
+
}
|
|
7695
|
+
mapPasskeyAuthenticationResponse(response) {
|
|
7696
|
+
var _a, _b;
|
|
7697
|
+
return {
|
|
7698
|
+
id: response.id, // ensure this is Base64URLString
|
|
7699
|
+
rawId: response.rawId, // ensure this is Base64URLString
|
|
7700
|
+
type: ((_a = response.type) !== null && _a !== void 0 ? _a : 'public-key'),
|
|
7701
|
+
response: response.response,
|
|
7702
|
+
// this should satisfy the expected extension response.
|
|
7703
|
+
clientExtensionResults: {
|
|
7704
|
+
credProps: { rk: true },
|
|
7705
|
+
prf: (_b = response.clientExtensionResults) === null || _b === void 0 ? void 0 : _b.prf,
|
|
7706
|
+
},
|
|
7707
|
+
};
|
|
7708
|
+
}
|
|
7709
|
+
mapPasskeyAuthenticationPayload(optionsJSON) {
|
|
7710
|
+
var _a, _b, _c;
|
|
7711
|
+
const requestedExtensions = optionsJSON.extensions;
|
|
7712
|
+
if (!((_a = requestedExtensions.prf.eval) === null || _a === void 0 ? void 0 : _a.first)) {
|
|
7713
|
+
throw new Error('Invalid passkey options. Required fields are missing.');
|
|
7714
|
+
}
|
|
7715
|
+
const prfFirstSalt = new Uint8Array(ArrayBuffer.isView(requestedExtensions.prf.eval.first)
|
|
7716
|
+
? requestedExtensions.prf.eval.first.buffer
|
|
7717
|
+
: requestedExtensions.prf.eval.first);
|
|
7718
|
+
return {
|
|
7719
|
+
rpId: (_b = optionsJSON.rpId) !== null && _b !== void 0 ? _b : '',
|
|
7720
|
+
challenge: optionsJSON.challenge,
|
|
7721
|
+
allowCredentials: (_c = optionsJSON.allowCredentials) === null || _c === void 0 ? void 0 : _c.map((credential) => ({
|
|
7722
|
+
id: credential.id,
|
|
7723
|
+
type: 'public-key',
|
|
7724
|
+
transports: [AuthenticatorTransport.internal],
|
|
7725
|
+
})),
|
|
7726
|
+
extensions: {
|
|
7727
|
+
prf: {
|
|
7728
|
+
eval: {
|
|
7729
|
+
first: prfFirstSalt,
|
|
7730
|
+
},
|
|
7731
|
+
},
|
|
7732
|
+
},
|
|
7733
|
+
};
|
|
7734
|
+
}
|
|
7735
|
+
}
|
|
7736
|
+
|
|
7737
|
+
/**
|
|
7738
|
+
* Shared base64 helpers. Platform-specific files (base64.ts, base64.native.ts)
|
|
7739
|
+
* import from here and add or re-export as needed.
|
|
7740
|
+
*/
|
|
7741
|
+
function normalizeAndPadBase64(s) {
|
|
7742
|
+
const normalized = s.replace(/-/g, '+').replace(/_/g, '/');
|
|
7743
|
+
return normalized.padEnd(normalized.length + ((4 - (normalized.length % 4)) % 4), '=');
|
|
7744
|
+
}
|
|
7745
|
+
function decodeBase64String(s) {
|
|
7746
|
+
return toUint8Array(normalizeAndPadBase64(s));
|
|
7747
|
+
}
|
|
7748
|
+
/**
|
|
7749
|
+
* Single-decode only: decode base64 (or base64url) to bytes. No round-trip double-decode.
|
|
7750
|
+
*/
|
|
7751
|
+
function base64ToUint8Array(base64) {
|
|
7752
|
+
try {
|
|
7753
|
+
return toUint8Array(base64);
|
|
7754
|
+
}
|
|
7755
|
+
catch (_a) {
|
|
7756
|
+
return decodeBase64String(base64);
|
|
7653
7757
|
}
|
|
7654
7758
|
}
|
|
7759
|
+
function decodeBase64URL(base64url) {
|
|
7760
|
+
const padded = normalizeAndPadBase64(base64url);
|
|
7761
|
+
const binary = atob(padded);
|
|
7762
|
+
const bytes = new Uint8Array(binary.length);
|
|
7763
|
+
for (let i = 0; i < binary.length; i++) {
|
|
7764
|
+
bytes[i] = binary.charCodeAt(i);
|
|
7765
|
+
}
|
|
7766
|
+
return bytes;
|
|
7767
|
+
}
|
|
7655
7768
|
|
|
7656
|
-
class PasskeyService {
|
|
7769
|
+
let PasskeyService$1 = class PasskeyService {
|
|
7657
7770
|
constructor(userId, storageService, request) {
|
|
7658
7771
|
this.cipher = new Cipher();
|
|
7659
7772
|
this.localStorageService = storageService;
|
|
@@ -7664,7 +7777,7 @@ class PasskeyService {
|
|
|
7664
7777
|
preparePasskeyRequestOptions(options) {
|
|
7665
7778
|
var _a, _b, _c, _d, _e, _f;
|
|
7666
7779
|
const prfExtensionEvaluation = ((_b = (_a = options.extensions) === null || _a === void 0 ? void 0 : _a.prf.eval) === null || _b === void 0 ? void 0 : _b.base64)
|
|
7667
|
-
?
|
|
7780
|
+
? decodeBase64URL(options.extensions.prf.eval.base64)
|
|
7668
7781
|
: ((_d = (_c = options.extensions) === null || _c === void 0 ? void 0 : _c.prf.eval) === null || _d === void 0 ? void 0 : _d.first) instanceof ArrayBuffer
|
|
7669
7782
|
? new Uint8Array(options.extensions.prf.eval.first)
|
|
7670
7783
|
: typeof ((_f = (_e = options.extensions) === null || _e === void 0 ? void 0 : _e.prf.eval) === null || _f === void 0 ? void 0 : _f.first) === 'object'
|
|
@@ -7684,7 +7797,7 @@ class PasskeyService {
|
|
|
7684
7797
|
preparePasskeyCreationOptions(options) {
|
|
7685
7798
|
var _a, _b, _c, _d, _e, _f;
|
|
7686
7799
|
const prfExtensionEvaluation = ((_b = (_a = options.extensions) === null || _a === void 0 ? void 0 : _a.prf.eval) === null || _b === void 0 ? void 0 : _b.base64)
|
|
7687
|
-
?
|
|
7800
|
+
? decodeBase64URL(options.extensions.prf.eval.base64)
|
|
7688
7801
|
: ((_d = (_c = options.extensions) === null || _c === void 0 ? void 0 : _c.prf.eval) === null || _d === void 0 ? void 0 : _d.first) instanceof ArrayBuffer
|
|
7689
7802
|
? new Uint8Array(options.extensions.prf.eval.first)
|
|
7690
7803
|
: typeof ((_f = (_e = options.extensions) === null || _e === void 0 ? void 0 : _e.prf.eval) === null || _f === void 0 ? void 0 : _f.first) === 'object'
|
|
@@ -8085,8 +8198,50 @@ class PasskeyService {
|
|
|
8085
8198
|
errorCode: ErrorResponseCodes.sdk_passkey_prf_not_available,
|
|
8086
8199
|
});
|
|
8087
8200
|
}
|
|
8088
|
-
const
|
|
8089
|
-
|
|
8201
|
+
const prfResult = (_e = extensions.prf.results) === null || _e === void 0 ? void 0 : _e.first;
|
|
8202
|
+
let prfValue;
|
|
8203
|
+
if (typeof prfResult === 'string') {
|
|
8204
|
+
prfValue = base64ToUint8Array(prfResult);
|
|
8205
|
+
}
|
|
8206
|
+
else if (prfResult instanceof Uint8Array) {
|
|
8207
|
+
prfValue = prfResult;
|
|
8208
|
+
}
|
|
8209
|
+
else if (prfResult instanceof ArrayBuffer) {
|
|
8210
|
+
prfValue = new Uint8Array(prfResult);
|
|
8211
|
+
}
|
|
8212
|
+
else if (ArrayBuffer.isView(prfResult)) {
|
|
8213
|
+
prfValue = new Uint8Array(prfResult.buffer);
|
|
8214
|
+
}
|
|
8215
|
+
else if (Array.isArray(prfResult)) {
|
|
8216
|
+
prfValue = new Uint8Array(prfResult);
|
|
8217
|
+
}
|
|
8218
|
+
else if (prfResult && typeof prfResult === 'object') {
|
|
8219
|
+
const data = prfResult.data;
|
|
8220
|
+
if (Array.isArray(data)) {
|
|
8221
|
+
prfValue = new Uint8Array(data);
|
|
8222
|
+
}
|
|
8223
|
+
else {
|
|
8224
|
+
const values = Object.values(prfResult);
|
|
8225
|
+
if (values.length && values.every((value) => typeof value === 'number')) {
|
|
8226
|
+
prfValue = new Uint8Array(values);
|
|
8227
|
+
}
|
|
8228
|
+
else {
|
|
8229
|
+
throw new WallabyError({
|
|
8230
|
+
message: 'Unsupported PRF result type.',
|
|
8231
|
+
statusCode: 400,
|
|
8232
|
+
errorCode: ErrorResponseCodes.sdk_passkey_prf_not_available,
|
|
8233
|
+
});
|
|
8234
|
+
}
|
|
8235
|
+
}
|
|
8236
|
+
}
|
|
8237
|
+
else {
|
|
8238
|
+
throw new WallabyError({
|
|
8239
|
+
message: 'Unsupported PRF result type.',
|
|
8240
|
+
statusCode: 400,
|
|
8241
|
+
errorCode: ErrorResponseCodes.sdk_passkey_prf_not_available,
|
|
8242
|
+
});
|
|
8243
|
+
}
|
|
8244
|
+
logger.debug('SDK::PasskeyService::handleCredentialsCreationFromPrfExtension::prfValue', prfValue);
|
|
8090
8245
|
const credentialsKeyPair = await this.cipher.getCredentialsKeyPair({
|
|
8091
8246
|
prfValue,
|
|
8092
8247
|
authType: AuthType.Passkey,
|
|
@@ -8110,6 +8265,17 @@ class PasskeyService {
|
|
|
8110
8265
|
throw this.authenticator.handlePasskeyError(error);
|
|
8111
8266
|
}
|
|
8112
8267
|
}
|
|
8268
|
+
};
|
|
8269
|
+
|
|
8270
|
+
class PasskeyService extends PasskeyService$1 {
|
|
8271
|
+
async isDevicePrfCompatible() {
|
|
8272
|
+
try {
|
|
8273
|
+
return NativeWebAuthn.Passkey.isSupported();
|
|
8274
|
+
}
|
|
8275
|
+
catch (_a) {
|
|
8276
|
+
return false;
|
|
8277
|
+
}
|
|
8278
|
+
}
|
|
8113
8279
|
}
|
|
8114
8280
|
|
|
8115
8281
|
/**
|
|
@@ -8429,7 +8595,6 @@ class AuthService extends Base {
|
|
|
8429
8595
|
let deviceKeyPair;
|
|
8430
8596
|
// This logic needs to change and depend on data from server.
|
|
8431
8597
|
if (!passkeyCredential) {
|
|
8432
|
-
console.debug('SDK::AuthService::handleSignInWithPasskey:: creating new key pair');
|
|
8433
8598
|
deviceKeyPair = createIdentity();
|
|
8434
8599
|
devicePublicKey = deviceKeyPair.publicKey;
|
|
8435
8600
|
await this.localStorageService.save(LocalStorageItems.ClientAuthPublicKey, devicePublicKey);
|
|
@@ -10322,6 +10487,12 @@ class WalletService extends Base {
|
|
|
10322
10487
|
const v2EncryptedSeed = await this.localStorageService.fetch(LocalStorageItems.EncryptedStandardSeedPhrase, {
|
|
10323
10488
|
walletId: input.walletId,
|
|
10324
10489
|
});
|
|
10490
|
+
const v2EncryptedPrimaryShare = await this.localStorageService.fetch(LocalStorageItems.PrimaryDeviceKeyShare, {
|
|
10491
|
+
walletId: input.walletId,
|
|
10492
|
+
});
|
|
10493
|
+
const v2EncryptedBackupShare = await this.localStorageService.fetch(LocalStorageItems.BackupDeviceKeyShare, {
|
|
10494
|
+
walletId: input.walletId,
|
|
10495
|
+
});
|
|
10325
10496
|
const clientSalt = await this.authService.getUserSalt();
|
|
10326
10497
|
const passwordCredentialsKeyPair = await this.cipher.getCredentialsKeyPair({
|
|
10327
10498
|
password: input.password,
|
|
@@ -10351,64 +10522,184 @@ class WalletService extends Base {
|
|
|
10351
10522
|
logger.log('SDK::WalletService::convertToPasskey::No encrypted device private key found, checking for v1 format');
|
|
10352
10523
|
decryptedClientAuthPrivKey = await this.localStorageService.getDecryptedV1PrivateKey(input.password);
|
|
10353
10524
|
}
|
|
10354
|
-
if (!decryptedClientAuthPrivKey) {
|
|
10355
|
-
logger.error('SDK::AuthService::handleSignInWithPassword::error', 'Device private key could not be decrypted');
|
|
10525
|
+
if (!decryptedClientAuthPrivKey) {
|
|
10526
|
+
logger.error('SDK::AuthService::handleSignInWithPassword::error', 'Device private key could not be decrypted');
|
|
10527
|
+
throw new WallabyError({
|
|
10528
|
+
message: 'Device private key could not be decrypted',
|
|
10529
|
+
statusCode: 500,
|
|
10530
|
+
errorCode: ErrorResponseCodes.sdk_private_key_decryption_failed,
|
|
10531
|
+
});
|
|
10532
|
+
}
|
|
10533
|
+
const clientPublicKey = publicKeyByPrivateKey(decryptedClientAuthPrivKey);
|
|
10534
|
+
const authentication = await this.passkeyService.addNewPasskey({
|
|
10535
|
+
deviceKeyPair: {
|
|
10536
|
+
publicKey: clientPublicKey,
|
|
10537
|
+
privateKey: decryptedClientAuthPrivKey,
|
|
10538
|
+
},
|
|
10539
|
+
getSignature: this.authService.getSignature.bind(this),
|
|
10540
|
+
});
|
|
10541
|
+
const prfValue = authentication.prfValue;
|
|
10542
|
+
if (!prfValue || !(prfValue instanceof Uint8Array) || prfValue.length === 0) {
|
|
10543
|
+
logger.error('SDK::WalletService::convertToPasskey::prfValue is required and must be a non-empty Uint8Array');
|
|
10544
|
+
throw new WallabyError({
|
|
10545
|
+
message: 'PRF value from passkey is required to derive credentials and could not be obtained',
|
|
10546
|
+
statusCode: 500,
|
|
10547
|
+
errorCode: ErrorResponseCodes.sdk_passkey_prf_not_available,
|
|
10548
|
+
});
|
|
10549
|
+
}
|
|
10550
|
+
logger.log('SDK::WalletService::convertToPasskey::Received authentication response', !!authentication);
|
|
10551
|
+
let decryptedSeedPhrase;
|
|
10552
|
+
let decryptedPrimaryShare;
|
|
10553
|
+
let decryptedBackupShare;
|
|
10554
|
+
if (v2EncryptedSeed && v2EncryptedPriv) {
|
|
10555
|
+
try {
|
|
10556
|
+
decryptedSeedPhrase = await this.cipher.displayStoredData({
|
|
10557
|
+
storedEncryptedData: safeJsonParse(v2EncryptedSeed),
|
|
10558
|
+
encryptedDevicePrivateKey: safeJsonParse(v2EncryptedPriv),
|
|
10559
|
+
options: {
|
|
10560
|
+
authType: AuthType.Password,
|
|
10561
|
+
password: input.password,
|
|
10562
|
+
salt: clientSalt,
|
|
10563
|
+
},
|
|
10564
|
+
});
|
|
10565
|
+
}
|
|
10566
|
+
catch (error) {
|
|
10567
|
+
logger.error('SDK::WalletService::convertToPasskey::seed_decryption_error', error);
|
|
10568
|
+
}
|
|
10569
|
+
}
|
|
10570
|
+
if (!decryptedSeedPhrase) {
|
|
10571
|
+
try {
|
|
10572
|
+
decryptedSeedPhrase = await this.localStorageService.getV1DecryptedSeedPhrase(input.password, clientSalt);
|
|
10573
|
+
}
|
|
10574
|
+
catch (error) {
|
|
10575
|
+
logger.error('SDK::WalletService::convertToPasskey::v1_seed_decryption_error', error);
|
|
10576
|
+
}
|
|
10577
|
+
}
|
|
10578
|
+
if (v2EncryptedPrimaryShare && v2EncryptedPriv) {
|
|
10579
|
+
try {
|
|
10580
|
+
const parsedPrimaryShare = safeJsonParse(v2EncryptedPrimaryShare);
|
|
10581
|
+
decryptedPrimaryShare = await this.cipher.displayStoredData({
|
|
10582
|
+
storedEncryptedData: parsedPrimaryShare,
|
|
10583
|
+
encryptedDevicePrivateKey: safeJsonParse(v2EncryptedPriv),
|
|
10584
|
+
options: {
|
|
10585
|
+
authType: AuthType.Password,
|
|
10586
|
+
password: input.password,
|
|
10587
|
+
salt: clientSalt,
|
|
10588
|
+
},
|
|
10589
|
+
});
|
|
10590
|
+
}
|
|
10591
|
+
catch (error) {
|
|
10592
|
+
logger.error('SDK::WalletService::convertToPasskey::primary_share_decryption_error', error);
|
|
10593
|
+
}
|
|
10594
|
+
}
|
|
10595
|
+
if (v2EncryptedBackupShare) {
|
|
10596
|
+
try {
|
|
10597
|
+
const parsedBackupShare = safeJsonParse(v2EncryptedBackupShare);
|
|
10598
|
+
// backup key share is wrapped with credentials public key at the outer layer
|
|
10599
|
+
// and wallaby public key at the inner layer, so only one local unwrap is needed.
|
|
10600
|
+
decryptedBackupShare = await this.cipher.decrypt({
|
|
10601
|
+
cipherText: parsedBackupShare,
|
|
10602
|
+
decryptionKey: passwordCredentialsKeyPair.privateKey,
|
|
10603
|
+
});
|
|
10604
|
+
}
|
|
10605
|
+
catch (error) {
|
|
10606
|
+
logger.error('SDK::WalletService::convertToPasskey::backup_share_decryption_error', error);
|
|
10607
|
+
}
|
|
10608
|
+
}
|
|
10609
|
+
const hasAnyDecryptedShare = !!decryptedPrimaryShare || !!decryptedBackupShare;
|
|
10610
|
+
if (!decryptedSeedPhrase && !hasAnyDecryptedShare) {
|
|
10356
10611
|
throw new WallabyError({
|
|
10357
|
-
message: '
|
|
10612
|
+
message: 'Seed phrase or key shares on this device could not be decrypted',
|
|
10358
10613
|
statusCode: 500,
|
|
10359
|
-
errorCode: ErrorResponseCodes.
|
|
10614
|
+
errorCode: ErrorResponseCodes.sdk_no_valid_seed_option,
|
|
10360
10615
|
});
|
|
10361
10616
|
}
|
|
10362
|
-
|
|
10363
|
-
|
|
10364
|
-
|
|
10617
|
+
// We only care about the primary share for future local operations.
|
|
10618
|
+
if (decryptedSeedPhrase && !decryptedPrimaryShare) {
|
|
10619
|
+
logger.info('SDK::WalletService::convertToPasskey::No primary share found, importing wallet');
|
|
10620
|
+
await this.handlers.handleImportWallet({
|
|
10365
10621
|
publicKey: clientPublicKey,
|
|
10366
10622
|
privateKey: decryptedClientAuthPrivKey,
|
|
10367
|
-
},
|
|
10368
|
-
|
|
10623
|
+
}, {
|
|
10624
|
+
authenticationOptions: authentication,
|
|
10625
|
+
seedPhrase: decryptedSeedPhrase,
|
|
10626
|
+
storeSeedPhrase: false,
|
|
10627
|
+
returnWalletOption: ReturnWalletOption.ReturnOnlyEncryptedShares, // always only return the encrypted shares
|
|
10628
|
+
keyShareOptions: {
|
|
10629
|
+
threshold: 2,
|
|
10630
|
+
numberOfKeyShares: 3,
|
|
10631
|
+
numberOfSharesReturned: 2,
|
|
10632
|
+
storeOneKeyShareWithWallaby: true,
|
|
10633
|
+
},
|
|
10634
|
+
});
|
|
10635
|
+
// Delete the old password-encrypted seed phrase since import stored the new passkey-encrypted version
|
|
10636
|
+
await this.localStorageService.delete(LocalStorageItems.EncryptedStandardSeedPhrase, { walletId: input.walletId });
|
|
10637
|
+
logger.info('SDK::WalletService::convertToPasskey::Wallet imported and converted successfully, old seed phrase removed');
|
|
10638
|
+
return { authentication, seedPhrase: decryptedSeedPhrase };
|
|
10639
|
+
}
|
|
10640
|
+
const passkeyDerivedKeyPair = await this.cipher.getCredentialsKeyPair({
|
|
10641
|
+
authType: AuthType.Passkey,
|
|
10642
|
+
prfValue,
|
|
10369
10643
|
});
|
|
10370
|
-
|
|
10371
|
-
|
|
10372
|
-
|
|
10373
|
-
|
|
10374
|
-
|
|
10375
|
-
|
|
10376
|
-
|
|
10377
|
-
|
|
10378
|
-
password: input.password,
|
|
10379
|
-
salt: clientSalt,
|
|
10644
|
+
const convertedShares = [];
|
|
10645
|
+
if (decryptedPrimaryShare) {
|
|
10646
|
+
const encryptedPrimaryShare = await this.cipher.doubleEncrypt({
|
|
10647
|
+
decryptedData: decryptedPrimaryShare,
|
|
10648
|
+
credentialsKeyPair: passkeyDerivedKeyPair,
|
|
10649
|
+
deviceKeyPair: {
|
|
10650
|
+
publicKey: clientPublicKey,
|
|
10651
|
+
privateKey: decryptedClientAuthPrivKey,
|
|
10380
10652
|
},
|
|
10381
10653
|
});
|
|
10654
|
+
convertedShares.push({
|
|
10655
|
+
key: V2KeyNames.PrimaryDeviceKeyShare,
|
|
10656
|
+
value: encryptedPrimaryShare,
|
|
10657
|
+
walletId: input.walletId,
|
|
10658
|
+
});
|
|
10382
10659
|
}
|
|
10383
|
-
|
|
10384
|
-
|
|
10385
|
-
|
|
10386
|
-
|
|
10387
|
-
|
|
10388
|
-
|
|
10389
|
-
|
|
10390
|
-
|
|
10391
|
-
|
|
10392
|
-
|
|
10660
|
+
if (decryptedBackupShare) {
|
|
10661
|
+
// Since this is only decrypted once, we only need passkey credential encryption.
|
|
10662
|
+
const encryptedBackupShare = await this.cipher.encrypt({
|
|
10663
|
+
data: decryptedBackupShare,
|
|
10664
|
+
encryptionKey: passkeyDerivedKeyPair.publicKey,
|
|
10665
|
+
});
|
|
10666
|
+
convertedShares.push({
|
|
10667
|
+
key: V2KeyNames.BackupDeviceKeyShare,
|
|
10668
|
+
value: encryptedBackupShare,
|
|
10669
|
+
walletId: input.walletId,
|
|
10670
|
+
});
|
|
10393
10671
|
}
|
|
10394
|
-
|
|
10395
|
-
|
|
10396
|
-
|
|
10397
|
-
|
|
10398
|
-
|
|
10399
|
-
|
|
10400
|
-
|
|
10401
|
-
|
|
10402
|
-
|
|
10403
|
-
|
|
10404
|
-
|
|
10405
|
-
|
|
10406
|
-
|
|
10407
|
-
|
|
10408
|
-
|
|
10409
|
-
|
|
10410
|
-
|
|
10411
|
-
|
|
10672
|
+
await this.localStorageService.saveInBulk(convertedShares);
|
|
10673
|
+
if (v2EncryptedSeed) {
|
|
10674
|
+
await this.localStorageService.delete(LocalStorageItems.EncryptedStandardSeedPhrase, { walletId: input.walletId });
|
|
10675
|
+
logger.info('SDK::WalletService::convertToPasskey::Seed phrase removed from device storage after conversion to passkey');
|
|
10676
|
+
}
|
|
10677
|
+
if (!decryptedSeedPhrase && decryptedPrimaryShare) {
|
|
10678
|
+
const flippedEncryptedPrimaryShare = await this.cipher.encrypt({
|
|
10679
|
+
data: decryptedPrimaryShare,
|
|
10680
|
+
encryptionKey: authentication.user.wallabyAuthPubKey,
|
|
10681
|
+
});
|
|
10682
|
+
const reconstructedSeedPhrase = await this.handlers.handleConstructingSeedPhraseFromShares({
|
|
10683
|
+
walletId: input.walletId,
|
|
10684
|
+
encryptedKeyShares: [flippedEncryptedPrimaryShare],
|
|
10685
|
+
deviceAuthKeys: {
|
|
10686
|
+
publicKey: clientPublicKey,
|
|
10687
|
+
privateKey: decryptedClientAuthPrivKey,
|
|
10688
|
+
},
|
|
10689
|
+
});
|
|
10690
|
+
decryptedSeedPhrase = await this.cipher.decrypt({
|
|
10691
|
+
cipherText: reconstructedSeedPhrase,
|
|
10692
|
+
decryptionKey: decryptedClientAuthPrivKey,
|
|
10693
|
+
});
|
|
10694
|
+
}
|
|
10695
|
+
if (!decryptedSeedPhrase) {
|
|
10696
|
+
throw new WallabyError({
|
|
10697
|
+
message: 'Seed phrase could not be reconstructed from the provided shares',
|
|
10698
|
+
statusCode: 500,
|
|
10699
|
+
errorCode: ErrorResponseCodes.sdk_no_valid_seed_option,
|
|
10700
|
+
});
|
|
10701
|
+
}
|
|
10702
|
+
return { authentication, seedPhrase: decryptedSeedPhrase };
|
|
10412
10703
|
}
|
|
10413
10704
|
catch (error) {
|
|
10414
10705
|
logger.error('SDK::WalletService::convertToPasskey::error', error);
|
|
@@ -10469,7 +10760,7 @@ class WalletDataService extends Base {
|
|
|
10469
10760
|
* @param { string } address Wallet address
|
|
10470
10761
|
* @param { string } symbol Token symbol
|
|
10471
10762
|
* @param { BlockchainName } chainName the chain name enum. i.e. 'ETHEREUM', 'BITCOIN'
|
|
10472
|
-
* @returns {
|
|
10763
|
+
* @returns { TokenBalance } Balance of the token
|
|
10473
10764
|
*/
|
|
10474
10765
|
async getTokenBalance({ address, symbol, tokenStandard, chainName }) {
|
|
10475
10766
|
try {
|
|
@@ -10510,7 +10801,7 @@ class WalletDataService extends Base {
|
|
|
10510
10801
|
});
|
|
10511
10802
|
}
|
|
10512
10803
|
const response = await this.request(WalletRoutes.getMultiTokenBalances, {
|
|
10513
|
-
payload: { tokensAndAddressesList },
|
|
10804
|
+
payload: { assets: tokensAndAddressesList },
|
|
10514
10805
|
});
|
|
10515
10806
|
return response;
|
|
10516
10807
|
}
|
|
@@ -10598,10 +10889,20 @@ class WalletDataService extends Base {
|
|
|
10598
10889
|
* Get all assets that exist in a certain wallet, by specifying a wallet ID
|
|
10599
10890
|
* @param walletId Wallaby's wallet ID
|
|
10600
10891
|
* @param { BasicQueryOptions } queryOptions Optional query options
|
|
10892
|
+
* @param { string } [queryOptions.search] - Search assets by name or symbol (minimum 3 characters)
|
|
10893
|
+
* @param { BlockchainName } [queryOptions.chainName] - Filter assets by blockchain name
|
|
10601
10894
|
* @returns { GetUserAssetsByWalletIdData } Returns all assets belonging in a certain wallet ID
|
|
10602
10895
|
*/
|
|
10603
10896
|
async getWalletAssets({ walletId, queryOptions }) {
|
|
10604
10897
|
try {
|
|
10898
|
+
// Validate search parameter if provided
|
|
10899
|
+
if ((queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.search) !== undefined && queryOptions.search.length < 3) {
|
|
10900
|
+
throw new WallabyError({
|
|
10901
|
+
message: 'Search parameter must be at least 3 characters long',
|
|
10902
|
+
statusCode: 400,
|
|
10903
|
+
errorCode: ErrorResponseCodes.sdk_invalid_parameter,
|
|
10904
|
+
});
|
|
10905
|
+
}
|
|
10605
10906
|
const response = await this.request(WalletRoutes.getWalletAssets, {
|
|
10606
10907
|
payload: {
|
|
10607
10908
|
walletId,
|
|
@@ -10718,7 +11019,7 @@ class WalletDataService extends Base {
|
|
|
10718
11019
|
/**
|
|
10719
11020
|
* Updates a wallet asset.
|
|
10720
11021
|
*
|
|
10721
|
-
* @param {string} params.
|
|
11022
|
+
* @param {string} params.configId - Config ID for the user asset.
|
|
10722
11023
|
* @param {string} params.walletId - Wallet ID to which the asset belongs.
|
|
10723
11024
|
* @param {string} params.assetName - Asset name.
|
|
10724
11025
|
* @param {boolean} params.isVisible - Asset visibility toggle.
|
|
@@ -10729,19 +11030,19 @@ class WalletDataService extends Base {
|
|
|
10729
11030
|
* @throws {Error} If required parameters are missing or invalid.
|
|
10730
11031
|
*/
|
|
10731
11032
|
async updateAsset(_a) {
|
|
10732
|
-
var {
|
|
11033
|
+
var { configId, walletId } = _a, assetConfig = __rest(_a, ["configId", "walletId"]);
|
|
10733
11034
|
try {
|
|
10734
|
-
if (!
|
|
11035
|
+
if (!configId || !walletId) {
|
|
10735
11036
|
throw new WallabyError({
|
|
10736
11037
|
message: 'Missing required parameters',
|
|
10737
11038
|
statusCode: 400,
|
|
10738
11039
|
errorCode: ErrorResponseCodes.sdk_missing_parameter,
|
|
10739
11040
|
});
|
|
10740
11041
|
}
|
|
10741
|
-
const response = await this.
|
|
10742
|
-
|
|
10743
|
-
|
|
10744
|
-
}
|
|
11042
|
+
const response = await this.request(WalletRoutes.updateAsset, {
|
|
11043
|
+
payload: Object.assign({ configId,
|
|
11044
|
+
walletId }, assetConfig),
|
|
11045
|
+
});
|
|
10745
11046
|
return response;
|
|
10746
11047
|
}
|
|
10747
11048
|
catch (error) {
|
|
@@ -11071,6 +11372,246 @@ class HttpApi extends Base {
|
|
|
11071
11372
|
}
|
|
11072
11373
|
}
|
|
11073
11374
|
|
|
11375
|
+
class Swap extends Base {
|
|
11376
|
+
constructor(config) {
|
|
11377
|
+
super(config);
|
|
11378
|
+
this.authService = new AuthService(config);
|
|
11379
|
+
this.walletService = new WalletService(config);
|
|
11380
|
+
}
|
|
11381
|
+
/**
|
|
11382
|
+
* Gets a swap quote between two assets (from/to), including fees, min output, and slippage limits.
|
|
11383
|
+
*
|
|
11384
|
+
* @public
|
|
11385
|
+
* @param {SwapQuoteRequest} request - The swap quote request parameters
|
|
11386
|
+
* @returns {Promise<SwapQuoteResponse>} A promise that resolves with the swap quote
|
|
11387
|
+
*/
|
|
11388
|
+
async getQuote({ walletId, fromAsset, toAsset, fromAmount, toAmount }) {
|
|
11389
|
+
try {
|
|
11390
|
+
if (!walletId || !fromAsset || !toAsset) {
|
|
11391
|
+
throw new WallabyError({
|
|
11392
|
+
message: 'Missing required parameters: walletId, fromAsset, and toAsset are required',
|
|
11393
|
+
statusCode: 400,
|
|
11394
|
+
errorCode: ErrorResponseCodes.sdk_missing_parameter,
|
|
11395
|
+
});
|
|
11396
|
+
}
|
|
11397
|
+
if (!fromAmount && !toAmount) {
|
|
11398
|
+
throw new WallabyError({
|
|
11399
|
+
message: 'Either fromAmount or toAmount must be provided',
|
|
11400
|
+
statusCode: 400,
|
|
11401
|
+
errorCode: ErrorResponseCodes.sdk_missing_parameter,
|
|
11402
|
+
});
|
|
11403
|
+
}
|
|
11404
|
+
// Build path with walletId, but exclude it from request body
|
|
11405
|
+
const routePayload = { walletId };
|
|
11406
|
+
const requestBody = Object.assign(Object.assign({ fromAsset,
|
|
11407
|
+
toAsset }, (fromAmount && { fromAmount })), (toAmount && { toAmount }));
|
|
11408
|
+
const response = await this.request(Object.assign(Object.assign({}, SwapRoutes.getQuote), { fullPath: SwapRoutes.getQuote.fullPath(routePayload) }), {
|
|
11409
|
+
payload: requestBody,
|
|
11410
|
+
});
|
|
11411
|
+
return response;
|
|
11412
|
+
}
|
|
11413
|
+
catch (error) {
|
|
11414
|
+
logger.error('SDK::Swap::getQuote::error', error);
|
|
11415
|
+
throw error;
|
|
11416
|
+
}
|
|
11417
|
+
}
|
|
11418
|
+
/**
|
|
11419
|
+
* Executes a swap using a previously generated quote.
|
|
11420
|
+
*
|
|
11421
|
+
* @public
|
|
11422
|
+
* @param {ExecuteSwapRequest} request - The execute swap request parameters
|
|
11423
|
+
* @returns {Promise<ExecuteSwapResponse>} A promise that resolves with the swap execution response
|
|
11424
|
+
*/
|
|
11425
|
+
async executeSwap({ walletId, quoteId, authenticationOptions }) {
|
|
11426
|
+
try {
|
|
11427
|
+
// Only attempt migration if we have password auth and V2 storage might be incomplete
|
|
11428
|
+
if (this.deviceAuthType === AuthType.Password && authenticationOptions.password) {
|
|
11429
|
+
try {
|
|
11430
|
+
await this.walletService.handleUpdateToV2({
|
|
11431
|
+
password: authenticationOptions.password,
|
|
11432
|
+
walletId: walletId,
|
|
11433
|
+
});
|
|
11434
|
+
}
|
|
11435
|
+
catch (error) {
|
|
11436
|
+
logger.error('SDK::Swap::executeSwap::handleUpdateToV2::error', error);
|
|
11437
|
+
throw new WallabyError({
|
|
11438
|
+
message: 'Error accessing user wallet on this device. Please ensure the password is correct and try again.',
|
|
11439
|
+
statusCode: 500,
|
|
11440
|
+
errorCode: ErrorResponseCodes.sdk_unknown_error,
|
|
11441
|
+
});
|
|
11442
|
+
}
|
|
11443
|
+
}
|
|
11444
|
+
const { deviceAuthPublicKey, signatureMessage, readyForTransportSeedPhrase, sharesEncryptedWithWallabyPubKey, hasShares } = await this.prepareSwapAuth(authenticationOptions, walletId);
|
|
11445
|
+
let swapResponse;
|
|
11446
|
+
// Build path with walletId, but exclude it from request body
|
|
11447
|
+
const routePayload = { walletId };
|
|
11448
|
+
if (readyForTransportSeedPhrase) {
|
|
11449
|
+
swapResponse = await this.request(Object.assign(Object.assign({}, SwapRoutes.executeSwap), { fullPath: SwapRoutes.executeSwap.fullPath(routePayload) }), {
|
|
11450
|
+
payload: {
|
|
11451
|
+
quoteId,
|
|
11452
|
+
message: signatureMessage.message,
|
|
11453
|
+
signature: signatureMessage.signature,
|
|
11454
|
+
clientAuthPubKey: deviceAuthPublicKey,
|
|
11455
|
+
encryptedSeed: readyForTransportSeedPhrase,
|
|
11456
|
+
},
|
|
11457
|
+
});
|
|
11458
|
+
}
|
|
11459
|
+
else if (hasShares) {
|
|
11460
|
+
swapResponse = await this.request(Object.assign(Object.assign({}, SwapRoutes.executeSwap), { fullPath: SwapRoutes.executeSwap.fullPath(routePayload) }), {
|
|
11461
|
+
payload: {
|
|
11462
|
+
quoteId,
|
|
11463
|
+
message: signatureMessage.message,
|
|
11464
|
+
signature: signatureMessage.signature,
|
|
11465
|
+
clientAuthPubKey: deviceAuthPublicKey,
|
|
11466
|
+
encryptedShares: sharesEncryptedWithWallabyPubKey,
|
|
11467
|
+
},
|
|
11468
|
+
});
|
|
11469
|
+
}
|
|
11470
|
+
else {
|
|
11471
|
+
throw new WallabyError({
|
|
11472
|
+
message: 'No valid seed option found on this device.',
|
|
11473
|
+
statusCode: 400,
|
|
11474
|
+
errorCode: ErrorResponseCodes.sdk_no_valid_seed_option,
|
|
11475
|
+
});
|
|
11476
|
+
}
|
|
11477
|
+
return swapResponse;
|
|
11478
|
+
}
|
|
11479
|
+
catch (error) {
|
|
11480
|
+
logger.error('SDK::Swap::executeSwap::error', error);
|
|
11481
|
+
throw error;
|
|
11482
|
+
}
|
|
11483
|
+
}
|
|
11484
|
+
/**
|
|
11485
|
+
* Lists executed swap transactions for a given wallet, with optional date and pagination filters.
|
|
11486
|
+
*
|
|
11487
|
+
* @public
|
|
11488
|
+
* @param {GetSwapsRequest} request - The get swaps request parameters
|
|
11489
|
+
* @returns {Promise<GetSwapsResponse>} A promise that resolves with the list of swaps
|
|
11490
|
+
*/
|
|
11491
|
+
async getSwaps({ walletId, queryParams }) {
|
|
11492
|
+
try {
|
|
11493
|
+
if (!walletId) {
|
|
11494
|
+
throw new WallabyError({
|
|
11495
|
+
message: 'Missing required parameter: walletId',
|
|
11496
|
+
statusCode: 400,
|
|
11497
|
+
errorCode: ErrorResponseCodes.sdk_missing_parameter,
|
|
11498
|
+
});
|
|
11499
|
+
}
|
|
11500
|
+
// Build path with walletId
|
|
11501
|
+
const routePayload = { walletId };
|
|
11502
|
+
const response = await this.request(Object.assign(Object.assign({}, SwapRoutes.getSwaps), { fullPath: SwapRoutes.getSwaps.fullPath(routePayload) }), {
|
|
11503
|
+
queryParams: queryParams,
|
|
11504
|
+
});
|
|
11505
|
+
return response;
|
|
11506
|
+
}
|
|
11507
|
+
catch (error) {
|
|
11508
|
+
logger.error('SDK::Swap::getSwaps::error', error);
|
|
11509
|
+
throw error;
|
|
11510
|
+
}
|
|
11511
|
+
}
|
|
11512
|
+
/**
|
|
11513
|
+
* Prepares authentication data and encrypted payload for swap requests
|
|
11514
|
+
* @private
|
|
11515
|
+
*/
|
|
11516
|
+
async prepareSwapAuth(authenticationOptions, walletId) {
|
|
11517
|
+
const { password, prfValue, user, clientSalt: authClientSalt } = authenticationOptions;
|
|
11518
|
+
const encryptedDevicePrivateKey = await this.localStorageService.fetch(LocalStorageItems.EncryptedDevicePrivateKey, {
|
|
11519
|
+
walletId,
|
|
11520
|
+
});
|
|
11521
|
+
if (!encryptedDevicePrivateKey) {
|
|
11522
|
+
throw new WallabyError({
|
|
11523
|
+
message: 'No private key was found on this device.',
|
|
11524
|
+
statusCode: 400,
|
|
11525
|
+
errorCode: ErrorResponseCodes.sdk_private_key_not_found,
|
|
11526
|
+
});
|
|
11527
|
+
}
|
|
11528
|
+
// Get credentials key pair for device private key decryption
|
|
11529
|
+
const clientSalt = authClientSalt || user.clientSalt;
|
|
11530
|
+
const credentialsKeyPair = await this.cipher.getCredentialsKeyPair({
|
|
11531
|
+
authType: this.deviceAuthType,
|
|
11532
|
+
password,
|
|
11533
|
+
prfValue,
|
|
11534
|
+
salt: clientSalt,
|
|
11535
|
+
});
|
|
11536
|
+
// Decrypt device private key
|
|
11537
|
+
const decryptedDevicePrivateKey = await this.cipher.decrypt({
|
|
11538
|
+
cipherText: JSON.parse(encryptedDevicePrivateKey),
|
|
11539
|
+
decryptionKey: credentialsKeyPair.privateKey,
|
|
11540
|
+
});
|
|
11541
|
+
if (!decryptedDevicePrivateKey) {
|
|
11542
|
+
throw new WallabyError({
|
|
11543
|
+
message: 'Credentials are wrong, please pass the correct credentials.',
|
|
11544
|
+
statusCode: 400,
|
|
11545
|
+
errorCode: ErrorResponseCodes.sdk_private_key_decryption_failed,
|
|
11546
|
+
});
|
|
11547
|
+
}
|
|
11548
|
+
const deviceAuthPublicKey = publicKeyByPrivateKey(decryptedDevicePrivateKey);
|
|
11549
|
+
// Get signature message
|
|
11550
|
+
const signatureMessage = await this.authService.getSignature({
|
|
11551
|
+
publicKey: deviceAuthPublicKey,
|
|
11552
|
+
privateKey: decryptedDevicePrivateKey,
|
|
11553
|
+
}, this.deviceAuthType === AuthType.Passkey ? PasskeyChallengeType.AUTHENTICATION : undefined);
|
|
11554
|
+
// Prepare encrypted data (seed phrase or key shares)
|
|
11555
|
+
const sharesEncryptedWithWallabyPubKey = [];
|
|
11556
|
+
let readyForTransportSeedPhrase = undefined;
|
|
11557
|
+
const primaryKeyShare = await this.localStorageService.fetch(LocalStorageItems.PrimaryDeviceKeyShare, { walletId });
|
|
11558
|
+
if (!primaryKeyShare) {
|
|
11559
|
+
// No primary share, try seed phrase
|
|
11560
|
+
const encryptedSeedPhrase = await this.localStorageService.fetch(LocalStorageItems.EncryptedStandardSeedPhrase, {
|
|
11561
|
+
walletId,
|
|
11562
|
+
});
|
|
11563
|
+
if (!encryptedSeedPhrase) {
|
|
11564
|
+
throw new WallabyError({
|
|
11565
|
+
message: 'Your device does not have a seed phrase or an operating share to sign the transaction.',
|
|
11566
|
+
statusCode: 400,
|
|
11567
|
+
errorCode: ErrorResponseCodes.sdk_seed_phrase_not_found,
|
|
11568
|
+
});
|
|
11569
|
+
}
|
|
11570
|
+
const parsedSeedPhrase = safeJsonParse(encryptedSeedPhrase);
|
|
11571
|
+
readyForTransportSeedPhrase = await this.cipher.prepareStoredDataForTransport({
|
|
11572
|
+
storedEncryptedData: parsedSeedPhrase,
|
|
11573
|
+
encryptedDevicePrivateKey: JSON.parse(encryptedDevicePrivateKey),
|
|
11574
|
+
wallabyPublicKey: user.wallabyAuthPubKey,
|
|
11575
|
+
options: {
|
|
11576
|
+
authType: this.deviceAuthType,
|
|
11577
|
+
password,
|
|
11578
|
+
prfValue,
|
|
11579
|
+
salt: clientSalt,
|
|
11580
|
+
},
|
|
11581
|
+
});
|
|
11582
|
+
}
|
|
11583
|
+
else {
|
|
11584
|
+
// Use primary key share
|
|
11585
|
+
const parsedPrimaryShare = safeJsonParse(primaryKeyShare);
|
|
11586
|
+
const readyForTransportShare = await this.cipher.prepareStoredDataForTransport({
|
|
11587
|
+
storedEncryptedData: parsedPrimaryShare,
|
|
11588
|
+
encryptedDevicePrivateKey: JSON.parse(encryptedDevicePrivateKey),
|
|
11589
|
+
wallabyPublicKey: user.wallabyAuthPubKey,
|
|
11590
|
+
options: {
|
|
11591
|
+
authType: this.deviceAuthType,
|
|
11592
|
+
password,
|
|
11593
|
+
prfValue,
|
|
11594
|
+
salt: clientSalt,
|
|
11595
|
+
},
|
|
11596
|
+
});
|
|
11597
|
+
sharesEncryptedWithWallabyPubKey.push(readyForTransportShare);
|
|
11598
|
+
}
|
|
11599
|
+
return Object.freeze({
|
|
11600
|
+
deviceAuthPublicKey,
|
|
11601
|
+
signatureMessage,
|
|
11602
|
+
readyForTransportSeedPhrase,
|
|
11603
|
+
sharesEncryptedWithWallabyPubKey,
|
|
11604
|
+
hasShares: sharesEncryptedWithWallabyPubKey.length > 0,
|
|
11605
|
+
});
|
|
11606
|
+
}
|
|
11607
|
+
}
|
|
11608
|
+
__decorate([
|
|
11609
|
+
WithLock('executeSwap'),
|
|
11610
|
+
__metadata("design:type", Function),
|
|
11611
|
+
__metadata("design:paramtypes", [Object]),
|
|
11612
|
+
__metadata("design:returntype", Promise)
|
|
11613
|
+
], Swap.prototype, "executeSwap", null);
|
|
11614
|
+
|
|
11074
11615
|
/**
|
|
11075
11616
|
* Sanitizes a Sui object ID by removing any part of the string after '::'.
|
|
11076
11617
|
*
|
|
@@ -11097,13 +11638,14 @@ class System extends Base {
|
|
|
11097
11638
|
/**
|
|
11098
11639
|
* @public
|
|
11099
11640
|
* Get all supported chains
|
|
11100
|
-
* @param {
|
|
11641
|
+
* @param {Object} [options] - Optional query parameters
|
|
11642
|
+
* @param {boolean} [options.supportSwaps] - When true, include only chains that support swaps
|
|
11101
11643
|
* @returns {Array<Blockchain>} Array of supported chains
|
|
11102
11644
|
*/
|
|
11103
|
-
async getSupportedBlockchains() {
|
|
11645
|
+
async getSupportedBlockchains(options) {
|
|
11104
11646
|
try {
|
|
11105
11647
|
const response = await this.request(SystemRoutes.getSupportedBlockchains, {
|
|
11106
|
-
|
|
11648
|
+
queryParams: (options === null || options === void 0 ? void 0 : options.supportSwaps) !== undefined ? { supportSwaps: options.supportSwaps } : undefined,
|
|
11107
11649
|
});
|
|
11108
11650
|
return response.chains;
|
|
11109
11651
|
}
|
|
@@ -11208,13 +11750,33 @@ class System extends Base {
|
|
|
11208
11750
|
/**
|
|
11209
11751
|
* @public
|
|
11210
11752
|
* Get all supported assets configuration
|
|
11211
|
-
* @param {
|
|
11753
|
+
* @param {Object} [options] - Optional query parameters
|
|
11754
|
+
* @param {boolean} [options.supportsSwaps] - When true, filter to assets that support swaps
|
|
11755
|
+
* @param {string} [options.search] - Search assets by name or symbol (minimum 3 characters)
|
|
11756
|
+
* @param {BlockchainName} [options.chainName] - Filter assets by blockchain name
|
|
11212
11757
|
* @returns {Array<AssetConfig>} Array of supported tokens
|
|
11213
11758
|
*/
|
|
11214
|
-
async getSupportedTokens() {
|
|
11759
|
+
async getSupportedTokens(options) {
|
|
11215
11760
|
try {
|
|
11761
|
+
const queryParams = {};
|
|
11762
|
+
if ((options === null || options === void 0 ? void 0 : options.supportsSwaps) !== undefined) {
|
|
11763
|
+
queryParams.supportsSwaps = options.supportsSwaps;
|
|
11764
|
+
}
|
|
11765
|
+
if ((options === null || options === void 0 ? void 0 : options.search) !== undefined) {
|
|
11766
|
+
if (options.search.length < 3) {
|
|
11767
|
+
throw new WallabyError({
|
|
11768
|
+
message: 'Search parameter must be at least 3 characters long',
|
|
11769
|
+
statusCode: 400,
|
|
11770
|
+
errorCode: ErrorResponseCodes.sdk_invalid_parameter,
|
|
11771
|
+
});
|
|
11772
|
+
}
|
|
11773
|
+
queryParams.search = options.search;
|
|
11774
|
+
}
|
|
11775
|
+
if ((options === null || options === void 0 ? void 0 : options.chainName) !== undefined) {
|
|
11776
|
+
queryParams.chainName = options.chainName;
|
|
11777
|
+
}
|
|
11216
11778
|
const response = await this.request(SystemRoutes.getSupportedTokens, {
|
|
11217
|
-
|
|
11779
|
+
queryParams: Object.keys(queryParams).length > 0 ? queryParams : undefined,
|
|
11218
11780
|
});
|
|
11219
11781
|
return response.assets;
|
|
11220
11782
|
}
|
|
@@ -11357,9 +11919,10 @@ class Transactions extends Base {
|
|
|
11357
11919
|
* @param {string} reference
|
|
11358
11920
|
* @param {AuthenticationResponse} authenticationOptions
|
|
11359
11921
|
* @param {string} memo
|
|
11922
|
+
* @param {TransactionType} transactionType
|
|
11360
11923
|
* @returns {TransactionResponse}
|
|
11361
11924
|
*/
|
|
11362
|
-
async transfer({ originAddress, recipientAddress, amount, assetId, walletId, reference, authenticationOptions, memo, }) {
|
|
11925
|
+
async transfer({ originAddress, recipientAddress, amount, assetId, walletId, reference, authenticationOptions, memo, transactionType, }) {
|
|
11363
11926
|
try {
|
|
11364
11927
|
// Only attempt migration if we have password auth and V2 storage might be incomplete
|
|
11365
11928
|
if (this.deviceAuthType === AuthType.Password && authenticationOptions.password) {
|
|
@@ -11385,7 +11948,8 @@ class Transactions extends Base {
|
|
|
11385
11948
|
payload: Object.assign(Object.assign({}, signatureMessage), { clientAuthPubKey: deviceAuthPublicKey, encryptedSeed: readyForTransportSeedPhrase, originAddress,
|
|
11386
11949
|
recipientAddress,
|
|
11387
11950
|
assetId,
|
|
11388
|
-
amount, reference: reference || v4(), memo
|
|
11951
|
+
amount, reference: reference || v4(), memo,
|
|
11952
|
+
transactionType }),
|
|
11389
11953
|
});
|
|
11390
11954
|
}
|
|
11391
11955
|
else if (hasShares) {
|
|
@@ -11393,14 +11957,15 @@ class Transactions extends Base {
|
|
|
11393
11957
|
payload: Object.assign(Object.assign({}, signatureMessage), { clientAuthPubKey: deviceAuthPublicKey, encryptedShares: sharesEncryptedWithWallabyPubKey, originAddress,
|
|
11394
11958
|
recipientAddress,
|
|
11395
11959
|
assetId,
|
|
11396
|
-
amount, reference: reference || v4(), memo
|
|
11960
|
+
amount, reference: reference || v4(), memo,
|
|
11961
|
+
transactionType }),
|
|
11397
11962
|
});
|
|
11398
11963
|
}
|
|
11399
11964
|
else {
|
|
11400
11965
|
throw new WallabyError({
|
|
11401
11966
|
message: 'No valid seed option found on this device.',
|
|
11402
11967
|
statusCode: 400,
|
|
11403
|
-
errorCode:
|
|
11968
|
+
errorCode: ErrorResponseCodes.sdk_no_valid_seed_option,
|
|
11404
11969
|
});
|
|
11405
11970
|
}
|
|
11406
11971
|
return transferResponse;
|
|
@@ -11422,10 +11987,11 @@ class Transactions extends Base {
|
|
|
11422
11987
|
* @param {string} suiObjectId
|
|
11423
11988
|
* @param {string} reference
|
|
11424
11989
|
* @param {string} memo
|
|
11990
|
+
* @param {TransactionType} transactionType
|
|
11425
11991
|
* @returns {CreateAllowanceResponse}
|
|
11426
11992
|
*
|
|
11427
11993
|
*/
|
|
11428
|
-
async createAllowance({ authenticationOptions, walletId, ownerAddress, spenderAddress, amount, assetId, suiObjectId, contractAddress, chainName, assetSymbol, reference, memo, }) {
|
|
11994
|
+
async createAllowance({ authenticationOptions, walletId, ownerAddress, spenderAddress, amount, assetId, suiObjectId, contractAddress, chainName, assetSymbol, reference, memo, transactionType, }) {
|
|
11429
11995
|
try {
|
|
11430
11996
|
if (!suiObjectId && !contractAddress && !assetId && !assetSymbol && !chainName) {
|
|
11431
11997
|
throw new WallabyError({
|
|
@@ -11466,14 +12032,14 @@ class Transactions extends Base {
|
|
|
11466
12032
|
}
|
|
11467
12033
|
const payload = Object.assign({ message,
|
|
11468
12034
|
walletId,
|
|
11469
|
-
authenticationOptions,
|
|
11470
12035
|
signature, clientAuthPubKey: deviceAuthPublicKey, ownerAddress,
|
|
11471
12036
|
spenderAddress,
|
|
11472
12037
|
chainName,
|
|
11473
12038
|
assetSymbol,
|
|
11474
12039
|
amount,
|
|
11475
12040
|
assetId, contractAddress: contractAddress !== null && contractAddress !== void 0 ? contractAddress : suiObjectId, reference,
|
|
11476
|
-
memo
|
|
12041
|
+
memo,
|
|
12042
|
+
transactionType }, (hasShares ? { encryptedShares: sharesEncryptedWithWallabyPubKey } : { encryptedSeed: readyForTransportSeedPhrase }));
|
|
11477
12043
|
const response = await this.request(TransactionsRoutes.createAllowance, {
|
|
11478
12044
|
payload,
|
|
11479
12045
|
});
|
|
@@ -11691,6 +12257,7 @@ class Wallaby {
|
|
|
11691
12257
|
this.auth = new AuthService(config);
|
|
11692
12258
|
this.system = new System(config);
|
|
11693
12259
|
this.transactions = new Transactions(config);
|
|
12260
|
+
this.swap = new Swap(config);
|
|
11694
12261
|
this.merchants = new Merchants(config);
|
|
11695
12262
|
this.httpApi = new HttpApi(config);
|
|
11696
12263
|
}
|