Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smart Contracts (read and write) Interaction #90

Merged
merged 6 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 3.1.1-beta01

- Better Smart Contract interactions

## 3.1.0

- Coinbase Wallet integration
Expand Down
4 changes: 3 additions & 1 deletion example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@
<package android:name="com.ripio.android"/>
<package android:name="kh.com.sabay.sabaywallet"/>
<package android:name="com.tokoin.wallet"/>
<package android:name="com.walletconnect.sample.wallet"/>
<package android:name="com.walletconnect.flutterwallet"/>
<package android:name="com.walletconnect.web3wallet.rnsample"/>
<package android:name="com.walletconnect.sample.wallet"/>
<package android:name="com.walletconnect.sample.wallet.internal"/>
</queries>
<uses-permission android:name="android.permission.INTERNET"/>
<application
Expand Down
4 changes: 2 additions & 2 deletions example/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
versionName=3.1.0
versionCode=30
versionName=3.1.1
versionCode=31
12 changes: 6 additions & 6 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 30;
CURRENT_PROJECT_VERSION = 31;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = W5R8AG9K22;
ENABLE_BITCODE = NO;
Expand All @@ -496,7 +496,7 @@
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 30;
CURRENT_PROJECT_VERSION = 31;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.web3modal.flutterExample.RunnerTests;
Expand All @@ -514,7 +514,7 @@
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 30;
CURRENT_PROJECT_VERSION = 31;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.web3modal.flutterExample.RunnerTests;
Expand All @@ -530,7 +530,7 @@
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 30;
CURRENT_PROJECT_VERSION = 31;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.web3modal.flutterExample.RunnerTests;
Expand Down Expand Up @@ -655,7 +655,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 30;
CURRENT_PROJECT_VERSION = 31;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = W5R8AG9K22;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -686,7 +686,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 30;
CURRENT_PROJECT_VERSION = 31;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = W5R8AG9K22;
ENABLE_BITCODE = NO;
Expand Down
6 changes: 3 additions & 3 deletions example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.1.0</string>
<string>3.1.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -36,7 +36,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>30</string>
<string>31</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down Expand Up @@ -81,7 +81,6 @@
<string>okex</string>
<string>trust</string>
<string>thorwallet</string>
<string>leapcosmos</string>
<string>everspace</string>
<string>cosmostation</string>
<string>coinwallet</string>
Expand All @@ -91,6 +90,7 @@
<string>argent</string>
<string>walletapp</string>
<string>wcflutterwallet</string>
<string>rn-web3wallet</string>
</array>
<key>LSRequiresIPhoneOS</key>
<true/>
Expand Down
19 changes: 16 additions & 3 deletions example/lib/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ class _MyHomePageState extends State<MyHomePage> {

void _initializeService() async {
// See https://docs.walletconnect.com/web3modal/flutter/custom-chains
W3MChainPresets.chains.putIfAbsent('42220', () => _exampleCustomChain);
W3MChainPresets.chains.putIfAbsent(_celo.chainId, () => _celo);
W3MChainPresets.chains.putIfAbsent(_sepolia.chainId, () => _sepolia);

_w3mService = W3MService(
projectId: DartDefines.projectId,
Expand All @@ -40,7 +41,7 @@ class _MyHomePageState extends State<MyHomePage> {
description: StringConstants.w3mPageTitleV3,
url: 'https://web3modal.com/',
icons: [
'https://raw.githubusercontent.com/WalletConnect/Web3ModalFlutter/master/assets/AppIcon.png'
'https://docs.walletconnect.com/assets/images/web3modalLogo-2cee77e07851ba0a710b56d03d4d09dd.png'
],
redirect: Redirect(
native: 'web3modalflutter://',
Expand Down Expand Up @@ -196,7 +197,7 @@ class _ConnectedView extends StatelessWidget {
}
}

final _exampleCustomChain = W3MChainInfo(
final _celo = W3MChainInfo(
chainName: 'Celo',
namespace: 'eip155:42220',
chainId: '42220',
Expand All @@ -207,3 +208,15 @@ final _exampleCustomChain = W3MChainInfo(
url: 'https://explorer.celo.org/mainnet',
),
);

final _sepolia = W3MChainInfo(
chainName: 'Sepolia Testnet',
chainId: '11155111',
namespace: 'eip155:11155111',
tokenName: 'ETH',
rpcUrl: 'https://ethereum-sepolia.publicnode.com',
blockExplorer: W3MBlockExplorer(
name: 'Sepolia Etherscan',
url: 'https://sepolia.etherscan.io/',
),
);
5 changes: 5 additions & 0 deletions example/lib/utils/crypto/chain_data_wrapper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ class ChainDataWrapper {
color: Colors.purple.shade700,
w3mChainInfo: W3MChainPresets.chains['1088']!,
),
ChainMetadata(
type: ChainType.eip155,
color: Colors.blue.shade200,
w3mChainInfo: W3MChainPresets.chains['11155111']!,
),
// const ChainMetadata(
// type: ChainType.solana,
// chainId: 'solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ',
Expand Down
Loading