@solana-mobile/mobile-wallet-adapter-walletlib 1.4.4 → 1.4.5

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["LINKING_ERROR","SolanaMobileWalletAdapterWalletLib","LINKING_ERROR"],"sources":["../../src/mwaSessionEvents.ts","../../src/resolve.ts","../../src/errors.ts","../../src/initializeMobileWalletAdapterSession.ts","../../src/initializeMWAEventListener.ts","../../src/useMobileWalletAdapterSession.ts","../../src/useDigitalAssetLinks.ts"],"sourcesContent":["/**\n * Mobile Wallet Adapter Session Events are notifications and events\n * about the underlying session between the wallet and the dApp.\n */\nexport enum MWASessionEventType {\n SessionStartEvent = 'SESSION_START',\n SessionReadyEvent = 'SESSION_READY',\n SessionTerminatedEvent = 'SESSION_TERMINATED',\n SessionServingClientsEvent = 'SESSION_SERVING_CLIENTS',\n SessionServingCompleteEvent = 'SESSION_SERVING_COMPLETE',\n SessionCompleteEvent = 'SESSION_COMPLETE',\n SessionErrorEvent = 'SESSION_ERROR',\n SessionTeardownCompleteEvent = 'SESSION_TEARDOWN_COMPLETE',\n LowPowerNoConnectionEvent = 'LOW_POWER_NO_CONNECTION',\n}\nexport interface IMWASessionEvent {\n __type: MWASessionEventType;\n sessionId: string;\n}\n\nexport type SessionStartEvent = Readonly<{\n __type: MWASessionEventType.SessionStartEvent;\n}> &\n IMWASessionEvent;\n\nexport type SessionReadyEvent = Readonly<{\n __type: MWASessionEventType.SessionReadyEvent;\n}> &\n IMWASessionEvent;\n\nexport type SessionTerminatedEvent = Readonly<{\n __type: MWASessionEventType.SessionTerminatedEvent;\n}> &\n IMWASessionEvent;\n\nexport type SessionServingClientsEvent = Readonly<{\n __type: MWASessionEventType.SessionServingClientsEvent;\n}> &\n IMWASessionEvent;\n\nexport type SessionServingCompleteEvent = Readonly<{\n __type: MWASessionEventType.SessionServingCompleteEvent;\n}> &\n IMWASessionEvent;\n\nexport type SessionCompleteEvent = Readonly<{\n __type: MWASessionEventType.SessionCompleteEvent;\n}> &\n IMWASessionEvent;\n\nexport type SessionErrorEvent = Readonly<{\n __type: MWASessionEventType.SessionErrorEvent;\n}> &\n IMWASessionEvent;\n\nexport type SessionTeardownCompleteEvent = Readonly<{\n __type: MWASessionEventType.SessionTeardownCompleteEvent;\n}> &\n IMWASessionEvent;\n\nexport type LowPowerNoConnectionEvent = Readonly<{\n __type: MWASessionEventType.LowPowerNoConnectionEvent;\n}> &\n IMWASessionEvent;\n\nexport type MWASessionEvent =\n | SessionStartEvent\n | SessionReadyEvent\n | SessionTerminatedEvent\n | SessionServingClientsEvent\n | SessionServingCompleteEvent\n | SessionCompleteEvent\n | SessionErrorEvent\n | SessionTeardownCompleteEvent\n | LowPowerNoConnectionEvent;\n","import type { IdentifierArray } from '@wallet-standard/core';\nimport { NativeModules, Platform } from 'react-native';\n\nconst LINKING_ERROR =\n `The package 'solana-mobile-wallet-adapter-walletlib' doesn't seem to be linked. Make sure: \\n\\n` +\n '- You rebuilt the app after installing the package\\n' +\n '- If you are using Lerna workspaces\\n' +\n ' - You have added `@solana-mobile/mobile-wallet-adapter-walletlib` as an explicit dependency, and\\n' +\n ' - You have added `@solana-mobile/mobile-wallet-adapter-walletlib` to the `nohoist` section of your package.json\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst SolanaMobileWalletAdapterWalletLib =\n Platform.OS === 'android' && NativeModules.SolanaMobileWalletAdapterWalletLib\n ? NativeModules.SolanaMobileWalletAdapterWalletLib\n : new Proxy(\n {},\n {\n get() {\n throw new Error(\n Platform.OS !== 'android'\n ? 'The package `solana-mobile-wallet-adapter-walletlib` is only compatible with React Native Android'\n : LINKING_ERROR,\n );\n },\n },\n );\n\ntype AppIdentity = Readonly<{\n identityUri?: string;\n iconRelativeUri?: string;\n identityName?: string;\n}>;\n\nexport type SignInPayload = Readonly<{\n domain?: string;\n address?: string;\n statement?: string;\n uri?: string;\n version?: string;\n chainId?: string;\n nonce?: string;\n issuedAt?: string;\n expirationTime?: string;\n notBefore?: string;\n requestId?: string;\n resources?: readonly string[];\n}>;\n\nexport type Base64EncodedAddress = string;\nexport type Base64EncodedSignature = string;\ntype Base64EncodedSignedMessage = string;\n\n/**\n * Mobile Wallet Adapter Requests are remote requests coming from\n * the dApp for authorization, signing, and sending services.\n */\n\nexport type MWARequest =\n | SignMessagesRequest\n | SignTransactionsRequest\n | SignAndSendTransactionsRequest\n | AuthorizeDappRequest\n | ReauthorizeDappRequest\n | DeauthorizeDappRequest;\n\nexport enum MWARequestType {\n AuthorizeDappRequest = 'AUTHORIZE_DAPP',\n ReauthorizeDappRequest = 'REAUTHORIZE_DAPP',\n DeauthorizeDappRequest = 'DEAUTHORIZE_DAPP',\n SignMessagesRequest = 'SIGN_MESSAGES',\n SignTransactionsRequest = 'SIGN_TRANSACTIONS',\n SignAndSendTransactionsRequest = 'SIGN_AND_SEND_TRANSACTIONS',\n}\n\ninterface IMWARequest {\n __type: MWARequestType;\n requestId: string;\n sessionId: string;\n}\n\ninterface IVerifiableIdentityRequest {\n chain: string;\n authorizationScope: Uint8Array;\n appIdentity?: AppIdentity;\n}\n\nexport type AuthorizeDappRequest = Readonly<{\n __type: MWARequestType.AuthorizeDappRequest;\n chain: string;\n appIdentity?: AppIdentity;\n features?: IdentifierArray;\n addresses?: [string];\n signInPayload?: SignInPayload;\n}> &\n IMWARequest;\n\nexport type ReauthorizeDappRequest = Readonly<{\n __type: MWARequestType.ReauthorizeDappRequest;\n}> &\n IMWARequest &\n IVerifiableIdentityRequest;\n\nexport type DeauthorizeDappRequest = Readonly<{\n __type: MWARequestType.DeauthorizeDappRequest;\n}> &\n IMWARequest &\n IVerifiableIdentityRequest;\n\nexport type SignMessagesRequest = Readonly<{\n __type: MWARequestType.SignMessagesRequest;\n payloads: Uint8Array[];\n}> &\n IMWARequest &\n IVerifiableIdentityRequest;\n\nexport type SignTransactionsRequest = Readonly<{\n __type: MWARequestType.SignTransactionsRequest;\n payloads: Uint8Array[];\n}> &\n IMWARequest &\n IVerifiableIdentityRequest;\n\nexport type SignAndSendTransactionsRequest = Readonly<{\n __type: MWARequestType.SignAndSendTransactionsRequest;\n payloads: Uint8Array[];\n minContextSlot?: number;\n commitment?: string;\n skipPreflight?: boolean;\n maxRetries?: number;\n waitForCommitmentToSendNextTransaction?: boolean;\n}> &\n IMWARequest &\n IVerifiableIdentityRequest;\n\n/**\n * MWA Request Responses\n */\n\nexport type MWAResponse =\n | AuthorizeDappResponse\n | ReauthorizeDappResponse\n | DeauthorizeDappResponse\n | SignMessagesResponse\n | SignTransactionsResponse\n | SignAndSendTransactionsResponse;\n\n/* Failure Responses */\nexport enum MWARequestFailReason {\n UserDeclined = 'USER_DECLINED',\n TooManyPayloads = 'TOO_MANY_PAYLOADS',\n InvalidSignatures = 'INVALID_SIGNATURES',\n AuthorizationNotValid = 'AUTHORIZATION_NOT_VALID',\n}\n\nexport type UserDeclinedResponse = Readonly<{\n failReason: MWARequestFailReason.UserDeclined;\n}>;\n\nexport type TooManyPayloadsResponse = Readonly<{\n failReason: MWARequestFailReason.TooManyPayloads;\n}>;\n\nexport type AuthorizationNotValidResponse = Readonly<{\n failReason: MWARequestFailReason.AuthorizationNotValid;\n}>;\n\nexport type InvalidSignaturesResponse = Readonly<{\n failReason: MWARequestFailReason.InvalidSignatures;\n valid: boolean[];\n}>;\n\n/* Authorize Dapp */\nexport type AuthorizedAccount = Readonly<{\n publicKey: Uint8Array;\n accountLabel?: string;\n icon?: string;\n chains?: IdentifierArray;\n features?: IdentifierArray;\n}>;\nexport type SignInResult = Readonly<{\n address: Base64EncodedAddress;\n signed_message: Base64EncodedSignedMessage;\n signature: Base64EncodedSignature;\n signature_type?: string;\n}>;\nexport type AuthorizeDappCompleteResponse = Readonly<{\n accounts: Array<AuthorizedAccount>;\n walletUriBase?: string;\n authorizationScope?: Uint8Array;\n signInResult?: SignInResult;\n}>;\nexport type AuthorizeDappResponse = AuthorizeDappCompleteResponse | UserDeclinedResponse;\n\n/* Reauthorize Dapp */\nexport type ReauthorizeDappCompleteResponse = Readonly<{\n authorizationScope?: Uint8Array;\n}>;\nexport type ReauthorizeDappResponse = ReauthorizeDappCompleteResponse | AuthorizationNotValidResponse;\n\n/* Deauthorize Dapp */\nexport type DeauthorizeDappCompleteResponse = Readonly<Record<string, never>>;\nexport type DeauthorizeDappResponse = DeauthorizeDappCompleteResponse | AuthorizationNotValidResponse;\n\n/* Sign Transactions/Messages */\nexport type SignPayloadsCompleteResponse = Readonly<{ signedPayloads: Uint8Array[] }>;\nexport type SignPayloadsFailResponse =\n | UserDeclinedResponse\n | TooManyPayloadsResponse\n | AuthorizationNotValidResponse\n | InvalidSignaturesResponse;\n\nexport type SignTransactionsResponse = SignPayloadsCompleteResponse | SignPayloadsFailResponse;\nexport type SignMessagesResponse = SignPayloadsCompleteResponse | SignPayloadsFailResponse;\n\n/* Sign and Send Transaction */\nexport type SignAndSendTransactionsCompleteResponse = Readonly<{ signedTransactions: Uint8Array[] }>;\nexport type SignAndSendTransactionsResponse =\n | SignAndSendTransactionsCompleteResponse\n | UserDeclinedResponse\n | TooManyPayloadsResponse\n | AuthorizationNotValidResponse\n | InvalidSignaturesResponse;\n\nexport function resolve(request: AuthorizeDappRequest, response: AuthorizeDappResponse): void;\nexport function resolve(request: ReauthorizeDappRequest, response: ReauthorizeDappResponse): void;\nexport function resolve(request: DeauthorizeDappRequest, response: DeauthorizeDappResponse): void;\nexport function resolve(request: SignMessagesRequest, response: SignMessagesResponse): void;\nexport function resolve(request: SignTransactionsRequest, response: SignTransactionsResponse): void;\nexport function resolve(request: SignAndSendTransactionsRequest, response: SignAndSendTransactionsResponse): void;\nexport function resolve(request: MWARequest, response: MWAResponse): void {\n SolanaMobileWalletAdapterWalletLib.resolve(JSON.stringify(request), JSON.stringify(response));\n}\n","export enum SolanaMWAWalletLibErrorCode {\n ERROR_INTENT_DATA_NOT_FOUND = 'ERROR_INTENT_DATA_NOT_FOUND',\n ERROR_SESSION_ALREADY_CREATED = 'ERROR_SESSION_ALREADY_CREATED',\n ERROR_UNSUPPORTED_ASSOCIATION_URI = 'ERROR_UNSUPPORTED_ASSOCIATION_URI',\n ERROR_UNSUPPORTED_ASSOCIATION_TYPE = 'ERROR_UNSUPPORTED_ASSOCIATION_TYPE',\n}\n\nexport class SolanaMWAWalletLibError extends Error {\n code: SolanaMWAWalletLibErrorCode;\n constructor(code: SolanaMWAWalletLibErrorCode, message: string) {\n super(message);\n this.name = 'SolanaMWAWalletLibError';\n this.code = code;\n }\n}\n","import type { TransactionVersion } from '@solana/web3.js';\nimport type { IdentifierArray } from '@wallet-standard/core';\nimport { NativeModules, Platform } from 'react-native';\n\nimport { SolanaMWAWalletLibError, SolanaMWAWalletLibErrorCode } from './errors.js';\n\nconst LINKING_ERROR =\n `The package 'solana-mobile-wallet-adapter-walletlib' doesn't seem to be linked. Make sure: \\n\\n` +\n '- You rebuilt the app after installing the package\\n' +\n '- If you are using Lerna workspaces\\n' +\n ' - You have added `@solana-mobile/mobile-wallet-adapter-walletlib` as an explicit dependency, and\\n' +\n ' - You have added `@solana-mobile/mobile-wallet-adapter-walletlib` to the `nohoist` section of your package.json\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst SolanaMobileWalletAdapterWalletLib =\n Platform.OS === 'android' && NativeModules.SolanaMobileWalletAdapterWalletLib\n ? NativeModules.SolanaMobileWalletAdapterWalletLib\n : new Proxy(\n {},\n {\n get() {\n throw new Error(\n Platform.OS !== 'android'\n ? 'The package `solana-mobile-wallet-adapter-walletlib` is only compatible with React Native Android'\n : LINKING_ERROR,\n );\n },\n },\n );\n\ntype ReactNativeError = Error & { code?: string; userInfo?: Record<string, unknown> };\n\nfunction handleError(e: unknown): never {\n if (e instanceof Error) {\n const { code, message } = e as ReactNativeError;\n if (code && code in SolanaMWAWalletLibErrorCode) {\n throw new SolanaMWAWalletLibError(code as SolanaMWAWalletLibErrorCode, message);\n }\n }\n throw e;\n}\n\nexport type MWASessionId = string;\n\nexport interface MobileWalletAdapterConfig {\n maxTransactionsPerSigningRequest: number;\n maxMessagesPerSigningRequest: number;\n supportedTransactionVersions: Array<TransactionVersion>;\n noConnectionWarningTimeoutMs: number;\n optionalFeatures: IdentifierArray;\n}\n\nexport async function initializeMobileWalletAdapterSession(\n walletName: string,\n config: MobileWalletAdapterConfig,\n): Promise<MWASessionId> {\n try {\n return await initializeScenario(walletName, config);\n } catch (e) {\n handleError(e);\n }\n}\n\n// Create Scenario and establish session with dapp\nfunction initializeScenario(walletName: string, walletConfig: MobileWalletAdapterConfig): Promise<MWASessionId> {\n return SolanaMobileWalletAdapterWalletLib.createScenario(walletName, JSON.stringify(walletConfig));\n}\n","import { EmitterSubscription, NativeEventEmitter } from 'react-native';\n\nimport { MWASessionEvent, MWASessionEventType } from './mwaSessionEvents.js';\nimport { MWARequest, MWARequestType } from './resolve.js';\n\nconst MOBILE_WALLET_ADAPTER_EVENT_BRIDGE_NAME = 'MobileWalletAdapterServiceRequestBridge';\ntype NativeMWAEvent = Readonly<{ __type?: unknown }>;\n\nexport function initializeMWAEventListener(\n handleRequest: (request: MWARequest) => void,\n handleSessionEvent: (sessionEvent: MWASessionEvent) => void,\n): EmitterSubscription {\n const mwaEventEmitter = new NativeEventEmitter();\n const listener = mwaEventEmitter.addListener(MOBILE_WALLET_ADAPTER_EVENT_BRIDGE_NAME, (nativeEvent) => {\n const event = nativeEvent as NativeMWAEvent;\n if (isMWARequest(event)) {\n handleRequest(event);\n } else if (isMWASessionEvent(event)) {\n handleSessionEvent(event);\n } else {\n console.warn('Unexpected native event type');\n }\n });\n\n return listener;\n}\n\nfunction isMWARequest(nativeEvent: NativeMWAEvent): nativeEvent is MWARequest {\n return Object.values(MWARequestType).includes(nativeEvent.__type as MWARequest['__type']);\n}\n\nfunction isMWASessionEvent(nativeEvent: NativeMWAEvent): nativeEvent is MWASessionEvent {\n return Object.values(MWASessionEventType).includes(nativeEvent.__type as MWASessionEvent['__type']);\n}\n","import { useEffect } from 'react';\n\nimport {\n initializeMobileWalletAdapterSession,\n MobileWalletAdapterConfig,\n} from './initializeMobileWalletAdapterSession.js';\nimport { initializeMWAEventListener } from './initializeMWAEventListener.js';\nimport { MWASessionEvent } from './mwaSessionEvents.js';\nimport { MWARequest } from './resolve.js';\n\nexport function useMobileWalletAdapterSession(\n walletName: string,\n config: MobileWalletAdapterConfig,\n handleRequest: (request: MWARequest) => void,\n handleSessionEvent: (sessionEvent: MWASessionEvent) => void,\n) {\n useEffect(() => {\n async function startSession() {\n try {\n await initializeMobileWalletAdapterSession(walletName, config);\n } catch (e) {\n console.error(e);\n }\n }\n const listener = initializeMWAEventListener(handleRequest, handleSessionEvent);\n startSession();\n return () => {\n listener.remove();\n };\n }, []);\n}\n","import { NativeModules, Platform } from 'react-native';\n\nconst LINKING_ERROR =\n `The package 'solana-mobile-wallet-adapter-walletlib' doesn't seem to be linked. Make sure: \\n\\n` +\n '- You rebuilt the app after installing the package\\n' +\n '- If you are using Lerna workspaces\\n' +\n ' - You have added `@solana-mobile/mobile-wallet-adapter-walletlib` as an explicit dependency, and\\n' +\n ' - You have added `@solana-mobile/mobile-wallet-adapter-walletlib` to the `nohoist` section of your package.json\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst SolanaMobileDigitalAssetLinks =\n Platform.OS === 'android' && NativeModules.SolanaMobileDigitalAssetLinks\n ? NativeModules.SolanaMobileDigitalAssetLinks\n : new Proxy(\n {},\n {\n get() {\n throw new Error(\n Platform.OS !== 'android'\n ? 'The package `solana-mobile-wallet-adapter-walletlib` is only compatible with React Native Android'\n : LINKING_ERROR,\n );\n },\n },\n );\n\nexport async function getCallingPackage(): Promise<string | undefined> {\n return await SolanaMobileDigitalAssetLinks.getCallingPackage();\n}\n\nexport async function verifyCallingPackage(clientIdentityUri: string) {\n return await SolanaMobileDigitalAssetLinks.verifyCallingPackage(clientIdentityUri);\n}\n\nexport async function getCallingPackageUid() {\n return await SolanaMobileDigitalAssetLinks.getCallingPackageUid();\n}\n\nexport async function getUidForPackage(packageName: string) {\n return await SolanaMobileDigitalAssetLinks.getUidForPackage(packageName);\n}\n"],"mappings":";;;;;;;AAIA,IAAY,sBAAL,yBAAA,qBAAA;AACH,qBAAA,uBAAA;AACA,qBAAA,uBAAA;AACA,qBAAA,4BAAA;AACA,qBAAA,gCAAA;AACA,qBAAA,iCAAA;AACA,qBAAA,0BAAA;AACA,qBAAA,uBAAA;AACA,qBAAA,kCAAA;AACA,qBAAA,+BAAA;;KACH;;;ACXD,MAAMA,kBACF;AAOJ,MAAMC,uCACF,SAAS,OAAO,aAAa,cAAc,qCACrC,cAAc,qCACd,IAAI,MACA,EAAE,EACF,EACI,MAAM;AACF,OAAM,IAAI,MACN,SAAS,OAAO,YACV,sGACAD,gBACT;GAER,CACJ;AAwCX,IAAY,iBAAL,yBAAA,gBAAA;AACH,gBAAA,0BAAA;AACA,gBAAA,4BAAA;AACA,gBAAA,4BAAA;AACA,gBAAA,yBAAA;AACA,gBAAA,6BAAA;AACA,gBAAA,oCAAA;;KACH;AA2ED,IAAY,uBAAL,yBAAA,sBAAA;AACH,sBAAA,kBAAA;AACA,sBAAA,qBAAA;AACA,sBAAA,uBAAA;AACA,sBAAA,2BAAA;;KACH;AA6ED,SAAgB,QAAQ,SAAqB,UAA6B;AACtE,sCAAmC,QAAQ,KAAK,UAAU,QAAQ,EAAE,KAAK,UAAU,SAAS,CAAC;;;;ACtOjG,IAAY,8BAAL,yBAAA,6BAAA;AACH,6BAAA,iCAAA;AACA,6BAAA,mCAAA;AACA,6BAAA,uCAAA;AACA,6BAAA,wCAAA;;KACH;AAED,IAAa,0BAAb,cAA6C,MAAM;CAC/C;CACA,YAAY,MAAmC,SAAiB;AAC5D,QAAM,QAAQ;AACd,OAAK,OAAO;AACZ,OAAK,OAAO;;;;;ACNpB,MAAME,kBACF;AAOJ,MAAM,qCACF,SAAS,OAAO,aAAa,cAAc,qCACrC,cAAc,qCACd,IAAI,MACA,EAAE,EACF,EACI,MAAM;AACF,OAAM,IA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,OAAM,IAAI,MACN,SAAS,OAAO,YACV,sGACA,cACT;GAER,CACJ;AAEX,eAAsB,oBAAiD;AACnE,QAAO,MAAM,8BAA8B,mBAAmB;;AAGlE,eAAsB,qBAAqB,mBAA2B;AAClE,QAAO,MAAM,8BAA8B,qBAAqB,kBAAkB;;AAGtF,eAAsB,uBAAuB;AACzC,QAAO,MAAM,8BAA8B,sBAAsB;;AAGrE,eAAsB,iBAAiB,aAAqB;AACxD,QAAO,MAAM,8BAA8B,iBAAiB,YAAY"}
1
+ {"version":3,"file":"index.js","names":["LINKING_ERROR","SolanaMobileWalletAdapterWalletLib","LINKING_ERROR"],"sources":["../../src/mwaSessionEvents.ts","../../src/resolve.ts","../../src/errors.ts","../../src/initializeMobileWalletAdapterSession.ts","../../src/initializeMWAEventListener.ts","../../src/useMobileWalletAdapterSession.ts","../../src/useDigitalAssetLinks.ts"],"sourcesContent":["/**\n * Mobile Wallet Adapter Session Events are notifications and events\n * about the underlying session between the wallet and the dApp.\n */\nexport enum MWASessionEventType {\n SessionStartEvent = 'SESSION_START',\n SessionReadyEvent = 'SESSION_READY',\n SessionTerminatedEvent = 'SESSION_TERMINATED',\n SessionServingClientsEvent = 'SESSION_SERVING_CLIENTS',\n SessionServingCompleteEvent = 'SESSION_SERVING_COMPLETE',\n SessionCompleteEvent = 'SESSION_COMPLETE',\n SessionErrorEvent = 'SESSION_ERROR',\n SessionTeardownCompleteEvent = 'SESSION_TEARDOWN_COMPLETE',\n LowPowerNoConnectionEvent = 'LOW_POWER_NO_CONNECTION',\n}\nexport interface IMWASessionEvent {\n __type: MWASessionEventType;\n sessionId: string;\n}\n\nexport type SessionStartEvent = Readonly<{\n __type: MWASessionEventType.SessionStartEvent;\n}> &\n IMWASessionEvent;\n\nexport type SessionReadyEvent = Readonly<{\n __type: MWASessionEventType.SessionReadyEvent;\n}> &\n IMWASessionEvent;\n\nexport type SessionTerminatedEvent = Readonly<{\n __type: MWASessionEventType.SessionTerminatedEvent;\n}> &\n IMWASessionEvent;\n\nexport type SessionServingClientsEvent = Readonly<{\n __type: MWASessionEventType.SessionServingClientsEvent;\n}> &\n IMWASessionEvent;\n\nexport type SessionServingCompleteEvent = Readonly<{\n __type: MWASessionEventType.SessionServingCompleteEvent;\n}> &\n IMWASessionEvent;\n\nexport type SessionCompleteEvent = Readonly<{\n __type: MWASessionEventType.SessionCompleteEvent;\n}> &\n IMWASessionEvent;\n\nexport type SessionErrorEvent = Readonly<{\n __type: MWASessionEventType.SessionErrorEvent;\n}> &\n IMWASessionEvent;\n\nexport type SessionTeardownCompleteEvent = Readonly<{\n __type: MWASessionEventType.SessionTeardownCompleteEvent;\n}> &\n IMWASessionEvent;\n\nexport type LowPowerNoConnectionEvent = Readonly<{\n __type: MWASessionEventType.LowPowerNoConnectionEvent;\n}> &\n IMWASessionEvent;\n\nexport type MWASessionEvent =\n | SessionStartEvent\n | SessionReadyEvent\n | SessionTerminatedEvent\n | SessionServingClientsEvent\n | SessionServingCompleteEvent\n | SessionCompleteEvent\n | SessionErrorEvent\n | SessionTeardownCompleteEvent\n | LowPowerNoConnectionEvent;\n","import type { IdentifierArray } from '@wallet-standard/core';\nimport { NativeModules, Platform } from 'react-native';\n\nconst LINKING_ERROR =\n `The package 'solana-mobile-wallet-adapter-walletlib' doesn't seem to be linked. Make sure: \\n\\n` +\n '- You rebuilt the app after installing the package\\n' +\n '- If you are using Lerna workspaces\\n' +\n ' - You have added `@solana-mobile/mobile-wallet-adapter-walletlib` as an explicit dependency, and\\n' +\n ' - You have added `@solana-mobile/mobile-wallet-adapter-walletlib` to the `nohoist` section of your package.json\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst SolanaMobileWalletAdapterWalletLib =\n Platform.OS === 'android' && NativeModules.SolanaMobileWalletAdapterWalletLib\n ? NativeModules.SolanaMobileWalletAdapterWalletLib\n : new Proxy(\n {},\n {\n get() {\n throw new Error(\n Platform.OS !== 'android'\n ? 'The package `solana-mobile-wallet-adapter-walletlib` is only compatible with React Native Android'\n : LINKING_ERROR,\n );\n },\n },\n );\n\ntype AppIdentity = Readonly<{\n identityUri?: string;\n iconRelativeUri?: string;\n identityName?: string;\n}>;\n\nexport type SignInPayload = Readonly<{\n domain?: string;\n address?: string;\n statement?: string;\n uri?: string;\n version?: string;\n chainId?: string;\n nonce?: string;\n issuedAt?: string;\n expirationTime?: string;\n notBefore?: string;\n requestId?: string;\n resources?: readonly string[];\n}>;\n\nexport type Base64EncodedAddress = string;\nexport type Base64EncodedSignature = string;\ntype Base64EncodedSignedMessage = string;\n\n/**\n * Mobile Wallet Adapter Requests are remote requests coming from\n * the dApp for authorization, signing, and sending services.\n */\n\nexport type MWARequest =\n | SignMessagesRequest\n | SignTransactionsRequest\n | SignAndSendTransactionsRequest\n | AuthorizeDappRequest\n | ReauthorizeDappRequest\n | DeauthorizeDappRequest;\n\nexport enum MWARequestType {\n AuthorizeDappRequest = 'AUTHORIZE_DAPP',\n ReauthorizeDappRequest = 'REAUTHORIZE_DAPP',\n DeauthorizeDappRequest = 'DEAUTHORIZE_DAPP',\n SignMessagesRequest = 'SIGN_MESSAGES',\n SignTransactionsRequest = 'SIGN_TRANSACTIONS',\n SignAndSendTransactionsRequest = 'SIGN_AND_SEND_TRANSACTIONS',\n}\n\ninterface IMWARequest {\n __type: MWARequestType;\n requestId: string;\n sessionId: string;\n}\n\ninterface IVerifiableIdentityRequest {\n chain: string;\n authorizationScope: Uint8Array;\n appIdentity?: AppIdentity;\n}\n\nexport type AuthorizeDappRequest = Readonly<{\n __type: MWARequestType.AuthorizeDappRequest;\n chain: string;\n appIdentity?: AppIdentity;\n features?: IdentifierArray;\n addresses?: [string];\n signInPayload?: SignInPayload;\n}> &\n IMWARequest;\n\nexport type ReauthorizeDappRequest = Readonly<{\n __type: MWARequestType.ReauthorizeDappRequest;\n}> &\n IMWARequest &\n IVerifiableIdentityRequest;\n\nexport type DeauthorizeDappRequest = Readonly<{\n __type: MWARequestType.DeauthorizeDappRequest;\n}> &\n IMWARequest &\n IVerifiableIdentityRequest;\n\nexport type SignMessagesRequest = Readonly<{\n __type: MWARequestType.SignMessagesRequest;\n payloads: Uint8Array[];\n}> &\n IMWARequest &\n IVerifiableIdentityRequest;\n\nexport type SignTransactionsRequest = Readonly<{\n __type: MWARequestType.SignTransactionsRequest;\n payloads: Uint8Array[];\n}> &\n IMWARequest &\n IVerifiableIdentityRequest;\n\nexport type SignAndSendTransactionsRequest = Readonly<{\n __type: MWARequestType.SignAndSendTransactionsRequest;\n payloads: Uint8Array[];\n minContextSlot?: number;\n commitment?: string;\n skipPreflight?: boolean;\n maxRetries?: number;\n waitForCommitmentToSendNextTransaction?: boolean;\n}> &\n IMWARequest &\n IVerifiableIdentityRequest;\n\n/**\n * MWA Request Responses\n */\n\nexport type MWAResponse =\n | AuthorizeDappResponse\n | ReauthorizeDappResponse\n | DeauthorizeDappResponse\n | SignMessagesResponse\n | SignTransactionsResponse\n | SignAndSendTransactionsResponse;\n\n/* Failure Responses */\nexport enum MWARequestFailReason {\n UserDeclined = 'USER_DECLINED',\n TooManyPayloads = 'TOO_MANY_PAYLOADS',\n InvalidSignatures = 'INVALID_SIGNATURES',\n AuthorizationNotValid = 'AUTHORIZATION_NOT_VALID',\n}\n\nexport type UserDeclinedResponse = Readonly<{\n failReason: MWARequestFailReason.UserDeclined;\n}>;\n\nexport type TooManyPayloadsResponse = Readonly<{\n failReason: MWARequestFailReason.TooManyPayloads;\n}>;\n\nexport type AuthorizationNotValidResponse = Readonly<{\n failReason: MWARequestFailReason.AuthorizationNotValid;\n}>;\n\nexport type InvalidSignaturesResponse = Readonly<{\n failReason: MWARequestFailReason.InvalidSignatures;\n valid: boolean[];\n}>;\n\n/* Authorize Dapp */\nexport type AuthorizedAccount = Readonly<{\n publicKey: Uint8Array;\n accountLabel?: string;\n icon?: string;\n chains?: IdentifierArray;\n features?: IdentifierArray;\n}>;\nexport type SignInResult = Readonly<{\n address: Base64EncodedAddress;\n signed_message: Base64EncodedSignedMessage;\n signature: Base64EncodedSignature;\n signature_type?: string;\n}>;\nexport type AuthorizeDappCompleteResponse = Readonly<{\n accounts: Array<AuthorizedAccount>;\n walletUriBase?: string;\n authorizationScope?: Uint8Array;\n signInResult?: SignInResult;\n}>;\nexport type AuthorizeDappResponse = AuthorizeDappCompleteResponse | UserDeclinedResponse;\n\n/* Reauthorize Dapp */\nexport type ReauthorizeDappCompleteResponse = Readonly<{\n authorizationScope?: Uint8Array;\n}>;\nexport type ReauthorizeDappResponse = ReauthorizeDappCompleteResponse | AuthorizationNotValidResponse;\n\n/* Deauthorize Dapp */\nexport type DeauthorizeDappCompleteResponse = Readonly<Record<string, never>>;\nexport type DeauthorizeDappResponse = DeauthorizeDappCompleteResponse | AuthorizationNotValidResponse;\n\n/* Sign Transactions/Messages */\nexport type SignPayloadsCompleteResponse = Readonly<{ signedPayloads: Uint8Array[] }>;\nexport type SignPayloadsFailResponse =\n | UserDeclinedResponse\n | TooManyPayloadsResponse\n | AuthorizationNotValidResponse\n | InvalidSignaturesResponse;\n\nexport type SignTransactionsResponse = SignPayloadsCompleteResponse | SignPayloadsFailResponse;\nexport type SignMessagesResponse = SignPayloadsCompleteResponse | SignPayloadsFailResponse;\n\n/* Sign and Send Transaction */\nexport type SignAndSendTransactionsCompleteResponse = Readonly<{ signedTransactions: Uint8Array[] }>;\nexport type SignAndSendTransactionsResponse =\n | SignAndSendTransactionsCompleteResponse\n | UserDeclinedResponse\n | TooManyPayloadsResponse\n | AuthorizationNotValidResponse\n | InvalidSignaturesResponse;\n\nexport function resolve(request: AuthorizeDappRequest, response: AuthorizeDappResponse): void;\nexport function resolve(request: ReauthorizeDappRequest, response: ReauthorizeDappResponse): void;\nexport function resolve(request: DeauthorizeDappRequest, response: DeauthorizeDappResponse): void;\nexport function resolve(request: SignMessagesRequest, response: SignMessagesResponse): void;\nexport function resolve(request: SignTransactionsRequest, response: SignTransactionsResponse): void;\nexport function resolve(request: SignAndSendTransactionsRequest, response: SignAndSendTransactionsResponse): void;\nexport function resolve(request: MWARequest, response: MWAResponse): void {\n SolanaMobileWalletAdapterWalletLib.resolve(JSON.stringify(request), JSON.stringify(response));\n}\n","export enum SolanaMWAWalletLibErrorCode {\n ERROR_INTENT_DATA_NOT_FOUND = 'ERROR_INTENT_DATA_NOT_FOUND',\n ERROR_SESSION_ALREADY_CREATED = 'ERROR_SESSION_ALREADY_CREATED',\n ERROR_UNSUPPORTED_ASSOCIATION_URI = 'ERROR_UNSUPPORTED_ASSOCIATION_URI',\n ERROR_UNSUPPORTED_ASSOCIATION_TYPE = 'ERROR_UNSUPPORTED_ASSOCIATION_TYPE',\n}\n\nexport class SolanaMWAWalletLibError extends Error {\n code: SolanaMWAWalletLibErrorCode;\n constructor(code: SolanaMWAWalletLibErrorCode, message: string) {\n super(message);\n this.name = 'SolanaMWAWalletLibError';\n this.code = code;\n }\n}\n","import type { TransactionVersion } from '@solana/web3.js';\nimport type { IdentifierArray } from '@wallet-standard/core';\nimport { NativeModules, Platform } from 'react-native';\n\nimport { SolanaMWAWalletLibError, SolanaMWAWalletLibErrorCode } from './errors.js';\n\nconst LINKING_ERROR =\n `The package 'solana-mobile-wallet-adapter-walletlib' doesn't seem to be linked. Make sure: \\n\\n` +\n '- You rebuilt the app after installing the package\\n' +\n '- If you are using Lerna workspaces\\n' +\n ' - You have added `@solana-mobile/mobile-wallet-adapter-walletlib` as an explicit dependency, and\\n' +\n ' - You have added `@solana-mobile/mobile-wallet-adapter-walletlib` to the `nohoist` section of your package.json\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst SolanaMobileWalletAdapterWalletLib =\n Platform.OS === 'android' && NativeModules.SolanaMobileWalletAdapterWalletLib\n ? NativeModules.SolanaMobileWalletAdapterWalletLib\n : new Proxy(\n {},\n {\n get() {\n throw new Error(\n Platform.OS !== 'android'\n ? 'The package `solana-mobile-wallet-adapter-walletlib` is only compatible with React Native Android'\n : LINKING_ERROR,\n );\n },\n },\n );\n\ntype ReactNativeError = Error & { code?: string; userInfo?: Record<string, unknown> };\n\nfunction handleError(e: unknown): never {\n if (e instanceof Error) {\n const { code, message } = e as ReactNativeError;\n if (code && code in SolanaMWAWalletLibErrorCode) {\n throw new SolanaMWAWalletLibError(code as SolanaMWAWalletLibErrorCode, message);\n }\n }\n throw e;\n}\n\nexport type MWASessionId = string;\n\nexport interface MobileWalletAdapterConfig {\n maxTransactionsPerSigningRequest: number;\n maxMessagesPerSigningRequest: number;\n supportedTransactionVersions: Array<TransactionVersion>;\n noConnectionWarningTimeoutMs: number;\n optionalFeatures: IdentifierArray;\n}\n\nexport async function initializeMobileWalletAdapterSession(\n walletName: string,\n config: MobileWalletAdapterConfig,\n): Promise<MWASessionId> {\n try {\n return await initializeScenario(walletName, config);\n } catch (e) {\n handleError(e);\n }\n}\n\n// Create Scenario and establish session with dapp\nfunction initializeScenario(walletName: string, walletConfig: MobileWalletAdapterConfig): Promise<MWASessionId> {\n return SolanaMobileWalletAdapterWalletLib.createScenario(walletName, JSON.stringify(walletConfig));\n}\n","import { EmitterSubscription, NativeEventEmitter } from 'react-native';\n\nimport { MWASessionEvent, MWASessionEventType } from './mwaSessionEvents.js';\nimport { MWARequest, MWARequestType } from './resolve.js';\n\nconst MOBILE_WALLET_ADAPTER_EVENT_BRIDGE_NAME = 'MobileWalletAdapterServiceRequestBridge';\ntype NativeMWAEvent = Readonly<{ __type?: unknown }>;\n\nexport function initializeMWAEventListener(\n handleRequest: (request: MWARequest) => void,\n handleSessionEvent: (sessionEvent: MWASessionEvent) => void,\n): EmitterSubscription {\n const mwaEventEmitter = new NativeEventEmitter();\n const listener = mwaEventEmitter.addListener(MOBILE_WALLET_ADAPTER_EVENT_BRIDGE_NAME, (nativeEvent) => {\n const event = nativeEvent as NativeMWAEvent;\n if (isMWARequest(event)) {\n handleRequest(event);\n } else if (isMWASessionEvent(event)) {\n handleSessionEvent(event);\n } else {\n console.warn('Unexpected native event type');\n }\n });\n\n return listener;\n}\n\nfunction isMWARequest(nativeEvent: NativeMWAEvent): nativeEvent is MWARequest {\n return Object.values(MWARequestType).includes(nativeEvent.__type as MWARequest['__type']);\n}\n\nfunction isMWASessionEvent(nativeEvent: NativeMWAEvent): nativeEvent is MWASessionEvent {\n return Object.values(MWASessionEventType).includes(nativeEvent.__type as MWASessionEvent['__type']);\n}\n","import { useEffect } from 'react';\n\nimport {\n initializeMobileWalletAdapterSession,\n MobileWalletAdapterConfig,\n} from './initializeMobileWalletAdapterSession.js';\nimport { initializeMWAEventListener } from './initializeMWAEventListener.js';\nimport { MWASessionEvent } from './mwaSessionEvents.js';\nimport { MWARequest } from './resolve.js';\n\nexport function useMobileWalletAdapterSession(\n walletName: string,\n config: MobileWalletAdapterConfig,\n handleRequest: (request: MWARequest) => void,\n handleSessionEvent: (sessionEvent: MWASessionEvent) => void,\n) {\n useEffect(() => {\n async function startSession() {\n try {\n await initializeMobileWalletAdapterSession(walletName, config);\n } catch (e) {\n console.error(e);\n }\n }\n const listener = initializeMWAEventListener(handleRequest, handleSessionEvent);\n startSession();\n return () => {\n listener.remove();\n };\n }, []);\n}\n","import { NativeModules, Platform } from 'react-native';\n\nconst LINKING_ERROR =\n `The package 'solana-mobile-wallet-adapter-walletlib' doesn't seem to be linked. Make sure: \\n\\n` +\n '- You rebuilt the app after installing the package\\n' +\n '- If you are using Lerna workspaces\\n' +\n ' - You have added `@solana-mobile/mobile-wallet-adapter-walletlib` as an explicit dependency, and\\n' +\n ' - You have added `@solana-mobile/mobile-wallet-adapter-walletlib` to the `nohoist` section of your package.json\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst SolanaMobileDigitalAssetLinks =\n Platform.OS === 'android' && NativeModules.SolanaMobileDigitalAssetLinks\n ? NativeModules.SolanaMobileDigitalAssetLinks\n : new Proxy(\n {},\n {\n get() {\n throw new Error(\n Platform.OS !== 'android'\n ? 'The package `solana-mobile-wallet-adapter-walletlib` is only compatible with React Native Android'\n : LINKING_ERROR,\n );\n },\n },\n );\n\nexport async function getCallingPackage(): Promise<string | undefined> {\n return await SolanaMobileDigitalAssetLinks.getCallingPackage();\n}\n\nexport async function verifyCallingPackage(clientIdentityUri: string) {\n return await SolanaMobileDigitalAssetLinks.verifyCallingPackage(clientIdentityUri);\n}\n\nexport async function getCallingPackageUid() {\n return await SolanaMobileDigitalAssetLinks.getCallingPackageUid();\n}\n\nexport async function getUidForPackage(packageName: string) {\n return await SolanaMobileDigitalAssetLinks.getUidForPackage(packageName);\n}\n"],"mappings":";;;;;;;AAIA,IAAY,sBAAL,yBAAA,qBAAA;CACH,oBAAA,uBAAA;CACA,oBAAA,uBAAA;CACA,oBAAA,4BAAA;CACA,oBAAA,gCAAA;CACA,oBAAA,iCAAA;CACA,oBAAA,0BAAA;CACA,oBAAA,uBAAA;CACA,oBAAA,kCAAA;CACA,oBAAA,+BAAA;;AACJ,EAAA,CAAA,CAAA;;;ACXA,MAAMA,kBACF;AAOJ,MAAMC,uCACF,SAAS,OAAO,aAAa,cAAc,qCACrC,cAAc,qCACd,IAAI,MACA,CAAC,GACD,EACI,MAAM;CACF,MAAM,IAAI,MACN,SAAS,OAAO,YACV,sGACAD,eACV;AACJ,EACJ,CACJ;AAwCV,IAAY,iBAAL,yBAAA,gBAAA;CACH,eAAA,0BAAA;CACA,eAAA,4BAAA;CACA,eAAA,4BAAA;CACA,eAAA,yBAAA;CACA,eAAA,6BAAA;CACA,eAAA,oCAAA;;AACJ,EAAA,CAAA,CAAA;AA2EA,IAAY,uBAAL,yBAAA,sBAAA;CACH,qBAAA,kBAAA;CACA,qBAAA,qBAAA;CACA,qBAAA,uBAAA;CACA,qBAAA,2BAAA;;AACJ,EAAA,CAAA,CAAA;AA6EA,SAAgB,QAAQ,SAAqB,UAA6B;CACtE,qCAAmC,QAAQ,KAAK,UAAU,OAAO,GAAG,KAAK,UAAU,QAAQ,CAAC;AAChG;;;ACvOA,IAAY,8BAAL,yBAAA,6BAAA;CACH,4BAAA,iCAAA;CACA,4BAAA,mCAAA;CACA,4BAAA,uCAAA;CACA,4BAAA,wCAAA;;AACJ,EAAA,CAAA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,gBAAgB;EACZ,eAAe,eAAe;GAC1B,IAAI;IACA,MAAM,qCAAqC,YAAY,MAAM;GACjE,SAAS,GAAG;IACR,QAAQ,MAAM,CAAC;GACnB;EACJ;EACA,MAAM,WAAW,2BAA2B,eAAe,kBAAkB;EAC7E,aAAa;EACb,aAAa;GACT,SAAS,OAAO;EACpB;CACJ,GAAG,CAAC,CAAC;AACT;;;AC5BA,MAAM,gBACF;AAOJ,MAAM,gCACF,SAAS,OAAO,aAAa,cAAc,gCACrC,cAAc,gCACd,IAAI,MACA,CAAC,GACD,EACI,MAAM;CACF,MAAM,IAAI,MACN,SAAS,OAAO,YACV,sGACA,aACV;AACJ,EACJ,CACJ;AAEV,eAAsB,oBAAiD;CACnE,OAAO,MAAM,8BAA8B,kBAAkB;AACjE;AAEA,eAAsB,qBAAqB,mBAA2B;CAClE,OAAO,MAAM,8BAA8B,qBAAqB,iBAAiB;AACrF;AAEA,eAAsB,uBAAuB;CACzC,OAAO,MAAM,8BAA8B,qBAAqB;AACpE;AAEA,eAAsB,iBAAiB,aAAqB;CACxD,OAAO,MAAM,8BAA8B,iBAAiB,WAAW;AAC3E"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.js","names":["LINKING_ERROR","SolanaMobileWalletAdapterWalletLib","LINKING_ERROR"],"sources":["../../src/mwaSessionEvents.ts","../../src/resolve.ts","../../src/errors.ts","../../src/initializeMobileWalletAdapterSession.ts","../../src/initializeMWAEventListener.ts","../../src/useMobileWalletAdapterSession.ts","../../src/useDigitalAssetLinks.ts"],"sourcesContent":["/**\n * Mobile Wallet Adapter Session Events are notifications and events\n * about the underlying session between the wallet and the dApp.\n */\nexport enum MWASessionEventType {\n SessionStartEvent = 'SESSION_START',\n SessionReadyEvent = 'SESSION_READY',\n SessionTerminatedEvent = 'SESSION_TERMINATED',\n SessionServingClientsEvent = 'SESSION_SERVING_CLIENTS',\n SessionServingCompleteEvent = 'SESSION_SERVING_COMPLETE',\n SessionCompleteEvent = 'SESSION_COMPLETE',\n SessionErrorEvent = 'SESSION_ERROR',\n SessionTeardownCompleteEvent = 'SESSION_TEARDOWN_COMPLETE',\n LowPowerNoConnectionEvent = 'LOW_POWER_NO_CONNECTION',\n}\nexport interface IMWASessionEvent {\n __type: MWASessionEventType;\n sessionId: string;\n}\n\nexport type SessionStartEvent = Readonly<{\n __type: MWASessionEventType.SessionStartEvent;\n}> &\n IMWASessionEvent;\n\nexport type SessionReadyEvent = Readonly<{\n __type: MWASessionEventType.SessionReadyEvent;\n}> &\n IMWASessionEvent;\n\nexport type SessionTerminatedEvent = Readonly<{\n __type: MWASessionEventType.SessionTerminatedEvent;\n}> &\n IMWASessionEvent;\n\nexport type SessionServingClientsEvent = Readonly<{\n __type: MWASessionEventType.SessionServingClientsEvent;\n}> &\n IMWASessionEvent;\n\nexport type SessionServingCompleteEvent = Readonly<{\n __type: MWASessionEventType.SessionServingCompleteEvent;\n}> &\n IMWASessionEvent;\n\nexport type SessionCompleteEvent = Readonly<{\n __type: MWASessionEventType.SessionCompleteEvent;\n}> &\n IMWASessionEvent;\n\nexport type SessionErrorEvent = Readonly<{\n __type: MWASessionEventType.SessionErrorEvent;\n}> &\n IMWASessionEvent;\n\nexport type SessionTeardownCompleteEvent = Readonly<{\n __type: MWASessionEventType.SessionTeardownCompleteEvent;\n}> &\n IMWASessionEvent;\n\nexport type LowPowerNoConnectionEvent = Readonly<{\n __type: MWASessionEventType.LowPowerNoConnectionEvent;\n}> &\n IMWASessionEvent;\n\nexport type MWASessionEvent =\n | SessionStartEvent\n | SessionReadyEvent\n | SessionTerminatedEvent\n | SessionServingClientsEvent\n | SessionServingCompleteEvent\n | SessionCompleteEvent\n | SessionErrorEvent\n | SessionTeardownCompleteEvent\n | LowPowerNoConnectionEvent;\n","import type { IdentifierArray } from '@wallet-standard/core';\nimport { NativeModules, Platform } from 'react-native';\n\nconst LINKING_ERROR =\n `The package 'solana-mobile-wallet-adapter-walletlib' doesn't seem to be linked. Make sure: \\n\\n` +\n '- You rebuilt the app after installing the package\\n' +\n '- If you are using Lerna workspaces\\n' +\n ' - You have added `@solana-mobile/mobile-wallet-adapter-walletlib` as an explicit dependency, and\\n' +\n ' - You have added `@solana-mobile/mobile-wallet-adapter-walletlib` to the `nohoist` section of your package.json\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst SolanaMobileWalletAdapterWalletLib =\n Platform.OS === 'android' && NativeModules.SolanaMobileWalletAdapterWalletLib\n ? NativeModules.SolanaMobileWalletAdapterWalletLib\n : new Proxy(\n {},\n {\n get() {\n throw new Error(\n Platform.OS !== 'android'\n ? 'The package `solana-mobile-wallet-adapter-walletlib` is only compatible with React Native Android'\n : LINKING_ERROR,\n );\n },\n },\n );\n\ntype AppIdentity = Readonly<{\n identityUri?: string;\n iconRelativeUri?: string;\n identityName?: string;\n}>;\n\nexport type SignInPayload = Readonly<{\n domain?: string;\n address?: string;\n statement?: string;\n uri?: string;\n version?: string;\n chainId?: string;\n nonce?: string;\n issuedAt?: string;\n expirationTime?: string;\n notBefore?: string;\n requestId?: string;\n resources?: readonly string[];\n}>;\n\nexport type Base64EncodedAddress = string;\nexport type Base64EncodedSignature = string;\ntype Base64EncodedSignedMessage = string;\n\n/**\n * Mobile Wallet Adapter Requests are remote requests coming from\n * the dApp for authorization, signing, and sending services.\n */\n\nexport type MWARequest =\n | SignMessagesRequest\n | SignTransactionsRequest\n | SignAndSendTransactionsRequest\n | AuthorizeDappRequest\n | ReauthorizeDappRequest\n | DeauthorizeDappRequest;\n\nexport enum MWARequestType {\n AuthorizeDappRequest = 'AUTHORIZE_DAPP',\n ReauthorizeDappRequest = 'REAUTHORIZE_DAPP',\n DeauthorizeDappRequest = 'DEAUTHORIZE_DAPP',\n SignMessagesRequest = 'SIGN_MESSAGES',\n SignTransactionsRequest = 'SIGN_TRANSACTIONS',\n SignAndSendTransactionsRequest = 'SIGN_AND_SEND_TRANSACTIONS',\n}\n\ninterface IMWARequest {\n __type: MWARequestType;\n requestId: string;\n sessionId: string;\n}\n\ninterface IVerifiableIdentityRequest {\n chain: string;\n authorizationScope: Uint8Array;\n appIdentity?: AppIdentity;\n}\n\nexport type AuthorizeDappRequest = Readonly<{\n __type: MWARequestType.AuthorizeDappRequest;\n chain: string;\n appIdentity?: AppIdentity;\n features?: IdentifierArray;\n addresses?: [string];\n signInPayload?: SignInPayload;\n}> &\n IMWARequest;\n\nexport type ReauthorizeDappRequest = Readonly<{\n __type: MWARequestType.ReauthorizeDappRequest;\n}> &\n IMWARequest &\n IVerifiableIdentityRequest;\n\nexport type DeauthorizeDappRequest = Readonly<{\n __type: MWARequestType.DeauthorizeDappRequest;\n}> &\n IMWARequest &\n IVerifiableIdentityRequest;\n\nexport type SignMessagesRequest = Readonly<{\n __type: MWARequestType.SignMessagesRequest;\n payloads: Uint8Array[];\n}> &\n IMWARequest &\n IVerifiableIdentityRequest;\n\nexport type SignTransactionsRequest = Readonly<{\n __type: MWARequestType.SignTransactionsRequest;\n payloads: Uint8Array[];\n}> &\n IMWARequest &\n IVerifiableIdentityRequest;\n\nexport type SignAndSendTransactionsRequest = Readonly<{\n __type: MWARequestType.SignAndSendTransactionsRequest;\n payloads: Uint8Array[];\n minContextSlot?: number;\n commitment?: string;\n skipPreflight?: boolean;\n maxRetries?: number;\n waitForCommitmentToSendNextTransaction?: boolean;\n}> &\n IMWARequest &\n IVerifiableIdentityRequest;\n\n/**\n * MWA Request Responses\n */\n\nexport type MWAResponse =\n | AuthorizeDappResponse\n | ReauthorizeDappResponse\n | DeauthorizeDappResponse\n | SignMessagesResponse\n | SignTransactionsResponse\n | SignAndSendTransactionsResponse;\n\n/* Failure Responses */\nexport enum MWARequestFailReason {\n UserDeclined = 'USER_DECLINED',\n TooManyPayloads = 'TOO_MANY_PAYLOADS',\n InvalidSignatures = 'INVALID_SIGNATURES',\n AuthorizationNotValid = 'AUTHORIZATION_NOT_VALID',\n}\n\nexport type UserDeclinedResponse = Readonly<{\n failReason: MWARequestFailReason.UserDeclined;\n}>;\n\nexport type TooManyPayloadsResponse = Readonly<{\n failReason: MWARequestFailReason.TooManyPayloads;\n}>;\n\nexport type AuthorizationNotValidResponse = Readonly<{\n failReason: MWARequestFailReason.AuthorizationNotValid;\n}>;\n\nexport type InvalidSignaturesResponse = Readonly<{\n failReason: MWARequestFailReason.InvalidSignatures;\n valid: boolean[];\n}>;\n\n/* Authorize Dapp */\nexport type AuthorizedAccount = Readonly<{\n publicKey: Uint8Array;\n accountLabel?: string;\n icon?: string;\n chains?: IdentifierArray;\n features?: IdentifierArray;\n}>;\nexport type SignInResult = Readonly<{\n address: Base64EncodedAddress;\n signed_message: Base64EncodedSignedMessage;\n signature: Base64EncodedSignature;\n signature_type?: string;\n}>;\nexport type AuthorizeDappCompleteResponse = Readonly<{\n accounts: Array<AuthorizedAccount>;\n walletUriBase?: string;\n authorizationScope?: Uint8Array;\n signInResult?: SignInResult;\n}>;\nexport type AuthorizeDappResponse = AuthorizeDappCompleteResponse | UserDeclinedResponse;\n\n/* Reauthorize Dapp */\nexport type ReauthorizeDappCompleteResponse = Readonly<{\n authorizationScope?: Uint8Array;\n}>;\nexport type ReauthorizeDappResponse = ReauthorizeDappCompleteResponse | AuthorizationNotValidResponse;\n\n/* Deauthorize Dapp */\nexport type DeauthorizeDappCompleteResponse = Readonly<Record<string, never>>;\nexport type DeauthorizeDappResponse = DeauthorizeDappCompleteResponse | AuthorizationNotValidResponse;\n\n/* Sign Transactions/Messages */\nexport type SignPayloadsCompleteResponse = Readonly<{ signedPayloads: Uint8Array[] }>;\nexport type SignPayloadsFailResponse =\n | UserDeclinedResponse\n | TooManyPayloadsResponse\n | AuthorizationNotValidResponse\n | InvalidSignaturesResponse;\n\nexport type SignTransactionsResponse = SignPayloadsCompleteResponse | SignPayloadsFailResponse;\nexport type SignMessagesResponse = SignPayloadsCompleteResponse | SignPayloadsFailResponse;\n\n/* Sign and Send Transaction */\nexport type SignAndSendTransactionsCompleteResponse = Readonly<{ signedTransactions: Uint8Array[] }>;\nexport type SignAndSendTransactionsResponse =\n | SignAndSendTransactionsCompleteResponse\n | UserDeclinedResponse\n | TooManyPayloadsResponse\n | AuthorizationNotValidResponse\n | InvalidSignaturesResponse;\n\nexport function resolve(request: AuthorizeDappRequest, response: AuthorizeDappResponse): void;\nexport function resolve(request: ReauthorizeDappRequest, response: ReauthorizeDappResponse): void;\nexport function resolve(request: DeauthorizeDappRequest, response: DeauthorizeDappResponse): void;\nexport function resolve(request: SignMessagesRequest, response: SignMessagesResponse): void;\nexport function resolve(request: SignTransactionsRequest, response: SignTransactionsResponse): void;\nexport function resolve(request: SignAndSendTransactionsRequest, response: SignAndSendTransactionsResponse): void;\nexport function resolve(request: MWARequest, response: MWAResponse): void {\n SolanaMobileWalletAdapterWalletLib.resolve(JSON.stringify(request), JSON.stringify(response));\n}\n","export enum SolanaMWAWalletLibErrorCode {\n ERROR_INTENT_DATA_NOT_FOUND = 'ERROR_INTENT_DATA_NOT_FOUND',\n ERROR_SESSION_ALREADY_CREATED = 'ERROR_SESSION_ALREADY_CREATED',\n ERROR_UNSUPPORTED_ASSOCIATION_URI = 'ERROR_UNSUPPORTED_ASSOCIATION_URI',\n ERROR_UNSUPPORTED_ASSOCIATION_TYPE = 'ERROR_UNSUPPORTED_ASSOCIATION_TYPE',\n}\n\nexport class SolanaMWAWalletLibError extends Error {\n code: SolanaMWAWalletLibErrorCode;\n constructor(code: SolanaMWAWalletLibErrorCode, message: string) {\n super(message);\n this.name = 'SolanaMWAWalletLibError';\n this.code = code;\n }\n}\n","import type { TransactionVersion } from '@solana/web3.js';\nimport type { IdentifierArray } from '@wallet-standard/core';\nimport { NativeModules, Platform } from 'react-native';\n\nimport { SolanaMWAWalletLibError, SolanaMWAWalletLibErrorCode } from './errors.js';\n\nconst LINKING_ERROR =\n `The package 'solana-mobile-wallet-adapter-walletlib' doesn't seem to be linked. Make sure: \\n\\n` +\n '- You rebuilt the app after installing the package\\n' +\n '- If you are using Lerna workspaces\\n' +\n ' - You have added `@solana-mobile/mobile-wallet-adapter-walletlib` as an explicit dependency, and\\n' +\n ' - You have added `@solana-mobile/mobile-wallet-adapter-walletlib` to the `nohoist` section of your package.json\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst SolanaMobileWalletAdapterWalletLib =\n Platform.OS === 'android' && NativeModules.SolanaMobileWalletAdapterWalletLib\n ? NativeModules.SolanaMobileWalletAdapterWalletLib\n : new Proxy(\n {},\n {\n get() {\n throw new Error(\n Platform.OS !== 'android'\n ? 'The package `solana-mobile-wallet-adapter-walletlib` is only compatible with React Native Android'\n : LINKING_ERROR,\n );\n },\n },\n );\n\ntype ReactNativeError = Error & { code?: string; userInfo?: Record<string, unknown> };\n\nfunction handleError(e: unknown): never {\n if (e instanceof Error) {\n const { code, message } = e as ReactNativeError;\n if (code && code in SolanaMWAWalletLibErrorCode) {\n throw new SolanaMWAWalletLibError(code as SolanaMWAWalletLibErrorCode, message);\n }\n }\n throw e;\n}\n\nexport type MWASessionId = string;\n\nexport interface MobileWalletAdapterConfig {\n maxTransactionsPerSigningRequest: number;\n maxMessagesPerSigningRequest: number;\n supportedTransactionVersions: Array<TransactionVersion>;\n noConnectionWarningTimeoutMs: number;\n optionalFeatures: IdentifierArray;\n}\n\nexport async function initializeMobileWalletAdapterSession(\n walletName: string,\n config: MobileWalletAdapterConfig,\n): Promise<MWASessionId> {\n try {\n return await initializeScenario(walletName, config);\n } catch (e) {\n handleError(e);\n }\n}\n\n// Create Scenario and establish session with dapp\nfunction initializeScenario(walletName: string, walletConfig: MobileWalletAdapterConfig): Promise<MWASessionId> {\n return SolanaMobileWalletAdapterWalletLib.createScenario(walletName, JSON.stringify(walletConfig));\n}\n","import { EmitterSubscription, NativeEventEmitter } from 'react-native';\n\nimport { MWASessionEvent, MWASessionEventType } from './mwaSessionEvents.js';\nimport { MWARequest, MWARequestType } from './resolve.js';\n\nconst MOBILE_WALLET_ADAPTER_EVENT_BRIDGE_NAME = 'MobileWalletAdapterServiceRequestBridge';\ntype NativeMWAEvent = Readonly<{ __type?: unknown }>;\n\nexport function initializeMWAEventListener(\n handleRequest: (request: MWARequest) => void,\n handleSessionEvent: (sessionEvent: MWASessionEvent) => void,\n): EmitterSubscription {\n const mwaEventEmitter = new NativeEventEmitter();\n const listener = mwaEventEmitter.addListener(MOBILE_WALLET_ADAPTER_EVENT_BRIDGE_NAME, (nativeEvent) => {\n const event = nativeEvent as NativeMWAEvent;\n if (isMWARequest(event)) {\n handleRequest(event);\n } else if (isMWASessionEvent(event)) {\n handleSessionEvent(event);\n } else {\n console.warn('Unexpected native event type');\n }\n });\n\n return listener;\n}\n\nfunction isMWARequest(nativeEvent: NativeMWAEvent): nativeEvent is MWARequest {\n return Object.values(MWARequestType).includes(nativeEvent.__type as MWARequest['__type']);\n}\n\nfunction isMWASessionEvent(nativeEvent: NativeMWAEvent): nativeEvent is MWASessionEvent {\n return Object.values(MWASessionEventType).includes(nativeEvent.__type as MWASessionEvent['__type']);\n}\n","import { useEffect } from 'react';\n\nimport {\n initializeMobileWalletAdapterSession,\n MobileWalletAdapterConfig,\n} from './initializeMobileWalletAdapterSession.js';\nimport { initializeMWAEventListener } from './initializeMWAEventListener.js';\nimport { MWASessionEvent } from './mwaSessionEvents.js';\nimport { MWARequest } from './resolve.js';\n\nexport function useMobileWalletAdapterSession(\n walletName: string,\n config: MobileWalletAdapterConfig,\n handleRequest: (request: MWARequest) => void,\n handleSessionEvent: (sessionEvent: MWASessionEvent) => void,\n) {\n useEffect(() => {\n async function startSession() {\n try {\n await initializeMobileWalletAdapterSession(walletName, config);\n } catch (e) {\n console.error(e);\n }\n }\n const listener = initializeMWAEventListener(handleRequest, handleSessionEvent);\n startSession();\n return () => {\n listener.remove();\n };\n }, []);\n}\n","import { NativeModules, Platform } from 'react-native';\n\nconst LINKING_ERROR =\n `The package 'solana-mobile-wallet-adapter-walletlib' doesn't seem to be linked. Make sure: \\n\\n` +\n '- You rebuilt the app after installing the package\\n' +\n '- If you are using Lerna workspaces\\n' +\n ' - You have added `@solana-mobile/mobile-wallet-adapter-walletlib` as an explicit dependency, and\\n' +\n ' - You have added `@solana-mobile/mobile-wallet-adapter-walletlib` to the `nohoist` section of your package.json\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst SolanaMobileDigitalAssetLinks =\n Platform.OS === 'android' && NativeModules.SolanaMobileDigitalAssetLinks\n ? NativeModules.SolanaMobileDigitalAssetLinks\n : new Proxy(\n {},\n {\n get() {\n throw new Error(\n Platform.OS !== 'android'\n ? 'The package `solana-mobile-wallet-adapter-walletlib` is only compatible with React Native Android'\n : LINKING_ERROR,\n );\n },\n },\n );\n\nexport async function getCallingPackage(): Promise<string | undefined> {\n return await SolanaMobileDigitalAssetLinks.getCallingPackage();\n}\n\nexport async function verifyCallingPackage(clientIdentityUri: string) {\n return await SolanaMobileDigitalAssetLinks.verifyCallingPackage(clientIdentityUri);\n}\n\nexport async function getCallingPackageUid() {\n return await SolanaMobileDigitalAssetLinks.getCallingPackageUid();\n}\n\nexport async function getUidForPackage(packageName: string) {\n return await SolanaMobileDigitalAssetLinks.getUidForPackage(packageName);\n}\n"],"mappings":";;;;;;;AAIA,IAAY,sBAAL,yBAAA,qBAAA;AACH,qBAAA,uBAAA;AACA,qBAAA,uBAAA;AACA,qBAAA,4BAAA;AACA,qBAAA,gCAAA;AACA,qBAAA,iCAAA;AACA,qBAAA,0BAAA;AACA,qBAAA,uBAAA;AACA,qBAAA,kCAAA;AACA,qBAAA,+BAAA;;KACH;;;ACXD,MAAMA,kBACF;AAOJ,MAAMC,uCACF,SAAS,OAAO,aAAa,cAAc,qCACrC,cAAc,qCACd,IAAI,MACA,EAAE,EACF,EACI,MAAM;AACF,OAAM,IAAI,MACN,SAAS,OAAO,YACV,sGACAD,gBACT;GAER,CACJ;AAwCX,IAAY,iBAAL,yBAAA,gBAAA;AACH,gBAAA,0BAAA;AACA,gBAAA,4BAAA;AACA,gBAAA,4BAAA;AACA,gBAAA,yBAAA;AACA,gBAAA,6BAAA;AACA,gBAAA,oCAAA;;KACH;AA2ED,IAAY,uBA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,KAAK,+BAA+B;GAElD;;AAKN,SAAS,aAAa,aAAwD;AAC1E,QAAO,OAAO,OAAO,eAAe,CAAC,SAAS,YAAY,OAA+B;;AAG7F,SAAS,kBAAkB,aAA6D;AACpF,QAAO,OAAO,OAAO,oBAAoB,CAAC,SAAS,YAAY,OAAoC;;;;ACtBvG,SAAgB,8BACZ,YACA,QACA,eACA,oBACF;AACE,iBAAgB;EACZ,eAAe,eAAe;AAC1B,OAAI;AACA,UAAM,qCAAqC,YAAY,OAAO;YACzD,GAAG;AACR,YAAQ,MAAM,EAAE;;;EAGxB,MAAM,WAAW,2BAA2B,eAAe,mBAAmB;AAC9E,gBAAc;AACd,eAAa;AACT,YAAS,QAAQ;;IAEtB,EAAE,CAAC;;;;AC3BV,MAAM,gBACF;AAOJ,MAAM,gCACF,SAAS,OAAO,aAAa,cAAc,gCACrC,cAAc,gCACd,IAAI,MACA,EAAE,EACF,EACI,MAAM;AACF,OAAM,IAAI,MACN,SAAS,OAAO,YACV,sGACA,cACT;GAER,CACJ;AAEX,eAAsB,oBAAiD;AACnE,QAAO,MAAM,8BAA8B,mBAAmB;;AAGlE,eAAsB,qBAAqB,mBAA2B;AAClE,QAAO,MAAM,8BAA8B,qBAAqB,kBAAkB;;AAGtF,eAAsB,uBAAuB;AACzC,QAAO,MAAM,8BAA8B,sBAAsB;;AAGrE,eAAsB,iBAAiB,aAAqB;AACxD,QAAO,MAAM,8BAA8B,iBAAiB,YAAY"}
1
+ {"version":3,"file":"index.native.js","names":["LINKING_ERROR","SolanaMobileWalletAdapterWalletLib","LINKING_ERROR"],"sources":["../../src/mwaSessionEvents.ts","../../src/resolve.ts","../../src/errors.ts","../../src/initializeMobileWalletAdapterSession.ts","../../src/initializeMWAEventListener.ts","../../src/useMobileWalletAdapterSession.ts","../../src/useDigitalAssetLinks.ts"],"sourcesContent":["/**\n * Mobile Wallet Adapter Session Events are notifications and events\n * about the underlying session between the wallet and the dApp.\n */\nexport enum MWASessionEventType {\n SessionStartEvent = 'SESSION_START',\n SessionReadyEvent = 'SESSION_READY',\n SessionTerminatedEvent = 'SESSION_TERMINATED',\n SessionServingClientsEvent = 'SESSION_SERVING_CLIENTS',\n SessionServingCompleteEvent = 'SESSION_SERVING_COMPLETE',\n SessionCompleteEvent = 'SESSION_COMPLETE',\n SessionErrorEvent = 'SESSION_ERROR',\n SessionTeardownCompleteEvent = 'SESSION_TEARDOWN_COMPLETE',\n LowPowerNoConnectionEvent = 'LOW_POWER_NO_CONNECTION',\n}\nexport interface IMWASessionEvent {\n __type: MWASessionEventType;\n sessionId: string;\n}\n\nexport type SessionStartEvent = Readonly<{\n __type: MWASessionEventType.SessionStartEvent;\n}> &\n IMWASessionEvent;\n\nexport type SessionReadyEvent = Readonly<{\n __type: MWASessionEventType.SessionReadyEvent;\n}> &\n IMWASessionEvent;\n\nexport type SessionTerminatedEvent = Readonly<{\n __type: MWASessionEventType.SessionTerminatedEvent;\n}> &\n IMWASessionEvent;\n\nexport type SessionServingClientsEvent = Readonly<{\n __type: MWASessionEventType.SessionServingClientsEvent;\n}> &\n IMWASessionEvent;\n\nexport type SessionServingCompleteEvent = Readonly<{\n __type: MWASessionEventType.SessionServingCompleteEvent;\n}> &\n IMWASessionEvent;\n\nexport type SessionCompleteEvent = Readonly<{\n __type: MWASessionEventType.SessionCompleteEvent;\n}> &\n IMWASessionEvent;\n\nexport type SessionErrorEvent = Readonly<{\n __type: MWASessionEventType.SessionErrorEvent;\n}> &\n IMWASessionEvent;\n\nexport type SessionTeardownCompleteEvent = Readonly<{\n __type: MWASessionEventType.SessionTeardownCompleteEvent;\n}> &\n IMWASessionEvent;\n\nexport type LowPowerNoConnectionEvent = Readonly<{\n __type: MWASessionEventType.LowPowerNoConnectionEvent;\n}> &\n IMWASessionEvent;\n\nexport type MWASessionEvent =\n | SessionStartEvent\n | SessionReadyEvent\n | SessionTerminatedEvent\n | SessionServingClientsEvent\n | SessionServingCompleteEvent\n | SessionCompleteEvent\n | SessionErrorEvent\n | SessionTeardownCompleteEvent\n | LowPowerNoConnectionEvent;\n","import type { IdentifierArray } from '@wallet-standard/core';\nimport { NativeModules, Platform } from 'react-native';\n\nconst LINKING_ERROR =\n `The package 'solana-mobile-wallet-adapter-walletlib' doesn't seem to be linked. Make sure: \\n\\n` +\n '- You rebuilt the app after installing the package\\n' +\n '- If you are using Lerna workspaces\\n' +\n ' - You have added `@solana-mobile/mobile-wallet-adapter-walletlib` as an explicit dependency, and\\n' +\n ' - You have added `@solana-mobile/mobile-wallet-adapter-walletlib` to the `nohoist` section of your package.json\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst SolanaMobileWalletAdapterWalletLib =\n Platform.OS === 'android' && NativeModules.SolanaMobileWalletAdapterWalletLib\n ? NativeModules.SolanaMobileWalletAdapterWalletLib\n : new Proxy(\n {},\n {\n get() {\n throw new Error(\n Platform.OS !== 'android'\n ? 'The package `solana-mobile-wallet-adapter-walletlib` is only compatible with React Native Android'\n : LINKING_ERROR,\n );\n },\n },\n );\n\ntype AppIdentity = Readonly<{\n identityUri?: string;\n iconRelativeUri?: string;\n identityName?: string;\n}>;\n\nexport type SignInPayload = Readonly<{\n domain?: string;\n address?: string;\n statement?: string;\n uri?: string;\n version?: string;\n chainId?: string;\n nonce?: string;\n issuedAt?: string;\n expirationTime?: string;\n notBefore?: string;\n requestId?: string;\n resources?: readonly string[];\n}>;\n\nexport type Base64EncodedAddress = string;\nexport type Base64EncodedSignature = string;\ntype Base64EncodedSignedMessage = string;\n\n/**\n * Mobile Wallet Adapter Requests are remote requests coming from\n * the dApp for authorization, signing, and sending services.\n */\n\nexport type MWARequest =\n | SignMessagesRequest\n | SignTransactionsRequest\n | SignAndSendTransactionsRequest\n | AuthorizeDappRequest\n | ReauthorizeDappRequest\n | DeauthorizeDappRequest;\n\nexport enum MWARequestType {\n AuthorizeDappRequest = 'AUTHORIZE_DAPP',\n ReauthorizeDappRequest = 'REAUTHORIZE_DAPP',\n DeauthorizeDappRequest = 'DEAUTHORIZE_DAPP',\n SignMessagesRequest = 'SIGN_MESSAGES',\n SignTransactionsRequest = 'SIGN_TRANSACTIONS',\n SignAndSendTransactionsRequest = 'SIGN_AND_SEND_TRANSACTIONS',\n}\n\ninterface IMWARequest {\n __type: MWARequestType;\n requestId: string;\n sessionId: string;\n}\n\ninterface IVerifiableIdentityRequest {\n chain: string;\n authorizationScope: Uint8Array;\n appIdentity?: AppIdentity;\n}\n\nexport type AuthorizeDappRequest = Readonly<{\n __type: MWARequestType.AuthorizeDappRequest;\n chain: string;\n appIdentity?: AppIdentity;\n features?: IdentifierArray;\n addresses?: [string];\n signInPayload?: SignInPayload;\n}> &\n IMWARequest;\n\nexport type ReauthorizeDappRequest = Readonly<{\n __type: MWARequestType.ReauthorizeDappRequest;\n}> &\n IMWARequest &\n IVerifiableIdentityRequest;\n\nexport type DeauthorizeDappRequest = Readonly<{\n __type: MWARequestType.DeauthorizeDappRequest;\n}> &\n IMWARequest &\n IVerifiableIdentityRequest;\n\nexport type SignMessagesRequest = Readonly<{\n __type: MWARequestType.SignMessagesRequest;\n payloads: Uint8Array[];\n}> &\n IMWARequest &\n IVerifiableIdentityRequest;\n\nexport type SignTransactionsRequest = Readonly<{\n __type: MWARequestType.SignTransactionsRequest;\n payloads: Uint8Array[];\n}> &\n IMWARequest &\n IVerifiableIdentityRequest;\n\nexport type SignAndSendTransactionsRequest = Readonly<{\n __type: MWARequestType.SignAndSendTransactionsRequest;\n payloads: Uint8Array[];\n minContextSlot?: number;\n commitment?: string;\n skipPreflight?: boolean;\n maxRetries?: number;\n waitForCommitmentToSendNextTransaction?: boolean;\n}> &\n IMWARequest &\n IVerifiableIdentityRequest;\n\n/**\n * MWA Request Responses\n */\n\nexport type MWAResponse =\n | AuthorizeDappResponse\n | ReauthorizeDappResponse\n | DeauthorizeDappResponse\n | SignMessagesResponse\n | SignTransactionsResponse\n | SignAndSendTransactionsResponse;\n\n/* Failure Responses */\nexport enum MWARequestFailReason {\n UserDeclined = 'USER_DECLINED',\n TooManyPayloads = 'TOO_MANY_PAYLOADS',\n InvalidSignatures = 'INVALID_SIGNATURES',\n AuthorizationNotValid = 'AUTHORIZATION_NOT_VALID',\n}\n\nexport type UserDeclinedResponse = Readonly<{\n failReason: MWARequestFailReason.UserDeclined;\n}>;\n\nexport type TooManyPayloadsResponse = Readonly<{\n failReason: MWARequestFailReason.TooManyPayloads;\n}>;\n\nexport type AuthorizationNotValidResponse = Readonly<{\n failReason: MWARequestFailReason.AuthorizationNotValid;\n}>;\n\nexport type InvalidSignaturesResponse = Readonly<{\n failReason: MWARequestFailReason.InvalidSignatures;\n valid: boolean[];\n}>;\n\n/* Authorize Dapp */\nexport type AuthorizedAccount = Readonly<{\n publicKey: Uint8Array;\n accountLabel?: string;\n icon?: string;\n chains?: IdentifierArray;\n features?: IdentifierArray;\n}>;\nexport type SignInResult = Readonly<{\n address: Base64EncodedAddress;\n signed_message: Base64EncodedSignedMessage;\n signature: Base64EncodedSignature;\n signature_type?: string;\n}>;\nexport type AuthorizeDappCompleteResponse = Readonly<{\n accounts: Array<AuthorizedAccount>;\n walletUriBase?: string;\n authorizationScope?: Uint8Array;\n signInResult?: SignInResult;\n}>;\nexport type AuthorizeDappResponse = AuthorizeDappCompleteResponse | UserDeclinedResponse;\n\n/* Reauthorize Dapp */\nexport type ReauthorizeDappCompleteResponse = Readonly<{\n authorizationScope?: Uint8Array;\n}>;\nexport type ReauthorizeDappResponse = ReauthorizeDappCompleteResponse | AuthorizationNotValidResponse;\n\n/* Deauthorize Dapp */\nexport type DeauthorizeDappCompleteResponse = Readonly<Record<string, never>>;\nexport type DeauthorizeDappResponse = DeauthorizeDappCompleteResponse | AuthorizationNotValidResponse;\n\n/* Sign Transactions/Messages */\nexport type SignPayloadsCompleteResponse = Readonly<{ signedPayloads: Uint8Array[] }>;\nexport type SignPayloadsFailResponse =\n | UserDeclinedResponse\n | TooManyPayloadsResponse\n | AuthorizationNotValidResponse\n | InvalidSignaturesResponse;\n\nexport type SignTransactionsResponse = SignPayloadsCompleteResponse | SignPayloadsFailResponse;\nexport type SignMessagesResponse = SignPayloadsCompleteResponse | SignPayloadsFailResponse;\n\n/* Sign and Send Transaction */\nexport type SignAndSendTransactionsCompleteResponse = Readonly<{ signedTransactions: Uint8Array[] }>;\nexport type SignAndSendTransactionsResponse =\n | SignAndSendTransactionsCompleteResponse\n | UserDeclinedResponse\n | TooManyPayloadsResponse\n | AuthorizationNotValidResponse\n | InvalidSignaturesResponse;\n\nexport function resolve(request: AuthorizeDappRequest, response: AuthorizeDappResponse): void;\nexport function resolve(request: ReauthorizeDappRequest, response: ReauthorizeDappResponse): void;\nexport function resolve(request: DeauthorizeDappRequest, response: DeauthorizeDappResponse): void;\nexport function resolve(request: SignMessagesRequest, response: SignMessagesResponse): void;\nexport function resolve(request: SignTransactionsRequest, response: SignTransactionsResponse): void;\nexport function resolve(request: SignAndSendTransactionsRequest, response: SignAndSendTransactionsResponse): void;\nexport function resolve(request: MWARequest, response: MWAResponse): void {\n SolanaMobileWalletAdapterWalletLib.resolve(JSON.stringify(request), JSON.stringify(response));\n}\n","export enum SolanaMWAWalletLibErrorCode {\n ERROR_INTENT_DATA_NOT_FOUND = 'ERROR_INTENT_DATA_NOT_FOUND',\n ERROR_SESSION_ALREADY_CREATED = 'ERROR_SESSION_ALREADY_CREATED',\n ERROR_UNSUPPORTED_ASSOCIATION_URI = 'ERROR_UNSUPPORTED_ASSOCIATION_URI',\n ERROR_UNSUPPORTED_ASSOCIATION_TYPE = 'ERROR_UNSUPPORTED_ASSOCIATION_TYPE',\n}\n\nexport class SolanaMWAWalletLibError extends Error {\n code: SolanaMWAWalletLibErrorCode;\n constructor(code: SolanaMWAWalletLibErrorCode, message: string) {\n super(message);\n this.name = 'SolanaMWAWalletLibError';\n this.code = code;\n }\n}\n","import type { TransactionVersion } from '@solana/web3.js';\nimport type { IdentifierArray } from '@wallet-standard/core';\nimport { NativeModules, Platform } from 'react-native';\n\nimport { SolanaMWAWalletLibError, SolanaMWAWalletLibErrorCode } from './errors.js';\n\nconst LINKING_ERROR =\n `The package 'solana-mobile-wallet-adapter-walletlib' doesn't seem to be linked. Make sure: \\n\\n` +\n '- You rebuilt the app after installing the package\\n' +\n '- If you are using Lerna workspaces\\n' +\n ' - You have added `@solana-mobile/mobile-wallet-adapter-walletlib` as an explicit dependency, and\\n' +\n ' - You have added `@solana-mobile/mobile-wallet-adapter-walletlib` to the `nohoist` section of your package.json\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst SolanaMobileWalletAdapterWalletLib =\n Platform.OS === 'android' && NativeModules.SolanaMobileWalletAdapterWalletLib\n ? NativeModules.SolanaMobileWalletAdapterWalletLib\n : new Proxy(\n {},\n {\n get() {\n throw new Error(\n Platform.OS !== 'android'\n ? 'The package `solana-mobile-wallet-adapter-walletlib` is only compatible with React Native Android'\n : LINKING_ERROR,\n );\n },\n },\n );\n\ntype ReactNativeError = Error & { code?: string; userInfo?: Record<string, unknown> };\n\nfunction handleError(e: unknown): never {\n if (e instanceof Error) {\n const { code, message } = e as ReactNativeError;\n if (code && code in SolanaMWAWalletLibErrorCode) {\n throw new SolanaMWAWalletLibError(code as SolanaMWAWalletLibErrorCode, message);\n }\n }\n throw e;\n}\n\nexport type MWASessionId = string;\n\nexport interface MobileWalletAdapterConfig {\n maxTransactionsPerSigningRequest: number;\n maxMessagesPerSigningRequest: number;\n supportedTransactionVersions: Array<TransactionVersion>;\n noConnectionWarningTimeoutMs: number;\n optionalFeatures: IdentifierArray;\n}\n\nexport async function initializeMobileWalletAdapterSession(\n walletName: string,\n config: MobileWalletAdapterConfig,\n): Promise<MWASessionId> {\n try {\n return await initializeScenario(walletName, config);\n } catch (e) {\n handleError(e);\n }\n}\n\n// Create Scenario and establish session with dapp\nfunction initializeScenario(walletName: string, walletConfig: MobileWalletAdapterConfig): Promise<MWASessionId> {\n return SolanaMobileWalletAdapterWalletLib.createScenario(walletName, JSON.stringify(walletConfig));\n}\n","import { EmitterSubscription, NativeEventEmitter } from 'react-native';\n\nimport { MWASessionEvent, MWASessionEventType } from './mwaSessionEvents.js';\nimport { MWARequest, MWARequestType } from './resolve.js';\n\nconst MOBILE_WALLET_ADAPTER_EVENT_BRIDGE_NAME = 'MobileWalletAdapterServiceRequestBridge';\ntype NativeMWAEvent = Readonly<{ __type?: unknown }>;\n\nexport function initializeMWAEventListener(\n handleRequest: (request: MWARequest) => void,\n handleSessionEvent: (sessionEvent: MWASessionEvent) => void,\n): EmitterSubscription {\n const mwaEventEmitter = new NativeEventEmitter();\n const listener = mwaEventEmitter.addListener(MOBILE_WALLET_ADAPTER_EVENT_BRIDGE_NAME, (nativeEvent) => {\n const event = nativeEvent as NativeMWAEvent;\n if (isMWARequest(event)) {\n handleRequest(event);\n } else if (isMWASessionEvent(event)) {\n handleSessionEvent(event);\n } else {\n console.warn('Unexpected native event type');\n }\n });\n\n return listener;\n}\n\nfunction isMWARequest(nativeEvent: NativeMWAEvent): nativeEvent is MWARequest {\n return Object.values(MWARequestType).includes(nativeEvent.__type as MWARequest['__type']);\n}\n\nfunction isMWASessionEvent(nativeEvent: NativeMWAEvent): nativeEvent is MWASessionEvent {\n return Object.values(MWASessionEventType).includes(nativeEvent.__type as MWASessionEvent['__type']);\n}\n","import { useEffect } from 'react';\n\nimport {\n initializeMobileWalletAdapterSession,\n MobileWalletAdapterConfig,\n} from './initializeMobileWalletAdapterSession.js';\nimport { initializeMWAEventListener } from './initializeMWAEventListener.js';\nimport { MWASessionEvent } from './mwaSessionEvents.js';\nimport { MWARequest } from './resolve.js';\n\nexport function useMobileWalletAdapterSession(\n walletName: string,\n config: MobileWalletAdapterConfig,\n handleRequest: (request: MWARequest) => void,\n handleSessionEvent: (sessionEvent: MWASessionEvent) => void,\n) {\n useEffect(() => {\n async function startSession() {\n try {\n await initializeMobileWalletAdapterSession(walletName, config);\n } catch (e) {\n console.error(e);\n }\n }\n const listener = initializeMWAEventListener(handleRequest, handleSessionEvent);\n startSession();\n return () => {\n listener.remove();\n };\n }, []);\n}\n","import { NativeModules, Platform } from 'react-native';\n\nconst LINKING_ERROR =\n `The package 'solana-mobile-wallet-adapter-walletlib' doesn't seem to be linked. Make sure: \\n\\n` +\n '- You rebuilt the app after installing the package\\n' +\n '- If you are using Lerna workspaces\\n' +\n ' - You have added `@solana-mobile/mobile-wallet-adapter-walletlib` as an explicit dependency, and\\n' +\n ' - You have added `@solana-mobile/mobile-wallet-adapter-walletlib` to the `nohoist` section of your package.json\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst SolanaMobileDigitalAssetLinks =\n Platform.OS === 'android' && NativeModules.SolanaMobileDigitalAssetLinks\n ? NativeModules.SolanaMobileDigitalAssetLinks\n : new Proxy(\n {},\n {\n get() {\n throw new Error(\n Platform.OS !== 'android'\n ? 'The package `solana-mobile-wallet-adapter-walletlib` is only compatible with React Native Android'\n : LINKING_ERROR,\n );\n },\n },\n );\n\nexport async function getCallingPackage(): Promise<string | undefined> {\n return await SolanaMobileDigitalAssetLinks.getCallingPackage();\n}\n\nexport async function verifyCallingPackage(clientIdentityUri: string) {\n return await SolanaMobileDigitalAssetLinks.verifyCallingPackage(clientIdentityUri);\n}\n\nexport async function getCallingPackageUid() {\n return await SolanaMobileDigitalAssetLinks.getCallingPackageUid();\n}\n\nexport async function getUidForPackage(packageName: string) {\n return await SolanaMobileDigitalAssetLinks.getUidForPackage(packageName);\n}\n"],"mappings":";;;;;;;AAIA,IAAY,sBAAL,yBAAA,qBAAA;CACH,oBAAA,uBAAA;CACA,oBAAA,uBAAA;CACA,oBAAA,4BAAA;CACA,oBAAA,gCAAA;CACA,oBAAA,iCAAA;CACA,oBAAA,0BAAA;CACA,oBAAA,uBAAA;CACA,oBAAA,kCAAA;CACA,oBAAA,+BAAA;;AACJ,EAAA,CAAA,CAAA;;;ACXA,MAAMA,kBACF;AAOJ,MAAMC,uCACF,SAAS,OAAO,aAAa,cAAc,qCACrC,cAAc,qCACd,IAAI,MACA,CAAC,GACD,EACI,MAAM;CACF,MAAM,IAAI,MACN,SAAS,OAAO,Y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AiB,aAAqB;CACxD,OAAO,MAAM,8BAA8B,iBAAiB,WAAW;AAC3E"}
@@ -1,6 +1,5 @@
1
1
  import { IdentifierArray } from "@wallet-standard/core";
2
2
  import { EmitterSubscription } from "react-native";
3
-
4
3
  //#region src/mwaSessionEvents.d.ts
5
4
  /**
6
5
  * Mobile Wallet Adapter Session Events are notifications and events
@@ -193,11 +192,8 @@ declare function resolve(request: SignMessagesRequest, response: SignMessagesRes
193
192
  declare function resolve(request: SignTransactionsRequest, response: SignTransactionsResponse): void;
194
193
  declare function resolve(request: SignAndSendTransactionsRequest, response: SignAndSendTransactionsResponse): void;
195
194
  //#endregion
196
- //#region ../../node_modules/.pnpm/@solana+web3.js@1.98.4_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10/node_modules/@solana/web3.js/lib/index.d.ts
195
+ //#region ../../node_modules/.pnpm/@solana+web3.js@1.98.4_bufferutil@4.1.0_typescript@6.0.3_utf-8-validate@5.0.10/node_modules/@solana/web3.js/lib/index.d.ts
197
196
  type TransactionVersion = 'legacy' | 0;
198
- /**
199
- * Versioned transaction class
200
- */
201
197
  //#endregion
202
198
  //#region src/initializeMobileWalletAdapterSession.d.ts
203
199
  type MWASessionId = string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["Buffer","Agent","Agent$1","Struct","constructor","properties","encode","decode","data","decodeUnchecked","Enum","enum","SOLANA_SCHEMA","Function","Map","MAX_SEED_LENGTH","PUBLIC_KEY_LENGTH","PublicKeyInitData","Uint8Array","Array","PublicKeyData","PublicKey","Symbol","toStringTag","Promise","value","unique","default","equals","publicKey","toBase58","toJSON","toBytes","toBuffer","toString","createWithSeed","fromPublicKey","seed","programId","createProgramAddressSync","seeds","createProgramAddress","findProgramAddressSync","findProgramAddress","isOnCurve","pubkeyData","Account","secretKey","Blockhash","BPF_LOADER_DEPRECATED_PROGRAM_ID","EpochSchedule","slotsPerEpoch","leaderScheduleSlotOffset","warmup","firstNormalEpoch","firstNormalSlot","getEpoch","slot","getEpochAndSlotIndex","getFirstSlotInEpoch","epoch","getLastSlotInEpoch","getSlotsInEpoch","_default","globalThis","fetch","FeeCalculator","lamportsPerSignature","NONCE_ACCOUNT_LENGTH","DurableNonce","NonceAccount","authorizedPubkey","nonce","feeCalculator","fromAccountData","buffer","Ed25519SecretKey","Ed25519Keypair","Signer","Keypair","_keypair","keypair","generate","fromSecretKey","skipValidation","options","fromSeed","PACKET_DATA_SIZE","VERSION_PREFIX_MASK","SIGNATURE_LENGTH_IN_BYTES","TransactionExpiredBlockheightExceededError","Error","signature","TransactionExpiredTimeoutError","timeoutSeconds","TransactionExpiredNonceInvalidError","AccountKeysFromLookups","LoadedAddresses","MessageAccountKeys","TransactionInstruction","MessageCompiledInstruction","staticAccountKeys","accountKeysFromLookups","keySegments","get","index","length","compileInstructions","instructions","CompiledInstruction","programIdIndex","accounts","MessageArgs","MessageHeader","header","accountKeys","recentBlockhash","CompileLegacyArgs","payerKey","Message","MessageAddressTableLookup","indexToProgramIds","args","version","compiledInstructions","addressTableLookups","getAccountKeys","compile","isAccountSigner","isAccountWritable","isProgramId","programIds","nonProgramIds","serialize","from","AddressLookupTableState","deactivationSlot","lastExtendedSlot","lastExtendedSlotStartIndex","authority","addresses","AddressLookupTableAccountArgs","key","state","AddressLookupTableAccount","isActive","deserialize","accountData","CreateLookupTableParams","payer","recentSlot","FreezeLookupTableParams","lookupTable","ExtendLookupTableParams","DeactivateLookupTableParams","CloseLookupTableParams","recipient","LookupTableInstructionType","AddressLookupTableInstruction","decodeInstructionType","instruction","decodeCreateLookupTable","decodeExtendLookupTable","decodeCloseLookupTable","decodeFreezeLookupTable","decodeDeactivateLookupTable","AddressLookupTableProgram","createLookupTable","params","freezeLookupTable","extendLookupTable","deactivateLookupTable","closeLookupTable","ComputeBudgetInstruction","ComputeBudgetInstructionType","RequestUnitsParams","RequestHeapFrameParams","SetComputeUnitLimitParams","SetComputeUnitPriceParams","decodeRequestUnits","decodeRequestHeapFrame","decodeSetComputeUnitLimit","decodeSetComputeUnitPrice","units","additionalFee","bytes","microLamports","ComputeBudgetProgram","requestUnits","requestHeapFrame","setComputeUnitLimit","setComputeUnitPrice","CreateEd25519InstructionWithPublicKeyParams","message","instructionIndex","CreateEd25519InstructionWithPrivateKeyParams","privateKey","Ed25519Program","createInstructionWithPublicKey","createInstructionWithPrivateKey","CreateSecp256k1InstructionWithPublicKeyParams","recoveryId","CreateSecp256k1InstructionWithEthAddressParams","ethAddress","CreateSecp256k1InstructionWithPrivateKeyParams","Secp256k1Program","publicKeyToEthAddress","createInstructionWithEthAddress","STAKE_CONFIG_ID","Authorized","staker","withdrawer","Lockup","unixTimestamp","custodian","CreateStakeAccountParams","fromPubkey","stakePubkey","authorized","lockup","lamports","CreateStakeAccountWithSeedParams","basePubkey","InitializeStakeParams","DelegateStakeParams","votePubkey","AuthorizeStakeParams","StakeAuthorizationType","newAuthorizedPubkey","stakeAuthorizationType","custodianPubkey","AuthorizeWithSeedStakeParams","authorityBase","authoritySeed","authorityOwner","SplitStakeParams","splitStakePubkey","SplitStakeWithSeedParams","WithdrawStakeParams","toPubkey","DeactivateStakeParams","MergeStakeParams","sourceStakePubKey","StakeInstruction","StakeInstructionType","decodeInitialize","decodeDelegate","decodeAuthorize","decodeAuthorizeWithSeed","decodeSplit","decodeMerge","decodeWithdraw","decodeDeactivate","StakeAuthorizationLayout","Readonly","Staker","Withdrawer","StakeProgram","Transaction","space","initialize","createAccountWithSeed","createAccount","delegate","authorize","authorizeWithSeed","split","rentExemptReserve","splitWithSeed","merge","withdraw","deactivate","CreateAccountParams","newAccountPubkey","TransferParams","AssignParams","accountPubkey","CreateAccountWithSeedParams","CreateNonceAccountParams","noncePubkey","CreateNonceAccountWithSeedParams","InitializeNonceParams","AdvanceNonceParams","WithdrawNonceParams","AuthorizeNonceParams","AllocateParams","AllocateWithSeedParams","AssignWithSeedParams","TransferWithSeedParams","DecodedTransferInstruction","DecodedTransferWithSeedInstruction","SystemInstruction","SystemInstructionType","decodeCreateAccount","decodeTransfer","decodeTransferWithSeed","decodeAllocate","decodeAllocateWithSeed","decodeAssign","decodeAssignWithSeed","decodeCreateWithSeed","decodeNonceInitialize","decodeNonceAdvance","decodeNonceWithdraw","decodeNonceAuthorize","SystemProgram","transfer","assign","createNonceAccount","nonceInitialize","nonceAdvance","nonceWithdraw","nonceAuthorize","allocate","VoteInit","nodePubkey","authorizedVoter","authorizedWithdrawer","commission","CreateVoteAccountParams","voteInit","InitializeAccountParams","AuthorizeVoteParams","VoteAuthorizationType","voteAuthorizationType","AuthorizeVoteWithSeedParams","currentAuthorityDerivedKeyBasePubkey","currentAuthorityDerivedKeyOwnerPubkey","currentAuthorityDerivedKeySeed","WithdrawFromVoteAccountParams","authorizedWithdrawerPubkey","UpdateValidatorIdentityParams","VoteInstruction","VoteInstructionType","decodeInitializeAccount","VoteAuthorizationLayout","Voter","VoteProgram","initializeAccount","safeWithdraw","currentVoteAccountBalance","rentExemptMinimum","updateValidatorIdentity","MessageV0Args","CompileV0Args","addressLookupTableAccounts","GetAccountKeysArgs","MessageV0","numAccountKeysFromLookups","resolveAddressTableLookups","serializeInstructions","serializeAddressTableLookups","serializedMessage","VersionedMessage","deserializeMessageVersion","numRequiredSignatures","numReadonlySignedAccounts","numReadonlyUnsignedAccounts","accountKey","writableIndexes","readonlyIndexes","accountKeyIndexes","TransactionSignature","TransactionStatus","BLOCKHEIGHT_EXCEEDED","PROCESSED","TIMED_OUT","NONCE_INVALID","AccountMeta","pubkey","isSigner","isWritable","TransactionInstructionCtorFields","keys","SerializeConfig","requireAllSignatures","verifySignatures","opts","SignaturePubkeyPair","TransactionCtorFields_DEPRECATED","NonceInformation","nonceInfo","feePayer","signatures","TransactionCtorFields","TransactionBlockhashCtor","blockhash","lastValidBlockHeight","TransactionNonceCtor","minContextSlot","nonceInstruction","Connection","minNonceContextSlot","add","items","compileMessage","serializeMessage","getEstimatedFee","connection","setSigners","signers","sign","partialSign","addSignature","config","populate","TransactionMessageArgs","DecompileArgs","TransactionMessage","decompile","compileToLegacyMessage","compileToV0Message","TransactionVersion","VersionedTransaction","serializedTransaction","ClientSubscriptionId","TokenAccountsFilter","mint","Context","SendOptions","Commitment","skipPreflight","preflightCommitment","maxRetries","ConfirmOptions","commitment","ConfirmedSignaturesForAddress2Options","before","until","limit","SignaturesForAddressOptions","RpcResponseAndContext","T","context","BlockhashWithExpiryBlockHeight","BlockheightBasedTransactionConfirmationStrategy","BaseTransactionConfirmationStrategy","DurableNonceTransactionConfirmationStrategy","nonceAccountPubkey","nonceValue","AbortSignal","abortSignal","TransactionConfirmationStrategy","Finality","LargestAccountsFilter","GetAccountInfoConfig","DataSlice","dataSlice","GetBalanceConfig","GetBlockConfig","rewards","transactionDetails","GetVersionedBlockConfig","maxSupportedTransactionVersion","GetStakeMinimumDelegationConfig","GetBlockHeightConfig","GetEpochInfoConfig","GetInflationRewardConfig","GetLatestBlockhashConfig","IsBlockhashValidConfig","GetSlotConfig","GetSlotLeaderConfig","GetTransactionConfig","GetVersionedTransactionConfig","GetLargestAccountsConfig","filter","GetSupplyConfig","excludeNonCirculatingAccountsList","SignatureStatusConfig","searchTransactionHistory","ContactInfo","gossip","tpu","rpc","VoteAccountInfo","activatedStake","epochVoteAccount","epochCredits","lastVote","VoteAccountStatus","current","delinquent","InflationGovernor","foundation","foundationTerm","initial","taper","terminal","InflationReward","effectiveSlot","amount","postBalance","RecentPrioritizationFees","prioritizationFee","GetRecentPrioritizationFeesConfig","lockedWritableAccounts","InflationRate","total","validator","EpochInfo","slotIndex","slotsInEpoch","absoluteSlot","blockHeight","transactionCount","LeaderSchedule","address","Version","SimulatedTransactionAccountInfo","executable","owner","rentEpoch","TransactionReturnDataEncoding","TransactionReturnData","SimulateTransactionConfig","sigVerify","replaceRecentBlockhash","encoding","innerInstructions","SimulatedTransactionResponse","TransactionError","ParsedInnerInstruction","err","logs","unitsConsumed","returnData","ParsedInstruction","PartiallyDecodedInstruction","TokenBalance","TokenAmount","accountIndex","uiTokenAmount","ParsedConfirmedTransactionMeta","ParsedTransactionMeta","writable","readonly","fee","preBalances","postBalances","logMessages","preTokenBalances","postTokenBalances","loadedAddresses","computeUnitsConsumed","costUnits","CompiledInnerInstruction","ConfirmedTransactionMeta","TransactionResponse","transaction","meta","blockTime","VersionedTransactionResponse","ConfirmedTransaction","ParsedMessageAccount","signer","source","program","parsed","ParsedAddressTableLookup","ParsedMessage","ParsedTransaction","ParsedConfirmedTransaction","ParsedTransactionWithMeta","BlockResponse","previousBlockhash","parentSlot","transactions","rewardType","AccountsModeBlockResponse","VersionedAccountsModeBlockResponse","NoneModeBlockResponse","VersionedNoneModeBlockResponse","ParsedBlockResponse","ParsedAccountsModeBlockResponse","Omit","Pick","ParsedNoneModeBlockResponse","VersionedBlockResponse","ConfirmedBlock","BlockSignatures","BlockProduction","ReadonlyArray","Record","byIdentity","range","firstSlot","lastSlot","GetBlockProductionConfig","identity","PerfSample","numTransactions","numSlots","samplePeriodSecs","Supply","circulating","nonCirculating","nonCirculatingAccounts","decimals","uiAmount","uiAmountString","TokenAccountBalancePair","AccountBalancePair","SlotUpdate","type","timestamp","parent","stats","numTransactionEntries","numSuccessfulTransactions","numFailedTransactions","maxTransactionsPerEntry","SlotInfo","root","ParsedAccountData","StakeActivationData","active","inactive","offset","MemcmpFilter","memcmp","DataSizeFilter","dataSize","GetProgramAccountsFilter","GetProgramAccountsConfig","filters","withContext","GetProgramAccountsResponse","AccountInfo","account","GetParsedProgramAccountsConfig","GetMultipleAccountsConfig","GetStakeActivationConfig","GetTokenAccountsByOwnerConfig","GetTransactionCountConfig","GetNonceConfig","GetNonceAndContextConfig","AccountSubscriptionConfig","ProgramAccountSubscriptionConfig","KeyedAccountInfo","accountId","accountInfo","AccountChangeCallback","ProgramAccountChangeCallback","keyedAccountInfo","SlotChangeCallback","slotInfo","SlotUpdateCallback","slotUpdate","SignatureResultCallback","SignatureResult","signatureResult","SignatureStatusNotification","result","SignatureReceivedNotification","SignatureSubscriptionCallback","notification","SignatureSubscriptionOptions","enableReceivedNotification","RootChangeCallback","Logs","LogsFilter","LogsCallback","ctx","TransactionConfirmationStatus","SignatureStatus","confirmations","confirmationStatus","ConfirmedSignatureInfo","memo","HttpHeaders","FetchFn","FetchMiddleware","Parameters","info","init","a","ConnectionConfig","httpAgent","wsEndpoint","httpHeaders","fetchMiddleware","disableRetryOnRateLimit","confirmTransactionInitialTimeout","endpoint","commitmentOrConfig","rpcEndpoint","getBalanceAndContext","getBalance","getBlockTime","getMinimumLedgerSlot","getFirstAvailableBlock","getSupply","getTokenSupply","tokenMintAddress","getTokenAccountBalance","tokenAddress","getTokenAccountsByOwner","ownerAddress","getParsedTokenAccountsByOwner","getLargestAccounts","getTokenLargestAccounts","mintAddress","getAccountInfoAndContext","getParsedAccountInfo","getAccountInfo","getMultipleParsedAccounts","publicKeys","rawConfig","getMultipleAccountsInfoAndContext","getMultipleAccountsInfo","getStakeActivation","getProgramAccounts","configOrCommitment","getParsedProgramAccounts","confirmTransaction","strategy","getCancellationPromise","getTransactionConfirmationPromise","confirmTransactionUsingBlockHeightExceedanceStrategy","confirmTransactionUsingDurableNonceStrategy","confirmTransactionUsingLegacyTimeoutStrategy","getClusterNodes","getVoteAccounts","getSlot","getSlotLeader","getSlotLeaders","startSlot","getSignatureStatus","getSignatureStatuses","getTransactionCount","getTotalSupply","getInflationGovernor","getInflationReward","getInflationRate","getEpochInfo","getEpochSchedule","getLeaderSchedule","getMinimumBalanceForRentExemption","dataLength","getRecentBlockhashAndContext","getRecentPerformanceSamples","getFeeCalculatorForBlockhash","getFeeForMessage","getRecentPrioritizationFees","getRecentBlockhash","getLatestBlockhash","getLatestBlockhashAndContext","isBlockhashValid","getVersion","getGenesisHash","getBlock","getParsedBlock","getBlockHeight","getBlockProduction","getTransaction","getParsedTransaction","getParsedTransactions","getTransactions","getConfirmedBlock","getBlocks","endSlot","getBlockSignatures","getConfirmedBlockSignatures","getConfirmedTransaction","getParsedConfirmedTransaction","getParsedConfirmedTransactions","getConfirmedSignaturesForAddress","getConfirmedSignaturesForAddress2","getSignaturesForAddress","getAddressLookupTable","getNonceAndContext","nonceAccount","getNonce","requestAirdrop","to","getStakeMinimumDelegation","simulateTransaction","transactionOrMessage","includeAccounts","sendTransaction","sendRawTransaction","rawTransaction","sendEncodedTransaction","encodedTransaction","onAccountChange","callback","removeAccountChangeListener","clientSubscriptionId","onProgramAccountChange","removeProgramAccountChangeListener","onLogs","removeOnLogsListener","onSlotChange","removeSlotChangeListener","onSlotUpdate","removeSlotUpdateListener","_buildArgs","override","extra","onSignature","onSignatureWithOptions","removeSignatureListener","onRootChange","removeRootChangeListener","BPF_LOADER_PROGRAM_ID","BpfLoader","getMinNumSignatures","load","elf","loaderProgramId","SendTransactionError","action","transactionMessage","transactionLogs","transactionError","getLogs","SolanaJSONRPCErrorCode","JSON_RPC_SERVER_ERROR_BLOCK_CLEANED_UP","JSON_RPC_SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE","JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE","JSON_RPC_SERVER_ERROR_BLOCK_NOT_AVAILABLE","JSON_RPC_SERVER_ERROR_NODE_UNHEALTHY","JSON_RPC_SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE","JSON_RPC_SERVER_ERROR_SLOT_SKIPPED","JSON_RPC_SERVER_ERROR_NO_SNAPSHOT","JSON_RPC_SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED","JSON_RPC_SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX","JSON_RPC_SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE","JSON_RPC_SCAN_ERROR","JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH","JSON_RPC_SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET","JSON_RPC_SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION","JSON_RPC_SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED","SolanaJSONRPCErrorCodeEnum","SolanaJSONRPCError","code","customMessage","Loader","chunkSize","VALIDATOR_INFO_KEY","Info","name","website","details","iconUrl","keybaseUsername","ValidatorInfo","fromConfigData","VOTE_PROGRAM_ID","Lockout","confirmationCount","EpochCredits","credits","prevCredits","AuthorizedVoter","PriorVoter","epochOfLastAuthorizedSwitch","targetEpoch","BlockTimestamp","VoteAccount","rootSlot","votes","authorizedVoters","priorVoters","lastTimestamp","SYSVAR_CLOCK_PUBKEY","SYSVAR_EPOCH_SCHEDULE_PUBKEY","SYSVAR_INSTRUCTIONS_PUBKEY","SYSVAR_RECENT_BLOCKHASHES_PUBKEY","SYSVAR_RENT_PUBKEY","SYSVAR_REWARDS_PUBKEY","SYSVAR_SLOT_HASHES_PUBKEY","SYSVAR_SLOT_HISTORY_PUBKEY","SYSVAR_STAKE_HISTORY_PUBKEY","Cluster","clusterApiUrl","cluster","tls","sendAndConfirmRawTransaction","confirmationStrategy","sendAndConfirmTransaction","LAMPORTS_PER_SOL"],"sources":["../../src/mwaSessionEvents.ts","../../src/resolve.ts","../../../../node_modules/.pnpm/@solana+web3.js@1.98.4_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10/node_modules/@solana/web3.js/lib/index.d.ts","../../src/initializeMobileWalletAdapterSession.ts","../../src/useMobileWalletAdapterSession.ts","../../src/initializeMWAEventListener.ts","../../src/useDigitalAssetLinks.ts","../../src/errors.ts"],"x_google_ignoreList":[2],"mappings":";;;;;;;;aAIY,mBAAA;EACR,iBAAA;EACA,iBAAA;EACA,sBAAA;EACA,0BAAA;EACA,2BAAA;EACA,oBAAA;EACA,iBAAA;EACA,4BAAA;EACA,yBAAA;AAAA;AAAA,UAEa,gBAAA;EACb,MAAA,EAAQ,mBAAA;EACR,SAAA;AAAA;AAAA,KAGQ,iBAAA,GAAoB,QAAA;EAC5B,MAAA,EAAQ,mBAAA,CAAoB,iBAAA;AAAA,KAE5B,gBAAA;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pB,gBAAA,CAAiB,WAAA,WAAmB,OAAA;;;aCtC9C,2BAAA;EACR,2BAAA;EACA,6BAAA;EACA,iCAAA;EACA,kCAAA;AAAA;AAAA,cAGS,uBAAA,SAAgC,KAAA;EACzC,IAAA,EAAM,2BAAA;cACM,IAAA,EAAM,2BAAA,EAA6B,OAAA;AAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/mwaSessionEvents.ts","../../src/resolve.ts","../../../../node_modules/.pnpm/@solana+web3.js@1.98.4_bufferutil@4.1.0_typescript@6.0.3_utf-8-validate@5.0.10/node_modules/@solana/web3.js/lib/index.d.ts","../../src/initializeMobileWalletAdapterSession.ts","../../src/useMobileWalletAdapterSession.ts","../../src/initializeMWAEventListener.ts","../../src/useDigitalAssetLinks.ts","../../src/errors.ts"],"x_google_ignoreList":[2],"mappings":";;;;;;;aAIY;EACR;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAEa;EACb,QAAQ;EACR;;KAGQ,oBAAoB;EAC5B,QAAQ,oBAAoB;KAE5B;KAEQ,oBAAoB;EAC5B,QAAQ,oBAAoB;KAE5B;KAEQ,yBAAyB;EACjC,QAAQ,oBAAoB;KAE5B;KAEQ,6BAA6B;EACrC,QAAQ,oBAAoB;KAE5B;KAEQ,8BAA8B;EACtC,QAAQ,oBAAoB;KAE5B;KAEQ,uBAAuB;EAC/B,QAAQ,oBAAoB;KAE5B;KAEQ,oBAAoB;EAC5B,QAAQ,oBAAoB;KAE5B;KAEQ,+BAA+B;EACvC,QAAQ,oBAAoB;KAE5B;KAEQ,4BAA4B;EACpC,QAAQ,oBAAoB;KAE5B;KAEQ,kBACN,oBACA,oBACA,yBACA,6BACA,8BACA,uBACA,oBACA,+BACA;;;KC/CD,cAAc;EACf;EACA;EACA;;KAGQ,gBAAgB;EACxB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;KAGQ;KACA;KACP;;;;;KAOO,aACN,sBACA,0BACA,iCACA,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sB,UAAU;iBACjD,QAAQ,SAAS,wBAAwB,UAAU;iBACnD,QAAQ,SAAS,wBAAwB,UAAU;iBACnD,QAAQ,SAAS,qBAAqB,UAAU;iBAChD,QAAQ,SAAS,yBAAyB,UAAU;iBACpD,QAAQ,SAAS,gCAAgC,UAAU;;;KC4/CtE;;;KCtrDO;UAEK;EACb;EACA;EACA,8BAA8B,MAAM;EACpC;EACA,kBAAkB;;iBAGA,qCAClB,oBACA,QAAQ,4BACT,QAAQ;;;iBC7CK,8BACZ,oBACA,QAAQ,2BACR,gBAAgB,SAAS,qBACzB,qBAAqB,cAAc;;;iBCNvB,2BACZ,gBAAgB,SAAS,qBACzB,qBAAqB,cAAc,2BACpC;;;iBCemB,qBAAqB;iBAIrB,qBAAqB,4BAAyB;iBAI9C,wBAAoB;iBAIpB,iBAAiB,sBAAmB;;;aCtC9C;EACR;EACA;EACA;EACA;;cAGS,gCAAgC;EACzC,MAAM;EACM,YAAA,MAAM,6BAA6B"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@solana-mobile/mobile-wallet-adapter-walletlib",
3
3
  "description": "A React Native wrapper of the Solana Mobile, Mobile Wallet Adapter Wallet Library. Wallet apps can use this to handle dapp requests for signing and sending.",
4
- "version": "1.4.4",
4
+ "version": "1.4.5",
5
5
  "author": "Michael Sulistio <mike.sulistio@solanamobile.com>",
6
6
  "repository": "https://github.com/solana-mobile/mobile-wallet-adapter",
7
7
  "license": "Apache-2.0",
@@ -30,10 +30,10 @@
30
30
  },
31
31
  "devDependencies": {
32
32
  "@solana/web3.js": "^1.98.4",
33
- "@types/react": "^19.2.0",
33
+ "@types/react": "^19.2.18",
34
34
  "@types/react-native": "^0.69.3",
35
35
  "@wallet-standard/core": "^1.1.1",
36
- "react": "^19.2.3",
36
+ "react": "^19.2.8",
37
37
  "cross-env": "^10.1.0",
38
38
  "shx": "^0.4.0"
39
39
  },