@oasisprotocol/privana-sdk 0.4.2 → 0.4.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.
- package/README.md +1 -1
- package/dist/{chunk-CRJNDCDT.cjs → chunk-NMRIKUDN.cjs} +15 -13
- package/dist/chunk-NMRIKUDN.cjs.map +1 -0
- package/dist/{chunk-ZXFQJ5MG.js → chunk-WV6CGHEF.js} +15 -14
- package/dist/chunk-WV6CGHEF.js.map +1 -0
- package/dist/index.cjs +151 -147
- package/dist/index.d.cts +10 -8
- package/dist/index.d.ts +10 -8
- package/dist/index.js +2 -2
- package/dist/{on-ramp-DIAOtdeU.d.cts → on-ramp-CdXqJjmm.d.cts} +1 -1
- package/dist/{on-ramp-DIAOtdeU.d.ts → on-ramp-CdXqJjmm.d.ts} +1 -1
- package/dist/on-ramp.cjs +7 -7
- package/dist/on-ramp.d.cts +2 -2
- package/dist/on-ramp.d.ts +2 -2
- package/dist/on-ramp.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-CRJNDCDT.cjs.map +0 -1
- package/dist/chunk-ZXFQJ5MG.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as Address, B as Bytes32, H as HexString, I as IntegerLike, a as HostedAuthResponseMode, S as SignOnRampUrlRequest, b as SignOnRampUrlResponse, C as CreateOnRampIntentRequest, c as CreateOnRampIntentResponse, U as UpdateOnRampRequest, d as UpdateOnRampResponse, P as PendingOnRampsResponse, N as NetworkConfig, T as TokenConfig } from './on-ramp-
|
|
2
|
-
export { e as NETWORK_CONFIG, f as Network, O as OnRampRecord, g as OnRampStatus, h as getAccountingContract, i as getApiUrl, j as getChainId, n as normalizeAddress, k as normalizeHex } from './on-ramp-
|
|
1
|
+
import { A as Address, B as Bytes32, H as HexString, I as IntegerLike, a as HostedAuthResponseMode, S as SignOnRampUrlRequest, b as SignOnRampUrlResponse, C as CreateOnRampIntentRequest, c as CreateOnRampIntentResponse, U as UpdateOnRampRequest, d as UpdateOnRampResponse, P as PendingOnRampsResponse, N as NetworkConfig, T as TokenConfig } from './on-ramp-CdXqJjmm.cjs';
|
|
2
|
+
export { e as NETWORK_CONFIG, f as Network, O as OnRampRecord, g as OnRampStatus, h as getAccountingContract, i as getApiUrl, j as getChainId, n as normalizeAddress, k as normalizeHex } from './on-ramp-CdXqJjmm.cjs';
|
|
3
3
|
import { WalletClient, Address as Address$1 } from 'viem';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
import * as React$1 from 'react';
|
|
@@ -324,6 +324,8 @@ declare function applyRefreshResponse(session: HostedAuthSession, response: JwtR
|
|
|
324
324
|
declare function isHostedAuthSessionActive(session: HostedAuthSession, now?: number, skewMs?: number): boolean;
|
|
325
325
|
declare function isHostedAuthRefreshActive(session: HostedAuthSession, now?: number, skewMs?: number): boolean;
|
|
326
326
|
|
|
327
|
+
declare function buildSiweStatement(chainId: number): string;
|
|
328
|
+
|
|
327
329
|
interface HttpClientConfig {
|
|
328
330
|
baseUrl: string;
|
|
329
331
|
timeout?: number;
|
|
@@ -624,16 +626,16 @@ interface SiweAuthContextValue {
|
|
|
624
626
|
login: () => Promise<void>;
|
|
625
627
|
logout: () => Promise<void>;
|
|
626
628
|
}
|
|
627
|
-
|
|
629
|
+
type SiweAuthConfig = boolean | {
|
|
628
630
|
autoLogin?: boolean;
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
interface SiweAuthProviderProps extends SiweAuthConfig {
|
|
631
|
+
};
|
|
632
|
+
interface SiweAuthProviderProps {
|
|
632
633
|
children: ReactNode;
|
|
633
634
|
client: PrivanaClient;
|
|
634
635
|
networkConfig: NetworkConfig;
|
|
636
|
+
autoLogin?: boolean;
|
|
635
637
|
}
|
|
636
|
-
declare function SiweAuthProvider({ children, client, networkConfig, autoLogin,
|
|
638
|
+
declare function SiweAuthProvider({ children, client, networkConfig, autoLogin, }: SiweAuthProviderProps): react_jsx_runtime.JSX.Element;
|
|
637
639
|
declare function useSiweAuth(): SiweAuthContextValue;
|
|
638
640
|
|
|
639
641
|
type TokensStatus = 'loading' | 'ready' | 'error';
|
|
@@ -1101,4 +1103,4 @@ declare function Skeleton({ className, ...props }: React.ComponentProps<'div'>):
|
|
|
1101
1103
|
declare function getTokenIcon(symbol: string, size?: number): react_jsx_runtime.JSX.Element;
|
|
1102
1104
|
declare function getChainIcon(chainId: number, size?: number): react_jsx_runtime.JSX.Element;
|
|
1103
1105
|
|
|
1104
|
-
export { AccountingApiError, Address, type BalanceResponse, type BatchBalancesRequest, type BatchBalancesResponse, Button, Bytes32, type ChainConfig, CreateOnRampIntentRequest, CreateOnRampIntentResponse, type DepositAddressRequest, type DepositAddressResponse, type DepositCheckRequest, type DepositCheckResponse, type DepositParams, type EIP712Domain, type ExpiredLocksResponse, HOSTED_AUTH_CLOCK_SKEW_MS, HexString, type HistoryEntry, type HistoryKind, type HistoryRequest, type HistoryResponse, type HostedAuthAuthorizeUrlRequest, type HostedAuthCallback, type HostedAuthCallbackError, type HostedAuthCallbackSuccess, type HostedAuthConfig, HostedAuthError, type HostedAuthPendingTransaction, HostedAuthRequiredError, HostedAuthResponseMode, type HostedAuthSession, HostedAuthStateMismatchError, type HostedAuthTokenExchangeRequest, type HostedAuthTokenExchangeResponse, HttpClient, type HttpClientConfig, IntegerLike, type JwtLogoutRequest, type JwtLogoutResponse, type JwtRefreshRequest, type JwtRefreshResponse, LOCK_TYPES, type LockFundsParams, type LockFundsRequest, type LockInfo, type LockMessage, type LockNonceResponse, type LockedFundsResponse, MODIFY_LOCK_TYPES, type MinDepositAmounts, type ModifyLockMessage, type ModifyLockNonceResponse, type ModifyLockParams, type ModifyLockRequest, NetworkConfig, NetworkError, PendingOnRampsResponse, type PendingWithdrawalsResponse, PrivanaButton, type PrivanaButtonProps, PrivanaClient, type PrivanaClientConfig, type PrivanaContextValue, PrivanaInlineModal, PrivanaModal, PrivanaProvider, type PrivanaProviderProps, SUPPORTED_CHAINS, type SignLockParams, type SignModifyLockParams, SignOnRampUrlRequest, SignOnRampUrlResponse, type SignTransferLockedParams, type SignTransferParams, type SignWithdrawFromLockParams, type SignWithdrawParams, type SiweAuthConfig, type SiweAuthContextValue, SiweAuthProvider, type SiweAuthProviderProps, type SiweAuthSession, type SiweAuthTokens, type SiweDomainResponse, type SiweLoginRequest, type SiweLoginResponse, type SiweNonceResponse, Skeleton, TRANSFER_LOCKED_TYPES, TRANSFER_TYPES, type TokenBalance, TokenConfig, type TokenInfoResponse, type TokenListResponse, type TokensStatus, type TotalLockedBalanceResponse, type TransactionSubmissionResponse, type TransferFundsRequest, type TransferLockedFundsRequest, type TransferLockedMessage, type TransferLockedNonceResponse, type TransferLockedParams, type TransferMessage, type TransferNonceResponse, type TransferParams, type UnlockAllExpiredRequest, type UnlockFundsParams, type UnlockFundsRequest, UpdateOnRampRequest, UpdateOnRampResponse, type UseBalanceOptions, type UseBalanceResult, type UseBatchBalancesOptions, type UseBatchBalancesResult, type UseDepositOptions, type UseDepositResult, type UseDepositVerificationOptions, type UseDepositVerificationResult, type UseExpiredLocksOptions, type UseExpiredLocksResult, type UseHistoryOptions, type UseHistoryResult, type UseHostedRedirectAuthResult, type UseLockFundsOptions, type UseLockFundsResult, type UseLockedFundsOptions, type UseLockedFundsResult, type UseModifyLockOptions, type UseModifyLockResult, type UsePendingWithdrawalsOptions, type UsePendingWithdrawalsResult, type UseTokenInfoOptions, type UseTokenInfoResult, type UseTokenListOptions, type UseTokenListResult, type UseTotalLockedBalanceOptions, type UseTotalLockedBalanceResult, type UseTransferOptions, type UseTransferResult, type UseUnlockFundsOptions, type UseUnlockFundsResult, type UseWithdrawOptions, type UseWithdrawResult, ValidationError, type VerificationContext, WITHDRAW_FROM_LOCK_TYPES, WITHDRAW_TYPES, type WithdrawFromLockMessage, type WithdrawFromLockRequest, type WithdrawMessage, type WithdrawParams, type WithdrawStep, type WithdrawalInfo, type WithdrawalInfoResponse, type WithdrawalNonceResponse, type WithdrawalRequest, applyRefreshResponse, buildHostedAuthSession, buttonVariants, clearHostedAuthPendingTransaction, createDomain, createHostedAuthPendingStorageKey, createHostedAuthState, createHostedAuthStorageKey, createLockExpiry, createPkceChallenge, createPkceVerifier, getChainById, getChainIcon, getExplorerAddressUrl, getTokenIcon, isHostedAuthRefreshActive, isHostedAuthSessionActive, parseHostedAuthCallback, persistHostedAuthPendingTransaction, readHostedAuthPendingTransaction, readStoredHostedAuthSession, signLockMessage, signModifyLockMessage, signTransferLockedMessage, signTransferMessage, signWithdrawFromLockMessage, signWithdrawMessage, stripHostedAuthCallbackParams, syncHostedAuthSessionToClient, useBalance, useBatchBalances, useDeposit, useDepositVerification, useExpiredLocks, useHistory, useHostedRedirectAuth, useLockFunds, useLockedFunds, useModifyLock, usePendingWithdrawals, usePrivanaClient, usePrivanaContext, useSafeAccount, useSafePrivanaContext, useSiweAuth, useTokenInfo, useTokenList, useTotalLockedBalance, useTransfer, useUnlockFunds, useWithdraw };
|
|
1106
|
+
export { AccountingApiError, Address, type BalanceResponse, type BatchBalancesRequest, type BatchBalancesResponse, Button, Bytes32, type ChainConfig, CreateOnRampIntentRequest, CreateOnRampIntentResponse, type DepositAddressRequest, type DepositAddressResponse, type DepositCheckRequest, type DepositCheckResponse, type DepositParams, type EIP712Domain, type ExpiredLocksResponse, HOSTED_AUTH_CLOCK_SKEW_MS, HexString, type HistoryEntry, type HistoryKind, type HistoryRequest, type HistoryResponse, type HostedAuthAuthorizeUrlRequest, type HostedAuthCallback, type HostedAuthCallbackError, type HostedAuthCallbackSuccess, type HostedAuthConfig, HostedAuthError, type HostedAuthPendingTransaction, HostedAuthRequiredError, HostedAuthResponseMode, type HostedAuthSession, HostedAuthStateMismatchError, type HostedAuthTokenExchangeRequest, type HostedAuthTokenExchangeResponse, HttpClient, type HttpClientConfig, IntegerLike, type JwtLogoutRequest, type JwtLogoutResponse, type JwtRefreshRequest, type JwtRefreshResponse, LOCK_TYPES, type LockFundsParams, type LockFundsRequest, type LockInfo, type LockMessage, type LockNonceResponse, type LockedFundsResponse, MODIFY_LOCK_TYPES, type MinDepositAmounts, type ModifyLockMessage, type ModifyLockNonceResponse, type ModifyLockParams, type ModifyLockRequest, NetworkConfig, NetworkError, PendingOnRampsResponse, type PendingWithdrawalsResponse, PrivanaButton, type PrivanaButtonProps, PrivanaClient, type PrivanaClientConfig, type PrivanaContextValue, PrivanaInlineModal, PrivanaModal, PrivanaProvider, type PrivanaProviderProps, SUPPORTED_CHAINS, type SignLockParams, type SignModifyLockParams, SignOnRampUrlRequest, SignOnRampUrlResponse, type SignTransferLockedParams, type SignTransferParams, type SignWithdrawFromLockParams, type SignWithdrawParams, type SiweAuthConfig, type SiweAuthContextValue, SiweAuthProvider, type SiweAuthProviderProps, type SiweAuthSession, type SiweAuthTokens, type SiweDomainResponse, type SiweLoginRequest, type SiweLoginResponse, type SiweNonceResponse, Skeleton, TRANSFER_LOCKED_TYPES, TRANSFER_TYPES, type TokenBalance, TokenConfig, type TokenInfoResponse, type TokenListResponse, type TokensStatus, type TotalLockedBalanceResponse, type TransactionSubmissionResponse, type TransferFundsRequest, type TransferLockedFundsRequest, type TransferLockedMessage, type TransferLockedNonceResponse, type TransferLockedParams, type TransferMessage, type TransferNonceResponse, type TransferParams, type UnlockAllExpiredRequest, type UnlockFundsParams, type UnlockFundsRequest, UpdateOnRampRequest, UpdateOnRampResponse, type UseBalanceOptions, type UseBalanceResult, type UseBatchBalancesOptions, type UseBatchBalancesResult, type UseDepositOptions, type UseDepositResult, type UseDepositVerificationOptions, type UseDepositVerificationResult, type UseExpiredLocksOptions, type UseExpiredLocksResult, type UseHistoryOptions, type UseHistoryResult, type UseHostedRedirectAuthResult, type UseLockFundsOptions, type UseLockFundsResult, type UseLockedFundsOptions, type UseLockedFundsResult, type UseModifyLockOptions, type UseModifyLockResult, type UsePendingWithdrawalsOptions, type UsePendingWithdrawalsResult, type UseTokenInfoOptions, type UseTokenInfoResult, type UseTokenListOptions, type UseTokenListResult, type UseTotalLockedBalanceOptions, type UseTotalLockedBalanceResult, type UseTransferOptions, type UseTransferResult, type UseUnlockFundsOptions, type UseUnlockFundsResult, type UseWithdrawOptions, type UseWithdrawResult, ValidationError, type VerificationContext, WITHDRAW_FROM_LOCK_TYPES, WITHDRAW_TYPES, type WithdrawFromLockMessage, type WithdrawFromLockRequest, type WithdrawMessage, type WithdrawParams, type WithdrawStep, type WithdrawalInfo, type WithdrawalInfoResponse, type WithdrawalNonceResponse, type WithdrawalRequest, applyRefreshResponse, buildHostedAuthSession, buildSiweStatement, buttonVariants, clearHostedAuthPendingTransaction, createDomain, createHostedAuthPendingStorageKey, createHostedAuthState, createHostedAuthStorageKey, createLockExpiry, createPkceChallenge, createPkceVerifier, getChainById, getChainIcon, getExplorerAddressUrl, getTokenIcon, isHostedAuthRefreshActive, isHostedAuthSessionActive, parseHostedAuthCallback, persistHostedAuthPendingTransaction, readHostedAuthPendingTransaction, readStoredHostedAuthSession, signLockMessage, signModifyLockMessage, signTransferLockedMessage, signTransferMessage, signWithdrawFromLockMessage, signWithdrawMessage, stripHostedAuthCallbackParams, syncHostedAuthSessionToClient, useBalance, useBatchBalances, useDeposit, useDepositVerification, useExpiredLocks, useHistory, useHostedRedirectAuth, useLockFunds, useLockedFunds, useModifyLock, usePendingWithdrawals, usePrivanaClient, usePrivanaContext, useSafeAccount, useSafePrivanaContext, useSiweAuth, useTokenInfo, useTokenList, useTotalLockedBalance, useTransfer, useUnlockFunds, useWithdraw };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as Address, B as Bytes32, H as HexString, I as IntegerLike, a as HostedAuthResponseMode, S as SignOnRampUrlRequest, b as SignOnRampUrlResponse, C as CreateOnRampIntentRequest, c as CreateOnRampIntentResponse, U as UpdateOnRampRequest, d as UpdateOnRampResponse, P as PendingOnRampsResponse, N as NetworkConfig, T as TokenConfig } from './on-ramp-
|
|
2
|
-
export { e as NETWORK_CONFIG, f as Network, O as OnRampRecord, g as OnRampStatus, h as getAccountingContract, i as getApiUrl, j as getChainId, n as normalizeAddress, k as normalizeHex } from './on-ramp-
|
|
1
|
+
import { A as Address, B as Bytes32, H as HexString, I as IntegerLike, a as HostedAuthResponseMode, S as SignOnRampUrlRequest, b as SignOnRampUrlResponse, C as CreateOnRampIntentRequest, c as CreateOnRampIntentResponse, U as UpdateOnRampRequest, d as UpdateOnRampResponse, P as PendingOnRampsResponse, N as NetworkConfig, T as TokenConfig } from './on-ramp-CdXqJjmm.js';
|
|
2
|
+
export { e as NETWORK_CONFIG, f as Network, O as OnRampRecord, g as OnRampStatus, h as getAccountingContract, i as getApiUrl, j as getChainId, n as normalizeAddress, k as normalizeHex } from './on-ramp-CdXqJjmm.js';
|
|
3
3
|
import { WalletClient, Address as Address$1 } from 'viem';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
import * as React$1 from 'react';
|
|
@@ -324,6 +324,8 @@ declare function applyRefreshResponse(session: HostedAuthSession, response: JwtR
|
|
|
324
324
|
declare function isHostedAuthSessionActive(session: HostedAuthSession, now?: number, skewMs?: number): boolean;
|
|
325
325
|
declare function isHostedAuthRefreshActive(session: HostedAuthSession, now?: number, skewMs?: number): boolean;
|
|
326
326
|
|
|
327
|
+
declare function buildSiweStatement(chainId: number): string;
|
|
328
|
+
|
|
327
329
|
interface HttpClientConfig {
|
|
328
330
|
baseUrl: string;
|
|
329
331
|
timeout?: number;
|
|
@@ -624,16 +626,16 @@ interface SiweAuthContextValue {
|
|
|
624
626
|
login: () => Promise<void>;
|
|
625
627
|
logout: () => Promise<void>;
|
|
626
628
|
}
|
|
627
|
-
|
|
629
|
+
type SiweAuthConfig = boolean | {
|
|
628
630
|
autoLogin?: boolean;
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
interface SiweAuthProviderProps extends SiweAuthConfig {
|
|
631
|
+
};
|
|
632
|
+
interface SiweAuthProviderProps {
|
|
632
633
|
children: ReactNode;
|
|
633
634
|
client: PrivanaClient;
|
|
634
635
|
networkConfig: NetworkConfig;
|
|
636
|
+
autoLogin?: boolean;
|
|
635
637
|
}
|
|
636
|
-
declare function SiweAuthProvider({ children, client, networkConfig, autoLogin,
|
|
638
|
+
declare function SiweAuthProvider({ children, client, networkConfig, autoLogin, }: SiweAuthProviderProps): react_jsx_runtime.JSX.Element;
|
|
637
639
|
declare function useSiweAuth(): SiweAuthContextValue;
|
|
638
640
|
|
|
639
641
|
type TokensStatus = 'loading' | 'ready' | 'error';
|
|
@@ -1101,4 +1103,4 @@ declare function Skeleton({ className, ...props }: React.ComponentProps<'div'>):
|
|
|
1101
1103
|
declare function getTokenIcon(symbol: string, size?: number): react_jsx_runtime.JSX.Element;
|
|
1102
1104
|
declare function getChainIcon(chainId: number, size?: number): react_jsx_runtime.JSX.Element;
|
|
1103
1105
|
|
|
1104
|
-
export { AccountingApiError, Address, type BalanceResponse, type BatchBalancesRequest, type BatchBalancesResponse, Button, Bytes32, type ChainConfig, CreateOnRampIntentRequest, CreateOnRampIntentResponse, type DepositAddressRequest, type DepositAddressResponse, type DepositCheckRequest, type DepositCheckResponse, type DepositParams, type EIP712Domain, type ExpiredLocksResponse, HOSTED_AUTH_CLOCK_SKEW_MS, HexString, type HistoryEntry, type HistoryKind, type HistoryRequest, type HistoryResponse, type HostedAuthAuthorizeUrlRequest, type HostedAuthCallback, type HostedAuthCallbackError, type HostedAuthCallbackSuccess, type HostedAuthConfig, HostedAuthError, type HostedAuthPendingTransaction, HostedAuthRequiredError, HostedAuthResponseMode, type HostedAuthSession, HostedAuthStateMismatchError, type HostedAuthTokenExchangeRequest, type HostedAuthTokenExchangeResponse, HttpClient, type HttpClientConfig, IntegerLike, type JwtLogoutRequest, type JwtLogoutResponse, type JwtRefreshRequest, type JwtRefreshResponse, LOCK_TYPES, type LockFundsParams, type LockFundsRequest, type LockInfo, type LockMessage, type LockNonceResponse, type LockedFundsResponse, MODIFY_LOCK_TYPES, type MinDepositAmounts, type ModifyLockMessage, type ModifyLockNonceResponse, type ModifyLockParams, type ModifyLockRequest, NetworkConfig, NetworkError, PendingOnRampsResponse, type PendingWithdrawalsResponse, PrivanaButton, type PrivanaButtonProps, PrivanaClient, type PrivanaClientConfig, type PrivanaContextValue, PrivanaInlineModal, PrivanaModal, PrivanaProvider, type PrivanaProviderProps, SUPPORTED_CHAINS, type SignLockParams, type SignModifyLockParams, SignOnRampUrlRequest, SignOnRampUrlResponse, type SignTransferLockedParams, type SignTransferParams, type SignWithdrawFromLockParams, type SignWithdrawParams, type SiweAuthConfig, type SiweAuthContextValue, SiweAuthProvider, type SiweAuthProviderProps, type SiweAuthSession, type SiweAuthTokens, type SiweDomainResponse, type SiweLoginRequest, type SiweLoginResponse, type SiweNonceResponse, Skeleton, TRANSFER_LOCKED_TYPES, TRANSFER_TYPES, type TokenBalance, TokenConfig, type TokenInfoResponse, type TokenListResponse, type TokensStatus, type TotalLockedBalanceResponse, type TransactionSubmissionResponse, type TransferFundsRequest, type TransferLockedFundsRequest, type TransferLockedMessage, type TransferLockedNonceResponse, type TransferLockedParams, type TransferMessage, type TransferNonceResponse, type TransferParams, type UnlockAllExpiredRequest, type UnlockFundsParams, type UnlockFundsRequest, UpdateOnRampRequest, UpdateOnRampResponse, type UseBalanceOptions, type UseBalanceResult, type UseBatchBalancesOptions, type UseBatchBalancesResult, type UseDepositOptions, type UseDepositResult, type UseDepositVerificationOptions, type UseDepositVerificationResult, type UseExpiredLocksOptions, type UseExpiredLocksResult, type UseHistoryOptions, type UseHistoryResult, type UseHostedRedirectAuthResult, type UseLockFundsOptions, type UseLockFundsResult, type UseLockedFundsOptions, type UseLockedFundsResult, type UseModifyLockOptions, type UseModifyLockResult, type UsePendingWithdrawalsOptions, type UsePendingWithdrawalsResult, type UseTokenInfoOptions, type UseTokenInfoResult, type UseTokenListOptions, type UseTokenListResult, type UseTotalLockedBalanceOptions, type UseTotalLockedBalanceResult, type UseTransferOptions, type UseTransferResult, type UseUnlockFundsOptions, type UseUnlockFundsResult, type UseWithdrawOptions, type UseWithdrawResult, ValidationError, type VerificationContext, WITHDRAW_FROM_LOCK_TYPES, WITHDRAW_TYPES, type WithdrawFromLockMessage, type WithdrawFromLockRequest, type WithdrawMessage, type WithdrawParams, type WithdrawStep, type WithdrawalInfo, type WithdrawalInfoResponse, type WithdrawalNonceResponse, type WithdrawalRequest, applyRefreshResponse, buildHostedAuthSession, buttonVariants, clearHostedAuthPendingTransaction, createDomain, createHostedAuthPendingStorageKey, createHostedAuthState, createHostedAuthStorageKey, createLockExpiry, createPkceChallenge, createPkceVerifier, getChainById, getChainIcon, getExplorerAddressUrl, getTokenIcon, isHostedAuthRefreshActive, isHostedAuthSessionActive, parseHostedAuthCallback, persistHostedAuthPendingTransaction, readHostedAuthPendingTransaction, readStoredHostedAuthSession, signLockMessage, signModifyLockMessage, signTransferLockedMessage, signTransferMessage, signWithdrawFromLockMessage, signWithdrawMessage, stripHostedAuthCallbackParams, syncHostedAuthSessionToClient, useBalance, useBatchBalances, useDeposit, useDepositVerification, useExpiredLocks, useHistory, useHostedRedirectAuth, useLockFunds, useLockedFunds, useModifyLock, usePendingWithdrawals, usePrivanaClient, usePrivanaContext, useSafeAccount, useSafePrivanaContext, useSiweAuth, useTokenInfo, useTokenList, useTotalLockedBalance, useTransfer, useUnlockFunds, useWithdraw };
|
|
1106
|
+
export { AccountingApiError, Address, type BalanceResponse, type BatchBalancesRequest, type BatchBalancesResponse, Button, Bytes32, type ChainConfig, CreateOnRampIntentRequest, CreateOnRampIntentResponse, type DepositAddressRequest, type DepositAddressResponse, type DepositCheckRequest, type DepositCheckResponse, type DepositParams, type EIP712Domain, type ExpiredLocksResponse, HOSTED_AUTH_CLOCK_SKEW_MS, HexString, type HistoryEntry, type HistoryKind, type HistoryRequest, type HistoryResponse, type HostedAuthAuthorizeUrlRequest, type HostedAuthCallback, type HostedAuthCallbackError, type HostedAuthCallbackSuccess, type HostedAuthConfig, HostedAuthError, type HostedAuthPendingTransaction, HostedAuthRequiredError, HostedAuthResponseMode, type HostedAuthSession, HostedAuthStateMismatchError, type HostedAuthTokenExchangeRequest, type HostedAuthTokenExchangeResponse, HttpClient, type HttpClientConfig, IntegerLike, type JwtLogoutRequest, type JwtLogoutResponse, type JwtRefreshRequest, type JwtRefreshResponse, LOCK_TYPES, type LockFundsParams, type LockFundsRequest, type LockInfo, type LockMessage, type LockNonceResponse, type LockedFundsResponse, MODIFY_LOCK_TYPES, type MinDepositAmounts, type ModifyLockMessage, type ModifyLockNonceResponse, type ModifyLockParams, type ModifyLockRequest, NetworkConfig, NetworkError, PendingOnRampsResponse, type PendingWithdrawalsResponse, PrivanaButton, type PrivanaButtonProps, PrivanaClient, type PrivanaClientConfig, type PrivanaContextValue, PrivanaInlineModal, PrivanaModal, PrivanaProvider, type PrivanaProviderProps, SUPPORTED_CHAINS, type SignLockParams, type SignModifyLockParams, SignOnRampUrlRequest, SignOnRampUrlResponse, type SignTransferLockedParams, type SignTransferParams, type SignWithdrawFromLockParams, type SignWithdrawParams, type SiweAuthConfig, type SiweAuthContextValue, SiweAuthProvider, type SiweAuthProviderProps, type SiweAuthSession, type SiweAuthTokens, type SiweDomainResponse, type SiweLoginRequest, type SiweLoginResponse, type SiweNonceResponse, Skeleton, TRANSFER_LOCKED_TYPES, TRANSFER_TYPES, type TokenBalance, TokenConfig, type TokenInfoResponse, type TokenListResponse, type TokensStatus, type TotalLockedBalanceResponse, type TransactionSubmissionResponse, type TransferFundsRequest, type TransferLockedFundsRequest, type TransferLockedMessage, type TransferLockedNonceResponse, type TransferLockedParams, type TransferMessage, type TransferNonceResponse, type TransferParams, type UnlockAllExpiredRequest, type UnlockFundsParams, type UnlockFundsRequest, UpdateOnRampRequest, UpdateOnRampResponse, type UseBalanceOptions, type UseBalanceResult, type UseBatchBalancesOptions, type UseBatchBalancesResult, type UseDepositOptions, type UseDepositResult, type UseDepositVerificationOptions, type UseDepositVerificationResult, type UseExpiredLocksOptions, type UseExpiredLocksResult, type UseHistoryOptions, type UseHistoryResult, type UseHostedRedirectAuthResult, type UseLockFundsOptions, type UseLockFundsResult, type UseLockedFundsOptions, type UseLockedFundsResult, type UseModifyLockOptions, type UseModifyLockResult, type UsePendingWithdrawalsOptions, type UsePendingWithdrawalsResult, type UseTokenInfoOptions, type UseTokenInfoResult, type UseTokenListOptions, type UseTokenListResult, type UseTotalLockedBalanceOptions, type UseTotalLockedBalanceResult, type UseTransferOptions, type UseTransferResult, type UseUnlockFundsOptions, type UseUnlockFundsResult, type UseWithdrawOptions, type UseWithdrawResult, ValidationError, type VerificationContext, WITHDRAW_FROM_LOCK_TYPES, WITHDRAW_TYPES, type WithdrawFromLockMessage, type WithdrawFromLockRequest, type WithdrawMessage, type WithdrawParams, type WithdrawStep, type WithdrawalInfo, type WithdrawalInfoResponse, type WithdrawalNonceResponse, type WithdrawalRequest, applyRefreshResponse, buildHostedAuthSession, buildSiweStatement, buttonVariants, clearHostedAuthPendingTransaction, createDomain, createHostedAuthPendingStorageKey, createHostedAuthState, createHostedAuthStorageKey, createLockExpiry, createPkceChallenge, createPkceVerifier, getChainById, getChainIcon, getExplorerAddressUrl, getTokenIcon, isHostedAuthRefreshActive, isHostedAuthSessionActive, parseHostedAuthCallback, persistHostedAuthPendingTransaction, readHostedAuthPendingTransaction, readStoredHostedAuthSession, signLockMessage, signModifyLockMessage, signTransferLockedMessage, signTransferMessage, signWithdrawFromLockMessage, signWithdrawMessage, stripHostedAuthCallbackParams, syncHostedAuthSessionToClient, useBalance, useBatchBalances, useDeposit, useDepositVerification, useExpiredLocks, useHistory, useHostedRedirectAuth, useLockFunds, useLockedFunds, useModifyLock, usePendingWithdrawals, usePrivanaClient, usePrivanaContext, useSafeAccount, useSafePrivanaContext, useSiweAuth, useTokenInfo, useTokenList, useTotalLockedBalance, useTransfer, useUnlockFunds, useWithdraw };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { usePrivanaContext, createHostedAuthPendingStorageKey, clearHostedAuthPendingTransaction, HostedAuthRequiredError, HostedAuthError, createPkceVerifier, createPkceChallenge, createHostedAuthState, persistHostedAuthPendingTransaction, parseHostedAuthCallback, readHostedAuthPendingTransaction, HostedAuthStateMismatchError, buildHostedAuthSession, useSafePrivanaContext, usePrivateReadRequest, formatTokenAmount, useDepositVerification, getTransactionReceipt, waitForTransactionReceipt, cn, Button, stripHostedAuthCallbackParams, AccountingApiError, getChainId2, shortenAddress, formatTimeRemaining, parseTokenAmount, getExplorerAddressUrl } from './chunk-
|
|
3
|
-
export { AccountingApiError, Button, HOSTED_AUTH_CLOCK_SKEW_MS, HostedAuthError, HostedAuthRequiredError, HostedAuthStateMismatchError, HttpClient, NETWORK_CONFIG, NetworkError, PrivanaClient, PrivanaProvider, SUPPORTED_CHAINS, SiweAuthProvider, Skeleton, ValidationError, applyRefreshResponse, buildHostedAuthSession, buttonVariants, clearHostedAuthPendingTransaction, createHostedAuthPendingStorageKey, createHostedAuthState, createHostedAuthStorageKey, createPkceChallenge, createPkceVerifier, getAccountingContract, getApiUrl, getChainById, getChainId, getExplorerAddressUrl, isHostedAuthRefreshActive, isHostedAuthSessionActive, normalizeAddress, normalizeHex, parseHostedAuthCallback, persistHostedAuthPendingTransaction, readHostedAuthPendingTransaction, readStoredHostedAuthSession, stripHostedAuthCallbackParams, syncHostedAuthSessionToClient, useDepositVerification, usePrivanaContext, useSafeAccount, useSafePrivanaContext, useSiweAuth } from './chunk-
|
|
2
|
+
import { usePrivanaContext, createHostedAuthPendingStorageKey, clearHostedAuthPendingTransaction, HostedAuthRequiredError, HostedAuthError, createPkceVerifier, createPkceChallenge, createHostedAuthState, persistHostedAuthPendingTransaction, parseHostedAuthCallback, readHostedAuthPendingTransaction, HostedAuthStateMismatchError, buildHostedAuthSession, useSafePrivanaContext, usePrivateReadRequest, formatTokenAmount, useDepositVerification, getTransactionReceipt, waitForTransactionReceipt, cn, Button, stripHostedAuthCallbackParams, AccountingApiError, getChainId2, shortenAddress, formatTimeRemaining, parseTokenAmount, getExplorerAddressUrl } from './chunk-WV6CGHEF.js';
|
|
3
|
+
export { AccountingApiError, Button, HOSTED_AUTH_CLOCK_SKEW_MS, HostedAuthError, HostedAuthRequiredError, HostedAuthStateMismatchError, HttpClient, NETWORK_CONFIG, NetworkError, PrivanaClient, PrivanaProvider, SUPPORTED_CHAINS, SiweAuthProvider, Skeleton, ValidationError, applyRefreshResponse, buildHostedAuthSession, buildSiweStatement, buttonVariants, clearHostedAuthPendingTransaction, createHostedAuthPendingStorageKey, createHostedAuthState, createHostedAuthStorageKey, createPkceChallenge, createPkceVerifier, getAccountingContract, getApiUrl, getChainById, getChainId, getExplorerAddressUrl, isHostedAuthRefreshActive, isHostedAuthSessionActive, normalizeAddress, normalizeHex, parseHostedAuthCallback, persistHostedAuthPendingTransaction, readHostedAuthPendingTransaction, readStoredHostedAuthSession, stripHostedAuthCallbackParams, syncHostedAuthSessionToClient, useDepositVerification, usePrivanaContext, useSafeAccount, useSafePrivanaContext, useSiweAuth } from './chunk-WV6CGHEF.js';
|
|
4
4
|
import { useState, useRef, useMemo, useCallback, useContext, useEffect, useId } from 'react';
|
|
5
5
|
import { QueryClientContext, useQuery, useQueryClient, useMutation, keepPreviousData } from '@tanstack/react-query';
|
|
6
6
|
import { useAccount, useWalletClient, useConfig, useWriteContract, useSendTransaction, useChainId, useSwitchChain, useBalance as useBalance$1, useReadContract } from 'wagmi';
|
package/dist/on-ramp.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkNMRIKUDN_cjs = require('./chunk-NMRIKUDN.cjs');
|
|
5
5
|
var react = require('react');
|
|
6
6
|
var viem = require('viem');
|
|
7
7
|
var wagmi = require('wagmi');
|
|
@@ -21,8 +21,8 @@ function useFiatOnRamp(options) {
|
|
|
21
21
|
const deliveryPollInterval = options.deliveryPollInterval ?? 3e3;
|
|
22
22
|
const verificationTimeout = options.verificationTimeout ?? DEFAULT_VERIFICATION_TIMEOUT_MS;
|
|
23
23
|
const finalityRetryInterval = options.finalityRetryInterval ?? DEFAULT_FINALITY_RETRY_INTERVAL_MS;
|
|
24
|
-
const { client, enabledTokens } =
|
|
25
|
-
const { executePrivateRead, privateReadReady } =
|
|
24
|
+
const { client, enabledTokens } = chunkNMRIKUDN_cjs.usePrivanaContext();
|
|
25
|
+
const { executePrivateRead, privateReadReady } = chunkNMRIKUDN_cjs.usePrivateReadRequest();
|
|
26
26
|
const wagmiConfig = wagmi.useConfig();
|
|
27
27
|
const selectedToken = enabledTokens.find((t) => t.id.toLowerCase() === tokenId.toLowerCase());
|
|
28
28
|
const [status, setStatus] = react.useState("idle");
|
|
@@ -133,7 +133,7 @@ function useFiatOnRamp(options) {
|
|
|
133
133
|
activeVerificationKeyRef.current = null;
|
|
134
134
|
activeVerificationRecordRef.current = null;
|
|
135
135
|
}, []);
|
|
136
|
-
const { verify } =
|
|
136
|
+
const { verify } = chunkNMRIKUDN_cjs.useDepositVerification({
|
|
137
137
|
pollTimeout: verificationTimeout,
|
|
138
138
|
pollInterval: options.verificationPollInterval,
|
|
139
139
|
finalityRetryInterval,
|
|
@@ -637,7 +637,7 @@ async function resolveDeliveredAmount({
|
|
|
637
637
|
}
|
|
638
638
|
let receiptError;
|
|
639
639
|
try {
|
|
640
|
-
const receipt = await
|
|
640
|
+
const receipt = await chunkNMRIKUDN_cjs.waitForTransactionReceipt(wagmiConfig, {
|
|
641
641
|
hash: onChainTxHash,
|
|
642
642
|
chainId,
|
|
643
643
|
timeout: 6e4,
|
|
@@ -875,7 +875,7 @@ function FiatOnRampForm({
|
|
|
875
875
|
emitFormDebug("moonpay:onReady");
|
|
876
876
|
}, [emitFormDebug]);
|
|
877
877
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-privana": true, className: "flex flex-col gap-4", children: [
|
|
878
|
-
isInitializing ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
878
|
+
isInitializing ? /* @__PURE__ */ jsxRuntime.jsx(chunkNMRIKUDN_cjs.Skeleton, { className: "h-9 w-full rounded-md" }) : /* @__PURE__ */ jsxRuntime.jsxs(chunkNMRIKUDN_cjs.Button, { type: "button", onClick: handleOpen, disabled: !canBuy, children: [
|
|
879
879
|
(isBusy || visible) && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "animate-spin", "aria-hidden": true }),
|
|
880
880
|
"Buy"
|
|
881
881
|
] }),
|
|
@@ -910,7 +910,7 @@ function FiatOnRampForm({
|
|
|
910
910
|
] }),
|
|
911
911
|
rowError?.id === record.transaction_id && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-destructive text-xs", children: rowError.message }),
|
|
912
912
|
showRetry && /* @__PURE__ */ jsxRuntime.jsx(
|
|
913
|
-
|
|
913
|
+
chunkNMRIKUDN_cjs.Button,
|
|
914
914
|
{
|
|
915
915
|
type: "button",
|
|
916
916
|
variant: "outline",
|
package/dist/on-ramp.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MoonPayBuyWidget } from '@moonpay/moonpay-react';
|
|
2
|
-
import { B as Bytes32, O as OnRampRecord, T as TokenConfig } from './on-ramp-
|
|
3
|
-
export { C as CreateOnRampIntentRequest, c as CreateOnRampIntentResponse, g as OnRampStatus, P as PendingOnRampsResponse, S as SignOnRampUrlRequest, b as SignOnRampUrlResponse, U as UpdateOnRampRequest, d as UpdateOnRampResponse } from './on-ramp-
|
|
2
|
+
import { B as Bytes32, O as OnRampRecord, T as TokenConfig } from './on-ramp-CdXqJjmm.cjs';
|
|
3
|
+
export { C as CreateOnRampIntentRequest, c as CreateOnRampIntentResponse, g as OnRampStatus, P as PendingOnRampsResponse, S as SignOnRampUrlRequest, b as SignOnRampUrlResponse, U as UpdateOnRampRequest, d as UpdateOnRampResponse } from './on-ramp-CdXqJjmm.cjs';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
6
|
type MoonPayBuyProps = Parameters<typeof MoonPayBuyWidget>[0];
|
package/dist/on-ramp.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MoonPayBuyWidget } from '@moonpay/moonpay-react';
|
|
2
|
-
import { B as Bytes32, O as OnRampRecord, T as TokenConfig } from './on-ramp-
|
|
3
|
-
export { C as CreateOnRampIntentRequest, c as CreateOnRampIntentResponse, g as OnRampStatus, P as PendingOnRampsResponse, S as SignOnRampUrlRequest, b as SignOnRampUrlResponse, U as UpdateOnRampRequest, d as UpdateOnRampResponse } from './on-ramp-
|
|
2
|
+
import { B as Bytes32, O as OnRampRecord, T as TokenConfig } from './on-ramp-CdXqJjmm.js';
|
|
3
|
+
export { C as CreateOnRampIntentRequest, c as CreateOnRampIntentResponse, g as OnRampStatus, P as PendingOnRampsResponse, S as SignOnRampUrlRequest, b as SignOnRampUrlResponse, U as UpdateOnRampRequest, d as UpdateOnRampResponse } from './on-ramp-CdXqJjmm.js';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
6
|
type MoonPayBuyProps = Parameters<typeof MoonPayBuyWidget>[0];
|
package/dist/on-ramp.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { usePrivanaContext, usePrivateReadRequest, useDepositVerification, waitForTransactionReceipt, Skeleton, Button } from './chunk-
|
|
2
|
+
import { usePrivanaContext, usePrivateReadRequest, useDepositVerification, waitForTransactionReceipt, Skeleton, Button } from './chunk-WV6CGHEF.js';
|
|
3
3
|
import { useState, useRef, useEffect, useCallback, useMemo } from 'react';
|
|
4
4
|
import { parseAbiItem, zeroAddress, parseUnits, decodeEventLog, formatUnits } from 'viem';
|
|
5
5
|
import { useConfig, useAccount } from 'wagmi';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oasisprotocol/privana-sdk",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"description": "React SDK for Privana - manage deposits, withdrawals, locks, and transfers",
|
|
5
5
|
"author": "Oasis Protocol Foundation <security@oasisprotocol.org>",
|
|
6
6
|
"license": "Apache-2.0",
|