-
Notifications
You must be signed in to change notification settings - Fork 51
feat: integrate WalletConnect Pay SDK with payment modal #310
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,3 +10,4 @@ SENTRY_DISABLE_AUTO_UPLOAD=true | |
|
|
||
| # debug, internal, production | ||
| ENV_SENTRY_TAG='debug' | ||
| ENV_PAY_API_KEY='' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,8 @@ | ||
| pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") } | ||
| plugins { id("com.facebook.react.settings") } | ||
| extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() } | ||
|
|
||
|
|
||
| rootProject.name = 'RNWeb3Wallet' | ||
| include ':app' | ||
| includeBuild('../node_modules/@react-native/gradle-plugin') |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -37,7 +37,8 @@ | |||||
| "@ton/core": "0.62.0", | ||||||
| "@ton/crypto": "3.3.0", | ||||||
| "@ton/ton": "15.4.0", | ||||||
| "@walletconnect/react-native-compat": "2.23.0", | ||||||
| "@walletconnect/pay": "0.0.0-canary.1", | ||||||
| "@walletconnect/react-native-compat": "2.23.1-canary.1", | ||||||
|
||||||
| "@walletconnect/react-native-compat": "2.23.1-canary.1", | |
| "@walletconnect/react-native-compat": "2.23.1", |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| import { useEffect, useState } from 'react'; | ||
| import Config from 'react-native-config'; | ||
|
|
||
| import PayStore from '@/store/PayStore'; | ||
|
|
||
| const PAY_CONFIG = { | ||
| projectId: Config.ENV_PROJECT_ID || '', | ||
| apiKey: Config.ENV_PAY_API_KEY || '', | ||
| metadata: { | ||
| name: 'RN Web3Wallet', | ||
| bundleId: 'com.walletconnect.web3wallet.rnsample', | ||
| }, | ||
| }; | ||
|
Comment on lines
+6
to
+13
|
||
|
|
||
| export default function useInitializePaySDK() { | ||
| const [initialized, setInitialized] = useState(false); | ||
|
|
||
| useEffect(() => { | ||
| if (initialized) { | ||
| return; | ||
| } | ||
|
|
||
| PayStore.initialize(PAY_CONFIG); | ||
| setInitialized(PayStore.isAvailable()); | ||
| }, [initialized]); | ||
|
|
||
| return initialized; | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The package version "0.0.0-canary.1" for @walletconnect/pay is a pre-release canary version. Using canary/pre-release versions in production code is risky as they may contain unstable features, breaking changes, or bugs. Canary versions are typically meant for testing and development purposes. Consider using a stable release version or documenting the risks of using this pre-release version.