@naculus/connect-appkit-core 0.12.1 → 0.14.0
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 +18 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -2
- package/dist/index.d.ts +17 -2
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Namespace, UniversalWalletSession, WalletCapabilities, TokenConfig, WalletError, WalletErrorCode, SimulationResult, NameResolverConfig, NameResolver, NotificationSettings, InAppChannel, NotificationItem, SessionKeyManagerConfig, SessionKeyManager, Hex, UserOperationReceipt, Address, SmartAccountConfig, AtomicityRequirement, ExecutionPlan, SessionKeyInfo, SessionKeyTransaction, delegationTypedData,
|
|
1
|
+
import { Namespace, UniversalWalletSession, WalletCapabilities, TokenConfig, WalletError, WalletErrorCode, SimulationResult, NameResolverConfig, NameResolver, NotificationSettings, InAppChannel, NotificationItem, SessionKeyManagerConfig, SessionKeyManager, SessionKeyRail, SessionKeyScope, Hex, UserOperationReceipt, Address, SmartAccountConfig, AtomicityRequirement, ExecutionPlan, SessionKeyInfo, SessionKeyTransaction, delegationTypedData, ScopeCheckResult, SpendRefusal, Authorization, ListedAuthorization, SpendRequest, SettlementVerification, SolanaSessionKeyInfo, SolanaSessionKeyScope, SolanaSessionKeyManager, SolanaPaymentRpc } from '@naculus/connect-core';
|
|
2
2
|
import { X402TypedDataSigner } from '@naculus/payments-x402';
|
|
3
3
|
export { X402TypedDataSigner } from '@naculus/payments-x402';
|
|
4
4
|
|
|
@@ -632,6 +632,21 @@ declare function getSharedSessionKeyManager(config?: SessionKeyManagerConfig): S
|
|
|
632
632
|
/** Drop the shared instance. For tests and for a full sign-out that must forget keys. */
|
|
633
633
|
declare function resetSharedSessionKeyManager(): void;
|
|
634
634
|
|
|
635
|
+
type Eip3009SessionKeyRail = Extract<SessionKeyRail, "x402-exact" | "mpp-charge">;
|
|
636
|
+
type SessionKeyRailGrantCheck = {
|
|
637
|
+
status: "ok";
|
|
638
|
+
rail: Eip3009SessionKeyRail;
|
|
639
|
+
} | {
|
|
640
|
+
status: "needs-regrant";
|
|
641
|
+
missingRail: Eip3009SessionKeyRail;
|
|
642
|
+
};
|
|
643
|
+
/**
|
|
644
|
+
* Checks whether a stored session-key scope can sign EIP-3009 for `rail`.
|
|
645
|
+
* Legacy, empty, unknown, and malformed rail lists fail closed and require a
|
|
646
|
+
* new wallet-approved grant.
|
|
647
|
+
*/
|
|
648
|
+
declare function checkSessionKeyRailGrant(scope: SessionKeyScope | null | undefined, rail: Eip3009SessionKeyRail): SessionKeyRailGrantCheck;
|
|
649
|
+
|
|
635
650
|
/**
|
|
636
651
|
* Validation of an ERC-4337 `eth_getUserOperationReceipt` result, shared by
|
|
637
652
|
* the React hook and the Vue composable. A bundler is an untrusted party:
|
|
@@ -1215,4 +1230,4 @@ declare function siwxResultToSession<M extends SiwxMessageLike>(result: SiwxResu
|
|
|
1215
1230
|
refreshedAt: null;
|
|
1216
1231
|
};
|
|
1217
1232
|
|
|
1218
|
-
export { type AddressValidationLevel, type AssetId, type AtomicSupport, type AuthorizationAmountView, type AuthorizationAssetMetadata, type AuthorizationDescription, type AuthorizationExpiryView, type AuthorizationGrantView, type AuthorizationRecipientView, type ChainCapabilities, type ChainInfo, type CompareCosts, type CompareCostsInput, type ConnectionStatus, type CostComparison, type CostComparisonOperation, type CostComparisonOptions, DEFAULT_NOTIFICATION_SETTINGS, DEFAULT_VERIFY_RETRY, type DecimalsCache, type DelegationFrameworkAdapterOptions, type DelegationPolicyDeps, type DelegationPolicyFlow, type DelegationPolicyPreview, type DelegationTypedData, type DescribeAuthorizationOptions, type DestinationIssue, type DestinationValidation, type ExecutableQuote, type ExecuteRoute, type ExecuteRouteError, type ExecuteRouteOptions, type ExecuteRouteResult, type GetRouteQuotes, InvalidUserOperationReceiptError, type MppSessionChannel, type MppSessionFetch, type MppSessionFetchResult, type MppSessionForceCloseResult, type MppSessionMeter, type MppSessionReceipt, type MppSessionRequest, type MppSessionRequestInit, NOTIFICATION_SETTINGS_KEY, type NotificationSettingsStorage, type NotificationSettingsUpdate, type PaymentFetch, type PaymentFetchResult, type PaymentRecord, type PaymentVerification, type PaymentVerificationStatus, type PolicyExecutionAdapter, type PolicyExecutionCheck, type PolicyExecutionPreview, type PolicyExecutionRoute, type PolicyExecutionSubmission, type PolicySignatureVerifier, type PreparedPolicyExecution, type RedemptionCodec, type RedemptionRpc, type RedemptionTransaction, type RetryOptions, type RouteQuote, type RouteQuoteInput, type RouteQuoteOptions, type SimulationCallClient, type SimulationTransaction, type SiwxLocation, type SiwxMessageLike, type SiwxResultLike, type SmartAccountOptionsLike, type SmartAccountType, type SolanaIdentity, type SolanaOwnerSigner, type SolanaPayer, type SolanaRoles, type SolanaRolesAbsence, type SolanaRolesSource, type SolanaRolesState, type SolanaSessionKeyFlow, type SolanaSessionKeyFlowDeps, type SolanaSigner, type SolanaWalletFeatures, type SpendExplanation, type TokenIdentity, type TransactionSimulationContext, type VerifyRetryOptions, type ViemChainShape, type WalletChain, type Web3Action, type Web3State, type X402Eip1193Provider, type X402ProviderSources, type X402SignerResolution, type X402SignerUnavailableReason, type X402WalletResolution, __resetResolverForTests, addInAppNotification, applySettlementVerification, assertHexSignature, atomicSupportFor, bareEvmAddress, buildDelegationPolicyMessage, buildSmartAccountConfig, chainNamespace, chainNumber, chainsForNamespace, channelsUpdate, clearOneInAppNotification, compareCostsKey, createDecimalsCache, createDelegationFrameworkAdapter, createDelegationPolicyFlow, createNotification, createNotificationSettingsStorage, createSolanaSessionKeyFlow, createX402WalletSigner, decodeRevertReason, defaultSiwxDomain, defaultSiwxUri, describeAuthorization, describeChain, describePayment, eip155ChainIdToNumber, encodeErc20Approve, encodeErc20Transfer, encodeErc20TransferFrom, errorMessage, explainSpend, fetchUserOperationReceipt, findX402Provider, formatAuthorizationAmount, getResolver, getSharedSessionKeyManager, initialWeb3State, isBurnDestination, isEvmChainId, isPositiveIntegerAmount, isQuotableInput, isSiwxExpired, isSiwxNotBeforeValid, isVerifiablePolicy, loadNotificationSettings, mutedChainSettings, normalizeCapabilities, normalizeEip155ChainId, parseUserOperationReceipt, readCurrentMppSessionChannel, readDecimals, readMppRecoveryChannelId, readMppSessionChannel, readMppSessionReceipt, readSolanaRoles, replayNotificationSettings, resetSharedSessionKeyManager, resolveChain, resolveContextSimulationEndpoint, resolveEvmChainId, resolveRevertReason, resolveSimulationEndpoint, resolveUserOpChain, resolveX402Wallet, sameExecutionIntent, saveNotificationSettings, selectChainCapabilities, sessionKeyConfigFingerprint, simulateTransactionPreview, siwxResultToSession, toChainSwitchError, toEip155Accounts, toExecuteRouteError, toViemChain, tokenChainMismatch, tokenKey, updateNotificationSettings, validateDestination, validateRouteRecipient, web3Reducer, withRetry, withTimeout, writeDecimals };
|
|
1233
|
+
export { type AddressValidationLevel, type AssetId, type AtomicSupport, type AuthorizationAmountView, type AuthorizationAssetMetadata, type AuthorizationDescription, type AuthorizationExpiryView, type AuthorizationGrantView, type AuthorizationRecipientView, type ChainCapabilities, type ChainInfo, type CompareCosts, type CompareCostsInput, type ConnectionStatus, type CostComparison, type CostComparisonOperation, type CostComparisonOptions, DEFAULT_NOTIFICATION_SETTINGS, DEFAULT_VERIFY_RETRY, type DecimalsCache, type DelegationFrameworkAdapterOptions, type DelegationPolicyDeps, type DelegationPolicyFlow, type DelegationPolicyPreview, type DelegationTypedData, type DescribeAuthorizationOptions, type DestinationIssue, type DestinationValidation, type Eip3009SessionKeyRail, type ExecutableQuote, type ExecuteRoute, type ExecuteRouteError, type ExecuteRouteOptions, type ExecuteRouteResult, type GetRouteQuotes, InvalidUserOperationReceiptError, type MppSessionChannel, type MppSessionFetch, type MppSessionFetchResult, type MppSessionForceCloseResult, type MppSessionMeter, type MppSessionReceipt, type MppSessionRequest, type MppSessionRequestInit, NOTIFICATION_SETTINGS_KEY, type NotificationSettingsStorage, type NotificationSettingsUpdate, type PaymentFetch, type PaymentFetchResult, type PaymentRecord, type PaymentVerification, type PaymentVerificationStatus, type PolicyExecutionAdapter, type PolicyExecutionCheck, type PolicyExecutionPreview, type PolicyExecutionRoute, type PolicyExecutionSubmission, type PolicySignatureVerifier, type PreparedPolicyExecution, type RedemptionCodec, type RedemptionRpc, type RedemptionTransaction, type RetryOptions, type RouteQuote, type RouteQuoteInput, type RouteQuoteOptions, type SessionKeyRailGrantCheck, type SimulationCallClient, type SimulationTransaction, type SiwxLocation, type SiwxMessageLike, type SiwxResultLike, type SmartAccountOptionsLike, type SmartAccountType, type SolanaIdentity, type SolanaOwnerSigner, type SolanaPayer, type SolanaRoles, type SolanaRolesAbsence, type SolanaRolesSource, type SolanaRolesState, type SolanaSessionKeyFlow, type SolanaSessionKeyFlowDeps, type SolanaSigner, type SolanaWalletFeatures, type SpendExplanation, type TokenIdentity, type TransactionSimulationContext, type VerifyRetryOptions, type ViemChainShape, type WalletChain, type Web3Action, type Web3State, type X402Eip1193Provider, type X402ProviderSources, type X402SignerResolution, type X402SignerUnavailableReason, type X402WalletResolution, __resetResolverForTests, addInAppNotification, applySettlementVerification, assertHexSignature, atomicSupportFor, bareEvmAddress, buildDelegationPolicyMessage, buildSmartAccountConfig, chainNamespace, chainNumber, chainsForNamespace, channelsUpdate, checkSessionKeyRailGrant, clearOneInAppNotification, compareCostsKey, createDecimalsCache, createDelegationFrameworkAdapter, createDelegationPolicyFlow, createNotification, createNotificationSettingsStorage, createSolanaSessionKeyFlow, createX402WalletSigner, decodeRevertReason, defaultSiwxDomain, defaultSiwxUri, describeAuthorization, describeChain, describePayment, eip155ChainIdToNumber, encodeErc20Approve, encodeErc20Transfer, encodeErc20TransferFrom, errorMessage, explainSpend, fetchUserOperationReceipt, findX402Provider, formatAuthorizationAmount, getResolver, getSharedSessionKeyManager, initialWeb3State, isBurnDestination, isEvmChainId, isPositiveIntegerAmount, isQuotableInput, isSiwxExpired, isSiwxNotBeforeValid, isVerifiablePolicy, loadNotificationSettings, mutedChainSettings, normalizeCapabilities, normalizeEip155ChainId, parseUserOperationReceipt, readCurrentMppSessionChannel, readDecimals, readMppRecoveryChannelId, readMppSessionChannel, readMppSessionReceipt, readSolanaRoles, replayNotificationSettings, resetSharedSessionKeyManager, resolveChain, resolveContextSimulationEndpoint, resolveEvmChainId, resolveRevertReason, resolveSimulationEndpoint, resolveUserOpChain, resolveX402Wallet, sameExecutionIntent, saveNotificationSettings, selectChainCapabilities, sessionKeyConfigFingerprint, simulateTransactionPreview, siwxResultToSession, toChainSwitchError, toEip155Accounts, toExecuteRouteError, toViemChain, tokenChainMismatch, tokenKey, updateNotificationSettings, validateDestination, validateRouteRecipient, web3Reducer, withRetry, withTimeout, writeDecimals };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Namespace, UniversalWalletSession, WalletCapabilities, TokenConfig, WalletError, WalletErrorCode, SimulationResult, NameResolverConfig, NameResolver, NotificationSettings, InAppChannel, NotificationItem, SessionKeyManagerConfig, SessionKeyManager, Hex, UserOperationReceipt, Address, SmartAccountConfig, AtomicityRequirement, ExecutionPlan, SessionKeyInfo, SessionKeyTransaction, delegationTypedData,
|
|
1
|
+
import { Namespace, UniversalWalletSession, WalletCapabilities, TokenConfig, WalletError, WalletErrorCode, SimulationResult, NameResolverConfig, NameResolver, NotificationSettings, InAppChannel, NotificationItem, SessionKeyManagerConfig, SessionKeyManager, SessionKeyRail, SessionKeyScope, Hex, UserOperationReceipt, Address, SmartAccountConfig, AtomicityRequirement, ExecutionPlan, SessionKeyInfo, SessionKeyTransaction, delegationTypedData, ScopeCheckResult, SpendRefusal, Authorization, ListedAuthorization, SpendRequest, SettlementVerification, SolanaSessionKeyInfo, SolanaSessionKeyScope, SolanaSessionKeyManager, SolanaPaymentRpc } from '@naculus/connect-core';
|
|
2
2
|
import { X402TypedDataSigner } from '@naculus/payments-x402';
|
|
3
3
|
export { X402TypedDataSigner } from '@naculus/payments-x402';
|
|
4
4
|
|
|
@@ -632,6 +632,21 @@ declare function getSharedSessionKeyManager(config?: SessionKeyManagerConfig): S
|
|
|
632
632
|
/** Drop the shared instance. For tests and for a full sign-out that must forget keys. */
|
|
633
633
|
declare function resetSharedSessionKeyManager(): void;
|
|
634
634
|
|
|
635
|
+
type Eip3009SessionKeyRail = Extract<SessionKeyRail, "x402-exact" | "mpp-charge">;
|
|
636
|
+
type SessionKeyRailGrantCheck = {
|
|
637
|
+
status: "ok";
|
|
638
|
+
rail: Eip3009SessionKeyRail;
|
|
639
|
+
} | {
|
|
640
|
+
status: "needs-regrant";
|
|
641
|
+
missingRail: Eip3009SessionKeyRail;
|
|
642
|
+
};
|
|
643
|
+
/**
|
|
644
|
+
* Checks whether a stored session-key scope can sign EIP-3009 for `rail`.
|
|
645
|
+
* Legacy, empty, unknown, and malformed rail lists fail closed and require a
|
|
646
|
+
* new wallet-approved grant.
|
|
647
|
+
*/
|
|
648
|
+
declare function checkSessionKeyRailGrant(scope: SessionKeyScope | null | undefined, rail: Eip3009SessionKeyRail): SessionKeyRailGrantCheck;
|
|
649
|
+
|
|
635
650
|
/**
|
|
636
651
|
* Validation of an ERC-4337 `eth_getUserOperationReceipt` result, shared by
|
|
637
652
|
* the React hook and the Vue composable. A bundler is an untrusted party:
|
|
@@ -1215,4 +1230,4 @@ declare function siwxResultToSession<M extends SiwxMessageLike>(result: SiwxResu
|
|
|
1215
1230
|
refreshedAt: null;
|
|
1216
1231
|
};
|
|
1217
1232
|
|
|
1218
|
-
export { type AddressValidationLevel, type AssetId, type AtomicSupport, type AuthorizationAmountView, type AuthorizationAssetMetadata, type AuthorizationDescription, type AuthorizationExpiryView, type AuthorizationGrantView, type AuthorizationRecipientView, type ChainCapabilities, type ChainInfo, type CompareCosts, type CompareCostsInput, type ConnectionStatus, type CostComparison, type CostComparisonOperation, type CostComparisonOptions, DEFAULT_NOTIFICATION_SETTINGS, DEFAULT_VERIFY_RETRY, type DecimalsCache, type DelegationFrameworkAdapterOptions, type DelegationPolicyDeps, type DelegationPolicyFlow, type DelegationPolicyPreview, type DelegationTypedData, type DescribeAuthorizationOptions, type DestinationIssue, type DestinationValidation, type ExecutableQuote, type ExecuteRoute, type ExecuteRouteError, type ExecuteRouteOptions, type ExecuteRouteResult, type GetRouteQuotes, InvalidUserOperationReceiptError, type MppSessionChannel, type MppSessionFetch, type MppSessionFetchResult, type MppSessionForceCloseResult, type MppSessionMeter, type MppSessionReceipt, type MppSessionRequest, type MppSessionRequestInit, NOTIFICATION_SETTINGS_KEY, type NotificationSettingsStorage, type NotificationSettingsUpdate, type PaymentFetch, type PaymentFetchResult, type PaymentRecord, type PaymentVerification, type PaymentVerificationStatus, type PolicyExecutionAdapter, type PolicyExecutionCheck, type PolicyExecutionPreview, type PolicyExecutionRoute, type PolicyExecutionSubmission, type PolicySignatureVerifier, type PreparedPolicyExecution, type RedemptionCodec, type RedemptionRpc, type RedemptionTransaction, type RetryOptions, type RouteQuote, type RouteQuoteInput, type RouteQuoteOptions, type SimulationCallClient, type SimulationTransaction, type SiwxLocation, type SiwxMessageLike, type SiwxResultLike, type SmartAccountOptionsLike, type SmartAccountType, type SolanaIdentity, type SolanaOwnerSigner, type SolanaPayer, type SolanaRoles, type SolanaRolesAbsence, type SolanaRolesSource, type SolanaRolesState, type SolanaSessionKeyFlow, type SolanaSessionKeyFlowDeps, type SolanaSigner, type SolanaWalletFeatures, type SpendExplanation, type TokenIdentity, type TransactionSimulationContext, type VerifyRetryOptions, type ViemChainShape, type WalletChain, type Web3Action, type Web3State, type X402Eip1193Provider, type X402ProviderSources, type X402SignerResolution, type X402SignerUnavailableReason, type X402WalletResolution, __resetResolverForTests, addInAppNotification, applySettlementVerification, assertHexSignature, atomicSupportFor, bareEvmAddress, buildDelegationPolicyMessage, buildSmartAccountConfig, chainNamespace, chainNumber, chainsForNamespace, channelsUpdate, clearOneInAppNotification, compareCostsKey, createDecimalsCache, createDelegationFrameworkAdapter, createDelegationPolicyFlow, createNotification, createNotificationSettingsStorage, createSolanaSessionKeyFlow, createX402WalletSigner, decodeRevertReason, defaultSiwxDomain, defaultSiwxUri, describeAuthorization, describeChain, describePayment, eip155ChainIdToNumber, encodeErc20Approve, encodeErc20Transfer, encodeErc20TransferFrom, errorMessage, explainSpend, fetchUserOperationReceipt, findX402Provider, formatAuthorizationAmount, getResolver, getSharedSessionKeyManager, initialWeb3State, isBurnDestination, isEvmChainId, isPositiveIntegerAmount, isQuotableInput, isSiwxExpired, isSiwxNotBeforeValid, isVerifiablePolicy, loadNotificationSettings, mutedChainSettings, normalizeCapabilities, normalizeEip155ChainId, parseUserOperationReceipt, readCurrentMppSessionChannel, readDecimals, readMppRecoveryChannelId, readMppSessionChannel, readMppSessionReceipt, readSolanaRoles, replayNotificationSettings, resetSharedSessionKeyManager, resolveChain, resolveContextSimulationEndpoint, resolveEvmChainId, resolveRevertReason, resolveSimulationEndpoint, resolveUserOpChain, resolveX402Wallet, sameExecutionIntent, saveNotificationSettings, selectChainCapabilities, sessionKeyConfigFingerprint, simulateTransactionPreview, siwxResultToSession, toChainSwitchError, toEip155Accounts, toExecuteRouteError, toViemChain, tokenChainMismatch, tokenKey, updateNotificationSettings, validateDestination, validateRouteRecipient, web3Reducer, withRetry, withTimeout, writeDecimals };
|
|
1233
|
+
export { type AddressValidationLevel, type AssetId, type AtomicSupport, type AuthorizationAmountView, type AuthorizationAssetMetadata, type AuthorizationDescription, type AuthorizationExpiryView, type AuthorizationGrantView, type AuthorizationRecipientView, type ChainCapabilities, type ChainInfo, type CompareCosts, type CompareCostsInput, type ConnectionStatus, type CostComparison, type CostComparisonOperation, type CostComparisonOptions, DEFAULT_NOTIFICATION_SETTINGS, DEFAULT_VERIFY_RETRY, type DecimalsCache, type DelegationFrameworkAdapterOptions, type DelegationPolicyDeps, type DelegationPolicyFlow, type DelegationPolicyPreview, type DelegationTypedData, type DescribeAuthorizationOptions, type DestinationIssue, type DestinationValidation, type Eip3009SessionKeyRail, type ExecutableQuote, type ExecuteRoute, type ExecuteRouteError, type ExecuteRouteOptions, type ExecuteRouteResult, type GetRouteQuotes, InvalidUserOperationReceiptError, type MppSessionChannel, type MppSessionFetch, type MppSessionFetchResult, type MppSessionForceCloseResult, type MppSessionMeter, type MppSessionReceipt, type MppSessionRequest, type MppSessionRequestInit, NOTIFICATION_SETTINGS_KEY, type NotificationSettingsStorage, type NotificationSettingsUpdate, type PaymentFetch, type PaymentFetchResult, type PaymentRecord, type PaymentVerification, type PaymentVerificationStatus, type PolicyExecutionAdapter, type PolicyExecutionCheck, type PolicyExecutionPreview, type PolicyExecutionRoute, type PolicyExecutionSubmission, type PolicySignatureVerifier, type PreparedPolicyExecution, type RedemptionCodec, type RedemptionRpc, type RedemptionTransaction, type RetryOptions, type RouteQuote, type RouteQuoteInput, type RouteQuoteOptions, type SessionKeyRailGrantCheck, type SimulationCallClient, type SimulationTransaction, type SiwxLocation, type SiwxMessageLike, type SiwxResultLike, type SmartAccountOptionsLike, type SmartAccountType, type SolanaIdentity, type SolanaOwnerSigner, type SolanaPayer, type SolanaRoles, type SolanaRolesAbsence, type SolanaRolesSource, type SolanaRolesState, type SolanaSessionKeyFlow, type SolanaSessionKeyFlowDeps, type SolanaSigner, type SolanaWalletFeatures, type SpendExplanation, type TokenIdentity, type TransactionSimulationContext, type VerifyRetryOptions, type ViemChainShape, type WalletChain, type Web3Action, type Web3State, type X402Eip1193Provider, type X402ProviderSources, type X402SignerResolution, type X402SignerUnavailableReason, type X402WalletResolution, __resetResolverForTests, addInAppNotification, applySettlementVerification, assertHexSignature, atomicSupportFor, bareEvmAddress, buildDelegationPolicyMessage, buildSmartAccountConfig, chainNamespace, chainNumber, chainsForNamespace, channelsUpdate, checkSessionKeyRailGrant, clearOneInAppNotification, compareCostsKey, createDecimalsCache, createDelegationFrameworkAdapter, createDelegationPolicyFlow, createNotification, createNotificationSettingsStorage, createSolanaSessionKeyFlow, createX402WalletSigner, decodeRevertReason, defaultSiwxDomain, defaultSiwxUri, describeAuthorization, describeChain, describePayment, eip155ChainIdToNumber, encodeErc20Approve, encodeErc20Transfer, encodeErc20TransferFrom, errorMessage, explainSpend, fetchUserOperationReceipt, findX402Provider, formatAuthorizationAmount, getResolver, getSharedSessionKeyManager, initialWeb3State, isBurnDestination, isEvmChainId, isPositiveIntegerAmount, isQuotableInput, isSiwxExpired, isSiwxNotBeforeValid, isVerifiablePolicy, loadNotificationSettings, mutedChainSettings, normalizeCapabilities, normalizeEip155ChainId, parseUserOperationReceipt, readCurrentMppSessionChannel, readDecimals, readMppRecoveryChannelId, readMppSessionChannel, readMppSessionReceipt, readSolanaRoles, replayNotificationSettings, resetSharedSessionKeyManager, resolveChain, resolveContextSimulationEndpoint, resolveEvmChainId, resolveRevertReason, resolveSimulationEndpoint, resolveUserOpChain, resolveX402Wallet, sameExecutionIntent, saveNotificationSettings, selectChainCapabilities, sessionKeyConfigFingerprint, simulateTransactionPreview, siwxResultToSession, toChainSwitchError, toEip155Accounts, toExecuteRouteError, toViemChain, tokenChainMismatch, tokenKey, updateNotificationSettings, validateDestination, validateRouteRecipient, web3Reducer, withRetry, withTimeout, writeDecimals };
|
package/dist/index.js
CHANGED
|
@@ -670,6 +670,22 @@ function resetSharedSessionKeyManager() {
|
|
|
670
670
|
sharedFingerprint = null;
|
|
671
671
|
}
|
|
672
672
|
|
|
673
|
+
// src/session-key-rail.ts
|
|
674
|
+
var knownRails = /* @__PURE__ */ new Set([
|
|
675
|
+
"transfer",
|
|
676
|
+
"x402-exact",
|
|
677
|
+
"mpp-charge"
|
|
678
|
+
]);
|
|
679
|
+
function checkSessionKeyRailGrant(scope, rail) {
|
|
680
|
+
const rails = scope?.rails;
|
|
681
|
+
if (!Array.isArray(rails) || rails.length === 0 || new Set(rails).size !== rails.length || !Array.from(rails).every(
|
|
682
|
+
(candidate) => typeof candidate === "string" && knownRails.has(candidate)
|
|
683
|
+
) || !rails.includes(rail)) {
|
|
684
|
+
return { status: "needs-regrant", missingRail: rail };
|
|
685
|
+
}
|
|
686
|
+
return { status: "ok", rail };
|
|
687
|
+
}
|
|
688
|
+
|
|
673
689
|
// src/user-op-receipt.ts
|
|
674
690
|
var InvalidUserOperationReceiptError = class extends Error {
|
|
675
691
|
constructor(message) {
|
|
@@ -1856,6 +1872,7 @@ export {
|
|
|
1856
1872
|
chainNumber,
|
|
1857
1873
|
chainsForNamespace,
|
|
1858
1874
|
channelsUpdate,
|
|
1875
|
+
checkSessionKeyRailGrant,
|
|
1859
1876
|
clearOneInAppNotification,
|
|
1860
1877
|
compareCostsKey,
|
|
1861
1878
|
createDecimalsCache,
|