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.cjs.js
CHANGED
|
@@ -8,6 +8,7 @@ const cryptoJs = require('crypto-js');
|
|
|
8
8
|
const jwtDecode = require('jwt-decode');
|
|
9
9
|
const lodash = require('lodash');
|
|
10
10
|
const WebAuthn = require('@simplewebauthn/browser');
|
|
11
|
+
const jsBase64 = require('js-base64');
|
|
11
12
|
|
|
12
13
|
const _interopDefaultCompat = e => e && typeof e === 'object' && 'default' in e ? e : { default: e };
|
|
13
14
|
|
|
@@ -389,6 +390,7 @@ exports.ErrorResponseCodes = void 0;
|
|
|
389
390
|
ErrorResponseCodes["sdk_missing_parameter"] = "sdk_missing_parameter";
|
|
390
391
|
ErrorResponseCodes["sdk_invalid_parameter"] = "sdk_invalid_parameter";
|
|
391
392
|
ErrorResponseCodes["sdk_wrong_password"] = "sdk_wrong_password";
|
|
393
|
+
ErrorResponseCodes["sdk_no_valid_seed_option"] = "sdk_no_valid_seed_option";
|
|
392
394
|
// passkey errors
|
|
393
395
|
ErrorResponseCodes["sdk_passkey_prf_not_available"] = "sdk_passkey_prf_not_available";
|
|
394
396
|
ErrorResponseCodes["sdk_passkey_challenge_unavailable"] = "sdk_passkey_challenge_unavailable";
|
|
@@ -795,14 +797,24 @@ const MASTER_ENCRYPTION_KEY = '9fa9d3f3c77c20d3a50a08e5299644be29f6e6206ef3479fe
|
|
|
795
797
|
In particular, RS256 is necessary for compatibility with Microsoft Windows platform authenticators.
|
|
796
798
|
ES256 is a widely supported algorithm and is compatible with most other platform authenticators and roaming authenticators.
|
|
797
799
|
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.
|
|
798
|
-
|
|
800
|
+
|
|
799
801
|
https://chromium.googlesource.com/chromium/src/+/main/content/browser/webauth/pub_key_cred_params.md
|
|
800
802
|
*/
|
|
801
803
|
[
|
|
802
804
|
{ type: 'public-key', alg: exports.PublicKeyCredentialAlgorithm.RS256 },
|
|
803
805
|
{ type: 'public-key', alg: exports.PublicKeyCredentialAlgorithm.ES256 },
|
|
804
806
|
];
|
|
805
|
-
const
|
|
807
|
+
const isWeb = typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
808
|
+
const currentPackageVersion = "2.3.2" ;
|
|
809
|
+
|
|
810
|
+
/**
|
|
811
|
+
* Storage keys adapter for Storage interface across different platforms.
|
|
812
|
+
*
|
|
813
|
+
* This sdk uses keys like "wsdk:version:key-name" but `SecureStore` doesn't allow colons in key names,
|
|
814
|
+
* Valid SecureStore key characters: alphanumeric, ".", "-", "_"
|
|
815
|
+
*
|
|
816
|
+
*/
|
|
817
|
+
const normalizeKey = (key) => key.replace(/:/g, '_');
|
|
806
818
|
|
|
807
819
|
const crypto = typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined;
|
|
808
820
|
|
|
@@ -5064,6 +5076,9 @@ class StorageService {
|
|
|
5064
5076
|
else {
|
|
5065
5077
|
storageKey = `wsdk:v2:${this.shortenedEnv}:${key}:${this.userId}`;
|
|
5066
5078
|
}
|
|
5079
|
+
if (!isWeb) {
|
|
5080
|
+
storageKey = normalizeKey(storageKey);
|
|
5081
|
+
}
|
|
5067
5082
|
const item = await this.getItem(storageKey);
|
|
5068
5083
|
if (!item) {
|
|
5069
5084
|
logger.debug(`(404): Item with key ${storageKey} was not found in storage.`);
|
|
@@ -5097,6 +5112,9 @@ class StorageService {
|
|
|
5097
5112
|
else {
|
|
5098
5113
|
storageKey = `wsdk:v2:${this.shortenedEnv}:${key}:${this.userId}`;
|
|
5099
5114
|
}
|
|
5115
|
+
if (!isWeb) {
|
|
5116
|
+
storageKey = normalizeKey(storageKey);
|
|
5117
|
+
}
|
|
5100
5118
|
let valueToStore;
|
|
5101
5119
|
if (this._keysProtectedByMasterKey.includes(key)) {
|
|
5102
5120
|
const wrappedByMasterKey = this.cipher.encryptWithMasterKey({ data: value });
|
|
@@ -5121,6 +5139,9 @@ class StorageService {
|
|
|
5121
5139
|
else {
|
|
5122
5140
|
storageKey = `wsdk:v2:${this.shortenedEnv}:${key}:${this.userId}`;
|
|
5123
5141
|
}
|
|
5142
|
+
if (!isWeb) {
|
|
5143
|
+
storageKey = normalizeKey(storageKey);
|
|
5144
|
+
}
|
|
5124
5145
|
return await this.removeItem(storageKey);
|
|
5125
5146
|
}
|
|
5126
5147
|
setItem(key, value) {
|
|
@@ -5618,7 +5639,7 @@ var ContentType;
|
|
|
5618
5639
|
})(ContentType || (ContentType = {}));
|
|
5619
5640
|
class HttpClient {
|
|
5620
5641
|
constructor(apiConfig = {}) {
|
|
5621
|
-
this.baseUrl = "
|
|
5642
|
+
this.baseUrl = "";
|
|
5622
5643
|
this.securityData = null;
|
|
5623
5644
|
this.abortControllers = new Map();
|
|
5624
5645
|
this.customFetch = (...fetchParams) => fetch(...fetchParams);
|
|
@@ -5751,15 +5772,31 @@ class HttpClient {
|
|
|
5751
5772
|
}
|
|
5752
5773
|
}
|
|
5753
5774
|
/**
|
|
5754
|
-
* @title
|
|
5755
|
-
* @version 1.0
|
|
5756
|
-
* @baseUrl https://staging-testnet.wallaby.cash
|
|
5775
|
+
* @title Wallaby API Service
|
|
5776
|
+
* @version 1.0.0
|
|
5757
5777
|
* @contact
|
|
5758
5778
|
*
|
|
5759
|
-
*
|
|
5779
|
+
* NCW Wallets Service API Documentation
|
|
5760
5780
|
*/
|
|
5761
5781
|
class Api {
|
|
5762
5782
|
constructor(http) {
|
|
5783
|
+
/**
|
|
5784
|
+
* No description
|
|
5785
|
+
*
|
|
5786
|
+
* @name DashboardControllerGetDashboardData
|
|
5787
|
+
* @summary Create new merchant. This endpoint is only available for super admin and republic admin
|
|
5788
|
+
* @request GET:/dashboard
|
|
5789
|
+
* @secure
|
|
5790
|
+
*/
|
|
5791
|
+
this.dashboardControllerGetDashboardData = (params = {}) => this.http.request(Object.assign({ path: `/dashboard`, method: "GET", secure: true }, params));
|
|
5792
|
+
/**
|
|
5793
|
+
* No description
|
|
5794
|
+
*
|
|
5795
|
+
* @name GetActivitiees
|
|
5796
|
+
* @summary Get all activities. This endpoint is only available for super admin and republic admin
|
|
5797
|
+
* @request GET:/users-activities
|
|
5798
|
+
*/
|
|
5799
|
+
this.getActivitiees = (query, params = {}) => this.http.request(Object.assign({ path: `/users-activities`, method: "GET", query: query }, params));
|
|
5763
5800
|
this.health = {
|
|
5764
5801
|
/**
|
|
5765
5802
|
* No description
|
|
@@ -5768,9 +5805,8 @@ class Api {
|
|
|
5768
5805
|
* @name GetHello
|
|
5769
5806
|
* @summary Health Check API
|
|
5770
5807
|
* @request GET:/
|
|
5771
|
-
* @secure
|
|
5772
5808
|
*/
|
|
5773
|
-
getHello: (params = {}) => this.http.request(Object.assign({ path: `/`, method: "GET"
|
|
5809
|
+
getHello: (params = {}) => this.http.request(Object.assign({ path: `/`, method: "GET" }, params)),
|
|
5774
5810
|
/**
|
|
5775
5811
|
* No description
|
|
5776
5812
|
*
|
|
@@ -5778,9 +5814,8 @@ class Api {
|
|
|
5778
5814
|
* @name GetHealthCheck
|
|
5779
5815
|
* @summary Service API status check
|
|
5780
5816
|
* @request GET:/healthz
|
|
5781
|
-
* @secure
|
|
5782
5817
|
*/
|
|
5783
|
-
getHealthCheck: (params = {}) => this.http.request(Object.assign({ path: `/healthz`, method: "GET"
|
|
5818
|
+
getHealthCheck: (params = {}) => this.http.request(Object.assign({ path: `/healthz`, method: "GET" }, params)),
|
|
5784
5819
|
};
|
|
5785
5820
|
this.auth = {
|
|
5786
5821
|
/**
|
|
@@ -5789,91 +5824,86 @@ class Api {
|
|
|
5789
5824
|
* @tags Auth
|
|
5790
5825
|
* @name GenerateExternalSignatureMessage
|
|
5791
5826
|
* @summary The returned message will be used for sign up and sign in signature
|
|
5792
|
-
* @request POST:/
|
|
5793
|
-
* @secure
|
|
5827
|
+
* @request POST:/auth/signature-message/external
|
|
5794
5828
|
*/
|
|
5795
|
-
generateExternalSignatureMessage: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
5829
|
+
generateExternalSignatureMessage: (data, params = {}) => this.http.request(Object.assign({ path: `/auth/signature-message/external`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
5796
5830
|
/**
|
|
5797
5831
|
* No description
|
|
5798
5832
|
*
|
|
5799
5833
|
* @tags Auth
|
|
5800
5834
|
* @name GenerateSignatureMessage
|
|
5801
5835
|
* @summary The returned message will be used for sign up and sign in signature
|
|
5802
|
-
* @request POST:/
|
|
5803
|
-
* @secure
|
|
5836
|
+
* @request POST:/auth/signature-message
|
|
5804
5837
|
*/
|
|
5805
|
-
generateSignatureMessage: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
5838
|
+
generateSignatureMessage: (data, params = {}) => this.http.request(Object.assign({ path: `/auth/signature-message`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
5806
5839
|
/**
|
|
5807
5840
|
* No description
|
|
5808
5841
|
*
|
|
5809
5842
|
* @tags Auth
|
|
5810
5843
|
* @name SignUp
|
|
5811
5844
|
* @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
|
|
5812
|
-
* @request POST:/
|
|
5813
|
-
* @secure
|
|
5845
|
+
* @request POST:/auth/sign-up
|
|
5814
5846
|
*/
|
|
5815
|
-
signUp: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
5847
|
+
signUp: (data, params = {}) => this.http.request(Object.assign({ path: `/auth/sign-up`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
5816
5848
|
/**
|
|
5817
5849
|
* No description
|
|
5818
5850
|
*
|
|
5819
5851
|
* @tags Auth
|
|
5820
5852
|
* @name SignUpExternal
|
|
5821
5853
|
* @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
|
|
5822
|
-
* @request POST:/
|
|
5823
|
-
* @secure
|
|
5854
|
+
* @request POST:/auth/sign-up/external
|
|
5824
5855
|
*/
|
|
5825
|
-
signUpExternal: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
5856
|
+
signUpExternal: (data, params = {}) => this.http.request(Object.assign({ path: `/auth/sign-up/external`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
5826
5857
|
/**
|
|
5827
5858
|
* No description
|
|
5828
5859
|
*
|
|
5829
5860
|
* @tags Auth
|
|
5830
5861
|
* @name SignIn
|
|
5831
5862
|
* @summary Users will be able to sign up by providing a signature and message. Use the same pair keys used on sign up
|
|
5832
|
-
* @request POST:/
|
|
5833
|
-
* @secure
|
|
5863
|
+
* @request POST:/auth/sign-in
|
|
5834
5864
|
*/
|
|
5835
|
-
signIn: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
5865
|
+
signIn: (data, params = {}) => this.http.request(Object.assign({ path: `/auth/sign-in`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
5836
5866
|
/**
|
|
5837
5867
|
* No description
|
|
5838
5868
|
*
|
|
5839
5869
|
* @tags Auth
|
|
5840
5870
|
* @name RefreshAccessToken
|
|
5841
5871
|
* @summary Users will be able to sign up by providing a signature and message. Use the same pair keys used on sign up
|
|
5842
|
-
* @request POST:/
|
|
5872
|
+
* @request POST:/auth/refresh-access-token
|
|
5843
5873
|
* @deprecated
|
|
5844
5874
|
* @secure
|
|
5845
5875
|
*/
|
|
5846
|
-
refreshAccessToken: (params = {}) => this.http.request(Object.assign({ path: `/
|
|
5876
|
+
refreshAccessToken: (params = {}) => this.http.request(Object.assign({ path: `/auth/refresh-access-token`, method: "POST", secure: true, format: "json" }, params)),
|
|
5847
5877
|
/**
|
|
5848
5878
|
* No description
|
|
5849
5879
|
*
|
|
5850
5880
|
* @tags Auth
|
|
5851
5881
|
* @name ChangeAuthPublicKey
|
|
5852
5882
|
* @summary Change user authentication public key
|
|
5853
|
-
* @request PUT:/
|
|
5883
|
+
* @request PUT:/auth/client-auth-pubkey
|
|
5854
5884
|
* @secure
|
|
5855
5885
|
*/
|
|
5856
|
-
changeAuthPublicKey: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
5886
|
+
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)),
|
|
5857
5887
|
/**
|
|
5858
5888
|
* No description
|
|
5859
5889
|
*
|
|
5860
5890
|
* @tags Auth
|
|
5861
5891
|
* @name GetWallabyAuthPubKey
|
|
5862
5892
|
* @summary Get user public key
|
|
5863
|
-
* @request POST:/
|
|
5893
|
+
* @request POST:/auth/wallaby-auth-pubkey
|
|
5864
5894
|
* @secure
|
|
5865
5895
|
*/
|
|
5866
|
-
getWallabyAuthPubKey: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
5896
|
+
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)),
|
|
5867
5897
|
/**
|
|
5868
5898
|
* No description
|
|
5869
5899
|
*
|
|
5870
5900
|
* @tags Auth
|
|
5871
5901
|
* @name GetPasskeyCredentials
|
|
5872
5902
|
* @summary Get user passkey credentials
|
|
5873
|
-
* @request GET:/
|
|
5903
|
+
* @request GET:/auth/passkey-credentials
|
|
5874
5904
|
* @secure
|
|
5875
5905
|
*/
|
|
5876
|
-
getPasskeyCredentials: (params = {}) => this.http.request(Object.assign({ path: `/
|
|
5906
|
+
getPasskeyCredentials: (params = {}) => this.http.request(Object.assign({ path: `/auth/passkey-credentials`, method: "GET", secure: true, format: "json" }, params)),
|
|
5877
5907
|
};
|
|
5878
5908
|
this.chains = {
|
|
5879
5909
|
/**
|
|
@@ -5882,33 +5912,31 @@ class Api {
|
|
|
5882
5912
|
* @tags Chains
|
|
5883
5913
|
* @name GetAllChains
|
|
5884
5914
|
* @summary Get all supported chains
|
|
5885
|
-
* @request GET:/
|
|
5915
|
+
* @request GET:/chains
|
|
5886
5916
|
* @secure
|
|
5887
5917
|
*/
|
|
5888
|
-
getAllChains: (query, params = {}) => this.http.request(Object.assign({ path: `/
|
|
5918
|
+
getAllChains: (query, params = {}) => this.http.request(Object.assign({ path: `/chains`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
5889
5919
|
/**
|
|
5890
5920
|
* No description
|
|
5891
5921
|
*
|
|
5892
5922
|
* @tags Chains
|
|
5893
5923
|
* @name CreateChain
|
|
5894
5924
|
* @summary Create new chain. This endpoint is only available for super admin and republic admin
|
|
5895
|
-
* @request POST:/
|
|
5896
|
-
* @secure
|
|
5925
|
+
* @request POST:/chains
|
|
5897
5926
|
*/
|
|
5898
|
-
createChain: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
5927
|
+
createChain: (data, params = {}) => this.http.request(Object.assign({ path: `/chains`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
5899
5928
|
/**
|
|
5900
5929
|
* No description
|
|
5901
5930
|
*
|
|
5902
5931
|
* @tags Chains
|
|
5903
5932
|
* @name UpdateChain
|
|
5904
5933
|
* @summary Update the chain public data
|
|
5905
|
-
* @request PUT:/
|
|
5906
|
-
* @secure
|
|
5934
|
+
* @request PUT:/chains/{chainId}
|
|
5907
5935
|
*/
|
|
5908
5936
|
updateChain: (_a, data, params) => {
|
|
5909
5937
|
var { chainId } = _a; __rest(_a, ["chainId"]);
|
|
5910
5938
|
if (params === void 0) { params = {}; }
|
|
5911
|
-
return this.http.request(Object.assign({ path: `/
|
|
5939
|
+
return this.http.request(Object.assign({ path: `/chains/${chainId}`, method: "PUT", body: data, type: ContentType.Json, format: "json" }, params));
|
|
5912
5940
|
},
|
|
5913
5941
|
};
|
|
5914
5942
|
this.assets = {
|
|
@@ -5918,33 +5946,33 @@ class Api {
|
|
|
5918
5946
|
* @tags Assets
|
|
5919
5947
|
* @name GetAssetsConfigurations
|
|
5920
5948
|
* @summary Get all supported assets configuration that can be imported into a merchant or a user wallet
|
|
5921
|
-
* @request GET:/
|
|
5949
|
+
* @request GET:/assets/configurations
|
|
5922
5950
|
* @secure
|
|
5923
5951
|
*/
|
|
5924
|
-
getAssetsConfigurations: (query, params = {}) => this.http.request(Object.assign({ path: `/
|
|
5952
|
+
getAssetsConfigurations: (query, params = {}) => this.http.request(Object.assign({ path: `/assets/configurations`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
5925
5953
|
/**
|
|
5926
5954
|
* No description
|
|
5927
5955
|
*
|
|
5928
5956
|
* @tags Assets
|
|
5929
5957
|
* @name CreateAssetConfig
|
|
5930
5958
|
* @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
|
|
5931
|
-
* @request POST:/
|
|
5959
|
+
* @request POST:/assets/configurations
|
|
5932
5960
|
* @secure
|
|
5933
5961
|
*/
|
|
5934
|
-
createAssetConfig: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
5962
|
+
createAssetConfig: (data, params = {}) => this.http.request(Object.assign({ path: `/assets/configurations`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
5935
5963
|
/**
|
|
5936
5964
|
* No description
|
|
5937
5965
|
*
|
|
5938
5966
|
* @tags Assets
|
|
5939
5967
|
* @name UpdateAssetConfig
|
|
5940
5968
|
* @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
|
|
5941
|
-
* @request PUT:/
|
|
5969
|
+
* @request PUT:/assets/configurations/{assetConfigId}
|
|
5942
5970
|
* @secure
|
|
5943
5971
|
*/
|
|
5944
5972
|
updateAssetConfig: (_a, data, params) => {
|
|
5945
5973
|
var { assetConfigId } = _a; __rest(_a, ["assetConfigId"]);
|
|
5946
5974
|
if (params === void 0) { params = {}; }
|
|
5947
|
-
return this.http.request(Object.assign({ path: `/
|
|
5975
|
+
return this.http.request(Object.assign({ path: `/assets/configurations/${assetConfigId}`, method: "PUT", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
|
|
5948
5976
|
},
|
|
5949
5977
|
/**
|
|
5950
5978
|
* No description
|
|
@@ -5952,13 +5980,13 @@ class Api {
|
|
|
5952
5980
|
* @tags Assets
|
|
5953
5981
|
* @name VerifyAsset
|
|
5954
5982
|
* @summary Verify asset configuration details.
|
|
5955
|
-
* @request POST:/
|
|
5983
|
+
* @request POST:/assets/configurations/{assetConfigId}/verify
|
|
5956
5984
|
* @secure
|
|
5957
5985
|
*/
|
|
5958
5986
|
verifyAsset: (_a, params) => {
|
|
5959
5987
|
var { assetConfigId } = _a; __rest(_a, ["assetConfigId"]);
|
|
5960
5988
|
if (params === void 0) { params = {}; }
|
|
5961
|
-
return this.http.request(Object.assign({ path: `/
|
|
5989
|
+
return this.http.request(Object.assign({ path: `/assets/configurations/${assetConfigId}/verify`, method: "POST", secure: true, format: "json" }, params));
|
|
5962
5990
|
},
|
|
5963
5991
|
/**
|
|
5964
5992
|
* No description
|
|
@@ -5966,13 +5994,13 @@ class Api {
|
|
|
5966
5994
|
* @tags Assets
|
|
5967
5995
|
* @name UnverifyAsset
|
|
5968
5996
|
* @summary Unverify asset configuration
|
|
5969
|
-
* @request DELETE:/
|
|
5997
|
+
* @request DELETE:/assets/configurations/{assetConfigId}/unverify
|
|
5970
5998
|
* @secure
|
|
5971
5999
|
*/
|
|
5972
6000
|
unverifyAsset: (_a, params) => {
|
|
5973
6001
|
var { assetConfigId } = _a; __rest(_a, ["assetConfigId"]);
|
|
5974
6002
|
if (params === void 0) { params = {}; }
|
|
5975
|
-
return this.http.request(Object.assign({ path: `/
|
|
6003
|
+
return this.http.request(Object.assign({ path: `/assets/configurations/${assetConfigId}/unverify`, method: "DELETE", secure: true, format: "json" }, params));
|
|
5976
6004
|
},
|
|
5977
6005
|
/**
|
|
5978
6006
|
* No description
|
|
@@ -5980,13 +6008,13 @@ class Api {
|
|
|
5980
6008
|
* @tags Assets
|
|
5981
6009
|
* @name ArchiveAsset
|
|
5982
6010
|
* @summary Archive an asset configuration
|
|
5983
|
-
* @request POST:/
|
|
6011
|
+
* @request POST:/assets/configurations/{assetConfigId}/archive
|
|
5984
6012
|
* @secure
|
|
5985
6013
|
*/
|
|
5986
6014
|
archiveAsset: (_a, params) => {
|
|
5987
6015
|
var { assetConfigId } = _a; __rest(_a, ["assetConfigId"]);
|
|
5988
6016
|
if (params === void 0) { params = {}; }
|
|
5989
|
-
return this.http.request(Object.assign({ path: `/
|
|
6017
|
+
return this.http.request(Object.assign({ path: `/assets/configurations/${assetConfigId}/archive`, method: "POST", secure: true, format: "json" }, params));
|
|
5990
6018
|
},
|
|
5991
6019
|
/**
|
|
5992
6020
|
* No description
|
|
@@ -5994,13 +6022,13 @@ class Api {
|
|
|
5994
6022
|
* @tags Assets
|
|
5995
6023
|
* @name UnarchiveAsset
|
|
5996
6024
|
* @summary Archive an asset configuration
|
|
5997
|
-
* @request POST:/
|
|
6025
|
+
* @request POST:/assets/configurations/{assetConfigId}/unarchive
|
|
5998
6026
|
* @secure
|
|
5999
6027
|
*/
|
|
6000
6028
|
unarchiveAsset: (_a, params) => {
|
|
6001
6029
|
var { assetConfigId } = _a; __rest(_a, ["assetConfigId"]);
|
|
6002
6030
|
if (params === void 0) { params = {}; }
|
|
6003
|
-
return this.http.request(Object.assign({ path: `/
|
|
6031
|
+
return this.http.request(Object.assign({ path: `/assets/configurations/${assetConfigId}/unarchive`, method: "POST", secure: true, format: "json" }, params));
|
|
6004
6032
|
},
|
|
6005
6033
|
};
|
|
6006
6034
|
this.merchants = {
|
|
@@ -6010,33 +6038,32 @@ class Api {
|
|
|
6010
6038
|
* @tags Merchants
|
|
6011
6039
|
* @name GetAllMerchants
|
|
6012
6040
|
* @summary Get all merchants
|
|
6013
|
-
* @request GET:/
|
|
6014
|
-
* @secure
|
|
6041
|
+
* @request GET:/merchants
|
|
6015
6042
|
*/
|
|
6016
|
-
getAllMerchants: (query, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6043
|
+
getAllMerchants: (query, params = {}) => this.http.request(Object.assign({ path: `/merchants`, method: "GET", query: query, format: "json" }, params)),
|
|
6017
6044
|
/**
|
|
6018
6045
|
* No description
|
|
6019
6046
|
*
|
|
6020
6047
|
* @tags Merchants
|
|
6021
6048
|
* @name CreateMerchant
|
|
6022
6049
|
* @summary Create new merchant. This endpoint is only available for super admin and republic admin
|
|
6023
|
-
* @request POST:/
|
|
6050
|
+
* @request POST:/merchants
|
|
6024
6051
|
* @secure
|
|
6025
6052
|
*/
|
|
6026
|
-
createMerchant: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6053
|
+
createMerchant: (data, params = {}) => this.http.request(Object.assign({ path: `/merchants`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6027
6054
|
/**
|
|
6028
6055
|
* No description
|
|
6029
6056
|
*
|
|
6030
6057
|
* @tags Merchants
|
|
6031
6058
|
* @name UpdateMerchant
|
|
6032
6059
|
* @summary Update merchant. This endpoint is only available for super admin and republic admin
|
|
6033
|
-
* @request PUT:/
|
|
6060
|
+
* @request PUT:/merchants/{merchantId}
|
|
6034
6061
|
* @secure
|
|
6035
6062
|
*/
|
|
6036
6063
|
updateMerchant: (_a, data, params) => {
|
|
6037
6064
|
var { merchantId } = _a; __rest(_a, ["merchantId"]);
|
|
6038
6065
|
if (params === void 0) { params = {}; }
|
|
6039
|
-
return this.http.request(Object.assign({ path: `/
|
|
6066
|
+
return this.http.request(Object.assign({ path: `/merchants/${merchantId}`, method: "PUT", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
|
|
6040
6067
|
},
|
|
6041
6068
|
/**
|
|
6042
6069
|
* No description
|
|
@@ -6044,13 +6071,12 @@ class Api {
|
|
|
6044
6071
|
* @tags Merchants
|
|
6045
6072
|
* @name GetOneMerchant
|
|
6046
6073
|
* @summary Get one merchant by id with counts
|
|
6047
|
-
* @request GET:/
|
|
6048
|
-
* @secure
|
|
6074
|
+
* @request GET:/merchants/{merchantId}
|
|
6049
6075
|
*/
|
|
6050
6076
|
getOneMerchant: (_a, params) => {
|
|
6051
6077
|
var { merchantId } = _a; __rest(_a, ["merchantId"]);
|
|
6052
6078
|
if (params === void 0) { params = {}; }
|
|
6053
|
-
return this.http.request(Object.assign({ path: `/
|
|
6079
|
+
return this.http.request(Object.assign({ path: `/merchants/${merchantId}`, method: "GET", format: "json" }, params));
|
|
6054
6080
|
},
|
|
6055
6081
|
/**
|
|
6056
6082
|
* No description
|
|
@@ -6058,13 +6084,12 @@ class Api {
|
|
|
6058
6084
|
* @tags Merchants
|
|
6059
6085
|
* @name GetMerchantAssets
|
|
6060
6086
|
* @summary Get merchant assets by merchant id
|
|
6061
|
-
* @request GET:/
|
|
6062
|
-
* @secure
|
|
6087
|
+
* @request GET:/merchants/{merchantId}/assets
|
|
6063
6088
|
*/
|
|
6064
6089
|
getMerchantAssets: (_a, params) => {
|
|
6065
6090
|
var { merchantId } = _a, query = __rest(_a, ["merchantId"]);
|
|
6066
6091
|
if (params === void 0) { params = {}; }
|
|
6067
|
-
return this.http.request(Object.assign({ path: `/
|
|
6092
|
+
return this.http.request(Object.assign({ path: `/merchants/${merchantId}/assets`, method: "GET", query: query, format: "json" }, params));
|
|
6068
6093
|
},
|
|
6069
6094
|
/**
|
|
6070
6095
|
* No description
|
|
@@ -6072,13 +6097,13 @@ class Api {
|
|
|
6072
6097
|
* @tags Merchants
|
|
6073
6098
|
* @name GetMerchantUsers
|
|
6074
6099
|
* @summary Get merchant users by merchant id
|
|
6075
|
-
* @request GET:/
|
|
6100
|
+
* @request GET:/merchants/{merchantId}/users
|
|
6076
6101
|
* @secure
|
|
6077
6102
|
*/
|
|
6078
6103
|
getMerchantUsers: (_a, params) => {
|
|
6079
6104
|
var { merchantId } = _a, query = __rest(_a, ["merchantId"]);
|
|
6080
6105
|
if (params === void 0) { params = {}; }
|
|
6081
|
-
return this.http.request(Object.assign({ path: `/
|
|
6106
|
+
return this.http.request(Object.assign({ path: `/merchants/${merchantId}/users`, method: "GET", query: query, secure: true, format: "json" }, params));
|
|
6082
6107
|
},
|
|
6083
6108
|
/**
|
|
6084
6109
|
* No description
|
|
@@ -6086,13 +6111,13 @@ class Api {
|
|
|
6086
6111
|
* @tags Merchants
|
|
6087
6112
|
* @name GetMerchantAdmins
|
|
6088
6113
|
* @summary Get merchant admins by merchant id
|
|
6089
|
-
* @request GET:/
|
|
6114
|
+
* @request GET:/merchants/{merchantId}/admins
|
|
6090
6115
|
* @secure
|
|
6091
6116
|
*/
|
|
6092
6117
|
getMerchantAdmins: (_a, params) => {
|
|
6093
6118
|
var { merchantId } = _a, query = __rest(_a, ["merchantId"]);
|
|
6094
6119
|
if (params === void 0) { params = {}; }
|
|
6095
|
-
return this.http.request(Object.assign({ path: `/
|
|
6120
|
+
return this.http.request(Object.assign({ path: `/merchants/${merchantId}/admins`, method: "GET", query: query, secure: true, format: "json" }, params));
|
|
6096
6121
|
},
|
|
6097
6122
|
/**
|
|
6098
6123
|
* No description
|
|
@@ -6100,23 +6125,23 @@ class Api {
|
|
|
6100
6125
|
* @tags Merchants
|
|
6101
6126
|
* @name InviteMerchantAdmins
|
|
6102
6127
|
* @summary Invite merchant admins by merchant id
|
|
6103
|
-
* @request POST:/
|
|
6128
|
+
* @request POST:/merchants/admins/invite
|
|
6104
6129
|
* @secure
|
|
6105
6130
|
*/
|
|
6106
|
-
inviteMerchantAdmins: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6131
|
+
inviteMerchantAdmins: (data, params = {}) => this.http.request(Object.assign({ path: `/merchants/admins/invite`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6107
6132
|
/**
|
|
6108
6133
|
* No description
|
|
6109
6134
|
*
|
|
6110
6135
|
* @tags Merchants
|
|
6111
6136
|
* @name RevokeMerchantAdmins
|
|
6112
6137
|
* @summary Invite merchant admins by merchant id
|
|
6113
|
-
* @request DELETE:/
|
|
6138
|
+
* @request DELETE:/merchants/{merchantId}/admins/{userId}
|
|
6114
6139
|
* @secure
|
|
6115
6140
|
*/
|
|
6116
6141
|
revokeMerchantAdmins: (_a, params) => {
|
|
6117
6142
|
var { merchantId, userId } = _a; __rest(_a, ["merchantId", "userId"]);
|
|
6118
6143
|
if (params === void 0) { params = {}; }
|
|
6119
|
-
return this.http.request(Object.assign({ path: `/
|
|
6144
|
+
return this.http.request(Object.assign({ path: `/merchants/${merchantId}/admins/${userId}`, method: "DELETE", secure: true, format: "json" }, params));
|
|
6120
6145
|
},
|
|
6121
6146
|
/**
|
|
6122
6147
|
* No description
|
|
@@ -6124,13 +6149,13 @@ class Api {
|
|
|
6124
6149
|
* @tags Merchants
|
|
6125
6150
|
* @name GetMerchantWallets
|
|
6126
6151
|
* @summary Get merchant wallets by merchant id
|
|
6127
|
-
* @request GET:/
|
|
6152
|
+
* @request GET:/merchants/{merchantId}/wallets
|
|
6128
6153
|
* @secure
|
|
6129
6154
|
*/
|
|
6130
6155
|
getMerchantWallets: (_a, params) => {
|
|
6131
6156
|
var { merchantId } = _a, query = __rest(_a, ["merchantId"]);
|
|
6132
6157
|
if (params === void 0) { params = {}; }
|
|
6133
|
-
return this.http.request(Object.assign({ path: `/
|
|
6158
|
+
return this.http.request(Object.assign({ path: `/merchants/${merchantId}/wallets`, method: "GET", query: query, secure: true, format: "json" }, params));
|
|
6134
6159
|
},
|
|
6135
6160
|
/**
|
|
6136
6161
|
* No description
|
|
@@ -6138,70 +6163,70 @@ class Api {
|
|
|
6138
6163
|
* @tags Merchants
|
|
6139
6164
|
* @name AddMerchantWalletAssets
|
|
6140
6165
|
* @summary Add assets to merchant wallets by merchant id
|
|
6141
|
-
* @request POST:/
|
|
6166
|
+
* @request POST:/merchants/wallets/add-assets
|
|
6142
6167
|
* @secure
|
|
6143
6168
|
*/
|
|
6144
|
-
addMerchantWalletAssets: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6169
|
+
addMerchantWalletAssets: (data, params = {}) => this.http.request(Object.assign({ path: `/merchants/wallets/add-assets`, method: "POST", body: data, secure: true, type: ContentType.Json }, params)),
|
|
6145
6170
|
/**
|
|
6146
6171
|
* No description
|
|
6147
6172
|
*
|
|
6148
6173
|
* @tags Merchants
|
|
6149
6174
|
* @name AddNewAsset
|
|
6150
6175
|
* @summary Add new asset to merchant based on the asset configuration
|
|
6151
|
-
* @request POST:/
|
|
6176
|
+
* @request POST:/merchants/assets/add
|
|
6152
6177
|
* @secure
|
|
6153
6178
|
*/
|
|
6154
|
-
addNewAsset: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6179
|
+
addNewAsset: (data, params = {}) => this.http.request(Object.assign({ path: `/merchants/assets/add`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6155
6180
|
/**
|
|
6156
6181
|
* No description
|
|
6157
6182
|
*
|
|
6158
6183
|
* @tags Merchants
|
|
6159
6184
|
* @name RemoveAsset
|
|
6160
6185
|
* @summary Remove asset from merchant based on the asset configuration
|
|
6161
|
-
* @request DELETE:/
|
|
6186
|
+
* @request DELETE:/merchants/assets/delete
|
|
6162
6187
|
* @secure
|
|
6163
6188
|
*/
|
|
6164
|
-
removeAsset: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6189
|
+
removeAsset: (data, params = {}) => this.http.request(Object.assign({ path: `/merchants/assets/delete`, method: "DELETE", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6165
6190
|
/**
|
|
6166
6191
|
* No description
|
|
6167
6192
|
*
|
|
6168
6193
|
* @tags Merchants
|
|
6169
6194
|
* @name ShowMerchantAssetToWalletHolders
|
|
6170
6195
|
* @summary Show merchant asset to wallet holders based on the asset configuration
|
|
6171
|
-
* @request POST:/
|
|
6196
|
+
* @request POST:/merchants/assets/update-visibility
|
|
6172
6197
|
* @secure
|
|
6173
6198
|
*/
|
|
6174
|
-
showMerchantAssetToWalletHolders: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6199
|
+
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)),
|
|
6175
6200
|
/**
|
|
6176
6201
|
* No description
|
|
6177
6202
|
*
|
|
6178
6203
|
* @tags Merchants
|
|
6179
6204
|
* @name ChangeMerchantAssetDefaultStatus
|
|
6180
6205
|
* @summary Change merchant asset default status
|
|
6181
|
-
* @request POST:/
|
|
6206
|
+
* @request POST:/merchants/assets/update-default-status
|
|
6182
6207
|
* @secure
|
|
6183
6208
|
*/
|
|
6184
|
-
changeMerchantAssetDefaultStatus: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6209
|
+
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)),
|
|
6185
6210
|
/**
|
|
6186
6211
|
* No description
|
|
6187
6212
|
*
|
|
6188
6213
|
* @tags Merchants
|
|
6189
6214
|
* @name CreateApiKey
|
|
6190
6215
|
* @summary Create new API Key
|
|
6191
|
-
* @request POST:/
|
|
6216
|
+
* @request POST:/merchants/api-keys/new
|
|
6192
6217
|
* @secure
|
|
6193
6218
|
*/
|
|
6194
|
-
createApiKey: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6219
|
+
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)),
|
|
6195
6220
|
/**
|
|
6196
6221
|
* No description
|
|
6197
6222
|
*
|
|
6198
6223
|
* @tags Merchants
|
|
6199
6224
|
* @name WhitelistApiKeyOrigins
|
|
6200
6225
|
* @summary Whitelist API Key's origins
|
|
6201
|
-
* @request POST:/
|
|
6226
|
+
* @request POST:/merchants/api-keys/whitelist-origins
|
|
6202
6227
|
* @secure
|
|
6203
6228
|
*/
|
|
6204
|
-
whitelistApiKeyOrigins: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6229
|
+
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)),
|
|
6205
6230
|
};
|
|
6206
6231
|
this.wallets = {
|
|
6207
6232
|
/**
|
|
@@ -6210,133 +6235,133 @@ class Api {
|
|
|
6210
6235
|
* @tags Wallets
|
|
6211
6236
|
* @name GetAllUsers
|
|
6212
6237
|
* @summary Get all wallets by the admin
|
|
6213
|
-
* @request GET:/
|
|
6238
|
+
* @request GET:/wallets
|
|
6214
6239
|
* @secure
|
|
6215
6240
|
*/
|
|
6216
|
-
getAllUsers: (query, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6241
|
+
getAllUsers: (query, params = {}) => this.http.request(Object.assign({ path: `/wallets`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6217
6242
|
/**
|
|
6218
6243
|
* No description
|
|
6219
6244
|
*
|
|
6220
6245
|
* @tags Wallets
|
|
6221
6246
|
* @name CreateWallet
|
|
6222
6247
|
* @summary Create a newly fresh wallet, returns asset list and encrypted seed
|
|
6223
|
-
* @request POST:/
|
|
6248
|
+
* @request POST:/wallets/create
|
|
6224
6249
|
* @secure
|
|
6225
6250
|
*/
|
|
6226
|
-
createWallet: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6251
|
+
createWallet: (data, params = {}) => this.http.request(Object.assign({ path: `/wallets/create`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6227
6252
|
/**
|
|
6228
6253
|
* No description
|
|
6229
6254
|
*
|
|
6230
6255
|
* @tags Wallets
|
|
6231
6256
|
* @name VerifyAccess
|
|
6232
6257
|
* @summary Verify that the user still has the ability to transact with the wallet
|
|
6233
|
-
* @request POST:/
|
|
6258
|
+
* @request POST:/wallets/verify-access
|
|
6234
6259
|
* @secure
|
|
6235
6260
|
*/
|
|
6236
|
-
verifyAccess: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6261
|
+
verifyAccess: (data, params = {}) => this.http.request(Object.assign({ path: `/wallets/verify-access`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6237
6262
|
/**
|
|
6238
6263
|
* No description
|
|
6239
6264
|
*
|
|
6240
6265
|
* @tags Wallets
|
|
6241
6266
|
* @name CreateAdminWallet
|
|
6242
6267
|
* @summary Create a server side admin wallet where encryptedSeed will be opaque to the caller
|
|
6243
|
-
* @request POST:/
|
|
6268
|
+
* @request POST:/wallets/create-admin-server-wallet
|
|
6244
6269
|
* @secure
|
|
6245
6270
|
*/
|
|
6246
|
-
createAdminWallet: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6271
|
+
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)),
|
|
6247
6272
|
/**
|
|
6248
6273
|
* No description
|
|
6249
6274
|
*
|
|
6250
6275
|
* @tags Wallets, MPC
|
|
6251
6276
|
* @name CreateWalletV2
|
|
6252
6277
|
* @summary Create a newly fresh wallet, returns asset list and encrypted seed, shares, or both
|
|
6253
|
-
* @request POST:/
|
|
6278
|
+
* @request POST:/wallets/create-with-shares
|
|
6254
6279
|
* @secure
|
|
6255
6280
|
*/
|
|
6256
|
-
createWalletV2: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6281
|
+
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)),
|
|
6257
6282
|
/**
|
|
6258
6283
|
* No description
|
|
6259
6284
|
*
|
|
6260
6285
|
* @tags Wallets, MPC
|
|
6261
6286
|
* @name ImportWalletSeedPhraseV2
|
|
6262
6287
|
* @summary Import an existing wallet seed phrase into wallaby system directly
|
|
6263
|
-
* @request POST:/
|
|
6288
|
+
* @request POST:/wallets/create-shares-based-wallet-from-seed
|
|
6264
6289
|
* @secure
|
|
6265
6290
|
*/
|
|
6266
|
-
importWalletSeedPhraseV2: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6291
|
+
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)),
|
|
6267
6292
|
/**
|
|
6268
6293
|
* No description
|
|
6269
6294
|
*
|
|
6270
6295
|
* @tags Wallets, MPC
|
|
6271
6296
|
* @name RetrieveShares
|
|
6272
6297
|
* @summary Retrieve shares which belong to the user on a specified wallet
|
|
6273
|
-
* @request POST:/
|
|
6298
|
+
* @request POST:/wallets/retrieve-shares
|
|
6274
6299
|
* @secure
|
|
6275
6300
|
*/
|
|
6276
|
-
retrieveShares: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6301
|
+
retrieveShares: (data, params = {}) => this.http.request(Object.assign({ path: `/wallets/retrieve-shares`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6277
6302
|
/**
|
|
6278
6303
|
* No description
|
|
6279
6304
|
*
|
|
6280
6305
|
* @tags Wallets, MPC
|
|
6281
6306
|
* @name ShareWallet
|
|
6282
6307
|
* @summary Share an entity wallet with another user
|
|
6283
|
-
* @request POST:/
|
|
6308
|
+
* @request POST:/wallets/initiate-share-wallet
|
|
6284
6309
|
* @secure
|
|
6285
6310
|
*/
|
|
6286
|
-
shareWallet: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6311
|
+
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)),
|
|
6287
6312
|
/**
|
|
6288
6313
|
* No description
|
|
6289
6314
|
*
|
|
6290
6315
|
* @tags Wallets, MPC
|
|
6291
6316
|
* @name UnshareWallet
|
|
6292
6317
|
* @summary Unshare an entity wallet with a user previously granted access
|
|
6293
|
-
* @request POST:/
|
|
6318
|
+
* @request POST:/wallets/unshare-wallet
|
|
6294
6319
|
* @secure
|
|
6295
6320
|
*/
|
|
6296
|
-
unshareWallet: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6321
|
+
unshareWallet: (data, params = {}) => this.http.request(Object.assign({ path: `/wallets/unshare-wallet`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6297
6322
|
/**
|
|
6298
6323
|
* No description
|
|
6299
6324
|
*
|
|
6300
6325
|
* @tags Wallets
|
|
6301
6326
|
* @name AddNewDevice
|
|
6302
6327
|
* @summary This endpoint will be called by the new device after it receives a Wallaby wrapped share
|
|
6303
|
-
* @request POST:/
|
|
6328
|
+
* @request POST:/wallets/add-new-device
|
|
6304
6329
|
* @secure
|
|
6305
6330
|
*/
|
|
6306
|
-
addNewDevice: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6331
|
+
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)),
|
|
6307
6332
|
/**
|
|
6308
6333
|
* No description
|
|
6309
6334
|
*
|
|
6310
6335
|
* @tags Wallets
|
|
6311
6336
|
* @name ImportWalletSeedPhrase
|
|
6312
6337
|
* @summary Import an existing wallet seed phrase into wallaby system directly
|
|
6313
|
-
* @request POST:/
|
|
6338
|
+
* @request POST:/wallets/import-seed-phrase
|
|
6314
6339
|
* @secure
|
|
6315
6340
|
*/
|
|
6316
|
-
importWalletSeedPhrase: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6341
|
+
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)),
|
|
6317
6342
|
/**
|
|
6318
6343
|
* No description
|
|
6319
6344
|
*
|
|
6320
6345
|
* @tags Wallets
|
|
6321
6346
|
* @name GenerateMissingAddresses
|
|
6322
6347
|
* @summary Generates missing wallet addresses for a user's wallet
|
|
6323
|
-
* @request POST:/
|
|
6348
|
+
* @request POST:/wallets/generate-wallet-addresses
|
|
6324
6349
|
* @secure
|
|
6325
6350
|
*/
|
|
6326
|
-
generateMissingAddresses: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6351
|
+
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)),
|
|
6327
6352
|
/**
|
|
6328
6353
|
* No description
|
|
6329
6354
|
*
|
|
6330
6355
|
* @tags Wallets
|
|
6331
6356
|
* @name GetUserAssetsByWalletId
|
|
6332
6357
|
* @summary Get all assets that exist in a certain wallet, by specifying a wallet ID
|
|
6333
|
-
* @request GET:/
|
|
6358
|
+
* @request GET:/wallets/{walletId}/assets
|
|
6334
6359
|
* @secure
|
|
6335
6360
|
*/
|
|
6336
6361
|
getUserAssetsByWalletId: (_a, params) => {
|
|
6337
6362
|
var { walletId } = _a, query = __rest(_a, ["walletId"]);
|
|
6338
6363
|
if (params === void 0) { params = {}; }
|
|
6339
|
-
return this.http.request(Object.assign({ path: `/
|
|
6364
|
+
return this.http.request(Object.assign({ path: `/wallets/${walletId}/assets`, method: "GET", query: query, secure: true, format: "json" }, params));
|
|
6340
6365
|
},
|
|
6341
6366
|
/**
|
|
6342
6367
|
* No description
|
|
@@ -6344,277 +6369,443 @@ class Api {
|
|
|
6344
6369
|
* @tags Wallets
|
|
6345
6370
|
* @name GetUserAsset
|
|
6346
6371
|
* @summary Get one asset from a user's wallet
|
|
6347
|
-
* @request GET:/
|
|
6372
|
+
* @request GET:/wallets/asset
|
|
6348
6373
|
* @secure
|
|
6349
6374
|
*/
|
|
6350
|
-
getUserAsset: (query, data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6375
|
+
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)),
|
|
6351
6376
|
/**
|
|
6352
6377
|
* No description
|
|
6353
6378
|
*
|
|
6354
6379
|
* @tags Wallets
|
|
6355
6380
|
* @name UpdateUserAsset
|
|
6356
6381
|
* @summary Update a specific asset in a wallet
|
|
6357
|
-
* @request PUT:/
|
|
6382
|
+
* @request PUT:/wallets/asset/update
|
|
6358
6383
|
* @secure
|
|
6359
6384
|
*/
|
|
6360
|
-
updateUserAsset: (query, data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6385
|
+
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)),
|
|
6361
6386
|
/**
|
|
6362
6387
|
* No description
|
|
6363
6388
|
*
|
|
6364
6389
|
* @tags Wallets, Multisig
|
|
6365
6390
|
* @name CreateMultisigAsset
|
|
6366
6391
|
* @summary Initiate creation for a new multisig asset, by specifying participants and the threshold
|
|
6367
|
-
* @request POST:/
|
|
6392
|
+
* @request POST:/wallets/create-multisig-asset
|
|
6368
6393
|
* @secure
|
|
6369
6394
|
*/
|
|
6370
|
-
createMultisigAsset: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6395
|
+
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)),
|
|
6371
6396
|
/**
|
|
6372
6397
|
* No description
|
|
6373
6398
|
*
|
|
6374
6399
|
* @tags Wallets, Recovery
|
|
6375
6400
|
* @name InitiateWalletRecovery
|
|
6376
6401
|
* @summary Wallet Recovery - Step 1: Initiate wallet recovery
|
|
6377
|
-
* @request POST:/
|
|
6402
|
+
* @request POST:/wallets/recover/init
|
|
6378
6403
|
* @secure
|
|
6379
6404
|
*/
|
|
6380
|
-
initiateWalletRecovery: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6405
|
+
initiateWalletRecovery: (data, params = {}) => this.http.request(Object.assign({ path: `/wallets/recover/init`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6381
6406
|
/**
|
|
6382
6407
|
* No description
|
|
6383
6408
|
*
|
|
6384
6409
|
* @tags Wallets, Recovery
|
|
6385
6410
|
* @name RecoverWallet
|
|
6386
6411
|
* @summary Wallet Recovery - Step 2 and final: Recover the lost wallet and its assets
|
|
6387
|
-
* @request POST:/
|
|
6412
|
+
* @request POST:/wallets/recover
|
|
6388
6413
|
* @secure
|
|
6389
6414
|
*/
|
|
6390
|
-
recoverWallet: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6415
|
+
recoverWallet: (data, params = {}) => this.http.request(Object.assign({ path: `/wallets/recover`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6391
6416
|
/**
|
|
6392
6417
|
* No description
|
|
6393
6418
|
*
|
|
6394
6419
|
* @tags Wallets, Algorand
|
|
6395
6420
|
* @name ConvertStandardPhraseToAlgoSpecific
|
|
6396
6421
|
* @summary Convert BIP39 Standard seed phrase to Algorand fixed 25 words mnemonic phrase
|
|
6397
|
-
* @request POST:/
|
|
6422
|
+
* @request POST:/wallets/convert-mnemonic-seed
|
|
6423
|
+
* @secure
|
|
6424
|
+
*/
|
|
6425
|
+
convertStandardPhraseToAlgoSpecific: (data, params = {}) => this.http.request(Object.assign({ path: `/wallets/convert-mnemonic-seed`, method: "POST", body: data, secure: true, type: ContentType.Json }, params)),
|
|
6426
|
+
};
|
|
6427
|
+
this.users = {
|
|
6428
|
+
/**
|
|
6429
|
+
* No description
|
|
6430
|
+
*
|
|
6431
|
+
* @tags Users
|
|
6432
|
+
* @name GetAllUsers
|
|
6433
|
+
* @summary Get all users by the admin
|
|
6434
|
+
* @request GET:/users
|
|
6435
|
+
* @secure
|
|
6436
|
+
*/
|
|
6437
|
+
getAllUsers: (query, params = {}) => this.http.request(Object.assign({ path: `/users`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6438
|
+
/**
|
|
6439
|
+
* No description
|
|
6440
|
+
*
|
|
6441
|
+
* @tags Users
|
|
6442
|
+
* @name UpdateProfile
|
|
6443
|
+
* @summary Update user profile info
|
|
6444
|
+
* @request PUT:/users/profile
|
|
6445
|
+
* @secure
|
|
6446
|
+
*/
|
|
6447
|
+
updateProfile: (data, params = {}) => this.http.request(Object.assign({ path: `/users/profile`, method: "PUT", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6448
|
+
/**
|
|
6449
|
+
* No description
|
|
6450
|
+
*
|
|
6451
|
+
* @tags Users
|
|
6452
|
+
* @name GetCurrentUser
|
|
6453
|
+
* @summary Returns current user data
|
|
6454
|
+
* @request GET:/users/profile
|
|
6455
|
+
* @secure
|
|
6456
|
+
*/
|
|
6457
|
+
getCurrentUser: (params = {}) => this.http.request(Object.assign({ path: `/users/profile`, method: "GET", secure: true, format: "json" }, params)),
|
|
6458
|
+
/**
|
|
6459
|
+
* No description
|
|
6460
|
+
*
|
|
6461
|
+
* @tags Users
|
|
6462
|
+
* @name GetCurrentUserSalt
|
|
6463
|
+
* @summary Get current user's client salt
|
|
6464
|
+
* @request GET:/users/salt
|
|
6465
|
+
* @secure
|
|
6466
|
+
*/
|
|
6467
|
+
getCurrentUserSalt: (params = {}) => this.http.request(Object.assign({ path: `/users/salt`, method: "GET", secure: true, format: "json" }, params)),
|
|
6468
|
+
/**
|
|
6469
|
+
* No description
|
|
6470
|
+
*
|
|
6471
|
+
* @tags Users
|
|
6472
|
+
* @name GetAllWalletsFromUserId
|
|
6473
|
+
* @summary Returns user wallets by specifying user id
|
|
6474
|
+
* @request GET:/users/{userId}/wallets
|
|
6475
|
+
* @secure
|
|
6476
|
+
*/
|
|
6477
|
+
getAllWalletsFromUserId: (_a, params) => {
|
|
6478
|
+
var { userId } = _a; __rest(_a, ["userId"]);
|
|
6479
|
+
if (params === void 0) { params = {}; }
|
|
6480
|
+
return this.http.request(Object.assign({ path: `/users/${userId}/wallets`, method: "GET", secure: true, format: "json" }, params));
|
|
6481
|
+
},
|
|
6482
|
+
/**
|
|
6483
|
+
* No description
|
|
6484
|
+
*
|
|
6485
|
+
* @tags Users
|
|
6486
|
+
* @name GetCurrentUserMerchantAssets
|
|
6487
|
+
* @summary Returns user's merchant assets
|
|
6488
|
+
* @request GET:/users/merchants/assets
|
|
6489
|
+
* @secure
|
|
6490
|
+
*/
|
|
6491
|
+
getCurrentUserMerchantAssets: (query, params = {}) => this.http.request(Object.assign({ path: `/users/merchants/assets`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6492
|
+
/**
|
|
6493
|
+
* No description
|
|
6494
|
+
*
|
|
6495
|
+
* @tags Users
|
|
6496
|
+
* @name GetCurrentUserMerchantAssets2
|
|
6497
|
+
* @summary Returns user's merchant assets
|
|
6498
|
+
* @request GET:/users/merchant/assets
|
|
6499
|
+
* @originalName getCurrentUserMerchantAssets
|
|
6500
|
+
* @duplicate
|
|
6501
|
+
* @secure
|
|
6502
|
+
*/
|
|
6503
|
+
getCurrentUserMerchantAssets2: (query, params = {}) => this.http.request(Object.assign({ path: `/users/merchant/assets`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6504
|
+
/**
|
|
6505
|
+
* No description
|
|
6506
|
+
*
|
|
6507
|
+
* @tags Users
|
|
6508
|
+
* @name GetAssetsByUserId
|
|
6509
|
+
* @summary Returns user assets by specifying user id
|
|
6510
|
+
* @request GET:/users/{userId}/assets
|
|
6511
|
+
* @secure
|
|
6512
|
+
*/
|
|
6513
|
+
getAssetsByUserId: (_a, params) => {
|
|
6514
|
+
var { userId } = _a, query = __rest(_a, ["userId"]);
|
|
6515
|
+
if (params === void 0) { params = {}; }
|
|
6516
|
+
return this.http.request(Object.assign({ path: `/users/${userId}/assets`, method: "GET", query: query, secure: true, format: "json" }, params));
|
|
6517
|
+
},
|
|
6518
|
+
/**
|
|
6519
|
+
* No description
|
|
6520
|
+
*
|
|
6521
|
+
* @tags Users
|
|
6522
|
+
* @name AddAssetToUser
|
|
6523
|
+
* @summary Add a new asset to the user's wallet based on the asset configuration
|
|
6524
|
+
* @request POST:/users/assets/add
|
|
6398
6525
|
* @secure
|
|
6399
6526
|
*/
|
|
6400
|
-
|
|
6527
|
+
addAssetToUser: (data, params = {}) => this.http.request(Object.assign({ path: `/users/assets/add`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6401
6528
|
/**
|
|
6402
6529
|
* No description
|
|
6403
6530
|
*
|
|
6404
|
-
* @tags
|
|
6405
|
-
* @name
|
|
6406
|
-
* @summary
|
|
6407
|
-
* @request
|
|
6531
|
+
* @tags Users
|
|
6532
|
+
* @name RemoveAssetFromUser
|
|
6533
|
+
* @summary Remove an asset from the user's wallet based on the asset configuration
|
|
6534
|
+
* @request DELETE:/users/{userId}/wallets/{walletId}/assets/{assetConfigId}
|
|
6408
6535
|
* @secure
|
|
6409
6536
|
*/
|
|
6410
|
-
|
|
6411
|
-
var { walletId } = _a; __rest(_a, ["walletId"]);
|
|
6537
|
+
removeAssetFromUser: (_a, params) => {
|
|
6538
|
+
var { assetConfigId, walletId, userId } = _a; __rest(_a, ["assetConfigId", "walletId", "userId"]);
|
|
6412
6539
|
if (params === void 0) { params = {}; }
|
|
6413
|
-
return this.http.request(Object.assign({ path: `/
|
|
6540
|
+
return this.http.request(Object.assign({ path: `/users/${userId}/wallets/${walletId}/assets/${assetConfigId}`, method: "DELETE", secure: true, format: "json" }, params));
|
|
6414
6541
|
},
|
|
6415
6542
|
/**
|
|
6416
6543
|
* No description
|
|
6417
6544
|
*
|
|
6418
|
-
* @tags
|
|
6419
|
-
* @name
|
|
6420
|
-
* @summary
|
|
6421
|
-
* @request GET:/
|
|
6545
|
+
* @tags Users
|
|
6546
|
+
* @name GetUserByUserId
|
|
6547
|
+
* @summary Returns user public data
|
|
6548
|
+
* @request GET:/users/{userId}
|
|
6422
6549
|
* @secure
|
|
6423
6550
|
*/
|
|
6424
|
-
|
|
6425
|
-
var {
|
|
6551
|
+
getUserByUserId: (_a, params) => {
|
|
6552
|
+
var { userId } = _a; __rest(_a, ["userId"]);
|
|
6553
|
+
if (params === void 0) { params = {}; }
|
|
6554
|
+
return this.http.request(Object.assign({ path: `/users/${userId}`, method: "GET", secure: true, format: "json" }, params));
|
|
6555
|
+
},
|
|
6556
|
+
/**
|
|
6557
|
+
* No description
|
|
6558
|
+
*
|
|
6559
|
+
* @tags Users
|
|
6560
|
+
* @name GetUserByExternalUserId
|
|
6561
|
+
* @request GET:/users/{externalUserId}/externalUserId
|
|
6562
|
+
* @secure
|
|
6563
|
+
*/
|
|
6564
|
+
getUserByExternalUserId: (_a, params) => {
|
|
6565
|
+
var { externalUserId } = _a; __rest(_a, ["externalUserId"]);
|
|
6426
6566
|
if (params === void 0) { params = {}; }
|
|
6427
|
-
return this.http.request(Object.assign({ path: `/
|
|
6567
|
+
return this.http.request(Object.assign({ path: `/users/${externalUserId}/externalUserId`, method: "GET", secure: true, format: "json" }, params));
|
|
6428
6568
|
},
|
|
6429
6569
|
/**
|
|
6430
6570
|
* No description
|
|
6431
6571
|
*
|
|
6432
|
-
* @tags
|
|
6433
|
-
* @name
|
|
6434
|
-
* @summary
|
|
6435
|
-
* @request GET:/
|
|
6572
|
+
* @tags Users
|
|
6573
|
+
* @name GetParticipantsByUserId
|
|
6574
|
+
* @summary Returns multisig participants by user id
|
|
6575
|
+
* @request GET:/users/{userId}/multisig-transactions
|
|
6436
6576
|
* @secure
|
|
6437
6577
|
*/
|
|
6438
|
-
|
|
6439
|
-
var {
|
|
6578
|
+
getParticipantsByUserId: (_a, params) => {
|
|
6579
|
+
var { userId } = _a, query = __rest(_a, ["userId"]);
|
|
6440
6580
|
if (params === void 0) { params = {}; }
|
|
6441
|
-
return this.http.request(Object.assign({ path: `/
|
|
6581
|
+
return this.http.request(Object.assign({ path: `/users/${userId}/multisig-transactions`, method: "GET", query: query, secure: true, format: "json" }, params));
|
|
6442
6582
|
},
|
|
6443
6583
|
};
|
|
6444
|
-
this.
|
|
6584
|
+
this.query = {
|
|
6445
6585
|
/**
|
|
6446
6586
|
* No description
|
|
6447
6587
|
*
|
|
6448
|
-
* @tags
|
|
6449
|
-
* @name
|
|
6450
|
-
* @summary
|
|
6451
|
-
* @request GET:/
|
|
6588
|
+
* @tags Query
|
|
6589
|
+
* @name FetchBalance
|
|
6590
|
+
* @summary Fetch asset balance by specifying the asset address and the asset symbol
|
|
6591
|
+
* @request GET:/query/assets/balance
|
|
6452
6592
|
* @secure
|
|
6453
6593
|
*/
|
|
6454
|
-
|
|
6594
|
+
fetchBalance: (query, params = {}) => this.http.request(Object.assign({ path: `/query/assets/balance`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6455
6595
|
/**
|
|
6456
6596
|
* No description
|
|
6457
6597
|
*
|
|
6458
|
-
* @tags
|
|
6459
|
-
* @name
|
|
6460
|
-
* @summary
|
|
6461
|
-
* @request GET:/
|
|
6598
|
+
* @tags Query
|
|
6599
|
+
* @name FetchOnlyBalance
|
|
6600
|
+
* @summary Fetch address balance by specifying the address and the asset symbol. This API works even for external assets addresses
|
|
6601
|
+
* @request GET:/query/address/balance
|
|
6602
|
+
* @secure
|
|
6603
|
+
*/
|
|
6604
|
+
fetchOnlyBalance: (query, params = {}) => this.http.request(Object.assign({ path: `/query/address/balance`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6605
|
+
/**
|
|
6606
|
+
* No description
|
|
6607
|
+
*
|
|
6608
|
+
* @tags Query
|
|
6609
|
+
* @name FetchBulkBalance
|
|
6610
|
+
* @summary Fetch assets' balance by providing an array of asset addresses and symbols
|
|
6611
|
+
* @request POST:/query/assets/bulk-balance
|
|
6612
|
+
* @secure
|
|
6613
|
+
*/
|
|
6614
|
+
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)),
|
|
6615
|
+
/**
|
|
6616
|
+
* No description
|
|
6617
|
+
*
|
|
6618
|
+
* @tags Query
|
|
6619
|
+
* @name FetchWalletBulkBalance
|
|
6620
|
+
* @summary Fetch assets balances by specifying the wallet ID
|
|
6621
|
+
* @request POST:/query/assets/wallet-bulk-balance
|
|
6622
|
+
* @secure
|
|
6623
|
+
*/
|
|
6624
|
+
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)),
|
|
6625
|
+
/**
|
|
6626
|
+
* No description
|
|
6627
|
+
*
|
|
6628
|
+
* @tags Query
|
|
6629
|
+
* @name FetchTransactions
|
|
6630
|
+
* @summary Fetch the current address historical transactions
|
|
6631
|
+
* @request GET:/query/transactions
|
|
6632
|
+
*/
|
|
6633
|
+
fetchTransactions: (query, params = {}) => this.http.request(Object.assign({ path: `/query/transactions`, method: "GET", query: query, format: "json" }, params)),
|
|
6634
|
+
/**
|
|
6635
|
+
* No description
|
|
6636
|
+
*
|
|
6637
|
+
* @tags Query, Assets
|
|
6638
|
+
* @name FetchEvmTokenAssetInfo
|
|
6639
|
+
* @summary Request token asset info like decimals, name and symbol
|
|
6640
|
+
* @request GET:/query/fetch-token-info
|
|
6641
|
+
* @secure
|
|
6642
|
+
*/
|
|
6643
|
+
fetchEvmTokenAssetInfo: (query, params = {}) => this.http.request(Object.assign({ path: `/query/fetch-token-info`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6644
|
+
/**
|
|
6645
|
+
* No description
|
|
6646
|
+
*
|
|
6647
|
+
* @tags Query, Assets
|
|
6648
|
+
* @name FetchAssetPairPrice
|
|
6649
|
+
* @summary Fetch asset price by providing symbol pairing or a list of pairing symbols
|
|
6650
|
+
* @request GET:/query/get-asset-price
|
|
6462
6651
|
* @secure
|
|
6463
6652
|
*/
|
|
6464
|
-
|
|
6653
|
+
fetchAssetPairPrice: (query, params = {}) => this.http.request(Object.assign({ path: `/query/get-asset-price`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6654
|
+
};
|
|
6655
|
+
this.transactions = {
|
|
6465
6656
|
/**
|
|
6466
6657
|
* No description
|
|
6467
6658
|
*
|
|
6468
6659
|
* @tags Transactions
|
|
6469
|
-
* @name
|
|
6470
|
-
* @summary
|
|
6471
|
-
* @request
|
|
6660
|
+
* @name GetTransactions
|
|
6661
|
+
* @summary Get list of transactions
|
|
6662
|
+
* @request GET:/transactions
|
|
6472
6663
|
* @secure
|
|
6473
6664
|
*/
|
|
6474
|
-
|
|
6665
|
+
getTransactions: (query, params = {}) => this.http.request(Object.assign({ path: `/transactions`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6475
6666
|
/**
|
|
6476
6667
|
* No description
|
|
6477
6668
|
*
|
|
6478
6669
|
* @tags Transactions
|
|
6479
6670
|
* @name SendTransaction
|
|
6480
6671
|
* @summary Request transferring funds to a recipient address
|
|
6481
|
-
* @request POST:/
|
|
6672
|
+
* @request POST:/transactions/transfer
|
|
6482
6673
|
* @secure
|
|
6483
6674
|
*/
|
|
6484
|
-
sendTransaction: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6675
|
+
sendTransaction: (data, params = {}) => this.http.request(Object.assign({ path: `/transactions/transfer`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6485
6676
|
/**
|
|
6486
6677
|
* No description
|
|
6487
6678
|
*
|
|
6488
6679
|
* @tags Transactions
|
|
6489
6680
|
* @name SendV2Transaction
|
|
6490
6681
|
* @summary Request transferring funds to a recipient address
|
|
6491
|
-
* @request POST:/
|
|
6682
|
+
* @request POST:/transactions/transfer-with-shares
|
|
6492
6683
|
* @secure
|
|
6493
6684
|
*/
|
|
6494
|
-
sendV2Transaction: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6685
|
+
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)),
|
|
6495
6686
|
/**
|
|
6496
6687
|
* No description
|
|
6497
6688
|
*
|
|
6498
6689
|
* @tags Transactions
|
|
6499
6690
|
* @name InitMultisigTransfer
|
|
6500
6691
|
* @summary User initiating and signing a multi-sig transfer request
|
|
6501
|
-
* @request POST:/
|
|
6692
|
+
* @request POST:/transactions/init-multisig-transfer
|
|
6502
6693
|
* @secure
|
|
6503
6694
|
*/
|
|
6504
|
-
initMultisigTransfer: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6695
|
+
initMultisigTransfer: (data, params = {}) => this.http.request(Object.assign({ path: `/transactions/init-multisig-transfer`, method: "POST", body: data, secure: true, type: ContentType.Json }, params)),
|
|
6505
6696
|
/**
|
|
6506
6697
|
* No description
|
|
6507
6698
|
*
|
|
6508
6699
|
* @tags Transactions, Multisig
|
|
6509
6700
|
* @name InitMultisigAssetOptin
|
|
6510
6701
|
* @summary User initiating a multi-sig asset optin request and subsequently signs the first signature on the request
|
|
6511
|
-
* @request POST:/
|
|
6702
|
+
* @request POST:/transactions/init-multisig-asset-optin
|
|
6512
6703
|
* @secure
|
|
6513
6704
|
*/
|
|
6514
|
-
initMultisigAssetOptin: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6705
|
+
initMultisigAssetOptin: (data, params = {}) => this.http.request(Object.assign({ path: `/transactions/init-multisig-asset-optin`, method: "POST", body: data, secure: true, type: ContentType.Json }, params)),
|
|
6515
6706
|
/**
|
|
6516
6707
|
* No description
|
|
6517
6708
|
*
|
|
6518
6709
|
* @tags Transactions, Multisig
|
|
6519
6710
|
* @name InitMultisigAppOptin
|
|
6520
6711
|
* @summary User initiating a multi-sig app optin request and subsequently signs the first signature on the request
|
|
6521
|
-
* @request POST:/
|
|
6712
|
+
* @request POST:/transactions/init-multisig-app-optin
|
|
6522
6713
|
* @secure
|
|
6523
6714
|
*/
|
|
6524
|
-
initMultisigAppOptin: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6715
|
+
initMultisigAppOptin: (data, params = {}) => this.http.request(Object.assign({ path: `/transactions/init-multisig-app-optin`, method: "POST", body: data, secure: true, type: ContentType.Json }, params)),
|
|
6525
6716
|
/**
|
|
6526
6717
|
* No description
|
|
6527
6718
|
*
|
|
6528
6719
|
* @tags Transactions, Multisig
|
|
6529
6720
|
* @name SignOnMultisigTransactionRequest
|
|
6530
6721
|
* @summary Append signature to an existing multisig transaction request: It can be a request to transfer, optin, etc, ...
|
|
6531
|
-
* @request POST:/
|
|
6722
|
+
* @request POST:/transactions/sign-multisig-request
|
|
6532
6723
|
* @secure
|
|
6533
6724
|
*/
|
|
6534
|
-
signOnMultisigTransactionRequest: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6725
|
+
signOnMultisigTransactionRequest: (data, params = {}) => this.http.request(Object.assign({ path: `/transactions/sign-multisig-request`, method: "POST", body: data, secure: true, type: ContentType.Json }, params)),
|
|
6535
6726
|
/**
|
|
6536
6727
|
* No description
|
|
6537
6728
|
*
|
|
6538
6729
|
* @tags Transactions, Optin
|
|
6539
6730
|
* @name AssetOptInTransaction
|
|
6540
6731
|
* @summary Transaction for optin to receive a specific asset in the future
|
|
6541
|
-
* @request POST:/
|
|
6732
|
+
* @request POST:/transactions/asset-optin
|
|
6542
6733
|
* @secure
|
|
6543
6734
|
*/
|
|
6544
|
-
assetOptInTransaction: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6735
|
+
assetOptInTransaction: (data, params = {}) => this.http.request(Object.assign({ path: `/transactions/asset-optin`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6545
6736
|
/**
|
|
6546
6737
|
* No description
|
|
6547
6738
|
*
|
|
6548
6739
|
* @tags Transactions, Optin
|
|
6549
6740
|
* @name AppOptInTransaction
|
|
6550
6741
|
* @summary Transaction for optin to interact with a specific app
|
|
6551
|
-
* @request POST:/
|
|
6742
|
+
* @request POST:/transactions/app-optin
|
|
6552
6743
|
* @secure
|
|
6553
6744
|
*/
|
|
6554
|
-
appOptInTransaction: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6745
|
+
appOptInTransaction: (data, params = {}) => this.http.request(Object.assign({ path: `/transactions/app-optin`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6555
6746
|
/**
|
|
6556
6747
|
* No description
|
|
6557
6748
|
*
|
|
6558
6749
|
* @tags Transactions
|
|
6559
6750
|
* @name GetEstimateFee
|
|
6560
6751
|
* @summary Request fee estimate for a particular transaction
|
|
6561
|
-
* @request GET:/
|
|
6752
|
+
* @request GET:/transactions/estimate-fee
|
|
6562
6753
|
* @secure
|
|
6563
6754
|
*/
|
|
6564
|
-
getEstimateFee: (query, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6755
|
+
getEstimateFee: (query, params = {}) => this.http.request(Object.assign({ path: `/transactions/estimate-fee`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6565
6756
|
/**
|
|
6566
6757
|
* @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
|
|
6567
6758
|
*
|
|
6568
6759
|
* @tags Transactions, Raw, Transactions
|
|
6569
6760
|
* @name SignAndBroadcastRawTx
|
|
6570
6761
|
* @summary Sign and broadcast raw transaction API
|
|
6571
|
-
* @request POST:/
|
|
6762
|
+
* @request POST:/transactions/sign-broadcast-rawtx
|
|
6572
6763
|
* @secure
|
|
6573
6764
|
*/
|
|
6574
|
-
signAndBroadcastRawTx: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6765
|
+
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)),
|
|
6575
6766
|
/**
|
|
6576
6767
|
* No description
|
|
6577
6768
|
*
|
|
6578
6769
|
* @tags Transactions, Query
|
|
6579
6770
|
* @name FetchTransactionByHashOrReference
|
|
6580
6771
|
* @summary Fetch transaction status data using a reference or transaction hash
|
|
6581
|
-
* @request GET:/
|
|
6772
|
+
* @request GET:/transactions/status
|
|
6582
6773
|
* @secure
|
|
6583
6774
|
*/
|
|
6584
|
-
fetchTransactionByHashOrReference: (query, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6775
|
+
fetchTransactionByHashOrReference: (query, params = {}) => this.http.request(Object.assign({ path: `/transactions/status`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6585
6776
|
/**
|
|
6586
6777
|
* No description
|
|
6587
6778
|
*
|
|
6588
6779
|
* @tags Transactions, Transactions, Multisig, Raw
|
|
6589
6780
|
* @name InitMultisigRawTransaction
|
|
6590
6781
|
* @summary Initiate a multisig raw transaction and sign the first signature on that same transaction
|
|
6591
|
-
* @request POST:/
|
|
6782
|
+
* @request POST:/transactions/init-sign-broadcast-multisig-rawtx
|
|
6592
6783
|
* @secure
|
|
6593
6784
|
*/
|
|
6594
|
-
initMultisigRawTransaction: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6785
|
+
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)),
|
|
6595
6786
|
/**
|
|
6596
6787
|
* No description
|
|
6597
6788
|
*
|
|
6598
6789
|
* @tags Transactions, Query
|
|
6599
6790
|
* @name GetDetailedRawTransactionDataByReference
|
|
6600
6791
|
* @summary Fetch transaction in raw data format from the system persistence
|
|
6601
|
-
* @request GET:/
|
|
6792
|
+
* @request GET:/transactions/raw-status
|
|
6602
6793
|
* @secure
|
|
6603
6794
|
*/
|
|
6604
|
-
getDetailedRawTransactionDataByReference: (query, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6795
|
+
getDetailedRawTransactionDataByReference: (query, params = {}) => this.http.request(Object.assign({ path: `/transactions/raw-status`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6605
6796
|
/**
|
|
6606
6797
|
* No description
|
|
6607
6798
|
*
|
|
6608
6799
|
* @tags Transactions, Query
|
|
6609
6800
|
* @name FetchTransactionParticipants
|
|
6610
6801
|
* @summary Fetch transaction's participants
|
|
6611
|
-
* @request GET:/
|
|
6802
|
+
* @request GET:/transactions/{reference}/participants
|
|
6612
6803
|
* @secure
|
|
6613
6804
|
*/
|
|
6614
6805
|
fetchTransactionParticipants: (_a, params) => {
|
|
6615
6806
|
var { reference } = _a; __rest(_a, ["reference"]);
|
|
6616
6807
|
if (params === void 0) { params = {}; }
|
|
6617
|
-
return this.http.request(Object.assign({ path: `/
|
|
6808
|
+
return this.http.request(Object.assign({ path: `/transactions/${reference}/participants`, method: "GET", secure: true, format: "json" }, params));
|
|
6618
6809
|
},
|
|
6619
6810
|
/**
|
|
6620
6811
|
* No description
|
|
@@ -6622,425 +6813,192 @@ class Api {
|
|
|
6622
6813
|
* @tags Transactions, Transactions, ERC1404
|
|
6623
6814
|
* @name DetectTransferRestriction
|
|
6624
6815
|
* @summary Request to detect whether there is a transfer restriction on a particular transaction
|
|
6625
|
-
* @request GET:/
|
|
6816
|
+
* @request GET:/transactions/detect-transfers-restrictions
|
|
6626
6817
|
* @secure
|
|
6627
6818
|
*/
|
|
6628
|
-
detectTransferRestriction: (query, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6819
|
+
detectTransferRestriction: (query, params = {}) => this.http.request(Object.assign({ path: `/transactions/detect-transfers-restrictions`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6629
6820
|
/**
|
|
6630
6821
|
* No description
|
|
6631
6822
|
*
|
|
6632
6823
|
* @tags Transactions, Transactions, ERC1404
|
|
6633
6824
|
* @name FetchMessageForTransferRestriction
|
|
6634
6825
|
* @summary Request restriction message by providing a restriction code
|
|
6635
|
-
* @request GET:/
|
|
6826
|
+
* @request GET:/transactions/transfer-restriction-message
|
|
6636
6827
|
* @secure
|
|
6637
6828
|
*/
|
|
6638
|
-
fetchMessageForTransferRestriction: (query, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6829
|
+
fetchMessageForTransferRestriction: (query, params = {}) => this.http.request(Object.assign({ path: `/transactions/transfer-restriction-message`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6639
6830
|
/**
|
|
6640
6831
|
* No description
|
|
6641
6832
|
*
|
|
6642
6833
|
* @tags Transactions, Optin
|
|
6643
6834
|
* @name CheckAssetOptinForAddress
|
|
6644
6835
|
* @summary Get the list of all assets that the current account has opted into. This is only relevant for the Algorand chain
|
|
6645
|
-
* @request GET:/
|
|
6836
|
+
* @request GET:/transactions/check-asset-optin
|
|
6646
6837
|
* @secure
|
|
6647
6838
|
*/
|
|
6648
|
-
checkAssetOptinForAddress: (query, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6839
|
+
checkAssetOptinForAddress: (query, params = {}) => this.http.request(Object.assign({ path: `/transactions/check-asset-optin`, method: "GET", query: query, secure: true }, params)),
|
|
6649
6840
|
/**
|
|
6650
6841
|
* No description
|
|
6651
6842
|
*
|
|
6652
6843
|
* @tags Transactions, Optin
|
|
6653
6844
|
* @name CheckAppOptinForAddress
|
|
6654
6845
|
* @summary Get the list of all apps that the current account has opted into. This is only relevant for the Algorand chain
|
|
6655
|
-
* @request GET:/
|
|
6846
|
+
* @request GET:/transactions/check-app-optin
|
|
6656
6847
|
* @secure
|
|
6657
6848
|
*/
|
|
6658
|
-
checkAppOptinForAddress: (query, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6849
|
+
checkAppOptinForAddress: (query, params = {}) => this.http.request(Object.assign({ path: `/transactions/check-app-optin`, method: "GET", query: query, secure: true }, params)),
|
|
6659
6850
|
/**
|
|
6660
6851
|
* No description
|
|
6661
6852
|
*
|
|
6662
6853
|
* @tags Transactions, Allowance, Transaction
|
|
6663
6854
|
* @name CreateAllowanceTransaction
|
|
6664
6855
|
* @summary Create an allowance for others to spend on your behalf
|
|
6665
|
-
* @request POST:/
|
|
6856
|
+
* @request POST:/transactions/create-allowance
|
|
6666
6857
|
* @secure
|
|
6667
6858
|
*/
|
|
6668
|
-
createAllowanceTransaction: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6859
|
+
createAllowanceTransaction: (data, params = {}) => this.http.request(Object.assign({ path: `/transactions/create-allowance`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6669
6860
|
};
|
|
6670
|
-
this.
|
|
6861
|
+
this.mpc = {
|
|
6671
6862
|
/**
|
|
6672
6863
|
* No description
|
|
6673
6864
|
*
|
|
6674
|
-
* @tags
|
|
6675
|
-
* @name
|
|
6676
|
-
* @summary
|
|
6677
|
-
* @request
|
|
6678
|
-
* @secure
|
|
6865
|
+
* @tags Mpc
|
|
6866
|
+
* @name InitKeyExchange
|
|
6867
|
+
* @summary Initialize key exchange process, the keys exchanged will be later used for encryption/decryption of the payloads exchanged
|
|
6868
|
+
* @request POST:/mpc/init-key-exchange
|
|
6679
6869
|
*/
|
|
6680
|
-
|
|
6870
|
+
initKeyExchange: (data, params = {}) => this.http.request(Object.assign({ path: `/mpc/init-key-exchange`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
6681
6871
|
/**
|
|
6682
6872
|
* No description
|
|
6683
6873
|
*
|
|
6684
|
-
* @tags
|
|
6685
|
-
* @name
|
|
6686
|
-
* @summary
|
|
6687
|
-
* @request
|
|
6688
|
-
* @secure
|
|
6874
|
+
* @tags Mpc
|
|
6875
|
+
* @name RequestSeedphraseSplit
|
|
6876
|
+
* @summary Request seed phrase split and return shares that can be used later for recovery
|
|
6877
|
+
* @request POST:/mpc/request-seed-split
|
|
6689
6878
|
*/
|
|
6690
|
-
|
|
6879
|
+
requestSeedphraseSplit: (data, params = {}) => this.http.request(Object.assign({ path: `/mpc/request-seed-split`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
6691
6880
|
/**
|
|
6692
6881
|
* No description
|
|
6693
6882
|
*
|
|
6694
|
-
* @tags
|
|
6695
|
-
* @name
|
|
6696
|
-
* @summary
|
|
6697
|
-
* @request POST:/
|
|
6698
|
-
* @secure
|
|
6883
|
+
* @tags Mpc
|
|
6884
|
+
* @name ReconstructSeedPhrase
|
|
6885
|
+
* @summary Pass encrypted shares and return reconstructed encrypted seed phrase
|
|
6886
|
+
* @request POST:/mpc/reconstruct-seed-phrase
|
|
6699
6887
|
*/
|
|
6700
|
-
|
|
6888
|
+
reconstructSeedPhrase: (data, params = {}) => this.http.request(Object.assign({ path: `/mpc/reconstruct-seed-phrase`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
6889
|
+
};
|
|
6890
|
+
this.adminTransactions = {
|
|
6701
6891
|
/**
|
|
6702
6892
|
* No description
|
|
6703
6893
|
*
|
|
6704
|
-
* @tags
|
|
6705
|
-
* @name
|
|
6706
|
-
* @summary
|
|
6707
|
-
* @request POST:/
|
|
6894
|
+
* @tags Admin-Transactions
|
|
6895
|
+
* @name CreateReleaseSchedule
|
|
6896
|
+
* @summary Request the creation of a release schedule
|
|
6897
|
+
* @request POST:/transactions/admin/release-schedule
|
|
6708
6898
|
* @secure
|
|
6709
6899
|
*/
|
|
6710
|
-
|
|
6900
|
+
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)),
|
|
6711
6901
|
/**
|
|
6712
6902
|
* No description
|
|
6713
6903
|
*
|
|
6714
|
-
* @tags
|
|
6715
|
-
* @name
|
|
6716
|
-
* @summary
|
|
6717
|
-
* @request GET:/
|
|
6904
|
+
* @tags Admin-Transactions
|
|
6905
|
+
* @name ViewReleaseSchedule
|
|
6906
|
+
* @summary View a release schedule
|
|
6907
|
+
* @request GET:/transactions/admin/release-schedule
|
|
6718
6908
|
* @secure
|
|
6719
6909
|
*/
|
|
6720
|
-
|
|
6910
|
+
viewReleaseSchedule: (query, params = {}) => this.http.request(Object.assign({ path: `/transactions/admin/release-schedule`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6721
6911
|
/**
|
|
6722
6912
|
* No description
|
|
6723
6913
|
*
|
|
6724
|
-
* @tags
|
|
6725
|
-
* @name
|
|
6726
|
-
* @summary Request
|
|
6727
|
-
* @request
|
|
6914
|
+
* @tags Admin-Transactions
|
|
6915
|
+
* @name Mint
|
|
6916
|
+
* @summary Request the minting of an asset to addresses either via mint release schedule or directly
|
|
6917
|
+
* @request POST:/transactions/admin/mint
|
|
6728
6918
|
* @secure
|
|
6729
6919
|
*/
|
|
6730
|
-
|
|
6920
|
+
mint: (data, params = {}) => this.http.request(Object.assign({ path: `/transactions/admin/mint`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6731
6921
|
/**
|
|
6732
6922
|
* No description
|
|
6733
6923
|
*
|
|
6734
|
-
* @tags
|
|
6735
|
-
* @name
|
|
6736
|
-
* @summary
|
|
6737
|
-
* @request
|
|
6924
|
+
* @tags Admin-Transactions
|
|
6925
|
+
* @name Burn
|
|
6926
|
+
* @summary Request the burning of an asset to address(es) directly
|
|
6927
|
+
* @request POST:/transactions/admin/burn
|
|
6738
6928
|
* @secure
|
|
6739
6929
|
*/
|
|
6740
|
-
|
|
6741
|
-
};
|
|
6742
|
-
this.mpc = {
|
|
6930
|
+
burn: (data, params = {}) => this.http.request(Object.assign({ path: `/transactions/admin/burn`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6743
6931
|
/**
|
|
6744
6932
|
* No description
|
|
6745
6933
|
*
|
|
6746
|
-
* @tags
|
|
6747
|
-
* @name
|
|
6748
|
-
* @summary
|
|
6749
|
-
* @request POST:/
|
|
6934
|
+
* @tags Admin-Transactions
|
|
6935
|
+
* @name ExecutePurchase
|
|
6936
|
+
* @summary Request purchase on the purchase contract
|
|
6937
|
+
* @request POST:/transactions/admin/execute-purchase
|
|
6750
6938
|
* @secure
|
|
6751
6939
|
*/
|
|
6752
|
-
|
|
6940
|
+
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)),
|
|
6753
6941
|
/**
|
|
6754
6942
|
* No description
|
|
6755
6943
|
*
|
|
6756
|
-
* @tags
|
|
6757
|
-
* @name
|
|
6758
|
-
* @summary Request
|
|
6759
|
-
* @request POST:/
|
|
6944
|
+
* @tags Admin-Transactions
|
|
6945
|
+
* @name ExecutePurchaseWithInterest
|
|
6946
|
+
* @summary Request purchase with interest on the purchase contract
|
|
6947
|
+
* @request POST:/transactions/admin/execute-purchase-with-interest
|
|
6760
6948
|
* @secure
|
|
6761
6949
|
*/
|
|
6762
|
-
|
|
6763
|
-
/**
|
|
6764
|
-
* No description
|
|
6765
|
-
*
|
|
6766
|
-
* @tags Mpc
|
|
6767
|
-
* @name ReconstructSeedPhrase
|
|
6768
|
-
* @summary Pass encrypted shares and return reconstructed encrypted seed phrase
|
|
6769
|
-
* @request POST:/api/v1/mpc/reconstruct-seed-phrase
|
|
6770
|
-
* @secure
|
|
6771
|
-
*/
|
|
6772
|
-
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)),
|
|
6773
|
-
};
|
|
6774
|
-
this.users = {
|
|
6775
|
-
/**
|
|
6776
|
-
* No description
|
|
6777
|
-
*
|
|
6778
|
-
* @tags Users
|
|
6779
|
-
* @name GetAllUsers
|
|
6780
|
-
* @summary Get all users by the admin
|
|
6781
|
-
* @request GET:/api/v1/users
|
|
6782
|
-
* @secure
|
|
6783
|
-
*/
|
|
6784
|
-
getAllUsers: (query, params = {}) => this.http.request(Object.assign({ path: `/api/v1/users`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6785
|
-
/**
|
|
6786
|
-
* No description
|
|
6787
|
-
*
|
|
6788
|
-
* @tags Users
|
|
6789
|
-
* @name UpdateProfile
|
|
6790
|
-
* @summary Update user profile info
|
|
6791
|
-
* @request PUT:/api/v1/users/profile
|
|
6792
|
-
* @secure
|
|
6793
|
-
*/
|
|
6794
|
-
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)),
|
|
6795
|
-
/**
|
|
6796
|
-
* No description
|
|
6797
|
-
*
|
|
6798
|
-
* @tags Users
|
|
6799
|
-
* @name GetCurrentUser
|
|
6800
|
-
* @summary Returns current user data
|
|
6801
|
-
* @request GET:/api/v1/users/profile
|
|
6802
|
-
* @secure
|
|
6803
|
-
*/
|
|
6804
|
-
getCurrentUser: (params = {}) => this.http.request(Object.assign({ path: `/api/v1/users/profile`, method: "GET", secure: true, format: "json" }, params)),
|
|
6805
|
-
/**
|
|
6806
|
-
* No description
|
|
6807
|
-
*
|
|
6808
|
-
* @tags Users
|
|
6809
|
-
* @name GetCurrentUserSalt
|
|
6810
|
-
* @summary Get current user's client salt
|
|
6811
|
-
* @request GET:/api/v1/users/salt
|
|
6812
|
-
* @secure
|
|
6813
|
-
*/
|
|
6814
|
-
getCurrentUserSalt: (params = {}) => this.http.request(Object.assign({ path: `/api/v1/users/salt`, method: "GET", secure: true, format: "json" }, params)),
|
|
6815
|
-
/**
|
|
6816
|
-
* No description
|
|
6817
|
-
*
|
|
6818
|
-
* @tags Users
|
|
6819
|
-
* @name GetAllWalletsFromUserId
|
|
6820
|
-
* @summary Returns user wallets by specifying user id
|
|
6821
|
-
* @request GET:/api/v1/users/{userId}/wallets
|
|
6822
|
-
* @secure
|
|
6823
|
-
*/
|
|
6824
|
-
getAllWalletsFromUserId: (_a, params) => {
|
|
6825
|
-
var { userId } = _a; __rest(_a, ["userId"]);
|
|
6826
|
-
if (params === void 0) { params = {}; }
|
|
6827
|
-
return this.http.request(Object.assign({ path: `/api/v1/users/${userId}/wallets`, method: "GET", secure: true, format: "json" }, params));
|
|
6828
|
-
},
|
|
6829
|
-
/**
|
|
6830
|
-
* No description
|
|
6831
|
-
*
|
|
6832
|
-
* @tags Users
|
|
6833
|
-
* @name GetCurrentUserMerchantAssets
|
|
6834
|
-
* @summary Returns user's merchant assets
|
|
6835
|
-
* @request GET:/api/v1/users/merchants/assets
|
|
6836
|
-
* @secure
|
|
6837
|
-
*/
|
|
6838
|
-
getCurrentUserMerchantAssets: (query, params = {}) => this.http.request(Object.assign({ path: `/api/v1/users/merchants/assets`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6839
|
-
/**
|
|
6840
|
-
* No description
|
|
6841
|
-
*
|
|
6842
|
-
* @tags Users
|
|
6843
|
-
* @name GetCurrentUserMerchantAssets2
|
|
6844
|
-
* @summary Returns user's merchant assets
|
|
6845
|
-
* @request GET:/api/v1/users/merchant/assets
|
|
6846
|
-
* @originalName getCurrentUserMerchantAssets
|
|
6847
|
-
* @duplicate
|
|
6848
|
-
* @secure
|
|
6849
|
-
*/
|
|
6850
|
-
getCurrentUserMerchantAssets2: (query, params = {}) => this.http.request(Object.assign({ path: `/api/v1/users/merchant/assets`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6851
|
-
/**
|
|
6852
|
-
* No description
|
|
6853
|
-
*
|
|
6854
|
-
* @tags Users
|
|
6855
|
-
* @name GetAssetsByUserId
|
|
6856
|
-
* @summary Returns user assets by specifying user id
|
|
6857
|
-
* @request GET:/api/v1/users/{userId}/assets
|
|
6858
|
-
* @secure
|
|
6859
|
-
*/
|
|
6860
|
-
getAssetsByUserId: (_a, params) => {
|
|
6861
|
-
var { userId } = _a, query = __rest(_a, ["userId"]);
|
|
6862
|
-
if (params === void 0) { params = {}; }
|
|
6863
|
-
return this.http.request(Object.assign({ path: `/api/v1/users/${userId}/assets`, method: "GET", query: query, secure: true, format: "json" }, params));
|
|
6864
|
-
},
|
|
6865
|
-
/**
|
|
6866
|
-
* No description
|
|
6867
|
-
*
|
|
6868
|
-
* @tags Users
|
|
6869
|
-
* @name AddAssetToUser
|
|
6870
|
-
* @summary Add a new asset to the user's wallet based on the asset configuration
|
|
6871
|
-
* @request POST:/api/v1/users/assets/add
|
|
6872
|
-
* @secure
|
|
6873
|
-
*/
|
|
6874
|
-
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)),
|
|
6875
|
-
/**
|
|
6876
|
-
* No description
|
|
6877
|
-
*
|
|
6878
|
-
* @tags Users
|
|
6879
|
-
* @name RemoveAssetFromUser
|
|
6880
|
-
* @summary Remove an asset from the user's wallet based on the asset configuration
|
|
6881
|
-
* @request DELETE:/api/v1/users/{userId}/wallets/{walletId}/assets/{assetConfigId}
|
|
6882
|
-
* @secure
|
|
6883
|
-
*/
|
|
6884
|
-
removeAssetFromUser: (_a, params) => {
|
|
6885
|
-
var { assetConfigId, walletId, userId } = _a; __rest(_a, ["assetConfigId", "walletId", "userId"]);
|
|
6886
|
-
if (params === void 0) { params = {}; }
|
|
6887
|
-
return this.http.request(Object.assign({ path: `/api/v1/users/${userId}/wallets/${walletId}/assets/${assetConfigId}`, method: "DELETE", secure: true, format: "json" }, params));
|
|
6888
|
-
},
|
|
6889
|
-
/**
|
|
6890
|
-
* No description
|
|
6891
|
-
*
|
|
6892
|
-
* @tags Users
|
|
6893
|
-
* @name GetUserByUserId
|
|
6894
|
-
* @summary Returns user public data
|
|
6895
|
-
* @request GET:/api/v1/users/{userId}
|
|
6896
|
-
* @secure
|
|
6897
|
-
*/
|
|
6898
|
-
getUserByUserId: (_a, params) => {
|
|
6899
|
-
var { userId } = _a; __rest(_a, ["userId"]);
|
|
6900
|
-
if (params === void 0) { params = {}; }
|
|
6901
|
-
return this.http.request(Object.assign({ path: `/api/v1/users/${userId}`, method: "GET", secure: true, format: "json" }, params));
|
|
6902
|
-
},
|
|
6903
|
-
/**
|
|
6904
|
-
* No description
|
|
6905
|
-
*
|
|
6906
|
-
* @tags Users
|
|
6907
|
-
* @name GetUserByExternalUserId
|
|
6908
|
-
* @request GET:/api/v1/users/{externalUserId}/externalUserId
|
|
6909
|
-
* @secure
|
|
6910
|
-
*/
|
|
6911
|
-
getUserByExternalUserId: (_a, params) => {
|
|
6912
|
-
var { externalUserId } = _a; __rest(_a, ["externalUserId"]);
|
|
6913
|
-
if (params === void 0) { params = {}; }
|
|
6914
|
-
return this.http.request(Object.assign({ path: `/api/v1/users/${externalUserId}/externalUserId`, method: "GET", secure: true, format: "json" }, params));
|
|
6915
|
-
},
|
|
6916
|
-
/**
|
|
6917
|
-
* No description
|
|
6918
|
-
*
|
|
6919
|
-
* @tags Users
|
|
6920
|
-
* @name GetParticipantsByUserId
|
|
6921
|
-
* @summary Returns multisig participants by user id
|
|
6922
|
-
* @request GET:/api/v1/users/{userId}/multisig-transactions
|
|
6923
|
-
* @secure
|
|
6924
|
-
*/
|
|
6925
|
-
getParticipantsByUserId: (_a, params) => {
|
|
6926
|
-
var { userId } = _a, query = __rest(_a, ["userId"]);
|
|
6927
|
-
if (params === void 0) { params = {}; }
|
|
6928
|
-
return this.http.request(Object.assign({ path: `/api/v1/users/${userId}/multisig-transactions`, method: "GET", query: query, secure: true, format: "json" }, params));
|
|
6929
|
-
},
|
|
6930
|
-
};
|
|
6931
|
-
this.adminTransactions = {
|
|
6932
|
-
/**
|
|
6933
|
-
* No description
|
|
6934
|
-
*
|
|
6935
|
-
* @tags Admin-Transactions
|
|
6936
|
-
* @name CreateReleaseSchedule
|
|
6937
|
-
* @summary Request the creation of a release schedule
|
|
6938
|
-
* @request POST:/api/v1/transactions/admin/release-schedule
|
|
6939
|
-
* @secure
|
|
6940
|
-
*/
|
|
6941
|
-
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)),
|
|
6942
|
-
/**
|
|
6943
|
-
* No description
|
|
6944
|
-
*
|
|
6945
|
-
* @tags Admin-Transactions
|
|
6946
|
-
* @name ViewReleaseSchedule
|
|
6947
|
-
* @summary View a release schedule
|
|
6948
|
-
* @request GET:/api/v1/transactions/admin/release-schedule
|
|
6949
|
-
* @secure
|
|
6950
|
-
*/
|
|
6951
|
-
viewReleaseSchedule: (query, params = {}) => this.http.request(Object.assign({ path: `/api/v1/transactions/admin/release-schedule`, method: "GET", query: query, secure: true, format: "json" }, params)),
|
|
6952
|
-
/**
|
|
6953
|
-
* No description
|
|
6954
|
-
*
|
|
6955
|
-
* @tags Admin-Transactions
|
|
6956
|
-
* @name Mint
|
|
6957
|
-
* @summary Request the minting of an asset to addresses either via mint release schedule or directly
|
|
6958
|
-
* @request POST:/api/v1/transactions/admin/mint
|
|
6959
|
-
* @secure
|
|
6960
|
-
*/
|
|
6961
|
-
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)),
|
|
6962
|
-
/**
|
|
6963
|
-
* No description
|
|
6964
|
-
*
|
|
6965
|
-
* @tags Admin-Transactions
|
|
6966
|
-
* @name Burn
|
|
6967
|
-
* @summary Request the burning of an asset to address(es) directly
|
|
6968
|
-
* @request POST:/api/v1/transactions/admin/burn
|
|
6969
|
-
* @secure
|
|
6970
|
-
*/
|
|
6971
|
-
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)),
|
|
6972
|
-
/**
|
|
6973
|
-
* No description
|
|
6974
|
-
*
|
|
6975
|
-
* @tags Admin-Transactions
|
|
6976
|
-
* @name ExecutePurchase
|
|
6977
|
-
* @summary Request purchase on the purchase contract
|
|
6978
|
-
* @request POST:/api/v1/transactions/admin/execute-purchase
|
|
6979
|
-
* @secure
|
|
6980
|
-
*/
|
|
6981
|
-
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)),
|
|
6982
|
-
/**
|
|
6983
|
-
* No description
|
|
6984
|
-
*
|
|
6985
|
-
* @tags Admin-Transactions
|
|
6986
|
-
* @name ExecutePurchaseWithInterest
|
|
6987
|
-
* @summary Request purchase with interest on the purchase contract
|
|
6988
|
-
* @request POST:/api/v1/transactions/admin/execute-purchase-with-interest
|
|
6989
|
-
* @secure
|
|
6990
|
-
*/
|
|
6991
|
-
executePurchaseWithInterest: (data, params = {}) => this.http.request(Object.assign({ path: `/api/v1/transactions/admin/execute-purchase-with-interest`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
6950
|
+
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)),
|
|
6992
6951
|
/**
|
|
6993
6952
|
* No description
|
|
6994
6953
|
*
|
|
6995
6954
|
* @tags Admin-Transactions
|
|
6996
6955
|
* @name SetIdentity
|
|
6997
6956
|
* @summary Set identity via the identity registry contract
|
|
6998
|
-
* @request POST:/
|
|
6957
|
+
* @request POST:/transactions/admin/set-identity
|
|
6999
6958
|
* @secure
|
|
7000
6959
|
*/
|
|
7001
|
-
setIdentity: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6960
|
+
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)),
|
|
7002
6961
|
/**
|
|
7003
6962
|
* No description
|
|
7004
6963
|
*
|
|
7005
6964
|
* @tags Admin-Transactions
|
|
7006
6965
|
* @name ForceClaim
|
|
7007
6966
|
* @summary Force claim interest via the interest payment contract
|
|
7008
|
-
* @request POST:/
|
|
6967
|
+
* @request POST:/transactions/admin/force-claim
|
|
7009
6968
|
* @secure
|
|
7010
6969
|
*/
|
|
7011
|
-
forceClaim: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6970
|
+
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)),
|
|
7012
6971
|
/**
|
|
7013
6972
|
* No description
|
|
7014
6973
|
*
|
|
7015
6974
|
* @tags Admin-Transactions
|
|
7016
6975
|
* @name ForceClaimPrincipal
|
|
7017
6976
|
* @summary Force claim principal via the interest payment contract
|
|
7018
|
-
* @request POST:/
|
|
6977
|
+
* @request POST:/transactions/admin/force-claim-principal
|
|
7019
6978
|
* @secure
|
|
7020
6979
|
*/
|
|
7021
|
-
forceClaimPrincipal: (data, params = {}) => this.http.request(Object.assign({ path: `/
|
|
6980
|
+
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)),
|
|
7022
6981
|
/**
|
|
7023
6982
|
* No description
|
|
7024
6983
|
*
|
|
7025
6984
|
* @tags Admin-Transactions
|
|
7026
6985
|
* @name GetCallbackPublicKey
|
|
7027
|
-
* @request GET:/
|
|
7028
|
-
* @secure
|
|
6986
|
+
* @request GET:/transactions/admin/callback_pk
|
|
7029
6987
|
*/
|
|
7030
|
-
getCallbackPublicKey: (params = {}) => this.http.request(Object.assign({ path: `/
|
|
6988
|
+
getCallbackPublicKey: (params = {}) => this.http.request(Object.assign({ path: `/transactions/admin/callback_pk`, method: "GET" }, params)),
|
|
7031
6989
|
/**
|
|
7032
6990
|
* No description
|
|
7033
6991
|
*
|
|
7034
6992
|
* @tags Admin-Transactions
|
|
7035
6993
|
* @name ViewAdminTransaction
|
|
7036
6994
|
* @summary View an admin transaction
|
|
7037
|
-
* @request GET:/
|
|
6995
|
+
* @request GET:/transactions/admin/{referenceId}
|
|
7038
6996
|
* @secure
|
|
7039
6997
|
*/
|
|
7040
6998
|
viewAdminTransaction: (_a, params) => {
|
|
7041
6999
|
var { referenceId } = _a; __rest(_a, ["referenceId"]);
|
|
7042
7000
|
if (params === void 0) { params = {}; }
|
|
7043
|
-
return this.http.request(Object.assign({ path: `/
|
|
7001
|
+
return this.http.request(Object.assign({ path: `/transactions/admin/${referenceId}`, method: "GET", secure: true, format: "json" }, params));
|
|
7044
7002
|
},
|
|
7045
7003
|
/**
|
|
7046
7004
|
* No description
|
|
@@ -7048,30 +7006,9 @@ class Api {
|
|
|
7048
7006
|
* @tags Admin-Transactions
|
|
7049
7007
|
* @name UpsideCallback
|
|
7050
7008
|
* @summary Upside callback for release schedule
|
|
7051
|
-
* @request POST:/
|
|
7052
|
-
* @secure
|
|
7053
|
-
*/
|
|
7054
|
-
upsideCallback: (data, params = {}) => this.http.request(Object.assign({ path: `/api/v1/transactions/admin/callback`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
7055
|
-
};
|
|
7056
|
-
this.v1 = {
|
|
7057
|
-
/**
|
|
7058
|
-
* No description
|
|
7059
|
-
*
|
|
7060
|
-
* @name DashboardControllerGetDashboardData
|
|
7061
|
-
* @summary Create new merchant. This endpoint is only available for super admin and republic admin
|
|
7062
|
-
* @request GET:/api/v1/dashboard
|
|
7063
|
-
* @secure
|
|
7064
|
-
*/
|
|
7065
|
-
dashboardControllerGetDashboardData: (params = {}) => this.http.request(Object.assign({ path: `/api/v1/dashboard`, method: "GET", secure: true }, params)),
|
|
7066
|
-
/**
|
|
7067
|
-
* No description
|
|
7068
|
-
*
|
|
7069
|
-
* @name GetActivitiees
|
|
7070
|
-
* @summary Get all activities. This endpoint is only available for super admin and republic admin
|
|
7071
|
-
* @request GET:/api/v1/users-activities
|
|
7072
|
-
* @secure
|
|
7009
|
+
* @request POST:/transactions/admin/callback
|
|
7073
7010
|
*/
|
|
7074
|
-
|
|
7011
|
+
upsideCallback: (data, params = {}) => this.http.request(Object.assign({ path: `/transactions/admin/callback`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
7075
7012
|
};
|
|
7076
7013
|
this.http = http;
|
|
7077
7014
|
}
|
|
@@ -7095,11 +7032,16 @@ function objectToQueryParams(obj) {
|
|
|
7095
7032
|
|
|
7096
7033
|
class Base {
|
|
7097
7034
|
constructor(config) {
|
|
7035
|
+
var _a, _b;
|
|
7098
7036
|
const sanitizedConfig = sanitizeConfig(config);
|
|
7099
7037
|
this.apiKey = sanitizedConfig.apiKey;
|
|
7100
7038
|
this.baseUrl = sanitizedConfig.baseUrl;
|
|
7101
7039
|
this.userId = sanitizedConfig.userId;
|
|
7102
7040
|
this.options = sanitizedConfig.options;
|
|
7041
|
+
if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.platform) {
|
|
7042
|
+
this.options.platform;
|
|
7043
|
+
this.options.platform === 'ios' || this.options.platform === 'android';
|
|
7044
|
+
}
|
|
7103
7045
|
this.cipher = new Cipher();
|
|
7104
7046
|
this.lockManager = new LockManagerService();
|
|
7105
7047
|
this._initializeClientAuthToken(sanitizedConfig.clientAuthToken);
|
|
@@ -7144,10 +7086,7 @@ class Base {
|
|
|
7144
7086
|
}
|
|
7145
7087
|
};
|
|
7146
7088
|
this.api = new Api(httpClient);
|
|
7147
|
-
this.api.http.setSecurityData({
|
|
7148
|
-
'x-api-key': config.apiKey,
|
|
7149
|
-
'x-client-jwt': config.clientAuthToken,
|
|
7150
|
-
});
|
|
7089
|
+
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));
|
|
7151
7090
|
}
|
|
7152
7091
|
set setClientAuthToken(token) {
|
|
7153
7092
|
this._initializeClientAuthToken(token);
|
|
@@ -7594,6 +7533,24 @@ const TransactionsRoutes = {
|
|
|
7594
7533
|
},
|
|
7595
7534
|
};
|
|
7596
7535
|
|
|
7536
|
+
const SwapRoutes = {
|
|
7537
|
+
getQuote: {
|
|
7538
|
+
fullPath: ({ walletId }) => `/api/v1/wallets/${walletId}/swap/quote`,
|
|
7539
|
+
method: exports.RequestMethod.Post,
|
|
7540
|
+
requiresAccessToken: true,
|
|
7541
|
+
},
|
|
7542
|
+
executeSwap: {
|
|
7543
|
+
fullPath: ({ walletId }) => `/api/v1/wallets/${walletId}/swap`,
|
|
7544
|
+
method: exports.RequestMethod.Post,
|
|
7545
|
+
requiresAccessToken: true,
|
|
7546
|
+
},
|
|
7547
|
+
getSwaps: {
|
|
7548
|
+
fullPath: ({ walletId }) => `/api/v1/wallets/${walletId}/swaps`,
|
|
7549
|
+
method: exports.RequestMethod.Get,
|
|
7550
|
+
requiresAccessToken: true,
|
|
7551
|
+
},
|
|
7552
|
+
};
|
|
7553
|
+
|
|
7597
7554
|
/* eslint-disable no-useless-catch */
|
|
7598
7555
|
/**
|
|
7599
7556
|
* Web Authenticator Implementation
|
|
@@ -7680,6 +7637,50 @@ class Authenticator {
|
|
|
7680
7637
|
}
|
|
7681
7638
|
}
|
|
7682
7639
|
|
|
7640
|
+
/**
|
|
7641
|
+
* Shared base64 helpers. Platform-specific files (base64.ts, base64.native.ts)
|
|
7642
|
+
* import from here and add or re-export as needed.
|
|
7643
|
+
*/
|
|
7644
|
+
function normalizeAndPadBase64(s) {
|
|
7645
|
+
const normalized = s.replace(/-/g, '+').replace(/_/g, '/');
|
|
7646
|
+
return normalized.padEnd(normalized.length + ((4 - (normalized.length % 4)) % 4), '=');
|
|
7647
|
+
}
|
|
7648
|
+
function decodeBase64String(s) {
|
|
7649
|
+
return jsBase64.toUint8Array(normalizeAndPadBase64(s));
|
|
7650
|
+
}
|
|
7651
|
+
function decodeBase64URL(base64url) {
|
|
7652
|
+
const padded = normalizeAndPadBase64(base64url);
|
|
7653
|
+
const binary = jsBase64.atob(padded);
|
|
7654
|
+
const bytes = new Uint8Array(binary.length);
|
|
7655
|
+
for (let i = 0; i < binary.length; i++) {
|
|
7656
|
+
bytes[i] = binary.charCodeAt(i);
|
|
7657
|
+
}
|
|
7658
|
+
return bytes;
|
|
7659
|
+
}
|
|
7660
|
+
|
|
7661
|
+
/**
|
|
7662
|
+
* Web: round-trip with uint8ArrayToBase64 (which does btoa(fromUint8Array(bytes, true))).
|
|
7663
|
+
* Single decode first; if the result looks like a base64 string, decode again to get original bytes.
|
|
7664
|
+
*/
|
|
7665
|
+
function base64ToUint8Array(base64) {
|
|
7666
|
+
try {
|
|
7667
|
+
const first = jsBase64.toUint8Array(base64);
|
|
7668
|
+
const asStr = String.fromCharCode.apply(null, first);
|
|
7669
|
+
if (/^[A-Za-z0-9+/\-_=]*$/.test(asStr) && asStr.length >= 4) {
|
|
7670
|
+
try {
|
|
7671
|
+
return decodeBase64String(asStr);
|
|
7672
|
+
}
|
|
7673
|
+
catch (_a) {
|
|
7674
|
+
// fall through
|
|
7675
|
+
}
|
|
7676
|
+
}
|
|
7677
|
+
return first;
|
|
7678
|
+
}
|
|
7679
|
+
catch (_b) {
|
|
7680
|
+
return decodeBase64String(base64);
|
|
7681
|
+
}
|
|
7682
|
+
}
|
|
7683
|
+
|
|
7683
7684
|
class PasskeyService {
|
|
7684
7685
|
constructor(userId, storageService, request) {
|
|
7685
7686
|
this.cipher = new Cipher();
|
|
@@ -7691,7 +7692,7 @@ class PasskeyService {
|
|
|
7691
7692
|
preparePasskeyRequestOptions(options) {
|
|
7692
7693
|
var _a, _b, _c, _d, _e, _f;
|
|
7693
7694
|
const prfExtensionEvaluation = ((_b = (_a = options.extensions) === null || _a === void 0 ? void 0 : _a.prf.eval) === null || _b === void 0 ? void 0 : _b.base64)
|
|
7694
|
-
?
|
|
7695
|
+
? decodeBase64URL(options.extensions.prf.eval.base64)
|
|
7695
7696
|
: ((_d = (_c = options.extensions) === null || _c === void 0 ? void 0 : _c.prf.eval) === null || _d === void 0 ? void 0 : _d.first) instanceof ArrayBuffer
|
|
7696
7697
|
? new Uint8Array(options.extensions.prf.eval.first)
|
|
7697
7698
|
: typeof ((_f = (_e = options.extensions) === null || _e === void 0 ? void 0 : _e.prf.eval) === null || _f === void 0 ? void 0 : _f.first) === 'object'
|
|
@@ -7711,7 +7712,7 @@ class PasskeyService {
|
|
|
7711
7712
|
preparePasskeyCreationOptions(options) {
|
|
7712
7713
|
var _a, _b, _c, _d, _e, _f;
|
|
7713
7714
|
const prfExtensionEvaluation = ((_b = (_a = options.extensions) === null || _a === void 0 ? void 0 : _a.prf.eval) === null || _b === void 0 ? void 0 : _b.base64)
|
|
7714
|
-
?
|
|
7715
|
+
? decodeBase64URL(options.extensions.prf.eval.base64)
|
|
7715
7716
|
: ((_d = (_c = options.extensions) === null || _c === void 0 ? void 0 : _c.prf.eval) === null || _d === void 0 ? void 0 : _d.first) instanceof ArrayBuffer
|
|
7716
7717
|
? new Uint8Array(options.extensions.prf.eval.first)
|
|
7717
7718
|
: typeof ((_f = (_e = options.extensions) === null || _e === void 0 ? void 0 : _e.prf.eval) === null || _f === void 0 ? void 0 : _f.first) === 'object'
|
|
@@ -8112,30 +8113,72 @@ class PasskeyService {
|
|
|
8112
8113
|
errorCode: exports.ErrorResponseCodes.sdk_passkey_prf_not_available,
|
|
8113
8114
|
});
|
|
8114
8115
|
}
|
|
8115
|
-
const
|
|
8116
|
-
|
|
8117
|
-
|
|
8118
|
-
prfValue
|
|
8119
|
-
authType: exports.AuthType.Passkey,
|
|
8120
|
-
});
|
|
8121
|
-
logger.log('SDK::PasskeyService::handleCredentialsCreationFromPrfExtension::credentials key pair was created', !!credentialsKeyPair);
|
|
8122
|
-
return Object.assign(Object.assign({}, credentialsKeyPair), { prfValue });
|
|
8123
|
-
}
|
|
8124
|
-
catch (error) {
|
|
8125
|
-
if (error instanceof WallabyError) {
|
|
8126
|
-
throw error;
|
|
8116
|
+
const prfResult = (_e = extensions.prf.results) === null || _e === void 0 ? void 0 : _e.first;
|
|
8117
|
+
let prfValue;
|
|
8118
|
+
if (typeof prfResult === 'string') {
|
|
8119
|
+
prfValue = base64ToUint8Array(prfResult);
|
|
8127
8120
|
}
|
|
8128
|
-
else if (
|
|
8129
|
-
|
|
8130
|
-
message: error.message,
|
|
8131
|
-
statusCode: 400,
|
|
8132
|
-
errorCode: 'sdk_passkey_prf_handling_failed',
|
|
8133
|
-
data: error,
|
|
8134
|
-
cause: error.cause,
|
|
8135
|
-
});
|
|
8121
|
+
else if (prfResult instanceof Uint8Array) {
|
|
8122
|
+
prfValue = prfResult;
|
|
8136
8123
|
}
|
|
8137
|
-
|
|
8138
|
-
|
|
8124
|
+
else if (prfResult instanceof ArrayBuffer) {
|
|
8125
|
+
prfValue = new Uint8Array(prfResult);
|
|
8126
|
+
}
|
|
8127
|
+
else if (ArrayBuffer.isView(prfResult)) {
|
|
8128
|
+
prfValue = new Uint8Array(prfResult.buffer);
|
|
8129
|
+
}
|
|
8130
|
+
else if (Array.isArray(prfResult)) {
|
|
8131
|
+
prfValue = new Uint8Array(prfResult);
|
|
8132
|
+
}
|
|
8133
|
+
else if (prfResult && typeof prfResult === 'object') {
|
|
8134
|
+
const data = prfResult.data;
|
|
8135
|
+
if (Array.isArray(data)) {
|
|
8136
|
+
prfValue = new Uint8Array(data);
|
|
8137
|
+
}
|
|
8138
|
+
else {
|
|
8139
|
+
const values = Object.values(prfResult);
|
|
8140
|
+
if (values.length && values.every((value) => typeof value === 'number')) {
|
|
8141
|
+
prfValue = new Uint8Array(values);
|
|
8142
|
+
}
|
|
8143
|
+
else {
|
|
8144
|
+
throw new WallabyError({
|
|
8145
|
+
message: 'Unsupported PRF result type.',
|
|
8146
|
+
statusCode: 400,
|
|
8147
|
+
errorCode: exports.ErrorResponseCodes.sdk_passkey_prf_not_available,
|
|
8148
|
+
});
|
|
8149
|
+
}
|
|
8150
|
+
}
|
|
8151
|
+
}
|
|
8152
|
+
else {
|
|
8153
|
+
throw new WallabyError({
|
|
8154
|
+
message: 'Unsupported PRF result type.',
|
|
8155
|
+
statusCode: 400,
|
|
8156
|
+
errorCode: exports.ErrorResponseCodes.sdk_passkey_prf_not_available,
|
|
8157
|
+
});
|
|
8158
|
+
}
|
|
8159
|
+
logger.debug('SDK::PasskeyService::handleCredentialsCreationFromPrfExtension::prfValue', prfValue);
|
|
8160
|
+
const credentialsKeyPair = await this.cipher.getCredentialsKeyPair({
|
|
8161
|
+
prfValue,
|
|
8162
|
+
authType: exports.AuthType.Passkey,
|
|
8163
|
+
});
|
|
8164
|
+
logger.log('SDK::PasskeyService::handleCredentialsCreationFromPrfExtension::credentials key pair was created', !!credentialsKeyPair);
|
|
8165
|
+
return Object.assign(Object.assign({}, credentialsKeyPair), { prfValue });
|
|
8166
|
+
}
|
|
8167
|
+
catch (error) {
|
|
8168
|
+
if (error instanceof WallabyError) {
|
|
8169
|
+
throw error;
|
|
8170
|
+
}
|
|
8171
|
+
else if (error instanceof Error) {
|
|
8172
|
+
throw new WallabyError({
|
|
8173
|
+
message: error.message,
|
|
8174
|
+
statusCode: 400,
|
|
8175
|
+
errorCode: 'sdk_passkey_prf_handling_failed',
|
|
8176
|
+
data: error,
|
|
8177
|
+
cause: error.cause,
|
|
8178
|
+
});
|
|
8179
|
+
}
|
|
8180
|
+
throw this.authenticator.handlePasskeyError(error);
|
|
8181
|
+
}
|
|
8139
8182
|
}
|
|
8140
8183
|
}
|
|
8141
8184
|
|
|
@@ -8456,7 +8499,6 @@ class AuthService extends Base {
|
|
|
8456
8499
|
let deviceKeyPair;
|
|
8457
8500
|
// This logic needs to change and depend on data from server.
|
|
8458
8501
|
if (!passkeyCredential) {
|
|
8459
|
-
console.debug('SDK::AuthService::handleSignInWithPasskey:: creating new key pair');
|
|
8460
8502
|
deviceKeyPair = createIdentity();
|
|
8461
8503
|
devicePublicKey = deviceKeyPair.publicKey;
|
|
8462
8504
|
await this.localStorageService.save(exports.LocalStorageItems.ClientAuthPublicKey, devicePublicKey);
|
|
@@ -10349,6 +10391,12 @@ class WalletService extends Base {
|
|
|
10349
10391
|
const v2EncryptedSeed = await this.localStorageService.fetch(exports.LocalStorageItems.EncryptedStandardSeedPhrase, {
|
|
10350
10392
|
walletId: input.walletId,
|
|
10351
10393
|
});
|
|
10394
|
+
const v2EncryptedPrimaryShare = await this.localStorageService.fetch(exports.LocalStorageItems.PrimaryDeviceKeyShare, {
|
|
10395
|
+
walletId: input.walletId,
|
|
10396
|
+
});
|
|
10397
|
+
const v2EncryptedBackupShare = await this.localStorageService.fetch(exports.LocalStorageItems.BackupDeviceKeyShare, {
|
|
10398
|
+
walletId: input.walletId,
|
|
10399
|
+
});
|
|
10352
10400
|
const clientSalt = await this.authService.getUserSalt();
|
|
10353
10401
|
const passwordCredentialsKeyPair = await this.cipher.getCredentialsKeyPair({
|
|
10354
10402
|
password: input.password,
|
|
@@ -10394,48 +10442,168 @@ class WalletService extends Base {
|
|
|
10394
10442
|
},
|
|
10395
10443
|
getSignature: this.authService.getSignature.bind(this),
|
|
10396
10444
|
});
|
|
10445
|
+
const prfValue = authentication.prfValue;
|
|
10446
|
+
if (!prfValue || !(prfValue instanceof Uint8Array) || prfValue.length === 0) {
|
|
10447
|
+
logger.error('SDK::WalletService::convertToPasskey::prfValue is required and must be a non-empty Uint8Array');
|
|
10448
|
+
throw new WallabyError({
|
|
10449
|
+
message: 'PRF value from passkey is required to derive credentials and could not be obtained',
|
|
10450
|
+
statusCode: 500,
|
|
10451
|
+
errorCode: exports.ErrorResponseCodes.sdk_passkey_prf_not_available,
|
|
10452
|
+
});
|
|
10453
|
+
}
|
|
10397
10454
|
logger.log('SDK::WalletService::convertToPasskey::Received authentication response', !!authentication);
|
|
10398
10455
|
let decryptedSeedPhrase;
|
|
10399
|
-
|
|
10400
|
-
|
|
10401
|
-
|
|
10402
|
-
|
|
10403
|
-
|
|
10404
|
-
|
|
10405
|
-
|
|
10406
|
-
|
|
10407
|
-
|
|
10408
|
-
|
|
10456
|
+
let decryptedPrimaryShare;
|
|
10457
|
+
let decryptedBackupShare;
|
|
10458
|
+
if (v2EncryptedSeed && v2EncryptedPriv) {
|
|
10459
|
+
try {
|
|
10460
|
+
decryptedSeedPhrase = await this.cipher.displayStoredData({
|
|
10461
|
+
storedEncryptedData: safeJsonParse(v2EncryptedSeed),
|
|
10462
|
+
encryptedDevicePrivateKey: safeJsonParse(v2EncryptedPriv),
|
|
10463
|
+
options: {
|
|
10464
|
+
authType: exports.AuthType.Password,
|
|
10465
|
+
password: input.password,
|
|
10466
|
+
salt: clientSalt,
|
|
10467
|
+
},
|
|
10468
|
+
});
|
|
10469
|
+
}
|
|
10470
|
+
catch (error) {
|
|
10471
|
+
logger.error('SDK::WalletService::convertToPasskey::seed_decryption_error', error);
|
|
10472
|
+
}
|
|
10409
10473
|
}
|
|
10410
|
-
|
|
10411
|
-
|
|
10412
|
-
|
|
10413
|
-
|
|
10414
|
-
|
|
10415
|
-
|
|
10416
|
-
|
|
10417
|
-
|
|
10474
|
+
if (!decryptedSeedPhrase) {
|
|
10475
|
+
try {
|
|
10476
|
+
decryptedSeedPhrase = await this.localStorageService.getV1DecryptedSeedPhrase(input.password, clientSalt);
|
|
10477
|
+
}
|
|
10478
|
+
catch (error) {
|
|
10479
|
+
logger.error('SDK::WalletService::convertToPasskey::v1_seed_decryption_error', error);
|
|
10480
|
+
}
|
|
10481
|
+
}
|
|
10482
|
+
if (v2EncryptedPrimaryShare && v2EncryptedPriv) {
|
|
10483
|
+
try {
|
|
10484
|
+
const parsedPrimaryShare = safeJsonParse(v2EncryptedPrimaryShare);
|
|
10485
|
+
decryptedPrimaryShare = await this.cipher.displayStoredData({
|
|
10486
|
+
storedEncryptedData: parsedPrimaryShare,
|
|
10487
|
+
encryptedDevicePrivateKey: safeJsonParse(v2EncryptedPriv),
|
|
10488
|
+
options: {
|
|
10489
|
+
authType: exports.AuthType.Password,
|
|
10490
|
+
password: input.password,
|
|
10491
|
+
salt: clientSalt,
|
|
10492
|
+
},
|
|
10418
10493
|
});
|
|
10419
10494
|
}
|
|
10495
|
+
catch (error) {
|
|
10496
|
+
logger.error('SDK::WalletService::convertToPasskey::primary_share_decryption_error', error);
|
|
10497
|
+
}
|
|
10420
10498
|
}
|
|
10421
|
-
|
|
10422
|
-
|
|
10423
|
-
|
|
10424
|
-
|
|
10425
|
-
|
|
10426
|
-
|
|
10427
|
-
|
|
10428
|
-
|
|
10429
|
-
|
|
10430
|
-
|
|
10431
|
-
|
|
10432
|
-
|
|
10433
|
-
|
|
10434
|
-
|
|
10499
|
+
if (v2EncryptedBackupShare) {
|
|
10500
|
+
try {
|
|
10501
|
+
const parsedBackupShare = safeJsonParse(v2EncryptedBackupShare);
|
|
10502
|
+
// backup key share is wrapped with credentials public key at the outer layer
|
|
10503
|
+
// and wallaby public key at the inner layer, so only one local unwrap is needed.
|
|
10504
|
+
decryptedBackupShare = await this.cipher.decrypt({
|
|
10505
|
+
cipherText: parsedBackupShare,
|
|
10506
|
+
decryptionKey: passwordCredentialsKeyPair.privateKey,
|
|
10507
|
+
});
|
|
10508
|
+
}
|
|
10509
|
+
catch (error) {
|
|
10510
|
+
logger.error('SDK::WalletService::convertToPasskey::backup_share_decryption_error', error);
|
|
10511
|
+
}
|
|
10512
|
+
}
|
|
10513
|
+
const hasAnyDecryptedShare = !!decryptedPrimaryShare || !!decryptedBackupShare;
|
|
10514
|
+
if (!decryptedSeedPhrase && !hasAnyDecryptedShare) {
|
|
10515
|
+
throw new WallabyError({
|
|
10516
|
+
message: 'Seed phrase or key shares on this device could not be decrypted',
|
|
10517
|
+
statusCode: 500,
|
|
10518
|
+
errorCode: exports.ErrorResponseCodes.sdk_no_valid_seed_option,
|
|
10519
|
+
});
|
|
10520
|
+
}
|
|
10521
|
+
// We only care about the primary share for future local operations.
|
|
10522
|
+
if (decryptedSeedPhrase && !decryptedPrimaryShare) {
|
|
10523
|
+
logger.info('SDK::WalletService::convertToPasskey::No primary share found, importing wallet');
|
|
10524
|
+
await this.handlers.handleImportWallet({
|
|
10525
|
+
publicKey: clientPublicKey,
|
|
10526
|
+
privateKey: decryptedClientAuthPrivKey,
|
|
10527
|
+
}, {
|
|
10528
|
+
authenticationOptions: authentication,
|
|
10529
|
+
seedPhrase: decryptedSeedPhrase,
|
|
10530
|
+
storeSeedPhrase: false,
|
|
10531
|
+
returnWalletOption: exports.ReturnWalletOption.ReturnOnlyEncryptedShares, // always only return the encrypted shares
|
|
10532
|
+
keyShareOptions: {
|
|
10533
|
+
threshold: 2,
|
|
10534
|
+
numberOfKeyShares: 3,
|
|
10535
|
+
numberOfSharesReturned: 2,
|
|
10536
|
+
storeOneKeyShareWithWallaby: true,
|
|
10537
|
+
},
|
|
10538
|
+
});
|
|
10539
|
+
// Delete the old password-encrypted seed phrase since import stored the new passkey-encrypted version
|
|
10540
|
+
await this.localStorageService.delete(exports.LocalStorageItems.EncryptedStandardSeedPhrase, { walletId: input.walletId });
|
|
10541
|
+
logger.info('SDK::WalletService::convertToPasskey::Wallet imported and converted successfully, old seed phrase removed');
|
|
10542
|
+
return { authentication, seedPhrase: decryptedSeedPhrase };
|
|
10543
|
+
}
|
|
10544
|
+
const passkeyDerivedKeyPair = await this.cipher.getCredentialsKeyPair({
|
|
10545
|
+
authType: exports.AuthType.Passkey,
|
|
10546
|
+
prfValue,
|
|
10435
10547
|
});
|
|
10436
|
-
|
|
10437
|
-
|
|
10438
|
-
|
|
10548
|
+
const convertedShares = [];
|
|
10549
|
+
if (decryptedPrimaryShare) {
|
|
10550
|
+
const encryptedPrimaryShare = await this.cipher.doubleEncrypt({
|
|
10551
|
+
decryptedData: decryptedPrimaryShare,
|
|
10552
|
+
credentialsKeyPair: passkeyDerivedKeyPair,
|
|
10553
|
+
deviceKeyPair: {
|
|
10554
|
+
publicKey: clientPublicKey,
|
|
10555
|
+
privateKey: decryptedClientAuthPrivKey,
|
|
10556
|
+
},
|
|
10557
|
+
});
|
|
10558
|
+
convertedShares.push({
|
|
10559
|
+
key: exports.V2KeyNames.PrimaryDeviceKeyShare,
|
|
10560
|
+
value: encryptedPrimaryShare,
|
|
10561
|
+
walletId: input.walletId,
|
|
10562
|
+
});
|
|
10563
|
+
}
|
|
10564
|
+
if (decryptedBackupShare) {
|
|
10565
|
+
// Since this is only decrypted once, we only need passkey credential encryption.
|
|
10566
|
+
const encryptedBackupShare = await this.cipher.encrypt({
|
|
10567
|
+
data: decryptedBackupShare,
|
|
10568
|
+
encryptionKey: passkeyDerivedKeyPair.publicKey,
|
|
10569
|
+
});
|
|
10570
|
+
convertedShares.push({
|
|
10571
|
+
key: exports.V2KeyNames.BackupDeviceKeyShare,
|
|
10572
|
+
value: encryptedBackupShare,
|
|
10573
|
+
walletId: input.walletId,
|
|
10574
|
+
});
|
|
10575
|
+
}
|
|
10576
|
+
await this.localStorageService.saveInBulk(convertedShares);
|
|
10577
|
+
if (v2EncryptedSeed) {
|
|
10578
|
+
await this.localStorageService.delete(exports.LocalStorageItems.EncryptedStandardSeedPhrase, { walletId: input.walletId });
|
|
10579
|
+
logger.info('SDK::WalletService::convertToPasskey::Seed phrase removed from device storage after conversion to passkey');
|
|
10580
|
+
}
|
|
10581
|
+
if (!decryptedSeedPhrase && decryptedPrimaryShare) {
|
|
10582
|
+
const flippedEncryptedPrimaryShare = await this.cipher.encrypt({
|
|
10583
|
+
data: decryptedPrimaryShare,
|
|
10584
|
+
encryptionKey: authentication.user.wallabyAuthPubKey,
|
|
10585
|
+
});
|
|
10586
|
+
const reconstructedSeedPhrase = await this.handlers.handleConstructingSeedPhraseFromShares({
|
|
10587
|
+
walletId: input.walletId,
|
|
10588
|
+
encryptedKeyShares: [flippedEncryptedPrimaryShare],
|
|
10589
|
+
deviceAuthKeys: {
|
|
10590
|
+
publicKey: clientPublicKey,
|
|
10591
|
+
privateKey: decryptedClientAuthPrivKey,
|
|
10592
|
+
},
|
|
10593
|
+
});
|
|
10594
|
+
decryptedSeedPhrase = await this.cipher.decrypt({
|
|
10595
|
+
cipherText: reconstructedSeedPhrase,
|
|
10596
|
+
decryptionKey: decryptedClientAuthPrivKey,
|
|
10597
|
+
});
|
|
10598
|
+
}
|
|
10599
|
+
if (!decryptedSeedPhrase) {
|
|
10600
|
+
throw new WallabyError({
|
|
10601
|
+
message: 'Seed phrase could not be reconstructed from the provided shares',
|
|
10602
|
+
statusCode: 500,
|
|
10603
|
+
errorCode: exports.ErrorResponseCodes.sdk_no_valid_seed_option,
|
|
10604
|
+
});
|
|
10605
|
+
}
|
|
10606
|
+
return { authentication, seedPhrase: decryptedSeedPhrase };
|
|
10439
10607
|
}
|
|
10440
10608
|
catch (error) {
|
|
10441
10609
|
logger.error('SDK::WalletService::convertToPasskey::error', error);
|
|
@@ -10496,7 +10664,7 @@ class WalletDataService extends Base {
|
|
|
10496
10664
|
* @param { string } address Wallet address
|
|
10497
10665
|
* @param { string } symbol Token symbol
|
|
10498
10666
|
* @param { BlockchainName } chainName the chain name enum. i.e. 'ETHEREUM', 'BITCOIN'
|
|
10499
|
-
* @returns {
|
|
10667
|
+
* @returns { TokenBalance } Balance of the token
|
|
10500
10668
|
*/
|
|
10501
10669
|
async getTokenBalance({ address, symbol, tokenStandard, chainName }) {
|
|
10502
10670
|
try {
|
|
@@ -10537,7 +10705,7 @@ class WalletDataService extends Base {
|
|
|
10537
10705
|
});
|
|
10538
10706
|
}
|
|
10539
10707
|
const response = await this.request(WalletRoutes.getMultiTokenBalances, {
|
|
10540
|
-
payload: { tokensAndAddressesList },
|
|
10708
|
+
payload: { assets: tokensAndAddressesList },
|
|
10541
10709
|
});
|
|
10542
10710
|
return response;
|
|
10543
10711
|
}
|
|
@@ -10625,10 +10793,20 @@ class WalletDataService extends Base {
|
|
|
10625
10793
|
* Get all assets that exist in a certain wallet, by specifying a wallet ID
|
|
10626
10794
|
* @param walletId Wallaby's wallet ID
|
|
10627
10795
|
* @param { BasicQueryOptions } queryOptions Optional query options
|
|
10796
|
+
* @param { string } [queryOptions.search] - Search assets by name or symbol (minimum 3 characters)
|
|
10797
|
+
* @param { BlockchainName } [queryOptions.chainName] - Filter assets by blockchain name
|
|
10628
10798
|
* @returns { GetUserAssetsByWalletIdData } Returns all assets belonging in a certain wallet ID
|
|
10629
10799
|
*/
|
|
10630
10800
|
async getWalletAssets({ walletId, queryOptions }) {
|
|
10631
10801
|
try {
|
|
10802
|
+
// Validate search parameter if provided
|
|
10803
|
+
if ((queryOptions === null || queryOptions === void 0 ? void 0 : queryOptions.search) !== undefined && queryOptions.search.length < 3) {
|
|
10804
|
+
throw new WallabyError({
|
|
10805
|
+
message: 'Search parameter must be at least 3 characters long',
|
|
10806
|
+
statusCode: 400,
|
|
10807
|
+
errorCode: exports.ErrorResponseCodes.sdk_invalid_parameter,
|
|
10808
|
+
});
|
|
10809
|
+
}
|
|
10632
10810
|
const response = await this.request(WalletRoutes.getWalletAssets, {
|
|
10633
10811
|
payload: {
|
|
10634
10812
|
walletId,
|
|
@@ -10745,7 +10923,7 @@ class WalletDataService extends Base {
|
|
|
10745
10923
|
/**
|
|
10746
10924
|
* Updates a wallet asset.
|
|
10747
10925
|
*
|
|
10748
|
-
* @param {string} params.
|
|
10926
|
+
* @param {string} params.configId - Config ID for the user asset.
|
|
10749
10927
|
* @param {string} params.walletId - Wallet ID to which the asset belongs.
|
|
10750
10928
|
* @param {string} params.assetName - Asset name.
|
|
10751
10929
|
* @param {boolean} params.isVisible - Asset visibility toggle.
|
|
@@ -10756,19 +10934,19 @@ class WalletDataService extends Base {
|
|
|
10756
10934
|
* @throws {Error} If required parameters are missing or invalid.
|
|
10757
10935
|
*/
|
|
10758
10936
|
async updateAsset(_a) {
|
|
10759
|
-
var {
|
|
10937
|
+
var { configId, walletId } = _a, assetConfig = __rest(_a, ["configId", "walletId"]);
|
|
10760
10938
|
try {
|
|
10761
|
-
if (!
|
|
10939
|
+
if (!configId || !walletId) {
|
|
10762
10940
|
throw new WallabyError({
|
|
10763
10941
|
message: 'Missing required parameters',
|
|
10764
10942
|
statusCode: 400,
|
|
10765
10943
|
errorCode: exports.ErrorResponseCodes.sdk_missing_parameter,
|
|
10766
10944
|
});
|
|
10767
10945
|
}
|
|
10768
|
-
const response = await this.
|
|
10769
|
-
|
|
10770
|
-
|
|
10771
|
-
}
|
|
10946
|
+
const response = await this.request(WalletRoutes.updateAsset, {
|
|
10947
|
+
payload: Object.assign({ configId,
|
|
10948
|
+
walletId }, assetConfig),
|
|
10949
|
+
});
|
|
10772
10950
|
return response;
|
|
10773
10951
|
}
|
|
10774
10952
|
catch (error) {
|
|
@@ -11098,6 +11276,246 @@ class HttpApi extends Base {
|
|
|
11098
11276
|
}
|
|
11099
11277
|
}
|
|
11100
11278
|
|
|
11279
|
+
class Swap extends Base {
|
|
11280
|
+
constructor(config) {
|
|
11281
|
+
super(config);
|
|
11282
|
+
this.authService = new AuthService(config);
|
|
11283
|
+
this.walletService = new WalletService(config);
|
|
11284
|
+
}
|
|
11285
|
+
/**
|
|
11286
|
+
* Gets a swap quote between two assets (from/to), including fees, min output, and slippage limits.
|
|
11287
|
+
*
|
|
11288
|
+
* @public
|
|
11289
|
+
* @param {SwapQuoteRequest} request - The swap quote request parameters
|
|
11290
|
+
* @returns {Promise<SwapQuoteResponse>} A promise that resolves with the swap quote
|
|
11291
|
+
*/
|
|
11292
|
+
async getQuote({ walletId, fromAsset, toAsset, fromAmount, toAmount }) {
|
|
11293
|
+
try {
|
|
11294
|
+
if (!walletId || !fromAsset || !toAsset) {
|
|
11295
|
+
throw new WallabyError({
|
|
11296
|
+
message: 'Missing required parameters: walletId, fromAsset, and toAsset are required',
|
|
11297
|
+
statusCode: 400,
|
|
11298
|
+
errorCode: exports.ErrorResponseCodes.sdk_missing_parameter,
|
|
11299
|
+
});
|
|
11300
|
+
}
|
|
11301
|
+
if (!fromAmount && !toAmount) {
|
|
11302
|
+
throw new WallabyError({
|
|
11303
|
+
message: 'Either fromAmount or toAmount must be provided',
|
|
11304
|
+
statusCode: 400,
|
|
11305
|
+
errorCode: exports.ErrorResponseCodes.sdk_missing_parameter,
|
|
11306
|
+
});
|
|
11307
|
+
}
|
|
11308
|
+
// Build path with walletId, but exclude it from request body
|
|
11309
|
+
const routePayload = { walletId };
|
|
11310
|
+
const requestBody = Object.assign(Object.assign({ fromAsset,
|
|
11311
|
+
toAsset }, (fromAmount && { fromAmount })), (toAmount && { toAmount }));
|
|
11312
|
+
const response = await this.request(Object.assign(Object.assign({}, SwapRoutes.getQuote), { fullPath: SwapRoutes.getQuote.fullPath(routePayload) }), {
|
|
11313
|
+
payload: requestBody,
|
|
11314
|
+
});
|
|
11315
|
+
return response;
|
|
11316
|
+
}
|
|
11317
|
+
catch (error) {
|
|
11318
|
+
logger.error('SDK::Swap::getQuote::error', error);
|
|
11319
|
+
throw error;
|
|
11320
|
+
}
|
|
11321
|
+
}
|
|
11322
|
+
/**
|
|
11323
|
+
* Executes a swap using a previously generated quote.
|
|
11324
|
+
*
|
|
11325
|
+
* @public
|
|
11326
|
+
* @param {ExecuteSwapRequest} request - The execute swap request parameters
|
|
11327
|
+
* @returns {Promise<ExecuteSwapResponse>} A promise that resolves with the swap execution response
|
|
11328
|
+
*/
|
|
11329
|
+
async executeSwap({ walletId, quoteId, authenticationOptions }) {
|
|
11330
|
+
try {
|
|
11331
|
+
// Only attempt migration if we have password auth and V2 storage might be incomplete
|
|
11332
|
+
if (this.deviceAuthType === exports.AuthType.Password && authenticationOptions.password) {
|
|
11333
|
+
try {
|
|
11334
|
+
await this.walletService.handleUpdateToV2({
|
|
11335
|
+
password: authenticationOptions.password,
|
|
11336
|
+
walletId: walletId,
|
|
11337
|
+
});
|
|
11338
|
+
}
|
|
11339
|
+
catch (error) {
|
|
11340
|
+
logger.error('SDK::Swap::executeSwap::handleUpdateToV2::error', error);
|
|
11341
|
+
throw new WallabyError({
|
|
11342
|
+
message: 'Error accessing user wallet on this device. Please ensure the password is correct and try again.',
|
|
11343
|
+
statusCode: 500,
|
|
11344
|
+
errorCode: exports.ErrorResponseCodes.sdk_unknown_error,
|
|
11345
|
+
});
|
|
11346
|
+
}
|
|
11347
|
+
}
|
|
11348
|
+
const { deviceAuthPublicKey, signatureMessage, readyForTransportSeedPhrase, sharesEncryptedWithWallabyPubKey, hasShares } = await this.prepareSwapAuth(authenticationOptions, walletId);
|
|
11349
|
+
let swapResponse;
|
|
11350
|
+
// Build path with walletId, but exclude it from request body
|
|
11351
|
+
const routePayload = { walletId };
|
|
11352
|
+
if (readyForTransportSeedPhrase) {
|
|
11353
|
+
swapResponse = await this.request(Object.assign(Object.assign({}, SwapRoutes.executeSwap), { fullPath: SwapRoutes.executeSwap.fullPath(routePayload) }), {
|
|
11354
|
+
payload: {
|
|
11355
|
+
quoteId,
|
|
11356
|
+
message: signatureMessage.message,
|
|
11357
|
+
signature: signatureMessage.signature,
|
|
11358
|
+
clientAuthPubKey: deviceAuthPublicKey,
|
|
11359
|
+
encryptedSeed: readyForTransportSeedPhrase,
|
|
11360
|
+
},
|
|
11361
|
+
});
|
|
11362
|
+
}
|
|
11363
|
+
else if (hasShares) {
|
|
11364
|
+
swapResponse = await this.request(Object.assign(Object.assign({}, SwapRoutes.executeSwap), { fullPath: SwapRoutes.executeSwap.fullPath(routePayload) }), {
|
|
11365
|
+
payload: {
|
|
11366
|
+
quoteId,
|
|
11367
|
+
message: signatureMessage.message,
|
|
11368
|
+
signature: signatureMessage.signature,
|
|
11369
|
+
clientAuthPubKey: deviceAuthPublicKey,
|
|
11370
|
+
encryptedShares: sharesEncryptedWithWallabyPubKey,
|
|
11371
|
+
},
|
|
11372
|
+
});
|
|
11373
|
+
}
|
|
11374
|
+
else {
|
|
11375
|
+
throw new WallabyError({
|
|
11376
|
+
message: 'No valid seed option found on this device.',
|
|
11377
|
+
statusCode: 400,
|
|
11378
|
+
errorCode: exports.ErrorResponseCodes.sdk_no_valid_seed_option,
|
|
11379
|
+
});
|
|
11380
|
+
}
|
|
11381
|
+
return swapResponse;
|
|
11382
|
+
}
|
|
11383
|
+
catch (error) {
|
|
11384
|
+
logger.error('SDK::Swap::executeSwap::error', error);
|
|
11385
|
+
throw error;
|
|
11386
|
+
}
|
|
11387
|
+
}
|
|
11388
|
+
/**
|
|
11389
|
+
* Lists executed swap transactions for a given wallet, with optional date and pagination filters.
|
|
11390
|
+
*
|
|
11391
|
+
* @public
|
|
11392
|
+
* @param {GetSwapsRequest} request - The get swaps request parameters
|
|
11393
|
+
* @returns {Promise<GetSwapsResponse>} A promise that resolves with the list of swaps
|
|
11394
|
+
*/
|
|
11395
|
+
async getSwaps({ walletId, queryParams }) {
|
|
11396
|
+
try {
|
|
11397
|
+
if (!walletId) {
|
|
11398
|
+
throw new WallabyError({
|
|
11399
|
+
message: 'Missing required parameter: walletId',
|
|
11400
|
+
statusCode: 400,
|
|
11401
|
+
errorCode: exports.ErrorResponseCodes.sdk_missing_parameter,
|
|
11402
|
+
});
|
|
11403
|
+
}
|
|
11404
|
+
// Build path with walletId
|
|
11405
|
+
const routePayload = { walletId };
|
|
11406
|
+
const response = await this.request(Object.assign(Object.assign({}, SwapRoutes.getSwaps), { fullPath: SwapRoutes.getSwaps.fullPath(routePayload) }), {
|
|
11407
|
+
queryParams: queryParams,
|
|
11408
|
+
});
|
|
11409
|
+
return response;
|
|
11410
|
+
}
|
|
11411
|
+
catch (error) {
|
|
11412
|
+
logger.error('SDK::Swap::getSwaps::error', error);
|
|
11413
|
+
throw error;
|
|
11414
|
+
}
|
|
11415
|
+
}
|
|
11416
|
+
/**
|
|
11417
|
+
* Prepares authentication data and encrypted payload for swap requests
|
|
11418
|
+
* @private
|
|
11419
|
+
*/
|
|
11420
|
+
async prepareSwapAuth(authenticationOptions, walletId) {
|
|
11421
|
+
const { password, prfValue, user, clientSalt: authClientSalt } = authenticationOptions;
|
|
11422
|
+
const encryptedDevicePrivateKey = await this.localStorageService.fetch(exports.LocalStorageItems.EncryptedDevicePrivateKey, {
|
|
11423
|
+
walletId,
|
|
11424
|
+
});
|
|
11425
|
+
if (!encryptedDevicePrivateKey) {
|
|
11426
|
+
throw new WallabyError({
|
|
11427
|
+
message: 'No private key was found on this device.',
|
|
11428
|
+
statusCode: 400,
|
|
11429
|
+
errorCode: exports.ErrorResponseCodes.sdk_private_key_not_found,
|
|
11430
|
+
});
|
|
11431
|
+
}
|
|
11432
|
+
// Get credentials key pair for device private key decryption
|
|
11433
|
+
const clientSalt = authClientSalt || user.clientSalt;
|
|
11434
|
+
const credentialsKeyPair = await this.cipher.getCredentialsKeyPair({
|
|
11435
|
+
authType: this.deviceAuthType,
|
|
11436
|
+
password,
|
|
11437
|
+
prfValue,
|
|
11438
|
+
salt: clientSalt,
|
|
11439
|
+
});
|
|
11440
|
+
// Decrypt device private key
|
|
11441
|
+
const decryptedDevicePrivateKey = await this.cipher.decrypt({
|
|
11442
|
+
cipherText: JSON.parse(encryptedDevicePrivateKey),
|
|
11443
|
+
decryptionKey: credentialsKeyPair.privateKey,
|
|
11444
|
+
});
|
|
11445
|
+
if (!decryptedDevicePrivateKey) {
|
|
11446
|
+
throw new WallabyError({
|
|
11447
|
+
message: 'Credentials are wrong, please pass the correct credentials.',
|
|
11448
|
+
statusCode: 400,
|
|
11449
|
+
errorCode: exports.ErrorResponseCodes.sdk_private_key_decryption_failed,
|
|
11450
|
+
});
|
|
11451
|
+
}
|
|
11452
|
+
const deviceAuthPublicKey = publicKeyByPrivateKey(decryptedDevicePrivateKey);
|
|
11453
|
+
// Get signature message
|
|
11454
|
+
const signatureMessage = await this.authService.getSignature({
|
|
11455
|
+
publicKey: deviceAuthPublicKey,
|
|
11456
|
+
privateKey: decryptedDevicePrivateKey,
|
|
11457
|
+
}, this.deviceAuthType === exports.AuthType.Passkey ? exports.PasskeyChallengeType.AUTHENTICATION : undefined);
|
|
11458
|
+
// Prepare encrypted data (seed phrase or key shares)
|
|
11459
|
+
const sharesEncryptedWithWallabyPubKey = [];
|
|
11460
|
+
let readyForTransportSeedPhrase = undefined;
|
|
11461
|
+
const primaryKeyShare = await this.localStorageService.fetch(exports.LocalStorageItems.PrimaryDeviceKeyShare, { walletId });
|
|
11462
|
+
if (!primaryKeyShare) {
|
|
11463
|
+
// No primary share, try seed phrase
|
|
11464
|
+
const encryptedSeedPhrase = await this.localStorageService.fetch(exports.LocalStorageItems.EncryptedStandardSeedPhrase, {
|
|
11465
|
+
walletId,
|
|
11466
|
+
});
|
|
11467
|
+
if (!encryptedSeedPhrase) {
|
|
11468
|
+
throw new WallabyError({
|
|
11469
|
+
message: 'Your device does not have a seed phrase or an operating share to sign the transaction.',
|
|
11470
|
+
statusCode: 400,
|
|
11471
|
+
errorCode: exports.ErrorResponseCodes.sdk_seed_phrase_not_found,
|
|
11472
|
+
});
|
|
11473
|
+
}
|
|
11474
|
+
const parsedSeedPhrase = safeJsonParse(encryptedSeedPhrase);
|
|
11475
|
+
readyForTransportSeedPhrase = await this.cipher.prepareStoredDataForTransport({
|
|
11476
|
+
storedEncryptedData: parsedSeedPhrase,
|
|
11477
|
+
encryptedDevicePrivateKey: JSON.parse(encryptedDevicePrivateKey),
|
|
11478
|
+
wallabyPublicKey: user.wallabyAuthPubKey,
|
|
11479
|
+
options: {
|
|
11480
|
+
authType: this.deviceAuthType,
|
|
11481
|
+
password,
|
|
11482
|
+
prfValue,
|
|
11483
|
+
salt: clientSalt,
|
|
11484
|
+
},
|
|
11485
|
+
});
|
|
11486
|
+
}
|
|
11487
|
+
else {
|
|
11488
|
+
// Use primary key share
|
|
11489
|
+
const parsedPrimaryShare = safeJsonParse(primaryKeyShare);
|
|
11490
|
+
const readyForTransportShare = await this.cipher.prepareStoredDataForTransport({
|
|
11491
|
+
storedEncryptedData: parsedPrimaryShare,
|
|
11492
|
+
encryptedDevicePrivateKey: JSON.parse(encryptedDevicePrivateKey),
|
|
11493
|
+
wallabyPublicKey: user.wallabyAuthPubKey,
|
|
11494
|
+
options: {
|
|
11495
|
+
authType: this.deviceAuthType,
|
|
11496
|
+
password,
|
|
11497
|
+
prfValue,
|
|
11498
|
+
salt: clientSalt,
|
|
11499
|
+
},
|
|
11500
|
+
});
|
|
11501
|
+
sharesEncryptedWithWallabyPubKey.push(readyForTransportShare);
|
|
11502
|
+
}
|
|
11503
|
+
return Object.freeze({
|
|
11504
|
+
deviceAuthPublicKey,
|
|
11505
|
+
signatureMessage,
|
|
11506
|
+
readyForTransportSeedPhrase,
|
|
11507
|
+
sharesEncryptedWithWallabyPubKey,
|
|
11508
|
+
hasShares: sharesEncryptedWithWallabyPubKey.length > 0,
|
|
11509
|
+
});
|
|
11510
|
+
}
|
|
11511
|
+
}
|
|
11512
|
+
__decorate([
|
|
11513
|
+
WithLock('executeSwap'),
|
|
11514
|
+
__metadata("design:type", Function),
|
|
11515
|
+
__metadata("design:paramtypes", [Object]),
|
|
11516
|
+
__metadata("design:returntype", Promise)
|
|
11517
|
+
], Swap.prototype, "executeSwap", null);
|
|
11518
|
+
|
|
11101
11519
|
/**
|
|
11102
11520
|
* Sanitizes a Sui object ID by removing any part of the string after '::'.
|
|
11103
11521
|
*
|
|
@@ -11124,13 +11542,14 @@ class System extends Base {
|
|
|
11124
11542
|
/**
|
|
11125
11543
|
* @public
|
|
11126
11544
|
* Get all supported chains
|
|
11127
|
-
* @param {
|
|
11545
|
+
* @param {Object} [options] - Optional query parameters
|
|
11546
|
+
* @param {boolean} [options.supportSwaps] - When true, include only chains that support swaps
|
|
11128
11547
|
* @returns {Array<Blockchain>} Array of supported chains
|
|
11129
11548
|
*/
|
|
11130
|
-
async getSupportedBlockchains() {
|
|
11549
|
+
async getSupportedBlockchains(options) {
|
|
11131
11550
|
try {
|
|
11132
11551
|
const response = await this.request(SystemRoutes.getSupportedBlockchains, {
|
|
11133
|
-
|
|
11552
|
+
queryParams: (options === null || options === void 0 ? void 0 : options.supportSwaps) !== undefined ? { supportSwaps: options.supportSwaps } : undefined,
|
|
11134
11553
|
});
|
|
11135
11554
|
return response.chains;
|
|
11136
11555
|
}
|
|
@@ -11235,13 +11654,33 @@ class System extends Base {
|
|
|
11235
11654
|
/**
|
|
11236
11655
|
* @public
|
|
11237
11656
|
* Get all supported assets configuration
|
|
11238
|
-
* @param {
|
|
11657
|
+
* @param {Object} [options] - Optional query parameters
|
|
11658
|
+
* @param {boolean} [options.supportsSwaps] - When true, filter to assets that support swaps
|
|
11659
|
+
* @param {string} [options.search] - Search assets by name or symbol (minimum 3 characters)
|
|
11660
|
+
* @param {BlockchainName} [options.chainName] - Filter assets by blockchain name
|
|
11239
11661
|
* @returns {Array<AssetConfig>} Array of supported tokens
|
|
11240
11662
|
*/
|
|
11241
|
-
async getSupportedTokens() {
|
|
11663
|
+
async getSupportedTokens(options) {
|
|
11242
11664
|
try {
|
|
11665
|
+
const queryParams = {};
|
|
11666
|
+
if ((options === null || options === void 0 ? void 0 : options.supportsSwaps) !== undefined) {
|
|
11667
|
+
queryParams.supportsSwaps = options.supportsSwaps;
|
|
11668
|
+
}
|
|
11669
|
+
if ((options === null || options === void 0 ? void 0 : options.search) !== undefined) {
|
|
11670
|
+
if (options.search.length < 3) {
|
|
11671
|
+
throw new WallabyError({
|
|
11672
|
+
message: 'Search parameter must be at least 3 characters long',
|
|
11673
|
+
statusCode: 400,
|
|
11674
|
+
errorCode: exports.ErrorResponseCodes.sdk_invalid_parameter,
|
|
11675
|
+
});
|
|
11676
|
+
}
|
|
11677
|
+
queryParams.search = options.search;
|
|
11678
|
+
}
|
|
11679
|
+
if ((options === null || options === void 0 ? void 0 : options.chainName) !== undefined) {
|
|
11680
|
+
queryParams.chainName = options.chainName;
|
|
11681
|
+
}
|
|
11243
11682
|
const response = await this.request(SystemRoutes.getSupportedTokens, {
|
|
11244
|
-
|
|
11683
|
+
queryParams: Object.keys(queryParams).length > 0 ? queryParams : undefined,
|
|
11245
11684
|
});
|
|
11246
11685
|
return response.assets;
|
|
11247
11686
|
}
|
|
@@ -11384,9 +11823,10 @@ class Transactions extends Base {
|
|
|
11384
11823
|
* @param {string} reference
|
|
11385
11824
|
* @param {AuthenticationResponse} authenticationOptions
|
|
11386
11825
|
* @param {string} memo
|
|
11826
|
+
* @param {TransactionType} transactionType
|
|
11387
11827
|
* @returns {TransactionResponse}
|
|
11388
11828
|
*/
|
|
11389
|
-
async transfer({ originAddress, recipientAddress, amount, assetId, walletId, reference, authenticationOptions, memo, }) {
|
|
11829
|
+
async transfer({ originAddress, recipientAddress, amount, assetId, walletId, reference, authenticationOptions, memo, transactionType, }) {
|
|
11390
11830
|
try {
|
|
11391
11831
|
// Only attempt migration if we have password auth and V2 storage might be incomplete
|
|
11392
11832
|
if (this.deviceAuthType === exports.AuthType.Password && authenticationOptions.password) {
|
|
@@ -11412,7 +11852,8 @@ class Transactions extends Base {
|
|
|
11412
11852
|
payload: Object.assign(Object.assign({}, signatureMessage), { clientAuthPubKey: deviceAuthPublicKey, encryptedSeed: readyForTransportSeedPhrase, originAddress,
|
|
11413
11853
|
recipientAddress,
|
|
11414
11854
|
assetId,
|
|
11415
|
-
amount, reference: reference || uuid.v4(), memo
|
|
11855
|
+
amount, reference: reference || uuid.v4(), memo,
|
|
11856
|
+
transactionType }),
|
|
11416
11857
|
});
|
|
11417
11858
|
}
|
|
11418
11859
|
else if (hasShares) {
|
|
@@ -11420,14 +11861,15 @@ class Transactions extends Base {
|
|
|
11420
11861
|
payload: Object.assign(Object.assign({}, signatureMessage), { clientAuthPubKey: deviceAuthPublicKey, encryptedShares: sharesEncryptedWithWallabyPubKey, originAddress,
|
|
11421
11862
|
recipientAddress,
|
|
11422
11863
|
assetId,
|
|
11423
|
-
amount, reference: reference || uuid.v4(), memo
|
|
11864
|
+
amount, reference: reference || uuid.v4(), memo,
|
|
11865
|
+
transactionType }),
|
|
11424
11866
|
});
|
|
11425
11867
|
}
|
|
11426
11868
|
else {
|
|
11427
11869
|
throw new WallabyError({
|
|
11428
11870
|
message: 'No valid seed option found on this device.',
|
|
11429
11871
|
statusCode: 400,
|
|
11430
|
-
errorCode:
|
|
11872
|
+
errorCode: exports.ErrorResponseCodes.sdk_no_valid_seed_option,
|
|
11431
11873
|
});
|
|
11432
11874
|
}
|
|
11433
11875
|
return transferResponse;
|
|
@@ -11449,10 +11891,11 @@ class Transactions extends Base {
|
|
|
11449
11891
|
* @param {string} suiObjectId
|
|
11450
11892
|
* @param {string} reference
|
|
11451
11893
|
* @param {string} memo
|
|
11894
|
+
* @param {TransactionType} transactionType
|
|
11452
11895
|
* @returns {CreateAllowanceResponse}
|
|
11453
11896
|
*
|
|
11454
11897
|
*/
|
|
11455
|
-
async createAllowance({ authenticationOptions, walletId, ownerAddress, spenderAddress, amount, assetId, suiObjectId, contractAddress, chainName, assetSymbol, reference, memo, }) {
|
|
11898
|
+
async createAllowance({ authenticationOptions, walletId, ownerAddress, spenderAddress, amount, assetId, suiObjectId, contractAddress, chainName, assetSymbol, reference, memo, transactionType, }) {
|
|
11456
11899
|
try {
|
|
11457
11900
|
if (!suiObjectId && !contractAddress && !assetId && !assetSymbol && !chainName) {
|
|
11458
11901
|
throw new WallabyError({
|
|
@@ -11493,14 +11936,14 @@ class Transactions extends Base {
|
|
|
11493
11936
|
}
|
|
11494
11937
|
const payload = Object.assign({ message,
|
|
11495
11938
|
walletId,
|
|
11496
|
-
authenticationOptions,
|
|
11497
11939
|
signature, clientAuthPubKey: deviceAuthPublicKey, ownerAddress,
|
|
11498
11940
|
spenderAddress,
|
|
11499
11941
|
chainName,
|
|
11500
11942
|
assetSymbol,
|
|
11501
11943
|
amount,
|
|
11502
11944
|
assetId, contractAddress: contractAddress !== null && contractAddress !== void 0 ? contractAddress : suiObjectId, reference,
|
|
11503
|
-
memo
|
|
11945
|
+
memo,
|
|
11946
|
+
transactionType }, (hasShares ? { encryptedShares: sharesEncryptedWithWallabyPubKey } : { encryptedSeed: readyForTransportSeedPhrase }));
|
|
11504
11947
|
const response = await this.request(TransactionsRoutes.createAllowance, {
|
|
11505
11948
|
payload,
|
|
11506
11949
|
});
|
|
@@ -11718,6 +12161,7 @@ class Wallaby {
|
|
|
11718
12161
|
this.auth = new AuthService(config);
|
|
11719
12162
|
this.system = new System(config);
|
|
11720
12163
|
this.transactions = new Transactions(config);
|
|
12164
|
+
this.swap = new Swap(config);
|
|
11721
12165
|
this.merchants = new Merchants(config);
|
|
11722
12166
|
this.httpApi = new HttpApi(config);
|
|
11723
12167
|
}
|