@solana-mobile/mobile-wallet-adapter-walletlib 1.4.0-beta2 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (269) hide show
  1. package/LICENSE +12 -12
  2. package/README.md +195 -195
  3. package/android/build.gradle +151 -151
  4. package/android/gradle/wrapper/gradle-wrapper.properties +5 -5
  5. package/android/gradle.properties +5 -5
  6. package/android/gradlew +185 -185
  7. package/android/src/main/java/com/solanamobile/mobilewalletadapterwalletlib/reactnative/Extensions.kt +98 -98
  8. package/android/src/main/java/com/solanamobile/mobilewalletadapterwalletlib/reactnative/JsonSerializationUtils.kt +156 -156
  9. package/android/src/main/java/com/solanamobile/mobilewalletadapterwalletlib/reactnative/MobileWalletAdapterWalletLibReactNativePackage.kt +18 -18
  10. package/android/src/main/java/com/solanamobile/mobilewalletadapterwalletlib/reactnative/SolanaMobileDigitalAssetLinksModule.kt +3 -3
  11. package/android/src/main/java/com/solanamobile/mobilewalletadapterwalletlib/reactnative/SolanaMobileWalletAdapterWalletLibModule.kt +691 -691
  12. package/android/src/main/java/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/MobileWalletAdapterConfig.kt +59 -59
  13. package/android/src/main/java/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/MobileWalletAdapterRequest.kt +97 -97
  14. package/android/src/main/java/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/MobileWalletAdapterResponse.kt +68 -68
  15. package/lib/types/index.d.ts +3 -2
  16. package/lib/types/index.native.d.ts +3 -2
  17. package/package.json +12 -4
  18. package/android/build/.transforms/13497a5703b6947fde9451a69f5bf84e/results.bin +0 -1
  19. package/android/build/.transforms/2914b53fef74c26f55fe655ad64eaca0/results.bin +0 -1
  20. package/android/build/.transforms/2914b53fef74c26f55fe655ad64eaca0/transformed/classes.jar +0 -0
  21. package/android/build/.transforms/55506892a286c808c43329ce3b47abbc/results.bin +0 -1
  22. package/android/build/.transforms/55506892a286c808c43329ce3b47abbc/transformed/classes.jar +0 -0
  23. package/android/build/.transforms/5bd4cfc09b747f98a6940cda90825a4c/results.bin +0 -1
  24. package/android/build/.transforms/5f4c2ab645d825cc973e8aa63856873c/results.bin +0 -1
  25. package/android/build/.transforms/5f4c2ab645d825cc973e8aa63856873c/transformed/classes/classes_dex/classes.dex +0 -0
  26. package/android/build/.transforms/64bdfbd710e289d8e28c2be3ed3756df/results.bin +0 -1
  27. package/android/build/.transforms/64bdfbd710e289d8e28c2be3ed3756df/transformed/classes/classes_dex/classes.dex +0 -0
  28. package/android/build/.transforms/6a1de4eb00f3ec453222ae6151dc8935/results.bin +0 -1
  29. package/android/build/.transforms/6a1de4eb00f3ec453222ae6151dc8935/transformed/classes.jar +0 -0
  30. package/android/build/.transforms/7929e290038023849e409120a378c19c/results.bin +0 -1
  31. package/android/build/.transforms/7929e290038023849e409120a378c19c/transformed/classes/classes_dex/classes.dex +0 -0
  32. package/android/build/.transforms/85d7dff3636e425271842ecf982ec652/results.bin +0 -1
  33. package/android/build/.transforms/85d7dff3636e425271842ecf982ec652/transformed/classes/classes_dex/classes.dex +0 -0
  34. package/android/build/.transforms/878776814e894fd5e446f13a261f64e8/results.bin +0 -1
  35. package/android/build/.transforms/98aab33b71a3e40206d7406232a2ca07/results.bin +0 -1
  36. package/android/build/.transforms/98aab33b71a3e40206d7406232a2ca07/transformed/classes.jar +0 -0
  37. package/android/build/.transforms/9b8e4ac8cb828fdd7dc77528d3fbab05/results.bin +0 -1
  38. package/android/build/.transforms/a54f8f96d32d6e6b94b2cedd8f31c196/results.bin +0 -1
  39. package/android/build/.transforms/c0ea43ad8c0b874ee514e95442a9df78/results.bin +0 -1
  40. package/android/build/.transforms/dd2f6e705f38149ec510481a95df2d6c/results.bin +0 -1
  41. package/android/build/.transforms/ee5cc75856861afda62d6c8d34631a40/results.bin +0 -1
  42. package/android/build/generated/source/buildConfig/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/BuildConfig.java +0 -12
  43. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +0 -7
  44. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +0 -18
  45. package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +0 -5
  46. package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +0 -1
  47. package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
  48. package/android/build/intermediates/compile_r_class_jar/debug/R.jar +0 -0
  49. package/android/build/intermediates/compile_symbol_list/debug/R.txt +0 -0
  50. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -1
  51. package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
  52. package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
  53. package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
  54. package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +0 -2
  55. package/android/build/intermediates/java_res/debug/out/META-INF/solana-mobile_mobile-wallet-adapter-walletlib_debug.kotlin_module +0 -0
  56. package/android/build/intermediates/javac/debug/classes/com/solanamobile/mobilewalletadapterwalletlib/reactnative/BuildConfig.class +0 -0
  57. package/android/build/intermediates/local_only_symbol_list/debug/R-def.txt +0 -2
  58. package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +0 -7
  59. package/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +0 -7
  60. package/android/build/intermediates/navigation_json/debug/navigation.json +0 -1
  61. package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
  62. package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +0 -1
  63. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
  64. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
  65. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
  66. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
  67. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values +0 -0
  68. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  69. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.s +0 -1
  70. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
  71. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
  72. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
  73. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -1
  74. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
  75. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
  76. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
  77. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
  78. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
  79. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  80. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -1
  81. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
  82. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
  83. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
  84. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
  85. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
  86. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
  87. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
  88. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
  89. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
  90. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
  91. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
  92. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
  93. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  94. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -1
  95. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
  96. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
  97. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values +0 -0
  98. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
  99. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.s +0 -1
  100. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
  101. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
  102. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab +0 -0
  103. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream +0 -0
  104. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream.len +0 -0
  105. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.len +0 -0
  106. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.values.at +0 -0
  107. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i +0 -0
  108. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i.len +0 -0
  109. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
  110. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -1
  111. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
  112. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
  113. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values +0 -0
  114. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  115. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.s +0 -1
  116. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
  117. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
  118. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  119. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
  120. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
  121. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
  122. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  123. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
  124. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
  125. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
  126. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
  127. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
  128. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
  129. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
  130. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
  131. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
  132. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
  133. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
  134. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
  135. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
  136. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
  137. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
  138. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
  139. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +0 -2
  140. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
  141. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
  142. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
  143. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
  144. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
  145. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
  146. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
  147. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
  148. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
  149. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
  150. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
  151. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
  152. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
  153. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
  154. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
  155. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
  156. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  157. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
  158. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
  159. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
  160. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
  161. package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
  162. package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
  163. package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -16
  164. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  165. package/android/build/tmp/kotlin-classes/debug/META-INF/solana-mobile_mobile-wallet-adapter-walletlib_debug.kotlin_module +0 -0
  166. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/AppIdentityTransformingSerializer.class +0 -0
  167. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/ByteArrayAsMapSerializer.class +0 -0
  168. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/ByteArrayCollectionAsMapCollectionSerializer.class +0 -0
  169. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/ExtensionsKt$WhenMappings.class +0 -0
  170. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/ExtensionsKt.class +0 -0
  171. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/FailReasonTransformingSerializer.class +0 -0
  172. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/MobileWalletAdapterRequestSerializer.class +0 -0
  173. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/MobileWalletAdapterResponseSerializer.class +0 -0
  174. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/MobileWalletAdapterWalletLibReactNativePackage.class +0 -0
  175. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/SignInPayloadSerializer$json$1.class +0 -0
  176. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/SignInPayloadSerializer.class +0 -0
  177. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/SignInResultSerializer.class +0 -0
  178. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/SolanaMobileDigitalAssetLinksModule$Companion.class +0 -0
  179. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/SolanaMobileDigitalAssetLinksModule.class +0 -0
  180. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/SolanaMobileWalletAdapterWalletLibModule$Companion.class +0 -0
  181. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/SolanaMobileWalletAdapterWalletLibModule$MobileWalletAdapterRemoteRequest$AuthorizeDapp.class +0 -0
  182. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/SolanaMobileWalletAdapterWalletLibModule$MobileWalletAdapterRemoteRequest$DeauthorizeDapp.class +0 -0
  183. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/SolanaMobileWalletAdapterWalletLibModule$MobileWalletAdapterRemoteRequest$ReauthorizeDapp.class +0 -0
  184. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/SolanaMobileWalletAdapterWalletLibModule$MobileWalletAdapterRemoteRequest$SignAndSendTransactions.class +0 -0
  185. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/SolanaMobileWalletAdapterWalletLibModule$MobileWalletAdapterRemoteRequest$SignMessages.class +0 -0
  186. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/SolanaMobileWalletAdapterWalletLibModule$MobileWalletAdapterRemoteRequest$SignPayloads.class +0 -0
  187. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/SolanaMobileWalletAdapterWalletLibModule$MobileWalletAdapterRemoteRequest$SignTransactions.class +0 -0
  188. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/SolanaMobileWalletAdapterWalletLibModule$MobileWalletAdapterRemoteRequest.class +0 -0
  189. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/SolanaMobileWalletAdapterWalletLibModule$MobileWalletAdapterScenarioCallbacks$onScenarioServingComplete$1.class +0 -0
  190. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/SolanaMobileWalletAdapterWalletLibModule$MobileWalletAdapterScenarioCallbacks.class +0 -0
  191. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/SolanaMobileWalletAdapterWalletLibModule$MobileWalletAdapterSessionEvent$LowPowerNoConnection.class +0 -0
  192. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/SolanaMobileWalletAdapterWalletLibModule$MobileWalletAdapterSessionEvent$None.class +0 -0
  193. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/SolanaMobileWalletAdapterWalletLibModule$MobileWalletAdapterSessionEvent$ScenarioComplete.class +0 -0
  194. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/SolanaMobileWalletAdapterWalletLibModule$MobileWalletAdapterSessionEvent$ScenarioError.class +0 -0
  195. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/SolanaMobileWalletAdapterWalletLibModule$MobileWalletAdapterSessionEvent$ScenarioReady.class +0 -0
  196. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/SolanaMobileWalletAdapterWalletLibModule$MobileWalletAdapterSessionEvent$ScenarioServingClients.class +0 -0
  197. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/SolanaMobileWalletAdapterWalletLibModule$MobileWalletAdapterSessionEvent$ScenarioServingComplete.class +0 -0
  198. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/SolanaMobileWalletAdapterWalletLibModule$MobileWalletAdapterSessionEvent$ScenarioTeardownComplete.class +0 -0
  199. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/SolanaMobileWalletAdapterWalletLibModule$MobileWalletAdapterSessionEvent$SessionTerminated.class +0 -0
  200. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/SolanaMobileWalletAdapterWalletLibModule$MobileWalletAdapterSessionEvent.class +0 -0
  201. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/SolanaMobileWalletAdapterWalletLibModule$createScenario$1.class +0 -0
  202. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/SolanaMobileWalletAdapterWalletLibModule$json$1.class +0 -0
  203. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/SolanaMobileWalletAdapterWalletLibModule$resolve$1.class +0 -0
  204. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/SolanaMobileWalletAdapterWalletLibModule.class +0 -0
  205. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/TypeTransformingSerializer.class +0 -0
  206. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/AuthorizationNotValidResponse$$cachedSerializer$delegate$1.class +0 -0
  207. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/AuthorizationNotValidResponse.class +0 -0
  208. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/AuthorizeDapp$$serializer.class +0 -0
  209. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/AuthorizeDapp$Companion.class +0 -0
  210. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/AuthorizeDapp.class +0 -0
  211. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/AuthorizeDappResponse$$serializer.class +0 -0
  212. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/AuthorizeDappResponse$Companion.class +0 -0
  213. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/AuthorizeDappResponse.class +0 -0
  214. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/AuthorizedAccount$$serializer.class +0 -0
  215. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/AuthorizedAccount$Companion.class +0 -0
  216. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/AuthorizedAccount.class +0 -0
  217. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/DeauthorizeDapp$$serializer.class +0 -0
  218. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/DeauthorizeDapp$Companion.class +0 -0
  219. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/DeauthorizeDapp.class +0 -0
  220. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/DeauthorizeDappResponse$$cachedSerializer$delegate$1.class +0 -0
  221. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/DeauthorizeDappResponse.class +0 -0
  222. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/InvalidSignaturesResponse$$serializer.class +0 -0
  223. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/InvalidSignaturesResponse$Companion.class +0 -0
  224. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/InvalidSignaturesResponse.class +0 -0
  225. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/MobileWalletAdapterConfigSerializer.class +0 -0
  226. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/MobileWalletAdapterConfigSurrogate$$serializer.class +0 -0
  227. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/MobileWalletAdapterConfigSurrogate$Companion.class +0 -0
  228. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/MobileWalletAdapterConfigSurrogate.class +0 -0
  229. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/MobileWalletAdapterFailureResponse$Companion$$cachedSerializer$delegate$1.class +0 -0
  230. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/MobileWalletAdapterFailureResponse$Companion.class +0 -0
  231. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/MobileWalletAdapterFailureResponse.class +0 -0
  232. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/MobileWalletAdapterRequest$Companion$$cachedSerializer$delegate$1.class +0 -0
  233. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/MobileWalletAdapterRequest$Companion.class +0 -0
  234. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/MobileWalletAdapterRequest.class +0 -0
  235. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/MobileWalletAdapterResponse$Companion$$cachedSerializer$delegate$1.class +0 -0
  236. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/MobileWalletAdapterResponse$Companion.class +0 -0
  237. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/MobileWalletAdapterResponse.class +0 -0
  238. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/ReauthorizeDapp$$serializer.class +0 -0
  239. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/ReauthorizeDapp$Companion.class +0 -0
  240. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/ReauthorizeDapp.class +0 -0
  241. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/ReauthorizeDappResponse$$serializer.class +0 -0
  242. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/ReauthorizeDappResponse$Companion.class +0 -0
  243. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/ReauthorizeDappResponse.class +0 -0
  244. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/SignAndSendTransactions$$serializer.class +0 -0
  245. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/SignAndSendTransactions$Companion.class +0 -0
  246. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/SignAndSendTransactions.class +0 -0
  247. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/SignMessages$$serializer.class +0 -0
  248. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/SignMessages$Companion.class +0 -0
  249. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/SignMessages.class +0 -0
  250. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/SignPayloads$Companion$$cachedSerializer$delegate$1.class +0 -0
  251. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/SignPayloads$Companion.class +0 -0
  252. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/SignPayloads.class +0 -0
  253. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/SignTransactions$$serializer.class +0 -0
  254. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/SignTransactions$Companion.class +0 -0
  255. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/SignTransactions.class +0 -0
  256. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/SignedAndSentTransactions$$serializer.class +0 -0
  257. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/SignedAndSentTransactions$Companion.class +0 -0
  258. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/SignedAndSentTransactions.class +0 -0
  259. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/SignedPayloads$$serializer.class +0 -0
  260. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/SignedPayloads$Companion.class +0 -0
  261. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/SignedPayloads.class +0 -0
  262. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/TooManyPayloadsResponse$$cachedSerializer$delegate$1.class +0 -0
  263. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/TooManyPayloadsResponse.class +0 -0
  264. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/TransactionVersionSerializer.class +0 -0
  265. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/UserDeclinedResponse$$cachedSerializer$delegate$1.class +0 -0
  266. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/UserDeclinedResponse.class +0 -0
  267. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/VerifiableIdentityRequestSurrogate$Companion$$cachedSerializer$delegate$1.class +0 -0
  268. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/VerifiableIdentityRequestSurrogate$Companion.class +0 -0
  269. package/android/build/tmp/kotlin-classes/debug/com/solanamobile/mobilewalletadapterwalletlib/reactnative/model/VerifiableIdentityRequestSurrogate.class +0 -0
package/LICENSE CHANGED
@@ -1,13 +1,13 @@
1
- Copyright 2022 Solana Mobile Inc.
2
-
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
6
-
7
- http://www.apache.org/licenses/LICENSE-2.0
8
-
9
- Unless required by applicable law or agreed to in writing, software
10
- distributed under the License is distributed on an "AS IS" BASIS,
11
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- See the License for the specific language governing permissions and
1
+ Copyright 2022 Solana Mobile Inc.
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
13
  limitations under the License.
package/README.md CHANGED
@@ -1,196 +1,196 @@
1
- # `@solana-mobile/mobile-wallet-adapter-walletlib`
2
-
3
- This 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).
4
-
5
- Deep 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).
6
-
7
- ## Note
8
- This 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.
9
-
10
-
11
- ## Quickstart
12
-
13
- ### 1. Initialize the MWA event listener
14
-
15
- Use the following API to start listening for MWA requests and events, and register request handlers.
16
-
17
- ```ts
18
- import {
19
- initializeMWAEventListener,
20
- MWARequest,
21
- MWASessionEvent,
22
- } from '@solana-mobile/mobile-wallet-adapter-walletlib';
23
-
24
- const listener: EmitterSubscription = initializeMWAEventListener(
25
- (request: MWARequest) => { /* ... */ },
26
- (sessionEvent: MWASessionEvent) => { /* ... */ },
27
- );
28
-
29
- /* ... */
30
-
31
- // Clean up the listener when it is out of scope
32
- listener.remove()
33
- ```
34
-
35
- You should ensure the listener is cleaned up with `listener.remove()` when it goes out of scope (e.g `listener.remove()` on component lifecycle unmount).
36
-
37
- ### 2. Initialize the MWA session
38
-
39
- Define your wallet config and use `initializeMWASession` to establish a session with the dApp endpoint and begin emission of MWA requests/events.
40
-
41
- > **Note:** This should be called *after* `initializeMWAEventListener` is called, to ensure no events are missed.
42
-
43
- ```ts
44
- const config: MobileWalletAdapterConfig = {
45
- supportsSignAndSendTransactions: true,
46
- maxTransactionsPerSigningRequest: 10,
47
- maxMessagesPerSigningRequest: 10,
48
- supportedTransactionVersions: [0, 'legacy'],
49
- noConnectionWarningTimeoutMs: 3000,
50
- optionalFeatures: ['solana:signInWithSolana']
51
- };
52
-
53
- try {
54
- const sessionId = await initializeMobileWalletAdapterSession(
55
- 'Wallet Name',
56
- config,
57
- );
58
- console.log('sessionId: ' + sessionId);
59
- } catch (e: any) {
60
- if (e instanceof SolanaMWAWalletLibError) {
61
- console.error(e.name, e.code, e.message);
62
- } else {
63
- console.error(e);
64
- }
65
- }
66
- ```
67
-
68
- > **Note**: Although, the `initializeMobileWalletAdapterSession` method returns a `sessionId`, this library only supports one active session for now.
69
-
70
- ### Example usage:
71
-
72
- ```ts
73
- // When your MWA entrypoint is loaded, call a `useEffect` to kick off the listener and session.
74
- useEffect(() => {
75
- async function initializeMWASession() {
76
- const config: MobileWalletAdapterConfig = {
77
- supportsSignAndSendTransactions: true,
78
- maxTransactionsPerSigningRequest: 10,
79
- maxMessagesPerSigningRequest: 10,
80
- supportedTransactionVersions: [0, 'legacy'],
81
- noConnectionWarningTimeoutMs: 3000,
82
- };
83
- try {
84
- const sessionId = await initializeMobileWalletAdapterSession(
85
- 'Wallet Name',
86
- config,
87
- );
88
- console.log('sessionId: ' + sessionId);
89
- } catch (e: any) {
90
- if (e instanceof SolanaMWAWalletLibError) {
91
- console.error(e.name, e.code, e.message);
92
- } else {
93
- console.error(e);
94
- }
95
- }
96
- }
97
- const listener = initializeMWAEventListener(
98
- (request: MWARequest) => { /* ... */ },
99
- (sessionEvent: MWASessionEvent) => { /* ... */ },
100
- );
101
- initializeMWASession();
102
-
103
- // When the component is unmounted, clean up the listener.
104
- return () => listener.remove();
105
- }, []);
106
- ```
107
-
108
- ### 3. Handling requests and events
109
-
110
- A `MWARequest` is handled by calling `resolve(request, response)` and each request have their appropriate response types.
111
-
112
- An example of handling an `AuthorizationRequest`:
113
- ```typescript
114
- import {
115
- AuthorizeDappResponse
116
- } from '@solana-mobile/mobile-wallet-adapter-walletlib';
117
-
118
- const response = {
119
- publicKey: Keypair.generate().publicKey.toBytes(),
120
- label: 'Wallet Label',
121
- } as AuthorizeDappResponse;
122
-
123
- resolve(authorizationRequest, response)
124
- ```
125
-
126
- There 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.
127
- ```typescript
128
- import {
129
- UserDeclinedResponse
130
- } from '@solana-mobile/mobile-wallet-adapter-walletlib';
131
-
132
- const response = {
133
- failReason: MWARequestFailReason.UserDeclined,
134
- } as UserDeclinedResponse;
135
-
136
- // Tells the dApp user has declined the authorization request
137
- resolve(authorizationRequest, response)
138
- ```
139
-
140
- ## Properties of an MWA Request
141
- Each 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).
142
- Each come with their own properties and completion response structures.
143
-
144
- If 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.
145
-
146
- ## MWARequest Interfaces
147
-
148
- ### `IMWARequest`
149
- This 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.
150
-
151
- Fields:
152
- - `__type`: An enum defining the type of MWA Request it is.
153
- - `requestId`: A unique identifier of this specific MWA Request
154
- - `sessionId`: A unique identifier of the MWA Session this request belongs to.
155
-
156
- ### `IVerifiableIdentityRequest`
157
- This an interface that describes MWA Requests that come with a verifiable identity and the following 3 fields.
158
-
159
- Fields:
160
- - `authorizationScope`: A byte representation of the authorization token granted to the dApp.
161
- - `cluster`: The Solana RPC cluster that the dApp intends to use.
162
- - `appIdentity`: An object containing 3 optional identity fields about the dApp:
163
- - Note: The `iconRelativeUri` is a relative path, relative to `identityUri`.
164
- ```
165
- {
166
- identityName: 'dApp Name',
167
- identityUri: 'https://yourdapp.com'
168
- iconRelativeUri: "favicon.ico", // Full path resolves to https://yourdapp.com/favicon.ico
169
- }
170
- ```
171
-
172
- ### MWARequest Types
173
-
174
- - `AuthorizeDappRequest`
175
- - [Spec](https://solana-mobile.github.io/mobile-wallet-adapter/spec/spec.html#authorize)
176
- - Interfaces: `IMWARequest`
177
-
178
- - `ReauthorizeDappRequest`
179
- - [Spec](https://solana-mobile.github.io/mobile-wallet-adapter/spec/spec.html#reauthorize)
180
- - Interfaces: `IMWARequest`, `IVerifiableIdentityRequest`
181
-
182
- - `DeauthorizeDappRequest`
183
- - [Spec](https://solana-mobile.github.io/mobile-wallet-adapter/spec/spec.html#deauthorize)
184
- - Interfaces: `IMWARequest`, `IVerifiableIdentityRequest`
185
-
186
- - `SignMessagesRequest`
187
- - [Spec](https://solana-mobile.github.io/mobile-wallet-adapter/spec/spec.html#sign_messages)
188
- - Interfaces: `IMWARequest`, `IVerifiableIdentityRequest`
189
-
190
- - `SignTransactionsRequest`
191
- - [Spec](https://solana-mobile.github.io/mobile-wallet-adapter/spec/spec.html#sign_transactions)
192
- - Interfaces: `IMWARequest`, `IVerifiableIdentityRequest`
193
-
194
- - `SignAndSendTransactionsRequest`
195
- - [Spec](https://solana-mobile.github.io/mobile-wallet-adapter/spec/spec.html#sign_and_send_transactions)
1
+ # `@solana-mobile/mobile-wallet-adapter-walletlib`
2
+
3
+ This 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).
4
+
5
+ Deep 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).
6
+
7
+ ## Note
8
+ This 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.
9
+
10
+
11
+ ## Quickstart
12
+
13
+ ### 1. Initialize the MWA event listener
14
+
15
+ Use the following API to start listening for MWA requests and events, and register request handlers.
16
+
17
+ ```ts
18
+ import {
19
+ initializeMWAEventListener,
20
+ MWARequest,
21
+ MWASessionEvent,
22
+ } from '@solana-mobile/mobile-wallet-adapter-walletlib';
23
+
24
+ const listener: EmitterSubscription = initializeMWAEventListener(
25
+ (request: MWARequest) => { /* ... */ },
26
+ (sessionEvent: MWASessionEvent) => { /* ... */ },
27
+ );
28
+
29
+ /* ... */
30
+
31
+ // Clean up the listener when it is out of scope
32
+ listener.remove()
33
+ ```
34
+
35
+ You should ensure the listener is cleaned up with `listener.remove()` when it goes out of scope (e.g `listener.remove()` on component lifecycle unmount).
36
+
37
+ ### 2. Initialize the MWA session
38
+
39
+ Define your wallet config and use `initializeMWASession` to establish a session with the dApp endpoint and begin emission of MWA requests/events.
40
+
41
+ > **Note:** This should be called *after* `initializeMWAEventListener` is called, to ensure no events are missed.
42
+
43
+ ```ts
44
+ const config: MobileWalletAdapterConfig = {
45
+ supportsSignAndSendTransactions: true,
46
+ maxTransactionsPerSigningRequest: 10,
47
+ maxMessagesPerSigningRequest: 10,
48
+ supportedTransactionVersions: [0, 'legacy'],
49
+ noConnectionWarningTimeoutMs: 3000,
50
+ optionalFeatures: ['solana:signInWithSolana']
51
+ };
52
+
53
+ try {
54
+ const sessionId = await initializeMobileWalletAdapterSession(
55
+ 'Wallet Name',
56
+ config,
57
+ );
58
+ console.log('sessionId: ' + sessionId);
59
+ } catch (e: any) {
60
+ if (e instanceof SolanaMWAWalletLibError) {
61
+ console.error(e.name, e.code, e.message);
62
+ } else {
63
+ console.error(e);
64
+ }
65
+ }
66
+ ```
67
+
68
+ > **Note**: Although, the `initializeMobileWalletAdapterSession` method returns a `sessionId`, this library only supports one active session for now.
69
+
70
+ ### Example usage:
71
+
72
+ ```ts
73
+ // When your MWA entrypoint is loaded, call a `useEffect` to kick off the listener and session.
74
+ useEffect(() => {
75
+ async function initializeMWASession() {
76
+ const config: MobileWalletAdapterConfig = {
77
+ supportsSignAndSendTransactions: true,
78
+ maxTransactionsPerSigningRequest: 10,
79
+ maxMessagesPerSigningRequest: 10,
80
+ supportedTransactionVersions: [0, 'legacy'],
81
+ noConnectionWarningTimeoutMs: 3000,
82
+ };
83
+ try {
84
+ const sessionId = await initializeMobileWalletAdapterSession(
85
+ 'Wallet Name',
86
+ config,
87
+ );
88
+ console.log('sessionId: ' + sessionId);
89
+ } catch (e: any) {
90
+ if (e instanceof SolanaMWAWalletLibError) {
91
+ console.error(e.name, e.code, e.message);
92
+ } else {
93
+ console.error(e);
94
+ }
95
+ }
96
+ }
97
+ const listener = initializeMWAEventListener(
98
+ (request: MWARequest) => { /* ... */ },
99
+ (sessionEvent: MWASessionEvent) => { /* ... */ },
100
+ );
101
+ initializeMWASession();
102
+
103
+ // When the component is unmounted, clean up the listener.
104
+ return () => listener.remove();
105
+ }, []);
106
+ ```
107
+
108
+ ### 3. Handling requests and events
109
+
110
+ A `MWARequest` is handled by calling `resolve(request, response)` and each request have their appropriate response types.
111
+
112
+ An example of handling an `AuthorizationRequest`:
113
+ ```typescript
114
+ import {
115
+ AuthorizeDappResponse
116
+ } from '@solana-mobile/mobile-wallet-adapter-walletlib';
117
+
118
+ const response = {
119
+ publicKey: Keypair.generate().publicKey.toBytes(),
120
+ label: 'Wallet Label',
121
+ } as AuthorizeDappResponse;
122
+
123
+ resolve(authorizationRequest, response)
124
+ ```
125
+
126
+ There 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.
127
+ ```typescript
128
+ import {
129
+ UserDeclinedResponse
130
+ } from '@solana-mobile/mobile-wallet-adapter-walletlib';
131
+
132
+ const response = {
133
+ failReason: MWARequestFailReason.UserDeclined,
134
+ } as UserDeclinedResponse;
135
+
136
+ // Tells the dApp user has declined the authorization request
137
+ resolve(authorizationRequest, response)
138
+ ```
139
+
140
+ ## Properties of an MWA Request
141
+ Each 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).
142
+ Each come with their own properties and completion response structures.
143
+
144
+ If 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.
145
+
146
+ ## MWARequest Interfaces
147
+
148
+ ### `IMWARequest`
149
+ This 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.
150
+
151
+ Fields:
152
+ - `__type`: An enum defining the type of MWA Request it is.
153
+ - `requestId`: A unique identifier of this specific MWA Request
154
+ - `sessionId`: A unique identifier of the MWA Session this request belongs to.
155
+
156
+ ### `IVerifiableIdentityRequest`
157
+ This an interface that describes MWA Requests that come with a verifiable identity and the following 3 fields.
158
+
159
+ Fields:
160
+ - `authorizationScope`: A byte representation of the authorization token granted to the dApp.
161
+ - `cluster`: The Solana RPC cluster that the dApp intends to use.
162
+ - `appIdentity`: An object containing 3 optional identity fields about the dApp:
163
+ - Note: The `iconRelativeUri` is a relative path, relative to `identityUri`.
164
+ ```
165
+ {
166
+ identityName: 'dApp Name',
167
+ identityUri: 'https://yourdapp.com'
168
+ iconRelativeUri: "favicon.ico", // Full path resolves to https://yourdapp.com/favicon.ico
169
+ }
170
+ ```
171
+
172
+ ### MWARequest Types
173
+
174
+ - `AuthorizeDappRequest`
175
+ - [Spec](https://solana-mobile.github.io/mobile-wallet-adapter/spec/spec.html#authorize)
176
+ - Interfaces: `IMWARequest`
177
+
178
+ - `ReauthorizeDappRequest`
179
+ - [Spec](https://solana-mobile.github.io/mobile-wallet-adapter/spec/spec.html#reauthorize)
180
+ - Interfaces: `IMWARequest`, `IVerifiableIdentityRequest`
181
+
182
+ - `DeauthorizeDappRequest`
183
+ - [Spec](https://solana-mobile.github.io/mobile-wallet-adapter/spec/spec.html#deauthorize)
184
+ - Interfaces: `IMWARequest`, `IVerifiableIdentityRequest`
185
+
186
+ - `SignMessagesRequest`
187
+ - [Spec](https://solana-mobile.github.io/mobile-wallet-adapter/spec/spec.html#sign_messages)
188
+ - Interfaces: `IMWARequest`, `IVerifiableIdentityRequest`
189
+
190
+ - `SignTransactionsRequest`
191
+ - [Spec](https://solana-mobile.github.io/mobile-wallet-adapter/spec/spec.html#sign_transactions)
192
+ - Interfaces: `IMWARequest`, `IVerifiableIdentityRequest`
193
+
194
+ - `SignAndSendTransactionsRequest`
195
+ - [Spec](https://solana-mobile.github.io/mobile-wallet-adapter/spec/spec.html#sign_and_send_transactions)
196
196
  - Interfaces: `IMWARequest`, `IVerifiableIdentityRequest`