wallaby-cash 1.3.2 → 1.3.4

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.
Files changed (44) hide show
  1. package/dist/base.d.ts +20 -1
  2. package/dist/index.d.ts +1 -1
  3. package/dist/index.esm.js +1 -1
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/index.js +1 -1
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.umd.js +1 -1
  8. package/dist/index.umd.js.map +1 -1
  9. package/dist/lib/auth/index.d.ts +16 -10
  10. package/dist/lib/transactions/index.d.ts +5 -5
  11. package/dist/lib/utils/index.d.ts +29 -9
  12. package/dist/lib/utils/utils.d.ts +22 -13
  13. package/dist/lib/wallet/index.d.ts +34 -11
  14. package/dist/routes/auth.d.ts +11 -6
  15. package/dist/routes/merchants.d.ts +7 -7
  16. package/dist/routes/system.d.ts +4 -4
  17. package/dist/routes/transactions.d.ts +13 -6
  18. package/dist/routes/wallet.d.ts +15 -10
  19. package/dist/tests/data/user.d.ts +3 -2
  20. package/dist/types/auth.d.ts +5 -10
  21. package/dist/types/common.d.ts +5 -1
  22. package/dist/types/transactions.d.ts +2 -2
  23. package/dist/types/wallet.d.ts +13 -6
  24. package/package.json +2 -2
  25. package/src/base.ts +40 -8
  26. package/src/index.ts +2 -2
  27. package/src/lib/auth/index.ts +49 -24
  28. package/src/lib/transactions/index.ts +7 -7
  29. package/src/lib/utils/index.ts +77 -19
  30. package/src/lib/utils/utils.ts +96 -36
  31. package/src/lib/wallet/index.ts +209 -35
  32. package/src/routes/auth.ts +11 -6
  33. package/src/routes/merchants.ts +7 -7
  34. package/src/routes/system.ts +4 -4
  35. package/src/routes/transactions.ts +23 -6
  36. package/src/routes/wallet.ts +15 -10
  37. package/src/tests/auth.spec.ts +26 -24
  38. package/src/tests/data/user.ts +3 -2
  39. package/src/tests/utils.spec.ts +9 -13
  40. package/src/tests/wallet.spec.ts +12 -7
  41. package/src/types/auth.ts +5 -11
  42. package/src/types/common.ts +6 -1
  43. package/src/types/transactions.ts +2 -2
  44. package/src/types/wallet.ts +14 -6
@@ -3,26 +3,33 @@ export declare const TransactionsRoutes: {
3
3
  transfer: {
4
4
  fullPath: string;
5
5
  method: RequestMothod;
6
- accessTokenRequired: boolean;
6
+ requiresAccessToken: boolean;
7
7
  };
8
8
  createAllowance: {
9
9
  fullPath: string;
10
10
  method: RequestMothod;
11
- accessTokenRequired: boolean;
11
+ requiresAccessToken: boolean;
12
12
  };
13
13
  estimateFee: {
14
- fullPath: string;
14
+ fullPath: ({ assetSymbol, originAddress, recipientAddress, amount, transactionType, tokenType, }: {
15
+ assetSymbol: string;
16
+ originAddress: string;
17
+ recipientAddress: string;
18
+ amount: number;
19
+ transactionType: string;
20
+ tokenType?: string | undefined;
21
+ }) => string;
15
22
  method: RequestMothod;
16
- accessTokenRequired: boolean;
23
+ requiresAccessToken: boolean;
17
24
  };
18
25
  getTransaction: {
19
26
  fullPath: string;
20
27
  method: RequestMothod;
21
- accessTokenRequired: boolean;
28
+ requiresAccessToken: boolean;
22
29
  };
23
30
  getTransactions: {
24
31
  fullPath: string;
25
32
  method: RequestMothod;
26
- accessTokenRequired: boolean;
33
+ requiresAccessToken: boolean;
27
34
  };
28
35
  };
@@ -3,51 +3,56 @@ export declare const WalletRoutes: {
3
3
  create: {
4
4
  fullPath: string;
5
5
  method: RequestMothod;
6
- accessTokenRequired: boolean;
6
+ requiresAccessToken: boolean;
7
+ };
8
+ import: {
9
+ fullPath: string;
10
+ method: RequestMothod;
11
+ requiresAccessToken: boolean;
7
12
  };
8
13
  initRecoveryFlow: {
9
14
  fullPath: string;
10
15
  method: RequestMothod;
11
- accessTokenRequired: boolean;
16
+ requiresAccessToken: boolean;
12
17
  };
13
18
  recover: {
14
19
  fullPath: string;
15
20
  method: RequestMothod;
16
- accessTokenRequired: boolean;
21
+ requiresAccessToken: boolean;
17
22
  };
18
23
  getTokenBalance: {
19
24
  fullPath: ({ address, symbol, tokenStandard }: TokenBalanceRequest) => string;
20
25
  method: RequestMothod;
21
- accessTokenRequired: boolean;
26
+ requiresAccessToken: boolean;
22
27
  };
23
28
  estimateFee: {
24
29
  fullPath: string;
25
30
  method: RequestMothod;
26
- accessTokenRequired: boolean;
31
+ requiresAccessToken: boolean;
27
32
  };
28
33
  getWalletAssets: {
29
34
  fullPath: ({ walletId }: QueryWalletRequest) => string;
30
35
  method: RequestMothod;
31
- accessTokenRequired: boolean;
36
+ requiresAccessToken: boolean;
32
37
  };
33
38
  getUserAssets: {
34
39
  fullPath: ({ userId }: QueryUserRequest) => string;
35
40
  method: RequestMothod;
36
- accessTokenRequired: boolean;
41
+ requiresAccessToken: boolean;
37
42
  };
38
43
  getUserWallets: {
39
44
  fullPath: ({ userId }: QueryUserRequest) => string;
40
45
  method: RequestMothod;
41
- accessTokenRequired: boolean;
46
+ requiresAccessToken: boolean;
42
47
  };
43
48
  convertMnemonicSeedphrase: {
44
49
  fullPath: string;
45
50
  method: RequestMothod;
46
- accessTokenRequired: boolean;
51
+ requiresAccessToken: boolean;
47
52
  };
48
53
  createMultisigAsset: {
49
54
  fullPath: string;
50
55
  method: RequestMothod;
51
- accessTokenRequired: boolean;
56
+ requiresAccessToken: boolean;
52
57
  };
53
58
  };
@@ -6,8 +6,9 @@ export declare const testUser: {
6
6
  firstName: string;
7
7
  lastName: string;
8
8
  email: string;
9
- hashKey: string;
10
- wrongHashKey: string;
9
+ password: string;
10
+ salt: string;
11
+ wrongPassword: string;
11
12
  message: string;
12
13
  hashedMessage: string;
13
14
  signature: string;
@@ -1,6 +1,6 @@
1
1
  import { User } from './common';
2
2
  export declare type SignatureMessageRequest = {
3
- hashKey: string;
3
+ password: string;
4
4
  userId: string;
5
5
  };
6
6
  export declare type SignatureMessageResponse = {
@@ -12,26 +12,21 @@ export declare type SignatureMessageResponse = {
12
12
  error?: any;
13
13
  };
14
14
  export declare type SignInRequest = {
15
- hashKey: string;
16
- };
17
- export declare type SignInResponse = {
18
- accessToken: string;
19
- user: User;
20
- error?: any;
15
+ password: string;
21
16
  };
22
17
  export declare type SignUpRequest = {
23
- hashKey: string;
18
+ password: string;
24
19
  firstName: string;
25
20
  lastName: string;
26
21
  email: string;
27
22
  };
28
- export declare type SignUpResponse = {
23
+ export declare type AuthResponse = {
29
24
  accessToken: string;
30
25
  user: User;
31
26
  error?: any;
32
27
  };
33
28
  export declare type ClientAuthPubKeyRequest = {
34
- hashKey: string;
29
+ password: string;
35
30
  userId: string;
36
31
  message: string;
37
32
  clientAuthPubKey: string;
@@ -1,5 +1,9 @@
1
1
  import { Merchant, MerchantAsset } from './merchants';
2
2
  export declare type UtilsResponse = string | undefined;
3
+ export declare type GetDecryptedSeedPhraseResponse = {
4
+ standardSeedPhrase: UtilsResponse;
5
+ algorandSeedPhrase: UtilsResponse;
6
+ };
3
7
  export declare type WallabyError = {
4
8
  statusCode: number;
5
9
  message: string;
@@ -165,7 +169,7 @@ export declare interface RequestOptions extends RequestInit {
165
169
  export declare type RequestRoute = {
166
170
  fullPath: string | ((params: any) => string);
167
171
  method: RequestMothod;
168
- accessTokenRequired: boolean;
172
+ requiresAccessToken: boolean;
169
173
  };
170
174
  export declare enum ApiKeyStatus {
171
175
  Active = "active",
@@ -82,7 +82,7 @@ export declare type TransferRequest = {
82
82
  assetId: string;
83
83
  reference: string;
84
84
  memo?: string;
85
- hashKey: string;
85
+ password: string;
86
86
  };
87
87
  export declare type TransferResponse = {
88
88
  transaction: Transaction;
@@ -123,5 +123,5 @@ export declare type CreateAllowanceRequest = {
123
123
  contractAddress: string;
124
124
  reference: string;
125
125
  memo?: string;
126
- hashKey: string;
126
+ password: string;
127
127
  };
@@ -36,7 +36,7 @@ export declare type WalletAssetsResponse = {
36
36
  };
37
37
  export declare type CreateWalletRequest = {
38
38
  userId?: string;
39
- hashKey: string;
39
+ password: string;
40
40
  firstName: string;
41
41
  lastName: string;
42
42
  email: string;
@@ -44,9 +44,16 @@ export declare type CreateWalletRequest = {
44
44
  clientAuthPubKey: string;
45
45
  signature: string;
46
46
  };
47
- export declare type ClearWalletInput = {
48
- userId: string;
49
- walletId?: string;
47
+ export declare type ImportWalletRequest = {
48
+ password: string;
49
+ seedPhrase: string;
50
+ };
51
+ export declare type ImportWalletResponse = {
52
+ wallabyAuthPubKey: string;
53
+ assets: Array<UserAsset>;
54
+ encryptedSeed: Encrypted;
55
+ wallet: Wallet;
56
+ error?: any;
50
57
  };
51
58
  export declare type Wallet = {
52
59
  id: string;
@@ -78,7 +85,7 @@ export declare type CreateWalletResponse = {
78
85
  export declare type ConvertMnemonicSeedPhraseRequest = {
79
86
  reference: string;
80
87
  signature: string;
81
- hashKey: string;
88
+ password: string;
82
89
  message: string;
83
90
  clientAuthPubKey: string;
84
91
  encryptedSeedPhrase: Encrypted;
@@ -93,7 +100,7 @@ export declare type ConvertMnemonicSeedPhraseResponse = {
93
100
  };
94
101
  export declare type RecoverWalletRequest = {
95
102
  clientAuthPubKey: string;
96
- newHashKey: string;
103
+ newPassword: string;
97
104
  seedPhrase: string;
98
105
  };
99
106
  export declare type RecoverWalletResponse = {
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "wallaby-cash",
3
- "version": "1.3.2",
3
+ "version": "1.3.4",
4
4
  "license": "MIT",
5
- "repository": "https://github.com/republic-crypto/ncw-sdk-js.git",
5
+ "repository": "https://github.com/WALLABY-WaaS/wallaby-sdk-js",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.esm.js",
8
8
  "exports": {
package/src/base.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import axios, { AxiosError } from 'axios';
2
- import { WallabyConfig, RequestMothod, RequestOptions, RequestRoute } from './types';
3
- import { getAccessToken } from './lib/utils/utils';
2
+ import { WallabyConfig, RequestMothod, RequestOptions, RequestRoute, SeedPhraseType } from './types';
3
+ import { getAccessToken, getEncryptedPrivateKey, getEncryptedSeedPhrase, getWallabyAuthPubKey } from './lib/utils/utils';
4
4
  import logger from './helpers/logger';
5
5
 
6
6
  export abstract class Base {
@@ -16,6 +16,18 @@ export abstract class Base {
16
16
  this.jwt = config.jwt;
17
17
  }
18
18
 
19
+ protected get device() {
20
+ return this.loadDeviceInformation();
21
+ }
22
+
23
+ private get settings() {
24
+ return {
25
+ apiKey: this.apiKey,
26
+ baseUrl: this.baseUrl,
27
+ env: process.env.NODE_ENV,
28
+ };
29
+ }
30
+
19
31
  protected async request<T>(route: RequestRoute, options?: RequestOptions): Promise<T | any> {
20
32
  try {
21
33
  let url;
@@ -24,7 +36,7 @@ export abstract class Base {
24
36
  } else {
25
37
  url = route.fullPath;
26
38
  }
27
- const headers = this.getRequestHeaders(route.accessTokenRequired);
39
+ const headers = this.getRequestHeaders(route.requiresAccessToken);
28
40
 
29
41
  const http = axios.create({
30
42
  url: url,
@@ -78,18 +90,38 @@ export abstract class Base {
78
90
  }
79
91
  }
80
92
 
81
- protected getRequestHeaders(accessTokenRequired: boolean) {
93
+ private getRequestHeaders(requiresAccessToken: boolean) {
82
94
  let headers: any = {
83
95
  'Content-Type': 'application/json',
84
- 'x-api-key': this.apiKey,
85
- 'x-client-jwt': this.jwt,
96
+ 'x-api-key': this.settings.apiKey,
97
+ 'x-client-jwt': this.device.authTokens.clientAuthToken,
86
98
  };
87
- if (accessTokenRequired && this.userId) {
99
+ if (requiresAccessToken && this.userId) {
88
100
  headers = {
89
101
  ...headers,
90
- Authorization: 'Bearer ' + getAccessToken(this.userId),
102
+ Authorization: 'Bearer ' + this.device.authTokens.accessToken,
91
103
  };
92
104
  }
93
105
  return headers;
94
106
  }
107
+
108
+ private loadDeviceInformation() {
109
+ return {
110
+ authTokens: {
111
+ accessToken: getAccessToken(this.userId),
112
+ clientAuthToken: this.jwt,
113
+ },
114
+ user: {
115
+ clientUserId: this.userId,
116
+ encryptedStandardSeedPhrase: getEncryptedSeedPhrase(this.userId, SeedPhraseType.Standard),
117
+ encryptedAlgorandSeedPhrase: getEncryptedSeedPhrase(this.userId, SeedPhraseType.Algorand),
118
+ wallabyUserId: undefined,
119
+ },
120
+ encrytionKeys: {
121
+ deviceEncryptedPrivateKey: getEncryptedPrivateKey(this.userId),
122
+ devicePublicKey: undefined, // initially this is undefined, because we don't have the decrypted private key yet
123
+ apiPublicKey: getWallabyAuthPubKey(this.userId),
124
+ },
125
+ };
126
+ }
95
127
  }
package/src/index.ts CHANGED
@@ -37,7 +37,7 @@ export default class Wallaby {
37
37
  /**
38
38
  * The `transactions` domain contains all transactions calls to Wallaby's APIs.
39
39
  */
40
- public readonly transactinos: Transactions;
40
+ public readonly transactions: Transactions;
41
41
 
42
42
  /**
43
43
  * @param {string} [config.apiKey] - The API key to use for Wallaby
@@ -51,7 +51,7 @@ export default class Wallaby {
51
51
  this.utils = new Utils(config);
52
52
  this.auth = new Auth(config);
53
53
  this.system = new System(config);
54
- this.transactinos = new Transactions(config);
54
+ this.transactions = new Transactions(config);
55
55
  }
56
56
  }
57
57
 
@@ -5,9 +5,8 @@ import {
5
5
  SignatureMessageRequest,
6
6
  SignatureMessageResponse,
7
7
  SignInRequest,
8
- SignInResponse,
8
+ AuthResponse,
9
9
  SignUpRequest,
10
- SignUpResponse,
11
10
  WallabyError,
12
11
  WallabyConfig,
13
12
  ClientAuthPubKeyRequest,
@@ -26,21 +25,21 @@ export class Auth extends Base {
26
25
  *
27
26
  * @public
28
27
  * @description The returned message will be used to authorize the user to sign operations
29
- * @param {string} hashKey
28
+ * @param {string} password
30
29
  * @param {string} userId
31
30
  * @returns {SignatureMessageResponse} The returned message will be used for sign up and sign in signature
32
31
  */
33
- async signatureMessage({ hashKey, userId }: SignatureMessageRequest): Promise<SignatureMessageResponse | undefined> {
32
+ async signatureMessage({ password, userId }: SignatureMessageRequest): Promise<SignatureMessageResponse | undefined> {
34
33
  try {
35
- if (!hashKey) {
36
- return undefined;
34
+ if (!password) {
35
+ throw new Error('Please provide a password');
37
36
  }
38
37
 
39
- let clientAuthPubKey = undefined;
40
- let decryptedClientAuthPrivKey = undefined;
38
+ let clientAuthPubKey;
39
+ let decryptedClientAuthPrivKey;
41
40
 
42
41
  // If local storage doesn't already have data for the user, we create new key pair and save it
43
- decryptedClientAuthPrivKey = Utils.getDecryptedPrivateKey(userId, hashKey);
42
+ decryptedClientAuthPrivKey = Utils.getDecryptedPrivateKey(userId, password);
44
43
  if (!decryptedClientAuthPrivKey) {
45
44
  const { publicKey, privateKey } = createIdentity();
46
45
  clientAuthPubKey = publicKey;
@@ -73,15 +72,15 @@ export class Auth extends Base {
73
72
  *
74
73
  * @public
75
74
  * @description Users will be able to sign in by providing a signature and message. Use the same key pair used on sign up'
76
- * @param {string} hashKey
75
+ * @param {string} password
77
76
  * @param {string} firstName
78
77
  * @param {string} lastName
79
78
  * @param {string} email
80
- * @returns {SignUpResponse}
79
+ * @returns { AuthResponse }
81
80
  */
82
- async signUp({ hashKey, firstName, lastName, email }: SignUpRequest): Promise<SignUpResponse | undefined> {
81
+ async signUp({ password, firstName, lastName, email }: SignUpRequest): Promise<AuthResponse | undefined> {
83
82
  try {
84
- const signatureMessage = await this.signatureMessage({ hashKey, userId: this.userId });
83
+ const signatureMessage = await this.signatureMessage({ password, userId: this.userId });
85
84
 
86
85
  if (!signatureMessage || signatureMessage.error) {
87
86
  throw new Error(signatureMessage?.error);
@@ -89,7 +88,7 @@ export class Auth extends Base {
89
88
 
90
89
  const { message, signature, decryptedClientAuthPrivKey, clientAuthPubKey } = signatureMessage;
91
90
 
92
- const response: SignUpResponse = await this.request(AuthRoutes.signUp, {
91
+ const response: AuthResponse = await this.request(AuthRoutes.signUp, {
93
92
  method: AuthRoutes.signUp.method,
94
93
  payload: { clientAuthPubKey, signature, message, firstName, lastName, email, externalUserId: this.userId },
95
94
  });
@@ -100,7 +99,7 @@ export class Auth extends Base {
100
99
  const { accessToken, user } = response;
101
100
  Utils.setAccessToken(this.userId, accessToken);
102
101
  Utils.setWallabyAuthPubKey(this.userId, user.wallabyAuthPubKey);
103
- Utils.setEncryptedPrivateKey(this.userId, decryptedClientAuthPrivKey, hashKey);
102
+ Utils.setEncryptedPrivateKey(this.userId, decryptedClientAuthPrivKey, password);
104
103
 
105
104
  return response;
106
105
  } catch (error) {
@@ -113,19 +112,19 @@ export class Auth extends Base {
113
112
  *
114
113
  * @public
115
114
  * @description Users will be able to sign in by providing a signature and message. Use the same key pair used on sign up'
116
- * @param {string} hashKey
115
+ * @param {string} password
117
116
  * @returns {SignInResponse}
118
117
  */
119
- async signIn({ hashKey }: SignInRequest): Promise<SignInResponse | undefined> {
118
+ async signIn({ password }: SignInRequest): Promise<AuthResponse | undefined> {
120
119
  try {
121
- const signatureMessage = await this.signatureMessage({ hashKey, userId: this.userId });
120
+ const signatureMessage = await this.signatureMessage({ password, userId: this.userId });
122
121
  if (!signatureMessage || signatureMessage.error) {
123
122
  throw new Error(signatureMessage?.error);
124
123
  }
125
124
 
126
125
  const { message, signature, clientAuthPubKey } = signatureMessage;
127
126
 
128
- const response: SignInResponse = await this.request(AuthRoutes.signIn, {
127
+ const response: AuthResponse = await this.request(AuthRoutes.signIn, {
129
128
  method: AuthRoutes.signUp.method,
130
129
  payload: { clientAuthPubKey, signature, message },
131
130
  });
@@ -137,6 +136,10 @@ export class Auth extends Base {
137
136
  const { accessToken, user } = response;
138
137
  const wallabyAuthPubKey = Utils.getWallabyAuthPubKey(this.userId);
139
138
 
139
+ if (wallabyAuthPubKey !== user.wallabyAuthPubKey) {
140
+ throw new Error('Wallaby Auth Public Key does not match the one stored in local storage');
141
+ }
142
+
140
143
  if (!wallabyAuthPubKey) {
141
144
  Utils.setWallabyAuthPubKey(this.userId, user.wallabyAuthPubKey);
142
145
  }
@@ -175,15 +178,15 @@ export class Auth extends Base {
175
178
 
176
179
  /**
177
180
  * @description Change user authentication public key
178
- * @param {string} hashKey
181
+ * @param {string} password
179
182
  * @param {string} userId
180
183
  * @returns {User} User object
181
184
  */
182
185
  async updateClientAuthPubKey({
183
- hashKey,
184
- }: Pick<ClientAuthPubKeyRequest, 'hashKey' | 'userId'>): Promise<ClientAuthPubKeyResponse | undefined> {
186
+ password,
187
+ }: Pick<ClientAuthPubKeyRequest, 'password' | 'userId'>): Promise<ClientAuthPubKeyResponse | undefined> {
185
188
  try {
186
- const signatureMessage = await this.signatureMessage({ hashKey, userId: this.userId });
189
+ const signatureMessage = await this.signatureMessage({ password, userId: this.userId });
187
190
  if (!signatureMessage || signatureMessage.error) {
188
191
  throw new Error(signatureMessage?.error);
189
192
  }
@@ -205,7 +208,7 @@ export class Auth extends Base {
205
208
  throw new Error(response.error);
206
209
  }
207
210
  // Updating private key from the newly generate key pair.
208
- Utils.setEncryptedPrivateKey(this.userId, privateKey, hashKey);
211
+ Utils.setEncryptedPrivateKey(this.userId, privateKey, password);
209
212
  return response;
210
213
  } catch (error) {
211
214
  logger('SDK::Auth::clientAuthPubKey::error', error);
@@ -221,5 +224,27 @@ export class Auth extends Base {
221
224
  * @returns {WallabyAuthPubKeyResponse} Returns user's Wallaby WallabyAuthPubKey
222
225
  */
223
226
  async getWallabyAuthPublicKey() {}
227
+
228
+ /**
229
+ * @description The user salt is used to double encrypt the seedphrase before being stored
230
+ * in local storage.
231
+ * @returns {string} Returns user's salt that is generated by Wallaby system
232
+ */
233
+ async getUserSalt(): Promise<string | undefined> {
234
+ try {
235
+ const response = await this.request(AuthRoutes.getUserSalt, {
236
+ method: AuthRoutes.getUserSalt.method,
237
+ payload: {},
238
+ });
239
+
240
+ if (!response || response.error) {
241
+ throw new Error();
242
+ }
243
+ return response.clientSalt;
244
+ } catch (error) {
245
+ logger('SDK::Auth::getUserSalt::error', error);
246
+ return Promise.reject(error);
247
+ }
248
+ }
224
249
  }
225
250
  1;
@@ -66,7 +66,7 @@ export class Transactions extends Base {
66
66
  * @param {string} assetId
67
67
  * @param {string} reference
68
68
  * @param {string} memo
69
- * @param {string} hashKey
69
+ * @param {string} password
70
70
  * @returns {TransferResponse} Transaction object which contains the transaction hash and status
71
71
  */
72
72
  async transfer({
@@ -76,10 +76,10 @@ export class Transactions extends Base {
76
76
  assetId,
77
77
  reference,
78
78
  memo,
79
- hashKey,
79
+ password,
80
80
  }: TransferRequest): Promise<TransferResponse | undefined> {
81
81
  try {
82
- const signatureMessage = await this.auth.signatureMessage({ hashKey, userId: this.userId });
82
+ const signatureMessage = await this.auth.signatureMessage({ password, userId: this.userId });
83
83
 
84
84
  if (!signatureMessage || signatureMessage.error) {
85
85
  throw new Error(signatureMessage?.error);
@@ -133,7 +133,7 @@ export class Transactions extends Base {
133
133
  transactionHash: string;
134
134
  reference: string;
135
135
  blockchain: BlockchainName;
136
- hashKey: string;
136
+ password: string;
137
137
  }): Promise<TransactionStatusResponse | undefined> {
138
138
  try {
139
139
  const response = await this.request(TransactionsRoutes.getTransaction, {
@@ -197,7 +197,7 @@ export class Transactions extends Base {
197
197
  /**
198
198
  *
199
199
  * @public
200
- * @param {string} hashKey
200
+ * @param {string} password
201
201
  * @param {string} ownerAddress
202
202
  * @param {string} spenderAddress
203
203
  * @param {string} amount
@@ -209,7 +209,7 @@ export class Transactions extends Base {
209
209
  *
210
210
  */
211
211
  async createAllowance({
212
- hashKey,
212
+ password,
213
213
  ownerAddress,
214
214
  spenderAddress,
215
215
  amount,
@@ -219,7 +219,7 @@ export class Transactions extends Base {
219
219
  memo,
220
220
  }: CreateAllowanceRequest): Promise<{ transaction: Transaction } | undefined> {
221
221
  try {
222
- const signatureMessage = await this.auth.signatureMessage({ hashKey, userId: this.userId });
222
+ const signatureMessage = await this.auth.signatureMessage({ password, userId: this.userId });
223
223
 
224
224
  if (!signatureMessage || signatureMessage.error) {
225
225
  throw new Error(signatureMessage?.error);