{"id":22051533,"url":"https://github.com/unboxed-software/mobile-wallet-adapter-walletlib","last_synced_at":"2026-05-05T19:32:56.523Z","repository":{"id":204547885,"uuid":"712116891","full_name":"Unboxed-Software/mobile-wallet-adapter-walletlib","owner":"Unboxed-Software","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-30T20:33:17.000Z","size":78,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-08T21:17:57.056Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Unboxed-Software.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-30T20:29:29.000Z","updated_at":"2023-10-30T20:30:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"a22ae63b-fde3-4800-b07e-9b25e07e9194","html_url":"https://github.com/Unboxed-Software/mobile-wallet-adapter-walletlib","commit_stats":null,"previous_names":["unboxed-software/mobile-wallet-adapter-walletlib"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Unboxed-Software/mobile-wallet-adapter-walletlib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Unboxed-Software%2Fmobile-wallet-adapter-walletlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Unboxed-Software%2Fmobile-wallet-adapter-walletlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Unboxed-Software%2Fmobile-wallet-adapter-walletlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Unboxed-Software%2Fmobile-wallet-adapter-walletlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Unboxed-Software","download_url":"https://codeload.github.com/Unboxed-Software/mobile-wallet-adapter-walletlib/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Unboxed-Software%2Fmobile-wallet-adapter-walletlib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32664951,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-05T11:29:49.557Z","status":"ssl_error","status_checked_at":"2026-05-05T11:29:48.587Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-30T15:09:31.278Z","updated_at":"2026-05-05T19:32:56.507Z","avatar_url":"https://github.com/Unboxed-Software.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unboxed Edits\n\nLet's clone and extract the package into a new directory `lib`:\n```bash\ngit clone https://github.com/solana-mobile/mobile-wallet-adapter.git\nmkdir lib\ncp -rf mobile-wallet-adapter/js/packages/mobile-wallet-adapter-walletlib ./lib\nrm -rf mobile-wallet-adapter\n```\n\nNow we have to make some slight edits for our app to compile and resolve the new package.\n\nFirst, in `android/build.gradle`, change the `minSdkVersion` to version `23`.\n```gradle\n  minSdkVersion = 23\n```\n\nIn `lib/mobile-wallet-adapter-walletlib/src/index.ts` remove all `.js` from the end of the exports.\n```ts\nexport * from './mwaSessionEvents';\nexport * from './resolve';\nexport * from './useMobileWalletAdapterSession';\nexport * from './useDigitalAssetLinks';\n```\n\nIn `lib/mobile-wallet-adapter-walletlib/src/useMobileWalletAdapterSession.ts` remove the `.js` from the following imports:\n```ts\nimport { MWASessionEvent, MWASessionEventType } from './mwaSessionEvents';\nimport { MWARequest, MWARequestType } from './resolve';\n```\n\nIn `lib/mobile-wallet-adapter-walletlib\\android\\src\\main\\java\\com\\solanamobile\\mobilewalletadapterwalletlib\\reactnative\\MobileWalletAdapterBottomSheetActivity.kt` comment out the `protected fun isConcurrentRootEnabled() = false` line at the very bottom.\n```kt\n// override protected fun isConcurrentRootEnabled() = false\n```\n\nLastly, add `@solana-mobile/mobile-wallet-adapter-walletlib` to our `package.json` dependancies with the filepath as the resolution:\n```json\n\"dependencies\": {\n    \"@solana-mobile/mobile-wallet-adapter-walletlib\": \"file:./lib/mobile-wallet-adapter-walletlib\",\n}\n```\n\n# `@solana-mobile/mobile-wallet-adapter-walletlib`\n\nThis is a package that provides React Native bridge for the native `mobile-wallet-adapter-walletlib` library and it is designed for *Wallet apps* built in React Native. It provides an API to implement the wallet endpoint of the [mobile wallet adapter protocol](https://github.com/solana-mobile/mobile-wallet-adapter/blob/main/spec/spec.md).\n\nDeep dive and read the full Mobile Wallet Adapter protocol [specification](https://solana-mobile.github.io/mobile-wallet-adapter/spec/spec.html#mobile-wallet-adapter-specification).\n\n## TODO\n- Separate bottom sheet signing experience or make optional\n\n## Note\nThis package is still in alpha and is not production ready. However, the API is stable and will not change drastically, so you can begin integration with your wallet.\n\n\n## Quickstart\n\n### 1. Define your MWA entrypoint\n\nTo support bottom sheet signing flow, you need to define a React component to be the entrypoint for MWA. When the dApp sends out an intent for `solana-wallet://`, this entrypoint component will be rendered.\n\nDefine your entrypoint component in `index.js`:\n```typescript\nAppRegistry.registerComponent(\n  'MobileWalletAdapterEntrypoint', // Constant\n  () =\u003e YourMWAComponent,\n);\n```\n\n### 2. Start listening and handling MWA requests\n\nUse this API to start a session and start handling requests:\n```typescript\nimport {\n  MobileWalletAdapterConfig,\n  MWARequest,\n  MWASessionEvent,\n  useMobileWalletAdapterSession,\n} from '@solana-mobile/mobile-wallet-adapter-protocol-walletlib';\n\nconst config: MobileWalletAdapterConfig = useMemo(() =\u003e {\n  return {\n    supportsSignAndSendTransactions: true,\n    maxTransactionsPerSigningRequest: 10,\n    maxMessagesPerSigningRequest: 10,\n    supportedTransactionVersions: [0, 'legacy'],\n    noConnectionWarningTimeoutMs: 3000,\n  };\n}, []);\n\n// MWA Session Handlers\nconst handleRequest = useCallback((request: MWARequest) =\u003e {\n  /* ... */\n}, []);\n\nconst handleSessionEvent = useCallback((sessionEvent: MWASessionEvent) =\u003e {\n  /* ... */\n}, []);\n\n// Connect to the calling dApp and begin handling dApp requests\nuseMobileWalletAdapterSession(\n  'Example Wallet Label',\n  config,\n  handleRequest,\n  handleSessionEvent,\n);\n```\n\n### 3. Handling requests\n\nA `MWARequest` is handled by calling `resolve(request, response)` and each request have their appropriate response types.\n\nAn example of handling an `AuthorizationRequest`:\n```typescript\nimport {\n  AuthorizeDappResponse\n} from '@solana-mobile/mobile-wallet-adapter-protocol-walletlib';\n\nconst response = {\n  publicKey: Keypair.generate().publicKey.toBytes(),\n  label: 'Wallet Label',\n} as AuthorizeDappResponse;\n\nresolve(authorizationRequest, response)\n```\n\nThere are a a selection of \"fail\" responses that you can return to the dApp. These are for cases where the user declines, or an error occurs during signing, etc.\n```typescript\nimport {\n  UserDeclinedResponse\n} from '@solana-mobile/mobile-wallet-adapter-protocol-walletlib';\n\nconst response = {\n  failReason: MWARequestFailReason.UserDeclined,\n} as UserDeclinedResponse;\n\n// Tells the dApp user has declined the authorization request\nresolve(authorizationRequest, response)\n```\n\n## Properties of an MWA Request\nEach MWA Request is defined in [`resolve.ts`](https://github.com/solana-mobile/mobile-wallet-adapter/blob/main/js/packages/mobile-wallet-adapter-walletlib/src/resolve.ts#L38). \nEach come with their own properties and completion response structures.\n\nIf you want to understand the dApp perspective and how a dApp would send these requests, see [MWA API Documentation](https://docs.solanamobile.com/reference/) for dAppstypescript/mobile-wallet-adapter.\n\n## MWARequest Interfaces\n\n### `IMWARequest`\nThis is the base interface that all MWARequsts inherit from. The fields defined here are used in the package's internal implementation and the package consumer will generally not use them.\n\nFields:\n- `__type`: An enum defining the type of MWA Request it is.\n- `requestId`: A unique identifier of this specific MWA Request\n- `sessionId`: A unique identifier of the MWA Session this request belongs to.\n\n### `IVerifiableIdentityRequest`\nThis an interface that describes MWA Requests that come with a verifiable identity and the following 3 fields.\n\nFields:\n- `authorizationScope`: A byte representation of the authorization token granted to the dApp.\n- `cluster`: The Solana RPC cluster that the dApp intends to use.\n- `appIdentity`: An object containing 3 optional identity fields about the dApp:\n    - Note: The `iconRelativeUri` is a relative path, relative to `identityUri`.\n```\n{\n  identityName: 'dApp Name',\n  identityUri:  'https://yourdapp.com'\n  iconRelativeUri: \"favicon.ico\", // Full path resolves to https://yourdapp.com/favicon.ico\n}\n```\n\n### MWARequest Types\n\n- `AuthorizeDappRequest`\n  - [Spec](https://solana-mobile.github.io/mobile-wallet-adapter/spec/spec.html#authorize)\n  - Interfaces: `IMWARequest`\n\n- `ReauthorizeDappRequest`\n  - [Spec](https://solana-mobile.github.io/mobile-wallet-adapter/spec/spec.html#reauthorize)\n  - Interfaces: `IMWARequest`, `IVerifiableIdentityRequest`\n\n- `DeauthorizeDappRequest`\n  - [Spec](https://solana-mobile.github.io/mobile-wallet-adapter/spec/spec.html#deauthorize)\n  - Interfaces: `IMWARequest`, `IVerifiableIdentityRequest`\n\n- `SignMessagesRequest`\n  - [Spec](https://solana-mobile.github.io/mobile-wallet-adapter/spec/spec.html#sign_messages)\n  - Interfaces: `IMWARequest`, `IVerifiableIdentityRequest`\n\n- `SignTransactionsRequest`\n  - [Spec](https://solana-mobile.github.io/mobile-wallet-adapter/spec/spec.html#sign_transactions)\n  - Interfaces: `IMWARequest`, `IVerifiableIdentityRequest`\n\n- `SignAndSendTransactionsRequest`\n  - [Spec](https://solana-mobile.github.io/mobile-wallet-adapter/spec/spec.html#sign_and_send_transactions)\n  - Interfaces: `IMWARequest`, `IVerifiableIdentityRequest`\n\n\n# Changelog\n\n## 1.0.3\n- Fixed a rerender bug within `useMobileWalletAdapterSession` where `initializeScenario` was needlessly called on rerender. \n\n- Added `DeauthorizeDappRequest` type, so Javascript side now knows when a dApp requests for deauthorization.\n\n- Added `ReauthorizeDappRequest` type, so Javascript side now knows when a dApp requests for reauthorization.\n\n- Refactored `IMWARequest` to only include fields `requestId`, `sessionId`, and `__type`. \n\n- Added `IVerifableIdentityRequest` to take on the fields `authorizationScope`, `cluster`, and `appIdentity`.\n\n- `AuthorizeDappRequest` now no longer includes `authorizationScope`. This was mistakenly included previously.\n\n- Updated documentation in the README. See \"Properties of an MWA Request\".\n\n# mobile-wallet-adapter-walletlib\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funboxed-software%2Fmobile-wallet-adapter-walletlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funboxed-software%2Fmobile-wallet-adapter-walletlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funboxed-software%2Fmobile-wallet-adapter-walletlib/lists"}