@volr/react 0.1.93 → 0.1.95
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/dist/index.cjs +7 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -8
- package/dist/index.d.ts +18 -8
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -116,6 +116,7 @@ interface UserDto {
|
|
|
116
116
|
email: string;
|
|
117
117
|
accountId?: string;
|
|
118
118
|
evmAddress?: `0x${string}`;
|
|
119
|
+
authWalletAddress?: string;
|
|
119
120
|
keyStorageType?: KeyStorageType$1;
|
|
120
121
|
signerType?: 'passkey' | 'external_wallet' | 'mpc';
|
|
121
122
|
walletConnector?: string;
|
|
@@ -207,6 +208,7 @@ interface VolrUser {
|
|
|
207
208
|
email?: string;
|
|
208
209
|
accountId?: string;
|
|
209
210
|
evmAddress?: `0x${string}`;
|
|
211
|
+
authWalletAddress?: string;
|
|
210
212
|
keyStorageType?: KeyStorageType;
|
|
211
213
|
signerType?: SignerType;
|
|
212
214
|
walletConnector?: string;
|
|
@@ -405,6 +407,15 @@ type SendBatchOverloads = {
|
|
|
405
407
|
* EVM client interface
|
|
406
408
|
*/
|
|
407
409
|
type EvmClient = {
|
|
410
|
+
/**
|
|
411
|
+
* Get native token balance for an address
|
|
412
|
+
* @example
|
|
413
|
+
* ```ts
|
|
414
|
+
* const balance = await evm(1).getBalance('0x...');
|
|
415
|
+
* // Returns bigint (in wei)
|
|
416
|
+
* ```
|
|
417
|
+
*/
|
|
418
|
+
getBalance: (address: `0x${string}`) => Promise<bigint>;
|
|
408
419
|
/**
|
|
409
420
|
* Read data from a smart contract
|
|
410
421
|
* @example
|
|
@@ -841,16 +852,15 @@ interface PaymentContext {
|
|
|
841
852
|
}
|
|
842
853
|
|
|
843
854
|
/**
|
|
844
|
-
*
|
|
855
|
+
* useVolrPaymentApi hook - Headless payment API for Volr SDK
|
|
845
856
|
*
|
|
846
|
-
* This hook provides
|
|
847
|
-
* For UI integration
|
|
857
|
+
* This hook provides core payment API methods without UI.
|
|
858
|
+
* For UI integration with PaymentModal, use useVolrPay from @volr/react-ui
|
|
848
859
|
*/
|
|
849
860
|
|
|
850
|
-
interface
|
|
861
|
+
interface UseVolrPaymentApiReturn {
|
|
851
862
|
/**
|
|
852
|
-
* Create a payment
|
|
853
|
-
* For UI integration, use useVolrPayUI from @volr/react-ui
|
|
863
|
+
* Create a payment via API
|
|
854
864
|
*/
|
|
855
865
|
createPayment: (options: PayOptions) => Promise<PaymentResult>;
|
|
856
866
|
/**
|
|
@@ -878,7 +888,7 @@ interface UseVolrPayReturn {
|
|
|
878
888
|
*/
|
|
879
889
|
isLoading: boolean;
|
|
880
890
|
}
|
|
881
|
-
declare function
|
|
891
|
+
declare function useVolrPaymentApi(): UseVolrPaymentApiReturn;
|
|
882
892
|
|
|
883
893
|
/**
|
|
884
894
|
* Passkey adapter for WebAuthn
|
|
@@ -1291,4 +1301,4 @@ declare function getUserCredentials(client: APIClient): Promise<Array<{
|
|
|
1291
1301
|
createdAt: string;
|
|
1292
1302
|
}>>;
|
|
1293
1303
|
|
|
1294
|
-
export { type ApiResponse, type AuthRefreshResponseDto, type AuthResult, type BuildCallOptions, type ContractAnalysisResult, DEFAULT_EXPIRES_IN_SEC, DEFAULT_MODE, type DepositAsset$1 as DepositAsset, type DepositConfig, type ERC20BalanceComparison, type Erc20Token$1 as Erc20Token, type EvmClient, type KeyStorageType, type MigrationCompleteParams, type MigrationCompleteResult, type MigrationError, type MigrationMessage, type MigrationRequestParams, type MigrationRequestResult, type MigrationSeedRequest, type MigrationSeedResponse, type MpcConnectionStep, type NetworkDto, type NetworkInfo, type PasskeyAdapterOptions, type PasskeyEnrollmentStep, PasskeyNotFoundError, type PayOptions, type PaymentContext, type PaymentError, type PaymentHandle, type PaymentHandlers, type PaymentHistoryOptions, type PaymentHistoryResult, type PaymentItem, type PaymentResult, type PaymentStatus, type PaymentToken, type PlatformCheckResult, type PrfInputDto, PrfNotSupportedError, type SendBatchOverloads, type SendTxOptions, type SignerType, type SiweSession, type SiweSessionStatus, type SocialProvider, type TransactionDto, type TransactionStatus, type UseMpcConnectionReturn, type UsePasskeyEnrollmentReturn, type UseVolrAuthCallbackOptions, type UseVolrAuthCallbackReturn, type UseVolrLoginReturn, type
|
|
1304
|
+
export { type ApiResponse, type AuthRefreshResponseDto, type AuthResult, type BuildCallOptions, type ContractAnalysisResult, DEFAULT_EXPIRES_IN_SEC, DEFAULT_MODE, type DepositAsset$1 as DepositAsset, type DepositConfig, type ERC20BalanceComparison, type Erc20Token$1 as Erc20Token, type EvmClient, type KeyStorageType, type MigrationCompleteParams, type MigrationCompleteResult, type MigrationError, type MigrationMessage, type MigrationRequestParams, type MigrationRequestResult, type MigrationSeedRequest, type MigrationSeedResponse, type MpcConnectionStep, type NetworkDto, type NetworkInfo, type PasskeyAdapterOptions, type PasskeyEnrollmentStep, PasskeyNotFoundError, type PayOptions, type PaymentContext, type PaymentError, type PaymentHandle, type PaymentHandlers, type PaymentHistoryOptions, type PaymentHistoryResult, type PaymentItem, type PaymentResult, type PaymentStatus, type PaymentToken, type PlatformCheckResult, type PrfInputDto, PrfNotSupportedError, type SendBatchOverloads, type SendTxOptions, type SignerType, type SiweSession, type SiweSessionStatus, type SocialProvider, type TransactionDto, type TransactionStatus, type UseMpcConnectionReturn, type UsePasskeyEnrollmentReturn, type UseVolrAuthCallbackOptions, type UseVolrAuthCallbackReturn, type UseVolrLoginReturn, type UseVolrPaymentApiReturn, UserCancelledError, type UserDto, type VolrClient, type VolrConfig, type VolrContextValue, VolrProvider, type VolrUser, type WalletStateComparison, analyzeContractForEIP7702, buildCall, buildCalls, checkPrfExtensionAvailable, checkPrfSupport, compareERC20Balances, compareWalletStates, completeMigration, createGetNetworkInfo, createPasskeyAdapter, debugTransactionFailure, defaultIdempotencyKey, diagnoseTransactionFailure, getERC20Balance, getPasskeyAuthGuidance, getUserCredentials, getWalletState, isEIP7702Delegated, isUserCancelledError, listenForSeedRequests, normalizeHex, normalizeHexArray, openMigrationPopup, requestMigration, requestSeedFromOpener, sendSeedToPopup, uploadBlobViaPresign, useDepositListener, useInternalAuth, useMpcConnection, usePasskeyEnrollment, useVolr, useVolrAuthCallback, useVolrContext, useVolrLogin, useVolrPaymentApi };
|
package/dist/index.d.ts
CHANGED
|
@@ -116,6 +116,7 @@ interface UserDto {
|
|
|
116
116
|
email: string;
|
|
117
117
|
accountId?: string;
|
|
118
118
|
evmAddress?: `0x${string}`;
|
|
119
|
+
authWalletAddress?: string;
|
|
119
120
|
keyStorageType?: KeyStorageType$1;
|
|
120
121
|
signerType?: 'passkey' | 'external_wallet' | 'mpc';
|
|
121
122
|
walletConnector?: string;
|
|
@@ -207,6 +208,7 @@ interface VolrUser {
|
|
|
207
208
|
email?: string;
|
|
208
209
|
accountId?: string;
|
|
209
210
|
evmAddress?: `0x${string}`;
|
|
211
|
+
authWalletAddress?: string;
|
|
210
212
|
keyStorageType?: KeyStorageType;
|
|
211
213
|
signerType?: SignerType;
|
|
212
214
|
walletConnector?: string;
|
|
@@ -405,6 +407,15 @@ type SendBatchOverloads = {
|
|
|
405
407
|
* EVM client interface
|
|
406
408
|
*/
|
|
407
409
|
type EvmClient = {
|
|
410
|
+
/**
|
|
411
|
+
* Get native token balance for an address
|
|
412
|
+
* @example
|
|
413
|
+
* ```ts
|
|
414
|
+
* const balance = await evm(1).getBalance('0x...');
|
|
415
|
+
* // Returns bigint (in wei)
|
|
416
|
+
* ```
|
|
417
|
+
*/
|
|
418
|
+
getBalance: (address: `0x${string}`) => Promise<bigint>;
|
|
408
419
|
/**
|
|
409
420
|
* Read data from a smart contract
|
|
410
421
|
* @example
|
|
@@ -841,16 +852,15 @@ interface PaymentContext {
|
|
|
841
852
|
}
|
|
842
853
|
|
|
843
854
|
/**
|
|
844
|
-
*
|
|
855
|
+
* useVolrPaymentApi hook - Headless payment API for Volr SDK
|
|
845
856
|
*
|
|
846
|
-
* This hook provides
|
|
847
|
-
* For UI integration
|
|
857
|
+
* This hook provides core payment API methods without UI.
|
|
858
|
+
* For UI integration with PaymentModal, use useVolrPay from @volr/react-ui
|
|
848
859
|
*/
|
|
849
860
|
|
|
850
|
-
interface
|
|
861
|
+
interface UseVolrPaymentApiReturn {
|
|
851
862
|
/**
|
|
852
|
-
* Create a payment
|
|
853
|
-
* For UI integration, use useVolrPayUI from @volr/react-ui
|
|
863
|
+
* Create a payment via API
|
|
854
864
|
*/
|
|
855
865
|
createPayment: (options: PayOptions) => Promise<PaymentResult>;
|
|
856
866
|
/**
|
|
@@ -878,7 +888,7 @@ interface UseVolrPayReturn {
|
|
|
878
888
|
*/
|
|
879
889
|
isLoading: boolean;
|
|
880
890
|
}
|
|
881
|
-
declare function
|
|
891
|
+
declare function useVolrPaymentApi(): UseVolrPaymentApiReturn;
|
|
882
892
|
|
|
883
893
|
/**
|
|
884
894
|
* Passkey adapter for WebAuthn
|
|
@@ -1291,4 +1301,4 @@ declare function getUserCredentials(client: APIClient): Promise<Array<{
|
|
|
1291
1301
|
createdAt: string;
|
|
1292
1302
|
}>>;
|
|
1293
1303
|
|
|
1294
|
-
export { type ApiResponse, type AuthRefreshResponseDto, type AuthResult, type BuildCallOptions, type ContractAnalysisResult, DEFAULT_EXPIRES_IN_SEC, DEFAULT_MODE, type DepositAsset$1 as DepositAsset, type DepositConfig, type ERC20BalanceComparison, type Erc20Token$1 as Erc20Token, type EvmClient, type KeyStorageType, type MigrationCompleteParams, type MigrationCompleteResult, type MigrationError, type MigrationMessage, type MigrationRequestParams, type MigrationRequestResult, type MigrationSeedRequest, type MigrationSeedResponse, type MpcConnectionStep, type NetworkDto, type NetworkInfo, type PasskeyAdapterOptions, type PasskeyEnrollmentStep, PasskeyNotFoundError, type PayOptions, type PaymentContext, type PaymentError, type PaymentHandle, type PaymentHandlers, type PaymentHistoryOptions, type PaymentHistoryResult, type PaymentItem, type PaymentResult, type PaymentStatus, type PaymentToken, type PlatformCheckResult, type PrfInputDto, PrfNotSupportedError, type SendBatchOverloads, type SendTxOptions, type SignerType, type SiweSession, type SiweSessionStatus, type SocialProvider, type TransactionDto, type TransactionStatus, type UseMpcConnectionReturn, type UsePasskeyEnrollmentReturn, type UseVolrAuthCallbackOptions, type UseVolrAuthCallbackReturn, type UseVolrLoginReturn, type
|
|
1304
|
+
export { type ApiResponse, type AuthRefreshResponseDto, type AuthResult, type BuildCallOptions, type ContractAnalysisResult, DEFAULT_EXPIRES_IN_SEC, DEFAULT_MODE, type DepositAsset$1 as DepositAsset, type DepositConfig, type ERC20BalanceComparison, type Erc20Token$1 as Erc20Token, type EvmClient, type KeyStorageType, type MigrationCompleteParams, type MigrationCompleteResult, type MigrationError, type MigrationMessage, type MigrationRequestParams, type MigrationRequestResult, type MigrationSeedRequest, type MigrationSeedResponse, type MpcConnectionStep, type NetworkDto, type NetworkInfo, type PasskeyAdapterOptions, type PasskeyEnrollmentStep, PasskeyNotFoundError, type PayOptions, type PaymentContext, type PaymentError, type PaymentHandle, type PaymentHandlers, type PaymentHistoryOptions, type PaymentHistoryResult, type PaymentItem, type PaymentResult, type PaymentStatus, type PaymentToken, type PlatformCheckResult, type PrfInputDto, PrfNotSupportedError, type SendBatchOverloads, type SendTxOptions, type SignerType, type SiweSession, type SiweSessionStatus, type SocialProvider, type TransactionDto, type TransactionStatus, type UseMpcConnectionReturn, type UsePasskeyEnrollmentReturn, type UseVolrAuthCallbackOptions, type UseVolrAuthCallbackReturn, type UseVolrLoginReturn, type UseVolrPaymentApiReturn, UserCancelledError, type UserDto, type VolrClient, type VolrConfig, type VolrContextValue, VolrProvider, type VolrUser, type WalletStateComparison, analyzeContractForEIP7702, buildCall, buildCalls, checkPrfExtensionAvailable, checkPrfSupport, compareERC20Balances, compareWalletStates, completeMigration, createGetNetworkInfo, createPasskeyAdapter, debugTransactionFailure, defaultIdempotencyKey, diagnoseTransactionFailure, getERC20Balance, getPasskeyAuthGuidance, getUserCredentials, getWalletState, isEIP7702Delegated, isUserCancelledError, listenForSeedRequests, normalizeHex, normalizeHexArray, openMigrationPopup, requestMigration, requestSeedFromOpener, sendSeedToPopup, uploadBlobViaPresign, useDepositListener, useInternalAuth, useMpcConnection, usePasskeyEnrollment, useVolr, useVolrAuthCallback, useVolrContext, useVolrLogin, useVolrPaymentApi };
|
package/dist/index.js
CHANGED
|
@@ -18531,6 +18531,10 @@ function useVolr() {
|
|
|
18531
18531
|
return { publicClient, extendedRpcClient };
|
|
18532
18532
|
};
|
|
18533
18533
|
return {
|
|
18534
|
+
getBalance: async (address) => {
|
|
18535
|
+
const { publicClient: client2 } = await ensureRpcClient();
|
|
18536
|
+
return client2.getBalance({ address });
|
|
18537
|
+
},
|
|
18534
18538
|
readContract: async (args) => {
|
|
18535
18539
|
const { publicClient: client2 } = await ensureRpcClient();
|
|
18536
18540
|
return client2.readContract(args);
|
|
@@ -18684,6 +18688,7 @@ function useVolrLogin() {
|
|
|
18684
18688
|
email: u.email,
|
|
18685
18689
|
accountId: u.accountId ?? void 0,
|
|
18686
18690
|
evmAddress: u.evmAddress,
|
|
18691
|
+
authWalletAddress: u.authWalletAddress ?? void 0,
|
|
18687
18692
|
keyStorageType: u.keyStorageType ?? void 0,
|
|
18688
18693
|
signerType: u.signerType ?? void 0,
|
|
18689
18694
|
walletConnector: u.walletConnector ?? void 0,
|
|
@@ -19598,7 +19603,7 @@ async function uploadBlobViaPresign(params) {
|
|
|
19598
19603
|
}
|
|
19599
19604
|
var POLL_INTERVAL_MS = 2e3;
|
|
19600
19605
|
var MAX_POLL_ATTEMPTS = 180;
|
|
19601
|
-
function
|
|
19606
|
+
function useVolrPaymentApi() {
|
|
19602
19607
|
const { client } = useInternalAuth();
|
|
19603
19608
|
const [isLoading, setIsLoading] = useState(false);
|
|
19604
19609
|
const createPayment = useCallback(
|
|
@@ -20283,6 +20288,6 @@ async function getUserCredentials(client) {
|
|
|
20283
20288
|
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
20284
20289
|
*/
|
|
20285
20290
|
|
|
20286
|
-
export { DEFAULT_EXPIRES_IN_SEC, DEFAULT_MODE, PasskeyNotFoundError, PrfNotSupportedError, UserCancelledError, VolrProvider, analyzeContractForEIP7702, buildCall, buildCalls, checkPrfExtensionAvailable, checkPrfSupport, compareERC20Balances, compareWalletStates, completeMigration, createGetNetworkInfo, createPasskeyAdapter, debugTransactionFailure, defaultIdempotencyKey, diagnoseTransactionFailure, getERC20Balance, getPasskeyAuthGuidance, getUserCredentials, getWalletState, isEIP7702Delegated, isUserCancelledError, listenForSeedRequests, normalizeHex, normalizeHexArray, openMigrationPopup, requestMigration, requestSeedFromOpener, sendSeedToPopup, uploadBlobViaPresign, useDepositListener, useInternalAuth, useMpcConnection, usePasskeyEnrollment, useVolr, useVolrAuthCallback, useVolrContext, useVolrLogin,
|
|
20291
|
+
export { DEFAULT_EXPIRES_IN_SEC, DEFAULT_MODE, PasskeyNotFoundError, PrfNotSupportedError, UserCancelledError, VolrProvider, analyzeContractForEIP7702, buildCall, buildCalls, checkPrfExtensionAvailable, checkPrfSupport, compareERC20Balances, compareWalletStates, completeMigration, createGetNetworkInfo, createPasskeyAdapter, debugTransactionFailure, defaultIdempotencyKey, diagnoseTransactionFailure, getERC20Balance, getPasskeyAuthGuidance, getUserCredentials, getWalletState, isEIP7702Delegated, isUserCancelledError, listenForSeedRequests, normalizeHex, normalizeHexArray, openMigrationPopup, requestMigration, requestSeedFromOpener, sendSeedToPopup, uploadBlobViaPresign, useDepositListener, useInternalAuth, useMpcConnection, usePasskeyEnrollment, useVolr, useVolrAuthCallback, useVolrContext, useVolrLogin, useVolrPaymentApi };
|
|
20287
20292
|
//# sourceMappingURL=index.js.map
|
|
20288
20293
|
//# sourceMappingURL=index.js.map
|