coinbase / waas-sdk-react-native

Coinbase Wallet as a Service (WaaS) SDK for React Native. Enables MPC Operations for iOS and Android Devices.
https://docs.cloud.coinbase.com/waas
Other
232 stars 105 forks source link

[wip] Native Swift SDK #52

Closed jbrower95 closed 12 months ago

jbrower95 commented 1 year ago

Native iOS SDK

Changelog:

Layout

ios/swift - The code-home of WaasSdk.podspec, the native iOS sdk. ios/react-native - The wrapper library for RN.

Architecture

  1. waas-sdk-react-native (whose name is set to look like a JS package probably), depends on WaasSdk (the native iOS waas pod).
  2. The class names between the two pods are duplicative, for convenience of the reader.
  3. WaasSdk.* uses Combine and Swift futures to perform async operations with the cross-platform Go SDK.
  4. The react-native SDK then rewraps these swift futures using the Operation.swift "bridge" method -- this awaits the future, and passes on either a resolution or rejection to React Native.

Usage

See README.md, but users can directly depend on WaasSdk.podspec from the root of this repo, which will pull in the code from ios/swift. Setup instructions are included.

Testing

Notes / Feedback on M1 setup

jbrower95 commented 12 months ago

Will push a commit with a sample app, and some more internal changes to the framework to make swift development easier.