@naculus/connect-appkit-core 0.6.0 → 0.7.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.d.cts CHANGED
@@ -484,6 +484,15 @@ declare function createNotificationSettingsStorage(): NotificationSettingsStorag
484
484
  declare function loadNotificationSettings(storage: NotificationSettingsStorage): Promise<NotificationSettings | null>;
485
485
  declare function saveNotificationSettings(storage: NotificationSettingsStorage, settings: NotificationSettings): void;
486
486
  declare function updateNotificationSettings(current: NotificationSettings, update: Partial<NotificationSettings>): NotificationSettings;
487
+ /** One settings change, computed from the settings it applies to. */
488
+ type NotificationSettingsUpdate = (current: NotificationSettings) => Partial<NotificationSettings>;
489
+ /**
490
+ * The settings once the persisted ones finish loading: every change made
491
+ * before the load resolved, replayed in order on top of what was persisted
492
+ * (or the defaults when nothing was). Without this the late load overwrote
493
+ * those changes, e.g. a chain muted during the first render came back.
494
+ */
495
+ declare function replayNotificationSettings(persisted: NotificationSettings | null, updates: readonly NotificationSettingsUpdate[]): NotificationSettings;
487
496
  declare function channelsUpdate(channels: string[]): Partial<NotificationSettings>;
488
497
  declare function mutedChainSettings(settings: NotificationSettings, chainId: string, muted: boolean): Partial<NotificationSettings>;
489
498
  declare function createNotification(item: Omit<NotificationItem, "id" | "timestamp">): NotificationItem;
@@ -890,6 +899,60 @@ interface PaymentRecord {
890
899
  */
891
900
  declare function describePayment(input: RequestInfo | URL, result: PaymentFetchResult): PaymentRecord | null;
892
901
 
902
+ /** Request options accepted by a caller-built MPP session fetch. */
903
+ interface MppSessionRequestInit extends RequestInit {
904
+ units?: bigint;
905
+ }
906
+ /** An open MPP payment channel, represented without depending on payments-mpp. */
907
+ interface MppSessionChannel {
908
+ channelId: string;
909
+ payer: string;
910
+ payee: string;
911
+ mint: string;
912
+ channelProgram: string;
913
+ deposit: bigint;
914
+ gracePeriodSeconds: number;
915
+ openSlot: bigint;
916
+ salt: bigint;
917
+ }
918
+ /** A successful MPP receipt, represented structurally. */
919
+ interface MppSessionReceipt {
920
+ status: "success";
921
+ method: string;
922
+ timestamp: string;
923
+ reference: string;
924
+ [field: string]: unknown;
925
+ }
926
+ interface MppSessionFetchResult {
927
+ response: Response;
928
+ receipt: unknown;
929
+ channel: unknown;
930
+ }
931
+ type MppSessionRequest = (input: RequestInfo | URL, init?: MppSessionRequestInit) => Promise<MppSessionFetchResult>;
932
+ interface MppSessionForceCloseResult {
933
+ requestCloseTxHash: string;
934
+ withdrawPayer(): Promise<string>;
935
+ }
936
+ interface MppSessionMeter {
937
+ add(units: bigint): void;
938
+ readonly pending: bigint;
939
+ }
940
+ /** The caller-owned session surface consumed by the React and Vue shells. */
941
+ interface MppSessionFetch extends MppSessionRequest {
942
+ readonly meter: MppSessionMeter;
943
+ readonly channels: readonly unknown[];
944
+ close(): Promise<MppSessionFetchResult>;
945
+ forceClose(): Promise<MppSessionForceCloseResult>;
946
+ }
947
+ /** Return a channel only when all public fields have the expected shape. */
948
+ declare function readMppSessionChannel(value: unknown): MppSessionChannel | null;
949
+ /** Return the newest structurally valid channel currently held by a session. */
950
+ declare function readCurrentMppSessionChannel(session: Pick<MppSessionFetch, "channels">): MppSessionChannel | null;
951
+ /** Return a receipt only when it has the public success-receipt shape. */
952
+ declare function readMppSessionReceipt(value: unknown): MppSessionReceipt | null;
953
+ /** A post-send channel-open failure carries the channel that can be recovered. */
954
+ declare function readMppRecoveryChannelId(error: unknown): string | null;
955
+
893
956
  /**
894
957
  * Solana session keys for the appkit shells (connect-lib STATE thread 18).
895
958
  *
@@ -1016,4 +1079,4 @@ declare function siwxResultToSession<M extends SiwxMessageLike>(result: SiwxResu
1016
1079
  refreshedAt: null;
1017
1080
  };
1018
1081
 
1019
- export { type AddressValidationLevel, type AtomicSupport, type ChainCapabilities, type ChainInfo, type CompareCosts, type CompareCostsInput, type ConnectionStatus, type CostComparison, type CostComparisonOperation, type CostComparisonOptions, DEFAULT_NOTIFICATION_SETTINGS, type DecimalsCache, type DelegationFrameworkAdapterOptions, type DelegationPolicyDeps, type DelegationPolicyFlow, type DelegationPolicyPreview, type DelegationTypedData, type DestinationIssue, type DestinationValidation, type ExecutableQuote, type ExecuteRoute, type ExecuteRouteError, type ExecuteRouteOptions, type ExecuteRouteResult, type GetRouteQuotes, InvalidUserOperationReceiptError, NOTIFICATION_SETTINGS_KEY, type NotificationSettingsStorage, type PaymentFetch, type PaymentFetchResult, type PaymentRecord, 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 TokenIdentity, type TransactionSimulationContext, type ViemChainShape, type WalletChain, type Web3Action, type Web3State, __resetResolverForTests, addInAppNotification, assertHexSignature, atomicSupportFor, bareEvmAddress, buildDelegationPolicyMessage, buildSmartAccountConfig, chainNamespace, chainNumber, chainsForNamespace, channelsUpdate, clearOneInAppNotification, compareCostsKey, createDecimalsCache, createDelegationFrameworkAdapter, createDelegationPolicyFlow, createNotification, createNotificationSettingsStorage, createSolanaSessionKeyFlow, decodeRevertReason, defaultSiwxDomain, defaultSiwxUri, describeChain, describePayment, eip155ChainIdToNumber, encodeErc20Approve, encodeErc20Transfer, encodeErc20TransferFrom, fetchUserOperationReceipt, getResolver, getSharedSessionKeyManager, initialWeb3State, isBurnDestination, isEvmChainId, isPositiveIntegerAmount, isQuotableInput, isSiwxExpired, isSiwxNotBeforeValid, isVerifiablePolicy, loadNotificationSettings, mutedChainSettings, normalizeCapabilities, normalizeEip155ChainId, parseUserOperationReceipt, readDecimals, readSolanaRoles, resetSharedSessionKeyManager, resolveChain, resolveContextSimulationEndpoint, resolveEvmChainId, resolveRevertReason, resolveSimulationEndpoint, resolveUserOpChain, sameExecutionIntent, saveNotificationSettings, selectChainCapabilities, sessionKeyConfigFingerprint, simulateTransactionPreview, siwxResultToSession, toChainSwitchError, toEip155Accounts, toExecuteRouteError, toViemChain, tokenChainMismatch, tokenKey, updateNotificationSettings, validateDestination, validateRouteRecipient, web3Reducer, withRetry, withTimeout, writeDecimals };
1082
+ export { type AddressValidationLevel, type AtomicSupport, type ChainCapabilities, type ChainInfo, type CompareCosts, type CompareCostsInput, type ConnectionStatus, type CostComparison, type CostComparisonOperation, type CostComparisonOptions, DEFAULT_NOTIFICATION_SETTINGS, type DecimalsCache, type DelegationFrameworkAdapterOptions, type DelegationPolicyDeps, type DelegationPolicyFlow, type DelegationPolicyPreview, type DelegationTypedData, 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 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 TokenIdentity, type TransactionSimulationContext, type ViemChainShape, type WalletChain, type Web3Action, type Web3State, __resetResolverForTests, addInAppNotification, assertHexSignature, atomicSupportFor, bareEvmAddress, buildDelegationPolicyMessage, buildSmartAccountConfig, chainNamespace, chainNumber, chainsForNamespace, channelsUpdate, clearOneInAppNotification, compareCostsKey, createDecimalsCache, createDelegationFrameworkAdapter, createDelegationPolicyFlow, createNotification, createNotificationSettingsStorage, createSolanaSessionKeyFlow, decodeRevertReason, defaultSiwxDomain, defaultSiwxUri, describeChain, describePayment, eip155ChainIdToNumber, encodeErc20Approve, encodeErc20Transfer, encodeErc20TransferFrom, fetchUserOperationReceipt, 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, 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
@@ -484,6 +484,15 @@ declare function createNotificationSettingsStorage(): NotificationSettingsStorag
484
484
  declare function loadNotificationSettings(storage: NotificationSettingsStorage): Promise<NotificationSettings | null>;
485
485
  declare function saveNotificationSettings(storage: NotificationSettingsStorage, settings: NotificationSettings): void;
486
486
  declare function updateNotificationSettings(current: NotificationSettings, update: Partial<NotificationSettings>): NotificationSettings;
487
+ /** One settings change, computed from the settings it applies to. */
488
+ type NotificationSettingsUpdate = (current: NotificationSettings) => Partial<NotificationSettings>;
489
+ /**
490
+ * The settings once the persisted ones finish loading: every change made
491
+ * before the load resolved, replayed in order on top of what was persisted
492
+ * (or the defaults when nothing was). Without this the late load overwrote
493
+ * those changes, e.g. a chain muted during the first render came back.
494
+ */
495
+ declare function replayNotificationSettings(persisted: NotificationSettings | null, updates: readonly NotificationSettingsUpdate[]): NotificationSettings;
487
496
  declare function channelsUpdate(channels: string[]): Partial<NotificationSettings>;
488
497
  declare function mutedChainSettings(settings: NotificationSettings, chainId: string, muted: boolean): Partial<NotificationSettings>;
489
498
  declare function createNotification(item: Omit<NotificationItem, "id" | "timestamp">): NotificationItem;
@@ -890,6 +899,60 @@ interface PaymentRecord {
890
899
  */
891
900
  declare function describePayment(input: RequestInfo | URL, result: PaymentFetchResult): PaymentRecord | null;
892
901
 
902
+ /** Request options accepted by a caller-built MPP session fetch. */
903
+ interface MppSessionRequestInit extends RequestInit {
904
+ units?: bigint;
905
+ }
906
+ /** An open MPP payment channel, represented without depending on payments-mpp. */
907
+ interface MppSessionChannel {
908
+ channelId: string;
909
+ payer: string;
910
+ payee: string;
911
+ mint: string;
912
+ channelProgram: string;
913
+ deposit: bigint;
914
+ gracePeriodSeconds: number;
915
+ openSlot: bigint;
916
+ salt: bigint;
917
+ }
918
+ /** A successful MPP receipt, represented structurally. */
919
+ interface MppSessionReceipt {
920
+ status: "success";
921
+ method: string;
922
+ timestamp: string;
923
+ reference: string;
924
+ [field: string]: unknown;
925
+ }
926
+ interface MppSessionFetchResult {
927
+ response: Response;
928
+ receipt: unknown;
929
+ channel: unknown;
930
+ }
931
+ type MppSessionRequest = (input: RequestInfo | URL, init?: MppSessionRequestInit) => Promise<MppSessionFetchResult>;
932
+ interface MppSessionForceCloseResult {
933
+ requestCloseTxHash: string;
934
+ withdrawPayer(): Promise<string>;
935
+ }
936
+ interface MppSessionMeter {
937
+ add(units: bigint): void;
938
+ readonly pending: bigint;
939
+ }
940
+ /** The caller-owned session surface consumed by the React and Vue shells. */
941
+ interface MppSessionFetch extends MppSessionRequest {
942
+ readonly meter: MppSessionMeter;
943
+ readonly channels: readonly unknown[];
944
+ close(): Promise<MppSessionFetchResult>;
945
+ forceClose(): Promise<MppSessionForceCloseResult>;
946
+ }
947
+ /** Return a channel only when all public fields have the expected shape. */
948
+ declare function readMppSessionChannel(value: unknown): MppSessionChannel | null;
949
+ /** Return the newest structurally valid channel currently held by a session. */
950
+ declare function readCurrentMppSessionChannel(session: Pick<MppSessionFetch, "channels">): MppSessionChannel | null;
951
+ /** Return a receipt only when it has the public success-receipt shape. */
952
+ declare function readMppSessionReceipt(value: unknown): MppSessionReceipt | null;
953
+ /** A post-send channel-open failure carries the channel that can be recovered. */
954
+ declare function readMppRecoveryChannelId(error: unknown): string | null;
955
+
893
956
  /**
894
957
  * Solana session keys for the appkit shells (connect-lib STATE thread 18).
895
958
  *
@@ -1016,4 +1079,4 @@ declare function siwxResultToSession<M extends SiwxMessageLike>(result: SiwxResu
1016
1079
  refreshedAt: null;
1017
1080
  };
1018
1081
 
1019
- export { type AddressValidationLevel, type AtomicSupport, type ChainCapabilities, type ChainInfo, type CompareCosts, type CompareCostsInput, type ConnectionStatus, type CostComparison, type CostComparisonOperation, type CostComparisonOptions, DEFAULT_NOTIFICATION_SETTINGS, type DecimalsCache, type DelegationFrameworkAdapterOptions, type DelegationPolicyDeps, type DelegationPolicyFlow, type DelegationPolicyPreview, type DelegationTypedData, type DestinationIssue, type DestinationValidation, type ExecutableQuote, type ExecuteRoute, type ExecuteRouteError, type ExecuteRouteOptions, type ExecuteRouteResult, type GetRouteQuotes, InvalidUserOperationReceiptError, NOTIFICATION_SETTINGS_KEY, type NotificationSettingsStorage, type PaymentFetch, type PaymentFetchResult, type PaymentRecord, 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 TokenIdentity, type TransactionSimulationContext, type ViemChainShape, type WalletChain, type Web3Action, type Web3State, __resetResolverForTests, addInAppNotification, assertHexSignature, atomicSupportFor, bareEvmAddress, buildDelegationPolicyMessage, buildSmartAccountConfig, chainNamespace, chainNumber, chainsForNamespace, channelsUpdate, clearOneInAppNotification, compareCostsKey, createDecimalsCache, createDelegationFrameworkAdapter, createDelegationPolicyFlow, createNotification, createNotificationSettingsStorage, createSolanaSessionKeyFlow, decodeRevertReason, defaultSiwxDomain, defaultSiwxUri, describeChain, describePayment, eip155ChainIdToNumber, encodeErc20Approve, encodeErc20Transfer, encodeErc20TransferFrom, fetchUserOperationReceipt, getResolver, getSharedSessionKeyManager, initialWeb3State, isBurnDestination, isEvmChainId, isPositiveIntegerAmount, isQuotableInput, isSiwxExpired, isSiwxNotBeforeValid, isVerifiablePolicy, loadNotificationSettings, mutedChainSettings, normalizeCapabilities, normalizeEip155ChainId, parseUserOperationReceipt, readDecimals, readSolanaRoles, resetSharedSessionKeyManager, resolveChain, resolveContextSimulationEndpoint, resolveEvmChainId, resolveRevertReason, resolveSimulationEndpoint, resolveUserOpChain, sameExecutionIntent, saveNotificationSettings, selectChainCapabilities, sessionKeyConfigFingerprint, simulateTransactionPreview, siwxResultToSession, toChainSwitchError, toEip155Accounts, toExecuteRouteError, toViemChain, tokenChainMismatch, tokenKey, updateNotificationSettings, validateDestination, validateRouteRecipient, web3Reducer, withRetry, withTimeout, writeDecimals };
1082
+ export { type AddressValidationLevel, type AtomicSupport, type ChainCapabilities, type ChainInfo, type CompareCosts, type CompareCostsInput, type ConnectionStatus, type CostComparison, type CostComparisonOperation, type CostComparisonOptions, DEFAULT_NOTIFICATION_SETTINGS, type DecimalsCache, type DelegationFrameworkAdapterOptions, type DelegationPolicyDeps, type DelegationPolicyFlow, type DelegationPolicyPreview, type DelegationTypedData, 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 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 TokenIdentity, type TransactionSimulationContext, type ViemChainShape, type WalletChain, type Web3Action, type Web3State, __resetResolverForTests, addInAppNotification, assertHexSignature, atomicSupportFor, bareEvmAddress, buildDelegationPolicyMessage, buildSmartAccountConfig, chainNamespace, chainNumber, chainsForNamespace, channelsUpdate, clearOneInAppNotification, compareCostsKey, createDecimalsCache, createDelegationFrameworkAdapter, createDelegationPolicyFlow, createNotification, createNotificationSettingsStorage, createSolanaSessionKeyFlow, decodeRevertReason, defaultSiwxDomain, defaultSiwxUri, describeChain, describePayment, eip155ChainIdToNumber, encodeErc20Approve, encodeErc20Transfer, encodeErc20TransferFrom, fetchUserOperationReceipt, 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, sameExecutionIntent, saveNotificationSettings, selectChainCapabilities, sessionKeyConfigFingerprint, simulateTransactionPreview, siwxResultToSession, toChainSwitchError, toEip155Accounts, toExecuteRouteError, toViemChain, tokenChainMismatch, tokenKey, updateNotificationSettings, validateDestination, validateRouteRecipient, web3Reducer, withRetry, withTimeout, writeDecimals };
package/dist/index.js CHANGED
@@ -478,6 +478,13 @@ function saveNotificationSettings(storage, settings) {
478
478
  function updateNotificationSettings(current, update) {
479
479
  return { ...current, ...update };
480
480
  }
481
+ function replayNotificationSettings(persisted, updates) {
482
+ let settings = persisted ?? DEFAULT_NOTIFICATION_SETTINGS;
483
+ for (const update of updates) {
484
+ settings = updateNotificationSettings(settings, update(settings));
485
+ }
486
+ return settings;
487
+ }
481
488
  function channelsUpdate(channels) {
482
489
  const update = {};
483
490
  if (channels.includes("telegram")) update.telegram = true;
@@ -1347,6 +1354,36 @@ function describePayment(input, result) {
1347
1354
  };
1348
1355
  }
1349
1356
 
1357
+ // src/mpp-session.ts
1358
+ function record2(value) {
1359
+ return typeof value === "object" && value !== null && !Array.isArray(value) ? value : null;
1360
+ }
1361
+ function readMppSessionChannel(value) {
1362
+ const channel = record2(value);
1363
+ if (!channel || typeof channel.channelId !== "string" || typeof channel.payer !== "string" || typeof channel.payee !== "string" || typeof channel.mint !== "string" || typeof channel.channelProgram !== "string" || typeof channel.deposit !== "bigint" || typeof channel.gracePeriodSeconds !== "number" || typeof channel.openSlot !== "bigint" || typeof channel.salt !== "bigint") {
1364
+ return null;
1365
+ }
1366
+ return channel;
1367
+ }
1368
+ function readCurrentMppSessionChannel(session) {
1369
+ for (let index = session.channels.length - 1; index >= 0; index--) {
1370
+ const channel = readMppSessionChannel(session.channels[index]);
1371
+ if (channel) return channel;
1372
+ }
1373
+ return null;
1374
+ }
1375
+ function readMppSessionReceipt(value) {
1376
+ const receipt = record2(value);
1377
+ if (receipt?.status !== "success" || typeof receipt.method !== "string" || typeof receipt.timestamp !== "string" || typeof receipt.reference !== "string") {
1378
+ return null;
1379
+ }
1380
+ return receipt;
1381
+ }
1382
+ function readMppRecoveryChannelId(error) {
1383
+ const channelId = record2(error)?.channelId;
1384
+ return typeof channelId === "string" && channelId !== "" ? channelId : null;
1385
+ }
1386
+
1350
1387
  // src/solana-session-key.ts
1351
1388
  import {
1352
1389
  verifySignedOwnerTransaction,
@@ -1613,8 +1650,13 @@ export {
1613
1650
  normalizeCapabilities,
1614
1651
  normalizeEip155ChainId,
1615
1652
  parseUserOperationReceipt,
1653
+ readCurrentMppSessionChannel,
1616
1654
  readDecimals,
1655
+ readMppRecoveryChannelId,
1656
+ readMppSessionChannel,
1657
+ readMppSessionReceipt,
1617
1658
  readSolanaRoles,
1659
+ replayNotificationSettings,
1618
1660
  resetSharedSessionKeyManager,
1619
1661
  resolveChain,
1620
1662
  resolveContextSimulationEndpoint,