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

feat: wallet features #230

Merged
merged 61 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
f423bfa
chore: implementing new account view
ignaciosantise Aug 6, 2024
74d0a6d
chore: new account screen ui
ignaciosantise Aug 6, 2024
072c326
chore: show balance in account screen
ignaciosantise Aug 6, 2024
b012080
chore: added receive funds button in token tab
ignaciosantise Aug 6, 2024
71b6d6f
chore: show wallet screen if its email login
ignaciosantise Aug 7, 2024
8f26ab0
chore: updated account default view, show wallet view for email login
ignaciosantise Aug 7, 2024
a6fad43
chore: added changeset
ignaciosantise Aug 7, 2024
08853cf
chore: limit width of platform tab in connecting view
ignaciosantise Aug 7, 2024
0b3d8c0
feat: wip receive screen
ignaciosantise Aug 8, 2024
6324668
chore: receive screen
ignaciosantise Aug 8, 2024
5b38658
chore: network button ui improvements
ignaciosantise Aug 9, 2024
422d497
chore: wrapped new views in scrollview + landscape
ignaciosantise Aug 9, 2024
5322428
chore: added network view + network image placeholder
ignaciosantise Aug 9, 2024
f5d3f67
Merge pull request #207 from WalletConnect/feat/wallet-screen
ignaciosantise Aug 9, 2024
0d2f111
chore: code improvements
ignaciosantise Aug 9, 2024
367a3b1
chore: code improvements
ignaciosantise Aug 9, 2024
dc09930
Merge pull request #211 from WalletConnect/feat/receive-assets
ignaciosantise Aug 12, 2024
0b60343
chore: added token list
ignaciosantise Aug 12, 2024
49516f6
chore: changed list token types
ignaciosantise Aug 12, 2024
494ce0c
chore: code style
ignaciosantise Aug 12, 2024
851fce9
chore: added network icon in token item
ignaciosantise Aug 13, 2024
3c2fde2
Merge pull request #212 from WalletConnect/feat/wallet-balance
ignaciosantise Aug 13, 2024
a7fb622
chore: wip transaction list
ignaciosantise Aug 15, 2024
ab3e662
chore: added load more button
ignaciosantise Aug 20, 2024
3734e04
chore: added activity evts
ignaciosantise Aug 20, 2024
34afaff
chore: change activity icon color using status
ignaciosantise Aug 20, 2024
a3d252c
chore: code style
ignaciosantise Aug 20, 2024
8d0863c
Merge pull request #217 from WalletConnect/feat/wallet-activity
ignaciosantise Aug 22, 2024
df19896
feat: added activity view for eoa
ignaciosantise Aug 22, 2024
644662f
Merge pull request #218 from WalletConnect/feat/wallet-eoa-activity
ignaciosantise Aug 22, 2024
6c4dfd0
chore: style improvements
ignaciosantise Aug 22, 2024
228c979
chore: style changes
ignaciosantise Aug 22, 2024
b45c681
Merge branch 'develop' into feat/wallet-features
ignaciosantise Aug 22, 2024
beccc6f
chore: wip send view
ignaciosantise Aug 26, 2024
087190f
chore: wip send screen
ignaciosantise Aug 27, 2024
fa3fa54
chore: adding send view
ignaciosantise Sep 3, 2024
c30cfe6
chore: removed account redirect for universal wallets
ignaciosantise Sep 5, 2024
8fb55e7
Merge pull request #228 from WalletConnect/feat/wallet-send
ignaciosantise Sep 5, 2024
7b3153c
Merge branch 'develop' into feat/wallet-features
ignaciosantise Sep 5, 2024
411c192
chore: removed changeset, solved ts error
ignaciosantise Sep 5, 2024
ffb0b2a
chore: added changeset
ignaciosantise Sep 5, 2024
34d7b63
Merge branch 'develop' into feat/wallet-features
ignaciosantise Sep 18, 2024
57db4f3
chore: working on send screen
ignaciosantise Sep 19, 2024
e75a54a
chore: working on preview send view
ignaciosantise Sep 20, 2024
8cfe95d
chore: preview send view
ignaciosantise Sep 20, 2024
e55ad32
chore: working on send flow
ignaciosantise Sep 20, 2024
4c84e83
chore: auth provider refactor
ignaciosantise Sep 23, 2024
f37bfba
chore: send changes
ignaciosantise Sep 23, 2024
66b3551
chore: select token view
ignaciosantise Sep 23, 2024
b03481f
chore: ui improvements
ignaciosantise Sep 23, 2024
a93eaef
fix: added usdt abi
ignaciosantise Sep 24, 2024
79e4606
chore: added refresh control to token and activity list
ignaciosantise Sep 24, 2024
0fa8312
chore: avatar colors based on address
ignaciosantise Sep 24, 2024
f01db27
chore: compacted erc20 and usdt abi, added more usdt contract adddresses
ignaciosantise Sep 25, 2024
c8acebb
chore: added ethers methods to resolve ens and write contract
ignaciosantise Sep 25, 2024
d56f2fd
chore: test fix
ignaciosantise Sep 25, 2024
07f5829
chore: snapshot action change
ignaciosantise Sep 25, 2024
0a81947
chore: small ui change
ignaciosantise Sep 25, 2024
b02a7d3
chore: changeset file
ignaciosantise Sep 25, 2024
f81884a
chore: code style
ignaciosantise Sep 25, 2024
48486f0
chore: added sendcontroller test
ignaciosantise Sep 25, 2024
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
18 changes: 18 additions & 0 deletions .changeset/old-beers-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
'@reown/appkit-coinbase-ethers-react-native': minor
'@reown/appkit-coinbase-wagmi-react-native': minor
'@reown/appkit-scaffold-utils-react-native': minor
'@reown/appkit-auth-ethers-react-native': minor
'@reown/appkit-auth-wagmi-react-native': minor
'@reown/appkit-scaffold-react-native': minor
'@reown/appkit-ethers5-react-native': minor
'@reown/appkit-common-react-native': minor
'@reown/appkit-ethers-react-native': minor
'@reown/appkit-wallet-react-native': minor
'@reown/appkit-wagmi-react-native': minor
'@reown/appkit-core-react-native': minor
'@reown/appkit-siwe-react-native': minor
'@reown/appkit-ui-react-native': minor
---

feat: added wallet features for universal wallets
2 changes: 1 addition & 1 deletion .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
uses: ./.github/actions/setup

- name: Publish Snapshots
continue-on-error: true
continue-on-error: false
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
9 changes: 4 additions & 5 deletions apps/gallery/stories/composites/AccountButton.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const meta: Meta<typeof AccountButton> = {
address: {
control: { type: 'text' }
},
isProfileName: {
control: { type: 'boolean' }
profileName: {
control: { type: 'text' }
},
networkSrc: {
control: { type: 'text' }
Expand All @@ -26,8 +26,7 @@ const meta: Meta<typeof AccountButton> = {
avatarSrc: avatarImageSrc,
address: '0xDBbD65026a07cFbFa1aa92744E4D69951686077d',
networkSrc: networkImageSrc,
balance: '0.527 ETH',
isProfileName: false
balance: '0.527 ETH'
}
};

Expand All @@ -41,7 +40,7 @@ export const Default: Story = {
address={args.address}
networkSrc={args.networkSrc}
balance={args.balance}
isProfileName={args.isProfileName}
profileName={args.profileName}
/>
)
};
14 changes: 2 additions & 12 deletions apps/gallery/stories/composites/Chip.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import type { Meta, StoryObj } from '@storybook/react';

import { Chip } from '@reown/appkit-ui-react-native';
import {
chipOptions,
externalLabel,
externalLink,
iconOptions,
walletImageSrc
} from '../../utils/PresetUtils';
import { chipOptions, externalLabel, iconOptions, walletImageSrc } from '../../utils/PresetUtils';

const meta: Meta<typeof Chip> = {
component: Chip,
Expand All @@ -23,9 +17,6 @@ const meta: Meta<typeof Chip> = {
disabled: {
control: { type: 'boolean' }
},
link: {
control: { type: 'text' }
},
label: {
control: { type: 'text' }
},
Expand All @@ -42,7 +33,6 @@ const meta: Meta<typeof Chip> = {
size: 'md',
disabled: false,
icon: 'disconnect',
link: externalLink,
label: externalLabel,
imageSrc: walletImageSrc
}
Expand All @@ -57,7 +47,7 @@ export const Default: Story = {
variant={args.variant}
size={args.size}
disabled={args.disabled}
link={args.link}
onPress={() => {}}
label={args.label}
imageSrc={args.imageSrc}
icon={args.icon}
Expand Down
12 changes: 0 additions & 12 deletions apps/gallery/stories/composites/ListItem.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,10 @@ const meta: Meta<typeof ListItem> = {
imageSrc: {
control: { type: 'text' }
},
variant: {
options: ['image', 'icon'],
control: { type: 'select' }
},
icon: {
options: iconOptions,
control: { type: 'select' }
},
iconVariant: {
options: ['blue', 'overlay'],
control: { type: 'select' }
},
disabled: {
control: { type: 'boolean' }
},
Expand All @@ -33,10 +25,8 @@ const meta: Meta<typeof ListItem> = {
}
},
args: {
variant: 'image',
imageSrc: networkImageSrc,
icon: 'swapHorizontal',
iconVariant: 'blue',
disabled: false,
chevron: true,
loading: false
Expand All @@ -50,10 +40,8 @@ export const Default: Story = {
render: (args: any) => (
<GalleryContainer width={300}>
<ListItem
variant={args.variant}
imageSrc={args.imageSrc}
icon={args.icon}
iconVariant={args.iconVariant}
disabled={args.disabled}
chevron={args.chevron}
loading={args.loading}
Expand Down
12 changes: 1 addition & 11 deletions apps/gallery/stories/composites/NetworkButton.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ import { networkImageSrc } from '../../utils/PresetUtils';
const meta: Meta<typeof NetworkButton> = {
component: NetworkButton,
argTypes: {
variant: {
options: ['fill', 'shade'],
control: { type: 'select' }
},
disabled: {
control: { type: 'boolean' }
},
Expand All @@ -21,7 +17,6 @@ const meta: Meta<typeof NetworkButton> = {
}
},
args: {
variant: 'fill',
disabled: false,
children: 'Ethereum',
imageSrc: networkImageSrc
Expand All @@ -33,12 +28,7 @@ type Story = StoryObj<typeof NetworkButton>;

export const Default: Story = {
render: args => (
<NetworkButton
variant={args.variant}
disabled={args.disabled}
imageSrc={args.imageSrc}
onPress={() => {}}
>
<NetworkButton disabled={args.disabled} imageSrc={args.imageSrc} onPress={() => {}}>
{args.children}
</NetworkButton>
)
Expand Down
2 changes: 0 additions & 2 deletions apps/gallery/utils/PresetUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ export const avatarImageSrc =
export const wcUri =
'wc:139520827546986d057472f8bbd7ef0484409458034b61cca59d908563773c7a@2?relay-protocol=irn&symKey=43b5fad11bf07bc8a0aa12231435a4ad3e72e2d1fa257cf191a90ec5b62cb0a';

export const externalLink = 'https://www.fireblocks.com';

export const externalLabel = 'www.fireblocks.com';

export const colorOptions: ColorType[] = [
Expand Down
4 changes: 4 additions & 0 deletions packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
"test": "jest --passWithNoTests",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
},
"dependencies": {
"bignumber.js": "9.1.2",
"dayjs": "1.11.10"
},
"files": [
"src",
"lib"
Expand Down
48 changes: 48 additions & 0 deletions packages/common/src/contracts/erc20.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
export const erc20ABI = [
{
type: 'function',
name: 'transfer',
stateMutability: 'nonpayable',
inputs: [
{
name: '_to',
type: 'address'
},
{
name: '_value',
type: 'uint256'
}
],
outputs: [
{
name: '',
type: 'bool'
}
]
},
{
type: 'function',
name: 'transferFrom',
stateMutability: 'nonpayable',
inputs: [
{
name: '_from',
type: 'address'
},
{
name: '_to',
type: 'address'
},
{
name: '_value',
type: 'uint256'
}
],
outputs: [
{
name: '',
type: 'bool'
}
]
}
];
43 changes: 43 additions & 0 deletions packages/common/src/contracts/usdt.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
export const usdtABI = [
{
type: 'function',
name: 'transfer',
stateMutability: 'nonpayable',
inputs: [
{
name: 'recipient',
type: 'address'
},
{
name: 'amount',
type: 'uint256'
}
],
outputs: []
},
{
type: 'function',
name: 'transferFrom',
stateMutability: 'nonpayable',
inputs: [
{
name: 'sender',
type: 'address'
},
{
name: 'recipient',
type: 'address'
},
{
name: 'amount',
type: 'uint256'
}
],
outputs: [
{
name: '',
type: 'bool'
}
]
}
];
6 changes: 6 additions & 0 deletions packages/common/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
export { ConstantsUtil } from './utils/ConstantsUtil';
export { ContractUtil } from './utils/ContractUtil';
export { DateUtil } from './utils/DateUtil';
export { NamesUtil } from './utils/NamesUtil';
export { NetworkUtil } from './utils/NetworkUtil';
export { NumberUtil } from './utils/NumberUtil';
export { erc20ABI } from './contracts/erc20';
export * from './utils/TypeUtil';
20 changes: 19 additions & 1 deletion packages/common/src/utils/ConstantsUtil.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
export const ConstantsUtil = {
WC_NAME_SUFFIX: '.reown.id',
WC_NAME_SUFFIX_LEGACY: '.wcn.id',
BLOCKCHAIN_API_RPC_URL: 'https://rpc.walletconnect.org',
PULSE_API_URL: 'https://pulse.walletconnect.org',
API_URL: 'https://api.web3modal.org',
COINBASE_CONNECTOR_ID: 'coinbaseWallet',
COINBASE_EXPLORER_ID: 'fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa'
COINBASE_EXPLORER_ID: 'fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa',
USDT_CONTRACT_ADDRESSES: [
// Mainnet
'0xdac17f958d2ee523a2206206994597c13d831ec7',
// Polygon
'0xc2132d05d31c914a87c6611c10748aeb04b58e8f',
// Avalanche
'0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7',
// Cosmos
'0x919C1c267BC06a7039e03fcc2eF738525769109c',
// Celo
'0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e',
// Binance
'0x55d398326f99059fF775485246999027B3197955',
// Arbitrum
'0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9'
]
};
13 changes: 13 additions & 0 deletions packages/common/src/utils/ContractUtil.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { erc20ABI } from '../contracts/erc20';
import { usdtABI } from '../contracts/usdt';
import { ConstantsUtil } from './ConstantsUtil';

export const ContractUtil = {
getERC20Abi: (tokenAddress: string) => {
if (ConstantsUtil.USDT_CONTRACT_ADDRESSES.includes(tokenAddress)) {
return usdtABI;
}

return erc20ABI;
}
};
47 changes: 47 additions & 0 deletions packages/common/src/utils/DateUtil.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import dayjs from 'dayjs';
import englishLocale from 'dayjs/locale/en.js';
import relativeTime from 'dayjs/plugin/relativeTime.js';
import updateLocale from 'dayjs/plugin/updateLocale.js';

dayjs.extend(relativeTime);
dayjs.extend(updateLocale);

const localeObject = {
...englishLocale,
name: 'en-web3-modal',
relativeTime: {
future: 'in %s',
past: '%s ago',
s: '%d sec',
m: '1 min',
mm: '%d min',
h: '1 hr',
hh: '%d hrs',
d: '1 d',
dd: '%d d',
M: '1 mo',
MM: '%d mo',
y: '1 yr',
yy: '%d yr'
}
};

dayjs.locale('en-appkit', localeObject);

export const DateUtil = {
getYear(date: string = new Date().toISOString()) {
return dayjs(date).year();
},

getRelativeDateFromNow(date: string | number) {
return dayjs(date).locale('en-appkit').fromNow(true);
},

formatDate(date: string | number, format = 'DD MMM') {
return dayjs(date).format(format);
},

getMonth(month: number) {
return dayjs().month(month).format('MMMM');
}
};
10 changes: 10 additions & 0 deletions packages/common/src/utils/NamesUtil.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { ConstantsUtil } from './ConstantsUtil';

export const NamesUtil = {
isReownName(value: string) {
return (
value?.endsWith(ConstantsUtil.WC_NAME_SUFFIX_LEGACY) ||
value?.endsWith(ConstantsUtil.WC_NAME_SUFFIX)
);
}
};
Loading
Loading