wallaby-cash 2.2.1-alpha.3 → 2.2.1

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.
@@ -1,6 +1,6 @@
1
1
  import { Base } from '../../base';
2
- import { WallabyConfig, BlockchainName, TokenStandard, FeeEstimatesResponse, Transaction, TransactionStatusResponse, TransferRequest } from '../../types';
3
- import { CreateAllowanceRequest } from '../../types';
2
+ import { WallabyConfig, TokenStandard, FeeEstimatesResponse, Transaction, BlockchainName, GetPendingTransactionsRequest, GetPendingTransactionsResponse, ResolvePendingTransactionRequest, ResolvePendingTransactionResponse } from '../../types';
3
+ import { CreateAllowanceRequest, TransactionStatusResponse, TransferRequest } from '../../types';
4
4
  import { FeeEstimateRequest } from './transactions.model';
5
5
  export declare class Transactions extends Base {
6
6
  private authService;
@@ -83,6 +83,26 @@ export declare class Transactions extends Base {
83
83
  createAllowance({ authenticationOptions, walletId, ownerAddress, spenderAddress, amount, assetId, suiObjectId, contractAddress, chainName, assetSymbol, reference, memo, }: CreateAllowanceRequest): Promise<{
84
84
  transaction: Transaction;
85
85
  }>;
86
+ /**
87
+ *
88
+ * @public
89
+ * @param {string} walletId
90
+ * @param {BlockchainName} chainName
91
+ * @returns {Promise<GetPendingTransactionsResponse>}
92
+ */
93
+ getPendingTransactions({ walletId, chainName }: GetPendingTransactionsRequest): Promise<GetPendingTransactionsResponse>;
94
+ /**
95
+ *
96
+ * @public
97
+ * @param {string} id
98
+ * @param {ResolvePendingTransactionDecision} choice
99
+ * @param {number} symbol
100
+ * @param {string} chainName
101
+ * @param {string} walletId
102
+ * @param {AuthResponse} authenticationOptions
103
+ * @returns {ResolvePendingTransactionResponse}
104
+ */
105
+ resolvePendingTransaction({ id, choice, symbol, chainName, walletId, authenticationOptions, }: ResolvePendingTransactionRequest): Promise<ResolvePendingTransactionResponse>;
86
106
  /**
87
107
  * Prepares authentication data and encrypted payload for transaction requests
88
108
  * @private
@@ -162,7 +162,7 @@ export declare class WalletService extends Base {
162
162
  */
163
163
  addNewDevice(input: AddNewDeviceRequest): Promise<{
164
164
  success: boolean;
165
- reference: any;
165
+ reference: string;
166
166
  }>;
167
167
  generateWalletAddresses(input: {
168
168
  walletId: string;
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wallaby-cash",
3
- "version": "2.2.1-alpha.3",
3
+ "version": "2.2.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git@github.com:WALLABY-WaaS/wallaby-sdk-js.git"
@@ -117,6 +117,7 @@
117
117
  "uuid": "^10.0.0"
118
118
  },
119
119
  "overrides": {
120
+ "js-yaml": "^4.1.1",
120
121
  "pbkdf2": "^3.1.3",
121
122
  "esbuild": "^0.25.0",
122
123
  "brace-expansion": "^2.0.2",
@@ -30,4 +30,14 @@ export declare const TransactionsRoutes: {
30
30
  method: RequestMethod;
31
31
  requiresAccessToken: boolean;
32
32
  };
33
+ getPendingTransactions: {
34
+ fullPath: string;
35
+ method: RequestMethod;
36
+ requiresAccessToken: boolean;
37
+ };
38
+ confirmPendingTransaction: {
39
+ fullPath: string;
40
+ method: RequestMethod;
41
+ requiresAccessToken: boolean;
42
+ };
33
43
  };
@@ -83,7 +83,7 @@ export declare type SignatureMessageResponse = {
83
83
  message: string;
84
84
  hashedMessage: string;
85
85
  signature: string;
86
- challenge?: Base64URLString;
86
+ challenge: Base64URLString;
87
87
  authenticationOptions?: PublicKeyCredentialRequestOptionsJSON;
88
88
  registrationOptions?: PublicKeyCredentialCreationOptionsJSON;
89
89
  };
@@ -21,9 +21,6 @@ export declare class WallabyError extends Error {
21
21
  data?: any;
22
22
  status?: number;
23
23
  cause?: unknown;
24
- /** Callback function to be executed on error.
25
- * Not tested yet.
26
- */
27
24
  onError?: () => void;
28
25
  constructor(errorPayload: {
29
26
  message: string;
@@ -33,7 +30,7 @@ export declare class WallabyError extends Error {
33
30
  cause?: unknown;
34
31
  onError?: () => void;
35
32
  });
36
- static isWallabyError(obj: unknown): obj is WallabyError;
33
+ static isWallabyError(error: any): error is WallabyError;
37
34
  }
38
35
  export declare type PasswordValidatorResponse = {
39
36
  valid: boolean;
@@ -1,6 +1,7 @@
1
1
  import { AssetConfig, BlockchainName, BlockchainSlip44, Encrypted, OwnershipType, TokenStandard, User } from './common';
2
2
  import { Merchant } from './merchants';
3
3
  import { AuthenticationResponse } from './auth';
4
+ import { CreateAllowanceTransactionData } from '../generated/api';
4
5
  export declare type Transaction = {
5
6
  id: string;
6
7
  reference: string;
@@ -111,11 +112,7 @@ export declare type CreateAllowanceRequestWithAmends = Omit<CreateAllowanceReque
111
112
  encryptedSeed?: CreateAllowanceRequest['encryptedSeed'];
112
113
  encryptedShares?: CreateAllowanceRequest['encryptedShares'];
113
114
  };
114
- export declare type TransactionResponse = {
115
- transaction: Transaction;
116
- /** @deprecated */
117
- error?: any;
118
- };
115
+ export declare type TransactionResponse = CreateAllowanceTransactionData;
119
116
  export declare type TransactionStatusResponse = {
120
117
  status: TransactionStatus;
121
118
  transactionHash: string;
@@ -148,3 +145,39 @@ export declare enum TransactionEntryType {
148
145
  OUTGOING = "OUTGOING",
149
146
  UNKNOWN = "UNKNOWN"
150
147
  }
148
+ export declare type GetPendingTransactionsRequest = {
149
+ chainName?: BlockchainName;
150
+ walletId: string;
151
+ };
152
+ export declare type PendingTransactionType = {
153
+ id: string;
154
+ amount: string;
155
+ sender: string;
156
+ asset: AssetConfig;
157
+ expires?: string;
158
+ };
159
+ export declare type GetPendingTransactionsResponse = {
160
+ transactions: PendingTransactionType[];
161
+ };
162
+ export declare enum ResolvePendingTransactionDecision {
163
+ APPROVE = "approve",
164
+ DENY = "deny"
165
+ }
166
+ export declare enum ResolvedPendingTransactionStatus {
167
+ CONFIRMED = "confirmed",
168
+ DENIED = "denied"
169
+ }
170
+ export declare type ResolvePendingTransactionRequest = {
171
+ id: string;
172
+ choice: ResolvePendingTransactionDecision;
173
+ symbol: string;
174
+ chainName: BlockchainName;
175
+ walletId: string;
176
+ authenticationOptions: AuthenticationResponse;
177
+ };
178
+ export declare type ResolvePendingTransactionResponse = {
179
+ id: string;
180
+ hash?: string;
181
+ status: ResolvedPendingTransactionStatus;
182
+ asset?: AssetConfig;
183
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wallaby-cash",
3
- "version": "2.2.1-alpha.3",
3
+ "version": "2.2.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git@github.com:WALLABY-WaaS/wallaby-sdk-js.git"
@@ -117,6 +117,7 @@
117
117
  "uuid": "^10.0.0"
118
118
  },
119
119
  "overrides": {
120
+ "js-yaml": "^4.1.1",
120
121
  "pbkdf2": "^3.1.3",
121
122
  "esbuild": "^0.25.0",
122
123
  "brace-expansion": "^2.0.2",