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
|
@@ -10,7 +10,7 @@ export declare class AuthService extends Base {
|
|
|
10
10
|
* This method is used to check if the user is on a device that supports PRF.
|
|
11
11
|
* @returns {boolean} Returns true if the user is authenticated, false otherwise.
|
|
12
12
|
*/
|
|
13
|
-
isDevicePrfCompatible(): Promise<
|
|
13
|
+
isDevicePrfCompatible(): Promise<boolean>;
|
|
14
14
|
/**
|
|
15
15
|
* @description Checks the current user Wallaby Access Token.
|
|
16
16
|
* @returns { boolean } Returns true if the user is authenticated, false otherwise.
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
* React Native will use authenticator.native.ts instead due to the .native.ts extension.
|
|
8
8
|
*/
|
|
9
9
|
import * as WebAuthn from '@simplewebauthn/browser';
|
|
10
|
-
import { IAuthenticator } from './passkey.model';
|
|
10
|
+
import { IAuthenticator, StartAuthenticationOpts, StartRegistrationOpts } from './passkey.model';
|
|
11
11
|
export declare class Authenticator implements IAuthenticator {
|
|
12
12
|
constructor();
|
|
13
|
-
register({ optionsJSON }:
|
|
14
|
-
authenticate({ optionsJSON, useBrowserAutofill, skipUserVerification, }:
|
|
13
|
+
register({ optionsJSON }: StartRegistrationOpts): Promise<WebAuthn.RegistrationResponseJSON>;
|
|
14
|
+
authenticate({ optionsJSON, useBrowserAutofill, skipUserVerification, }: StartAuthenticationOpts & {
|
|
15
15
|
skipUserVerification?: boolean;
|
|
16
16
|
}): Promise<WebAuthn.AuthenticationResponseJSON>;
|
|
17
17
|
/**
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React Native Authenticator Implementation
|
|
3
|
+
*
|
|
4
|
+
* This file contains the native-specific authenticator logic for iOS and Android.
|
|
5
|
+
* It's automatically picked up by React Native Metro bundler when importing './authenticator'
|
|
6
|
+
*
|
|
7
|
+
* https://reactnative.dev/docs/platform-specific-code#native-specific-extensions-ie-sharing-code-with-nodejs-and-web
|
|
8
|
+
*/
|
|
9
|
+
import * as NativeWebAuthn from 'react-native-passkey';
|
|
10
|
+
import { AuthenticationResponseJSON, RegistrationResponseJSON } from '../../types';
|
|
11
|
+
import { IAuthenticator, StartAuthenticationOpts, StartRegistrationOpts } from './passkey.model';
|
|
12
|
+
export declare enum AuthenticatorTransport {
|
|
13
|
+
usb = "usb",
|
|
14
|
+
nfc = "nfc",
|
|
15
|
+
ble = "ble",
|
|
16
|
+
smartCard = "smart-card",
|
|
17
|
+
hybrid = "hybrid",
|
|
18
|
+
internal = "internal"
|
|
19
|
+
}
|
|
20
|
+
export declare class Authenticator implements IAuthenticator {
|
|
21
|
+
private platform;
|
|
22
|
+
constructor();
|
|
23
|
+
register({ optionsJSON }: StartRegistrationOpts): Promise<RegistrationResponseJSON>;
|
|
24
|
+
authenticate({ optionsJSON }: StartAuthenticationOpts): Promise<AuthenticationResponseJSON>;
|
|
25
|
+
/**
|
|
26
|
+
* @description Handles the passkey error and throws a user-friendly error message.
|
|
27
|
+
* @param {WebAuthnError | PasskeyError | Error | any} error
|
|
28
|
+
* @returns {Error} The error message.
|
|
29
|
+
*/
|
|
30
|
+
handlePasskeyError(error: NativeWebAuthn.PasskeyError | Error | any): void;
|
|
31
|
+
private throwPasskeyError;
|
|
32
|
+
private mapPasskeyCreationPayload;
|
|
33
|
+
private mapPasskeyCreationResponse;
|
|
34
|
+
private mapPasskeyAuthenticationResponse;
|
|
35
|
+
private mapPasskeyAuthenticationPayload;
|
|
36
|
+
}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { AuthenticationResponseJSON, PublicKeyCredentialCreationOptionsJSON, PublicKeyCredentialRequestOptionsJSON, RegistrationResponseJSON } from '../../types';
|
|
2
|
+
export type StartRegistrationOpts = {
|
|
3
|
+
optionsJSON: PublicKeyCredentialCreationOptionsJSON;
|
|
4
|
+
};
|
|
5
|
+
export type StartAuthenticationOpts = {
|
|
6
|
+
optionsJSON: PublicKeyCredentialRequestOptionsJSON;
|
|
7
|
+
useBrowserAutofill?: boolean;
|
|
8
|
+
};
|
|
2
9
|
export interface IAuthenticator {
|
|
3
|
-
register: ({ optionsJSON }:
|
|
4
|
-
authenticate: ({ optionsJSON }:
|
|
10
|
+
register: ({ optionsJSON }: StartRegistrationOpts) => Promise<RegistrationResponseJSON> | void;
|
|
11
|
+
authenticate: ({ optionsJSON }: StartAuthenticationOpts) => Promise<AuthenticationResponseJSON> | void;
|
|
5
12
|
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { AsymmetricKeyPair, Encrypted, SignatureMessageResponse, AuthenticationResponse, RequestOptions, RequestRoute } from '../../types';
|
|
2
|
+
import { StorageService } from '../utils/storage.service';
|
|
3
|
+
import { AuthService } from './auth.service';
|
|
4
|
+
export declare class PasskeyService {
|
|
5
|
+
private cipher;
|
|
6
|
+
private localStorageService;
|
|
7
|
+
private userId;
|
|
8
|
+
private request;
|
|
9
|
+
private authenticator;
|
|
10
|
+
constructor(userId: string, storageService: StorageService, request: <T = any>(route: RequestRoute, options?: RequestOptions) => Promise<T>);
|
|
11
|
+
private preparePasskeyRequestOptions;
|
|
12
|
+
private preparePasskeyCreationOptions;
|
|
13
|
+
/**
|
|
14
|
+
* @description Adds a new passkey to the user's account on that device.
|
|
15
|
+
* @param { AsymmetricKeyPair } deviceKeyPair
|
|
16
|
+
* @param { SignatureMessageResponse } challengeResponse
|
|
17
|
+
* @returns { AuthenticationResponse } The authentication response containing the access token and user information.
|
|
18
|
+
*/
|
|
19
|
+
addNewPasskey({ deviceKeyPair, getSignature, }: {
|
|
20
|
+
deviceKeyPair: AsymmetricKeyPair;
|
|
21
|
+
getSignature: AuthService['getSignature'];
|
|
22
|
+
}): Promise<AuthenticationResponse>;
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @description Authenticates the user using a passkey.
|
|
26
|
+
* @param { AsymmetricKeyPair } deviceKeyPair
|
|
27
|
+
* @param { SignatureMessageResponse } challengeResponse
|
|
28
|
+
* @returns { AuthResponse } The authentication response containing the access token and user information.
|
|
29
|
+
*/
|
|
30
|
+
authenticate({ deviceKeyPair, challengeResponse, }: {
|
|
31
|
+
deviceKeyPair: Pick<AsymmetricKeyPair, 'publicKey'> & {
|
|
32
|
+
encryptedDevicePrivateKey?: Encrypted;
|
|
33
|
+
decryptedPrivateKey?: string;
|
|
34
|
+
};
|
|
35
|
+
challengeResponse: SignatureMessageResponse;
|
|
36
|
+
}): Promise<AuthenticationResponse>;
|
|
37
|
+
private getDeviceSignature;
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
* @description Registers a new passkey for the user.
|
|
41
|
+
* @param { AsymmetricKeyPair } deviceKeyPair
|
|
42
|
+
* @param { SignatureMessageResponse } challengeResponse
|
|
43
|
+
* @returns { AuthenticationResponse } The authentication response containing the access token and user information.
|
|
44
|
+
*/
|
|
45
|
+
register({ deviceKeyPair, challengeResponse, }: {
|
|
46
|
+
deviceKeyPair: AsymmetricKeyPair;
|
|
47
|
+
challengeResponse: SignatureMessageResponse;
|
|
48
|
+
}): Promise<AuthenticationResponse>;
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
* @description Checks if the device is compatible with the PRF extension.
|
|
52
|
+
* @returns {boolean} Returns true if the device is compatible with PRF extension, false otherwise.
|
|
53
|
+
*/
|
|
54
|
+
isDevicePrfCompatible(): Promise<any>;
|
|
55
|
+
/**
|
|
56
|
+
*
|
|
57
|
+
* @description Retrieves the passkey credential stored on the device.
|
|
58
|
+
* @returns {Promise<AuthenticationResponseJSON | RegistrationResponseJSON>} The passkey credential stored on the device.
|
|
59
|
+
*/
|
|
60
|
+
publicKeyCredential(): Promise<any>;
|
|
61
|
+
/**
|
|
62
|
+
*
|
|
63
|
+
* @description Stores the encrypted device private key, public key, and authentication response in local storage.
|
|
64
|
+
* @param {AuthResponse} AuthenticationResponse
|
|
65
|
+
* @param { AsymmetricKeyPair } deviceKeyPair
|
|
66
|
+
* @returns {Promise<void>}
|
|
67
|
+
*/
|
|
68
|
+
private handleStoringData;
|
|
69
|
+
/**
|
|
70
|
+
*
|
|
71
|
+
* @description Handles the creation of credentials from the PRF extension.
|
|
72
|
+
* @param {AuthenticationResponseJSON | RegistrationResponseJSON} passkeyCredential
|
|
73
|
+
* @returns {Promise<AsymmetricKeyPair>} The credentials key pair.
|
|
74
|
+
*/
|
|
75
|
+
private handleCredentialsCreationFromPrfExtension;
|
|
76
|
+
}
|
|
@@ -1,76 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { StorageService } from '../utils/storage.service';
|
|
3
|
-
import { AuthService } from './auth.service';
|
|
4
|
-
export declare class PasskeyService {
|
|
5
|
-
private cipher;
|
|
6
|
-
private localStorageService;
|
|
7
|
-
private userId;
|
|
8
|
-
private request;
|
|
9
|
-
private authenticator;
|
|
10
|
-
constructor(userId: string, storageService: StorageService, request: <T = any>(route: RequestRoute, options?: RequestOptions) => Promise<T>);
|
|
11
|
-
private preparePasskeyRequestOptions;
|
|
12
|
-
private preparePasskeyCreationOptions;
|
|
13
|
-
/**
|
|
14
|
-
* @description Adds a new passkey to the user's account on that device.
|
|
15
|
-
* @param { AsymmetricKeyPair } deviceKeyPair
|
|
16
|
-
* @param { SignatureMessageResponse } challengeResponse
|
|
17
|
-
* @returns { AuthenticationResponse } The authentication response containing the access token and user information.
|
|
18
|
-
*/
|
|
19
|
-
addNewPasskey({ deviceKeyPair, getSignature, }: {
|
|
20
|
-
deviceKeyPair: AsymmetricKeyPair;
|
|
21
|
-
getSignature: AuthService['getSignature'];
|
|
22
|
-
}): Promise<AuthenticationResponse>;
|
|
23
|
-
/**
|
|
24
|
-
*
|
|
25
|
-
* @description Authenticates the user using a passkey.
|
|
26
|
-
* @param { AsymmetricKeyPair } deviceKeyPair
|
|
27
|
-
* @param { SignatureMessageResponse } challengeResponse
|
|
28
|
-
* @returns { AuthResponse } The authentication response containing the access token and user information.
|
|
29
|
-
*/
|
|
30
|
-
authenticate({ deviceKeyPair, challengeResponse, }: {
|
|
31
|
-
deviceKeyPair: Pick<AsymmetricKeyPair, 'publicKey'> & {
|
|
32
|
-
encryptedDevicePrivateKey?: Encrypted;
|
|
33
|
-
decryptedPrivateKey?: string;
|
|
34
|
-
};
|
|
35
|
-
challengeResponse: SignatureMessageResponse;
|
|
36
|
-
}): Promise<AuthenticationResponse>;
|
|
37
|
-
private getDeviceSignature;
|
|
38
|
-
/**
|
|
39
|
-
*
|
|
40
|
-
* @description Registers a new passkey for the user.
|
|
41
|
-
* @param { AsymmetricKeyPair } deviceKeyPair
|
|
42
|
-
* @param { SignatureMessageResponse } challengeResponse
|
|
43
|
-
* @returns { AuthenticationResponse } The authentication response containing the access token and user information.
|
|
44
|
-
*/
|
|
45
|
-
register({ deviceKeyPair, challengeResponse, }: {
|
|
46
|
-
deviceKeyPair: AsymmetricKeyPair;
|
|
47
|
-
challengeResponse: SignatureMessageResponse;
|
|
48
|
-
}): Promise<AuthenticationResponse>;
|
|
49
|
-
/**
|
|
50
|
-
*
|
|
51
|
-
* @description Checks if the device is compatible with the PRF extension.
|
|
52
|
-
* @returns {boolean} Returns true if the device is compatible with PRF extension, false otherwise.
|
|
53
|
-
*/
|
|
54
|
-
isDevicePrfCompatible(): Promise<any>;
|
|
55
|
-
/**
|
|
56
|
-
*
|
|
57
|
-
* @description Retrieves the passkey credential stored on the device.
|
|
58
|
-
* @returns {Promise<AuthenticationResponseJSON | RegistrationResponseJSON>} The passkey credential stored on the device.
|
|
59
|
-
*/
|
|
60
|
-
publicKeyCredential(): Promise<any>;
|
|
61
|
-
/**
|
|
62
|
-
*
|
|
63
|
-
* @description Stores the encrypted device private key, public key, and authentication response in local storage.
|
|
64
|
-
* @param {AuthResponse} AuthenticationResponse
|
|
65
|
-
* @param { AsymmetricKeyPair } deviceKeyPair
|
|
66
|
-
* @returns {Promise<void>}
|
|
67
|
-
*/
|
|
68
|
-
private handleStoringData;
|
|
69
|
-
/**
|
|
70
|
-
*
|
|
71
|
-
* @description Handles the creation of credentials from the PRF extension.
|
|
72
|
-
* @param {AuthenticationResponseJSON | RegistrationResponseJSON} passkeyCredential
|
|
73
|
-
* @returns {Promise<AsymmetricKeyPair>} The credentials key pair.
|
|
74
|
-
*/
|
|
75
|
-
private handleCredentialsCreationFromPrfExtension;
|
|
76
|
-
}
|
|
1
|
+
export { PasskeyService } from './passkey.service.base';
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Base } from '../../base';
|
|
2
|
+
import { WallabyConfig, SwapQuoteRequest, SwapQuoteResponse, ExecuteSwapRequest, ExecuteSwapResponse, GetSwapsRequest, GetSwapsResponse } from '../../types';
|
|
3
|
+
export declare class Swap extends Base {
|
|
4
|
+
private authService;
|
|
5
|
+
private walletService;
|
|
6
|
+
constructor(config: WallabyConfig);
|
|
7
|
+
/**
|
|
8
|
+
* Gets a swap quote between two assets (from/to), including fees, min output, and slippage limits.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
* @param {SwapQuoteRequest} request - The swap quote request parameters
|
|
12
|
+
* @returns {Promise<SwapQuoteResponse>} A promise that resolves with the swap quote
|
|
13
|
+
*/
|
|
14
|
+
getQuote({ walletId, fromAsset, toAsset, fromAmount, toAmount }: SwapQuoteRequest): Promise<SwapQuoteResponse>;
|
|
15
|
+
/**
|
|
16
|
+
* Executes a swap using a previously generated quote.
|
|
17
|
+
*
|
|
18
|
+
* @public
|
|
19
|
+
* @param {ExecuteSwapRequest} request - The execute swap request parameters
|
|
20
|
+
* @returns {Promise<ExecuteSwapResponse>} A promise that resolves with the swap execution response
|
|
21
|
+
*/
|
|
22
|
+
executeSwap({ walletId, quoteId, authenticationOptions }: ExecuteSwapRequest): Promise<ExecuteSwapResponse>;
|
|
23
|
+
/**
|
|
24
|
+
* Lists executed swap transactions for a given wallet, with optional date and pagination filters.
|
|
25
|
+
*
|
|
26
|
+
* @public
|
|
27
|
+
* @param {GetSwapsRequest} request - The get swaps request parameters
|
|
28
|
+
* @returns {Promise<GetSwapsResponse>} A promise that resolves with the list of swaps
|
|
29
|
+
*/
|
|
30
|
+
getSwaps({ walletId, queryParams }: GetSwapsRequest): Promise<GetSwapsResponse>;
|
|
31
|
+
/**
|
|
32
|
+
* Prepares authentication data and encrypted payload for swap requests
|
|
33
|
+
* @private
|
|
34
|
+
*/
|
|
35
|
+
private prepareSwapAuth;
|
|
36
|
+
}
|
|
@@ -5,10 +5,13 @@ export declare class System extends Base {
|
|
|
5
5
|
/**
|
|
6
6
|
* @public
|
|
7
7
|
* Get all supported chains
|
|
8
|
-
* @param {
|
|
8
|
+
* @param {Object} [options] - Optional query parameters
|
|
9
|
+
* @param {boolean} [options.supportSwaps] - When true, include only chains that support swaps
|
|
9
10
|
* @returns {Array<Blockchain>} Array of supported chains
|
|
10
11
|
*/
|
|
11
|
-
getSupportedBlockchains(
|
|
12
|
+
getSupportedBlockchains(options?: {
|
|
13
|
+
supportSwaps?: boolean;
|
|
14
|
+
}): Promise<Array<Blockchain> | undefined>;
|
|
12
15
|
/**
|
|
13
16
|
* Validates the contract address or SUI object ID for a given blockchain.
|
|
14
17
|
*
|
|
@@ -57,10 +60,17 @@ export declare class System extends Base {
|
|
|
57
60
|
/**
|
|
58
61
|
* @public
|
|
59
62
|
* Get all supported assets configuration
|
|
60
|
-
* @param {
|
|
63
|
+
* @param {Object} [options] - Optional query parameters
|
|
64
|
+
* @param {boolean} [options.supportsSwaps] - When true, filter to assets that support swaps
|
|
65
|
+
* @param {string} [options.search] - Search assets by name or symbol (minimum 3 characters)
|
|
66
|
+
* @param {BlockchainName} [options.chainName] - Filter assets by blockchain name
|
|
61
67
|
* @returns {Array<AssetConfig>} Array of supported tokens
|
|
62
68
|
*/
|
|
63
|
-
getSupportedTokens(
|
|
69
|
+
getSupportedTokens(options?: {
|
|
70
|
+
supportsSwaps?: boolean;
|
|
71
|
+
search?: string;
|
|
72
|
+
chainName?: BlockchainName;
|
|
73
|
+
}): Promise<AssetConfig[] | undefined>;
|
|
64
74
|
/**
|
|
65
75
|
* @public
|
|
66
76
|
* @param {string} userId
|
|
@@ -59,9 +59,10 @@ export declare class Transactions extends Base {
|
|
|
59
59
|
* @param {string} reference
|
|
60
60
|
* @param {AuthenticationResponse} authenticationOptions
|
|
61
61
|
* @param {string} memo
|
|
62
|
+
* @param {TransactionType} transactionType
|
|
62
63
|
* @returns {TransactionResponse}
|
|
63
64
|
*/
|
|
64
|
-
transfer({ originAddress, recipientAddress, amount, assetId, walletId, reference, authenticationOptions, memo, }: TransferRequest): Promise<TransactionResponse>;
|
|
65
|
+
transfer({ originAddress, recipientAddress, amount, assetId, walletId, reference, authenticationOptions, memo, transactionType, }: TransferRequest): Promise<TransactionResponse>;
|
|
65
66
|
/**
|
|
66
67
|
*
|
|
67
68
|
* @public
|
|
@@ -74,10 +75,11 @@ export declare class Transactions extends Base {
|
|
|
74
75
|
* @param {string} suiObjectId
|
|
75
76
|
* @param {string} reference
|
|
76
77
|
* @param {string} memo
|
|
78
|
+
* @param {TransactionType} transactionType
|
|
77
79
|
* @returns {CreateAllowanceResponse}
|
|
78
80
|
*
|
|
79
81
|
*/
|
|
80
|
-
createAllowance({ authenticationOptions, walletId, ownerAddress, spenderAddress, amount, assetId, suiObjectId, contractAddress, chainName, assetSymbol, reference, memo, }: CreateAllowanceRequest): Promise<TransactionResponse>;
|
|
82
|
+
createAllowance({ authenticationOptions, walletId, ownerAddress, spenderAddress, amount, assetId, suiObjectId, contractAddress, chainName, assetSymbol, reference, memo, transactionType, }: CreateAllowanceRequest): Promise<TransactionResponse>;
|
|
81
83
|
/**
|
|
82
84
|
*
|
|
83
85
|
* @public
|
|
@@ -27,7 +27,7 @@ export declare const MASTER_ENCRYPTION_KEY = "9fa9d3f3c77c20d3a50a08e5299644be29
|
|
|
27
27
|
In particular, RS256 is necessary for compatibility with Microsoft Windows platform authenticators.
|
|
28
28
|
ES256 is a widely supported algorithm and is compatible with most other platform authenticators and roaming authenticators.
|
|
29
29
|
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.
|
|
30
|
-
|
|
30
|
+
|
|
31
31
|
https://chromium.googlesource.com/chromium/src/+/main/content/browser/webauth/pub_key_cred_params.md
|
|
32
32
|
*/
|
|
33
33
|
export declare const PUBLIC_KEY_CREDENTIAL_PARAM: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Base } from '../../base';
|
|
2
|
-
import { AddTokenToWalletRequest, BlockchainName, QueryUserRequest, QueryWalletRequest, TokenBalanceRequest, UpdateAssetRequest, WallabyConfig, WalletAddressesInfoEntry, AuthenticationResponse, AddTokenToWalletResponse, TokenBalanceResponse } from '../../types';
|
|
3
|
-
import { FetchBalanceData, GetAllWalletsFromUserIdData, GetAssetsByUserIdData, GetUserAssetsByWalletIdData
|
|
2
|
+
import { AddTokenToWalletRequest, BlockchainName, QueryUserRequest, QueryWalletRequest, TokenBalanceRequest, UpdateAssetRequest, WallabyConfig, WalletAddressesInfoEntry, AuthenticationResponse, AddTokenToWalletResponse, TokenBalanceResponse, TokenBalance, UpdateAssetResponse } from '../../types';
|
|
3
|
+
import { FetchBalanceData, GetAllWalletsFromUserIdData, GetAssetsByUserIdData, GetUserAssetsByWalletIdData } from '../../generated/api';
|
|
4
4
|
export declare class WalletDataService extends Base {
|
|
5
5
|
private walletService;
|
|
6
6
|
constructor(config: WallabyConfig);
|
|
@@ -18,9 +18,9 @@ export declare class WalletDataService extends Base {
|
|
|
18
18
|
* @param { string } address Wallet address
|
|
19
19
|
* @param { string } symbol Token symbol
|
|
20
20
|
* @param { BlockchainName } chainName the chain name enum. i.e. 'ETHEREUM', 'BITCOIN'
|
|
21
|
-
* @returns {
|
|
21
|
+
* @returns { TokenBalance } Balance of the token
|
|
22
22
|
*/
|
|
23
|
-
getTokenBalance({ address, symbol, tokenStandard, chainName }: TokenBalanceRequest): Promise<
|
|
23
|
+
getTokenBalance({ address, symbol, tokenStandard, chainName }: TokenBalanceRequest): Promise<TokenBalance>;
|
|
24
24
|
/**
|
|
25
25
|
*
|
|
26
26
|
* @public
|
|
@@ -62,6 +62,8 @@ export declare class WalletDataService extends Base {
|
|
|
62
62
|
* Get all assets that exist in a certain wallet, by specifying a wallet ID
|
|
63
63
|
* @param walletId Wallaby's wallet ID
|
|
64
64
|
* @param { BasicQueryOptions } queryOptions Optional query options
|
|
65
|
+
* @param { string } [queryOptions.search] - Search assets by name or symbol (minimum 3 characters)
|
|
66
|
+
* @param { BlockchainName } [queryOptions.chainName] - Filter assets by blockchain name
|
|
65
67
|
* @returns { GetUserAssetsByWalletIdData } Returns all assets belonging in a certain wallet ID
|
|
66
68
|
*/
|
|
67
69
|
getWalletAssets({ walletId, queryOptions }: QueryWalletRequest): Promise<GetUserAssetsByWalletIdData>;
|
|
@@ -91,7 +93,7 @@ export declare class WalletDataService extends Base {
|
|
|
91
93
|
/**
|
|
92
94
|
* Updates a wallet asset.
|
|
93
95
|
*
|
|
94
|
-
* @param {string} params.
|
|
96
|
+
* @param {string} params.configId - Config ID for the user asset.
|
|
95
97
|
* @param {string} params.walletId - Wallet ID to which the asset belongs.
|
|
96
98
|
* @param {string} params.assetName - Asset name.
|
|
97
99
|
* @param {boolean} params.isVisible - Asset visibility toggle.
|
|
@@ -101,5 +103,5 @@ export declare class WalletDataService extends Base {
|
|
|
101
103
|
*
|
|
102
104
|
* @throws {Error} If required parameters are missing or invalid.
|
|
103
105
|
*/
|
|
104
|
-
updateAsset({
|
|
106
|
+
updateAsset({ configId, walletId, ...assetConfig }: UpdateAssetRequest): Promise<UpdateAssetResponse>;
|
|
105
107
|
}
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wallaby-cash",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git@github.com:WALLABY-WaaS/wallaby-sdk-js.git"
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"test:coverage": "NODE_ENV=test npm run test --coverage",
|
|
41
41
|
"test:watch": "NODE_ENV=test jest --watch",
|
|
42
42
|
"lint": "eslint .",
|
|
43
|
+
"lint:fix": "eslint . --fix",
|
|
43
44
|
"typecheck": "tsc --noEmit",
|
|
44
45
|
"audit-ci": "npx audit-ci@^7 --config audit-ci.jsonc",
|
|
45
46
|
"docs:serve": "docsify serve -p 3100 ./docsify",
|
|
@@ -67,12 +68,7 @@
|
|
|
67
68
|
"@rollup/plugin-replace": "^6.0.3",
|
|
68
69
|
"@rollup/plugin-terser": "^0.4.4",
|
|
69
70
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
70
|
-
"@
|
|
71
|
-
"@semantic-release/commit-analyzer": "^9.0.2",
|
|
72
|
-
"@semantic-release/git": "^10.0.1",
|
|
73
|
-
"@semantic-release/github": "^8.0.7",
|
|
74
|
-
"@semantic-release/npm": "^12.0.0",
|
|
75
|
-
"@semantic-release/release-notes-generator": "^11.0.1",
|
|
71
|
+
"@simplewebauthn/browser": "^13.2.2",
|
|
76
72
|
"@size-limit/preset-small-lib": "^11.2.0",
|
|
77
73
|
"@types/crypto-js": "^4.2.2",
|
|
78
74
|
"@types/jest": "^29.5.0",
|
|
@@ -90,12 +86,12 @@
|
|
|
90
86
|
"nock": "^13.5.6",
|
|
91
87
|
"nyc": "^17.1.0",
|
|
92
88
|
"prettier": "^3.3.3",
|
|
89
|
+
"react-native-passkey": "^3.3.2",
|
|
93
90
|
"rimraf": "^5.0.7",
|
|
94
91
|
"rollup": "^4.18.0",
|
|
95
92
|
"rollup-plugin-copy": "^3.5.0",
|
|
96
93
|
"rollup-plugin-filesize": "^10.0.0",
|
|
97
94
|
"rollup-plugin-polyfill-node": "^0.13.0",
|
|
98
|
-
"semantic-release": "^24.2.5",
|
|
99
95
|
"size-limit": "^8.2.4",
|
|
100
96
|
"swagger-typescript-api": "^13.2.10",
|
|
101
97
|
"ts-jest": "^29.2.5",
|
|
@@ -105,19 +101,34 @@
|
|
|
105
101
|
"underscore": "^1.13.7"
|
|
106
102
|
},
|
|
107
103
|
"dependencies": {
|
|
108
|
-
"@simplewebauthn/browser": "^13.1.0",
|
|
109
|
-
"axios": "^1.7.7",
|
|
110
104
|
"crypto-js": "4.2.0",
|
|
111
105
|
"ethereum-cryptography": "^3.0.0",
|
|
112
106
|
"js-base64": "^3.7.7",
|
|
113
107
|
"jwt-decode": "^4.0.0",
|
|
114
|
-
"lodash": "^4.17.
|
|
108
|
+
"lodash": "^4.17.23",
|
|
115
109
|
"loglevel": "^1.9.2",
|
|
116
110
|
"loglevel-plugin-prefix": "^0.8.4",
|
|
117
|
-
"react-native-passkey": "^3.1.0",
|
|
118
111
|
"uuid": "^10.0.0"
|
|
119
112
|
},
|
|
113
|
+
"peerDependencies": {
|
|
114
|
+
"@simplewebauthn/browser": "^13.1.0",
|
|
115
|
+
"react-native-passkey": "^3.1.0"
|
|
116
|
+
},
|
|
117
|
+
"peerDependenciesMeta": {
|
|
118
|
+
"@simplewebauthn/browser": {
|
|
119
|
+
"optional": true
|
|
120
|
+
},
|
|
121
|
+
"react-native-passkey": {
|
|
122
|
+
"optional": true
|
|
123
|
+
}
|
|
124
|
+
},
|
|
120
125
|
"overrides": {
|
|
126
|
+
"markdown-it": "^14.1.1",
|
|
127
|
+
"diff": "^5.2.2",
|
|
128
|
+
"tar": "^7.5.8",
|
|
129
|
+
"lodash": "^4.17.23",
|
|
130
|
+
"lodash-es": "^4.17.23",
|
|
131
|
+
"undici": "^7.19.0",
|
|
121
132
|
"js-yaml": "^4.1.1",
|
|
122
133
|
"pbkdf2": "^3.1.3",
|
|
123
134
|
"esbuild": "^0.25.0",
|
package/dist/routes/index.d.ts
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { RequestMethod } from '../types';
|
|
2
|
+
export declare const SwapRoutes: {
|
|
3
|
+
getQuote: {
|
|
4
|
+
fullPath: ({ walletId }: {
|
|
5
|
+
walletId: string;
|
|
6
|
+
}) => string;
|
|
7
|
+
method: RequestMethod;
|
|
8
|
+
requiresAccessToken: boolean;
|
|
9
|
+
};
|
|
10
|
+
executeSwap: {
|
|
11
|
+
fullPath: ({ walletId }: {
|
|
12
|
+
walletId: string;
|
|
13
|
+
}) => string;
|
|
14
|
+
method: RequestMethod;
|
|
15
|
+
requiresAccessToken: boolean;
|
|
16
|
+
};
|
|
17
|
+
getSwaps: {
|
|
18
|
+
fullPath: ({ walletId }: {
|
|
19
|
+
walletId: string;
|
|
20
|
+
}) => string;
|
|
21
|
+
method: RequestMethod;
|
|
22
|
+
requiresAccessToken: boolean;
|
|
23
|
+
};
|
|
24
|
+
};
|