Skip to content

Commit 9f31f4c

Browse files
authored
iOS native SDK and example app (coinbase#589)
* first commit * ios example app scaffolding * README * Update README.md * pod * integrate pod * Create .codeflow.yml * remove example on pod * cleanup * cleanup * handshake * handshake request encoder / response handler * ios proof of concept * Update README.md * reorg * host example app * build settings * cleanup * request message renderer * url rendering * isCoinbaseWalletInstalled * refactor * key manager * url codable / task manager pod * make request * reintroduce message renderer * dedup Message with custom coding * response handler * key storage * hmmmmm * key storage / no error throwing during init * add domain to key storage * response handling / error handling * distinguish request/response types * access control * initial request * host example app * host * handle encrypted response * simplify symkey generation flow * rename Update README.md Update README.md * update path * ios 12 support * make RawRepresentableKey public * clean up cryptography * RawRepresentableKey * make initialzier public * ugh * Update README.md * Update README.md * Update README.md * sample host app * reorg * Merge remote-tracking branch 'native/master' # Conflicts: # .gitignore # Conflicts: # native/ios/CoinbaseWalletSDK.swift # native/ios/Message/Message.swift # native/ios/Message/Request/EncryptedRequestContent.swift # native/ios/Message/Request/Request.swift # native/ios/Message/Request/RequestMessage.swift # native/ios/Message/Response/EncryptedResponseContent.swift # native/ios/Message/Response/ResponseMessage.swift # native/ios/Task/TaskManager.swift * Merge branch 'master' of github.com:coinbase/coinbase-wallet-sdk # Conflicts: # .github/workflows/codeql-analysis.yml # .github/workflows/main.yml # .github/workflows/versioning.yml # .gitignore # README.md # host/ios/LICENSE # packages/wallet-sdk/.eslintignore # packages/wallet-sdk/.eslintrc.js # packages/wallet-sdk/.prettierignore # packages/wallet-sdk/.prettierrc.yml # packages/wallet-sdk/LICENSE # packages/wallet-sdk/__tests__/addressStorage.test.js # packages/wallet-sdk/__tests__/encryptDecrypt.test.js # packages/wallet-sdk/assets/coinbase_wallet_logo_kit.zip # packages/wallet-sdk/babel.config.js # packages/wallet-sdk/compile-assets.js # packages/wallet-sdk/jest.config.ts # packages/wallet-sdk/jest.setup.ts # packages/wallet-sdk/karma.conf.js # packages/wallet-sdk/package.json # packages/wallet-sdk/scripts/release.sh # packages/wallet-sdk/src/CoinbaseWalletSDK.test.ts # packages/wallet-sdk/src/CoinbaseWalletSDK.ts # packages/wallet-sdk/src/__mocks__/provider.ts # packages/wallet-sdk/src/__mocks__/relay.ts # packages/wallet-sdk/src/assets/wallet-logo.ts # packages/wallet-sdk/src/components/LinkFlow.test.tsx # packages/wallet-sdk/src/components/LinkFlow.tsx # packages/wallet-sdk/src/components/QRCode.tsx # packages/wallet-sdk/src/components/Snackbar.scss # packages/wallet-sdk/src/components/Snackbar.test.tsx # packages/wallet-sdk/src/components/Snackbar.tsx # packages/wallet-sdk/src/components/SnackbarContainer.test.tsx # packages/wallet-sdk/src/components/Spinner.scss # packages/wallet-sdk/src/components/Spinner.test.tsx # packages/wallet-sdk/src/components/Spinner.tsx # packages/wallet-sdk/src/components/TryExtensionLinkDialog.scss # packages/wallet-sdk/src/components/TryExtensionLinkDialog.test.tsx # packages/wallet-sdk/src/components/TryExtensionLinkDialog.tsx # packages/wallet-sdk/src/components/icons/QRLogo.ts # packages/wallet-sdk/src/components/icons/globe-icon.svg # packages/wallet-sdk/src/components/icons/link-icon.svg # packages/wallet-sdk/src/components/icons/lock-icon.svg # packages/wallet-sdk/src/connection/ClientMessage.ts # packages/wallet-sdk/src/connection/DiagnosticLogger.test.ts # packages/wallet-sdk/src/connection/DiagnosticLogger.ts # packages/wallet-sdk/src/connection/EventListener.ts # packages/wallet-sdk/src/connection/RxWebSocket.test.ts # packages/wallet-sdk/src/connection/RxWebSocket.ts # packages/wallet-sdk/src/connection/ServerMessage.ts # packages/wallet-sdk/src/connection/SessionConfig.ts # packages/wallet-sdk/src/connection/WalletSDKConnection.ts # packages/wallet-sdk/src/fixtures/provider.ts # packages/wallet-sdk/src/index.ts # packages/wallet-sdk/src/lib/ScopedLocalStorage.test.ts # packages/wallet-sdk/src/lib/ScopedLocalStorage.ts # packages/wallet-sdk/src/lib/cssReset.scss # packages/wallet-sdk/src/lib/cssReset.ts # packages/wallet-sdk/src/provider/CoinbaseWalletProvider.test.ts # packages/wallet-sdk/src/provider/CoinbaseWalletProvider.ts # packages/wallet-sdk/src/provider/FilterPolyfill.ts # packages/wallet-sdk/src/provider/JSONRPC.ts # packages/wallet-sdk/src/provider/SubscriptionManager.ts # packages/wallet-sdk/src/provider/WalletSDKUI.test.ts # packages/wallet-sdk/src/provider/WalletSDKUI.ts # packages/wallet-sdk/src/provider/WalletUI.ts # packages/wallet-sdk/src/provider/WalletUIError.ts # packages/wallet-sdk/src/provider/Web3Provider.ts # packages/wallet-sdk/src/relay/EthereumTransactionParams.ts # packages/wallet-sdk/src/relay/RelayMessage.ts # packages/wallet-sdk/src/relay/Session.ts # packages/wallet-sdk/src/relay/WalletSDKRelay.ts # packages/wallet-sdk/src/relay/WalletSDKRelayAbstract.ts # packages/wallet-sdk/src/relay/WalletSDKRelayEventManager.test.ts # packages/wallet-sdk/src/relay/WalletSDKRelayEventManager.ts # packages/wallet-sdk/src/relay/Web3Method.ts # packages/wallet-sdk/src/relay/Web3Request.ts # packages/wallet-sdk/src/relay/Web3RequestCanceledMessage.ts # packages/wallet-sdk/src/relay/Web3RequestMessage.ts # packages/wallet-sdk/src/relay/Web3Response.ts # packages/wallet-sdk/src/relay/Web3ResponseMessage.ts # packages/wallet-sdk/src/relay/aes256gcm.test.ts # packages/wallet-sdk/src/relay/aes256gcm.ts # packages/wallet-sdk/src/types.ts # packages/wallet-sdk/src/util.test.ts # packages/wallet-sdk/src/util.ts # packages/wallet-sdk/src/vendor-js/eth-eip712-util/LICENSE # packages/wallet-sdk/src/vendor-js/eth-eip712-util/abi.js # packages/wallet-sdk/src/vendor-js/eth-eip712-util/index.d.ts # packages/wallet-sdk/src/vendor-js/eth-eip712-util/index.js # packages/wallet-sdk/src/vendor-js/eth-eip712-util/util.js # packages/wallet-sdk/src/vendor-js/qrcode-svg/LICENSE # packages/wallet-sdk/src/vendor-js/qrcode-svg/index.d.ts # packages/wallet-sdk/src/vendor-js/qrcode-svg/index.js # packages/wallet-sdk/src/version.ts # packages/wallet-sdk/tsconfig.build.json # packages/wallet-sdk/tsconfig.json # packages/wallet-sdk/webpack.config.js # packages/wallet-sdk/yarn.lock # src/vendor-js/qrcode-svg/LICENSE * move under packages * readme * sample ios client app * pod settings * add `optional` filed to `Action` * update example app * Merge branch 'walletsegue' of github.com:coinbase/coinbase-wallet-sdk into walletsegue * define ReturnType * Update README.md Update README.md * introduce Web3JSONRPC helper * nested params * access control * # This is a combination of 2 commits. # This is the 1st commit message: access control # This is the commit message #2: Revert "access control" This reverts commit c8ea3da. * remove public initializers access control # This is the commit message #2: Revert "access control" This reverts commit c8ea3da. # This is the commit message #3: remove public initializers * use JSONSerialization to simplify Web3JSONRPC encoding * singleton * clean up error type * host example * ios example app * example app * add timestamp to message * allow custom scheme / keystorage error message * keystorageerror * sampel ios app * response handler * swizzle * update request on sample app * cleanup keymanager implementation * remove codeflow config * remove old files * gitignore * cleanup * rename * missing changes * sample app name * update podspec * author
1 parent cf9254d commit 9f31f4c

39 files changed

+2444
-0
lines changed

.gitignore

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,127 @@
11
# misc
22
.DS_Store
3+
4+
# Native mobile
5+
6+
## User settings
7+
xcuserdata/
8+
9+
## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
10+
*.xcscmblueprint
11+
*.xccheckout
12+
13+
## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
14+
build/
15+
DerivedData/
16+
*.moved-aside
17+
*.pbxuser
18+
!default.pbxuser
19+
*.mode1v3
20+
!default.mode1v3
21+
*.mode2v3
22+
!default.mode2v3
23+
*.perspectivev3
24+
!default.perspectivev3
25+
26+
## Obj-C/Swift specific
27+
*.hmap
28+
29+
## App packaging
30+
*.ipa
31+
*.dSYM.zip
32+
*.dSYM
33+
34+
## Playgrounds
35+
timeline.xctimeline
36+
playground.xcworkspace
37+
38+
# Swift Package Manager
39+
#
40+
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
41+
# Packages/
42+
# Package.pins
43+
# Package.resolved
44+
# *.xcodeproj
45+
#
46+
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
47+
# hence it is not needed unless you have added a package configuration file to your project
48+
# .swiftpm
49+
50+
.build/
51+
52+
# CocoaPods
53+
#
54+
# We recommend against adding the Pods directory to your .gitignore. However
55+
# you should judge for yourself, the pros and cons are mentioned at:
56+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
57+
#
58+
Pods/
59+
#
60+
# Add this line if you want to avoid checking in source code from the Xcode workspace
61+
*.xcworkspace
62+
63+
# Carthage
64+
#
65+
# Add this line if you want to avoid checking in source code from Carthage dependencies.
66+
# Carthage/Checkouts
67+
68+
Carthage/Build/
69+
70+
# Accio dependency management
71+
Dependencies/
72+
.accio/
73+
74+
# fastlane
75+
#
76+
# It is recommended to not store the screenshots in the git repo.
77+
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
78+
# For more information about the recommended setup visit:
79+
# https://docs.fastlane.tools/best-practices/source-control/#source-control
80+
81+
fastlane/report.xml
82+
fastlane/Preview.html
83+
fastlane/screenshots/**/*.png
84+
fastlane/test_output
85+
86+
# Code Injection
87+
#
88+
# After new code Injection tools there's a generated folder /iOSInjectionProject
89+
# https://github.com/johnno1962/injectionforxcode
90+
91+
iOSInjectionProject/
92+
.DS_Store
93+
xcshareddata
94+
95+
# Gradle files
96+
.gradle/
97+
build/
98+
99+
# Local configuration file (sdk path, etc)
100+
local.properties
101+
102+
# Log/OS Files
103+
*.log
104+
105+
# Android Studio generated files and folders
106+
captures/
107+
.externalNativeBuild/
108+
.cxx/
109+
*.apk
110+
output.json
111+
112+
# IntelliJ
113+
*.iml
114+
.idea/
115+
misc.xml
116+
deploymentTargetDropDown.xml
117+
render.experimental.xml
118+
119+
# Keystore files
120+
*.jks
121+
*.keystore
122+
123+
# Google Services (e.g. APIs or Firebase)
124+
google-services.json
125+
126+
# Android Profiling
127+
*.hprof

CoinbaseWalletSDK.podspec

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Pod::Spec.new do |s|
2+
s.name = 'CoinbaseWalletSDK'
3+
s.version = '0.1.0'
4+
s.summary = 'Swift SDK to interact with Coinbase Wallet iOS app'
5+
s.description = <<-DESC
6+
Swift implementation of WalletSegue protocol for iOS web3 apps to interact with web3 wallets.
7+
Inter-app messaging contained within user's device, not requiring a bridge server.
8+
Secure communication channel between client app and host wallet.
9+
Decentralized verification of participating apps' authenticity without centralized registry.
10+
DESC
11+
s.homepage = 'https://www.coinbase.com/wallet/developers'
12+
s.license = { :type => 'Apache', :file => 'LICENSE' }
13+
s.author = { 'Coinbase Wallet' => '[email protected]' }
14+
s.source = { :git => 'https://github.com/coinbase/coinbase-wallet-sdk.git', :tag => "ios-v#{s.version}" }
15+
s.social_media_url = 'https://twitter.com/CoinbaseWallet'
16+
s.ios.deployment_target = '12.0'
17+
s.swift_version = '5.0'
18+
s.source_files = 'packages/wallet-native-sdk/ios/**/*.swift'
19+
end

LICENSE

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright (c) 2018-2022 Coinbase, 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+
limitations under the License.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
platform :ios, '13.0'
2+
use_frameworks!
3+
4+
target 'NativeWeb3App' do
5+
pod 'CoinbaseWalletSDK', path: '../../'
6+
end
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
PODS:
2+
- CoinbaseWalletSDK (0.1.0)
3+
4+
DEPENDENCIES:
5+
- CoinbaseWalletSDK (from `../../`)
6+
7+
EXTERNAL SOURCES:
8+
CoinbaseWalletSDK:
9+
:path: "../../"
10+
11+
SPEC CHECKSUMS:
12+
CoinbaseWalletSDK: cae36a0585ac804b9a421659092d64476e6e9b85
13+
14+
PODFILE CHECKSUM: 258b9c0ec0f0d17a701912e5f713afb0de91d709
15+
16+
COCOAPODS: 1.11.3

0 commit comments

Comments
 (0)