Skip to content
New issue

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

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

Already on GitHub? # to your account

upgrade: v.1.13 to v.1.1.18 #49

Open
wants to merge 30 commits into
base: compare-last-release
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
15be88c
fix: Convert initCode to v0.7 factory/factoryData
mmontour1306 Dec 12, 2024
59ede67
Merge pull request #37 from bobanetwork/mm/support-v7
wsdt Dec 13, 2024
1cd419f
fix: light mode fix
wsdt Dec 17, 2024
754f17e
Merge pull request #38 from bobanetwork/wsdt/ui-light
wsdt Dec 17, 2024
11c0f55
fix: shasum
wsdt Dec 17, 2024
f248215
feat: in-wallet transfer
wsdt Dec 29, 2024
8125c5a
fix: enfore light mode
wsdt Jan 6, 2025
29d18a5
Merge pull request #40 from bobanetwork/wsdt/light-mode-enforced
wsdt Jan 6, 2025
8ab21a6
fix: improve header ui/ux and visiblity
wsdt Jan 7, 2025
5624693
Merge pull request #39 from bobanetwork/wsdt/in-wallet-fund-transfer
wsdt Jan 8, 2025
6adde10
fix: lean
wsdt Jan 9, 2025
d6b0497
fix: bugfixes, mainnet configuration, network switching, disable sign…
wsdt Jan 10, 2025
a824969
fix: conflicts
wsdt Jan 13, 2025
e92bc11
Merge pull request #42 from bobanetwork/wsdt/mainnet-config
wsdt Jan 13, 2025
56b81f2
fix: disable paymaster
wsdt Jan 14, 2025
8eb3efd
Merge pull request #43 from bobanetwork/wsdt/disable-paymaster
wsdt Jan 14, 2025
935a3cb
fix: encryption
wsdt Jan 19, 2025
218f51b
Merge pull request #44 from bobanetwork/wsdt/fix-encr
wsdt Jan 19, 2025
0bf4778
white listed staging url
sk-enya Jan 22, 2025
a154eed
updated version to 1.1.15
sk-enya Jan 22, 2025
769221a
Merge pull request #45 from bobanetwork/fix/extend-permision-to-stagi…
wsdt Jan 24, 2025
dfe8ca3
fix: codecaster permission
wsdt Jan 25, 2025
9c105b8
Merge pull request #46 from bobanetwork/wsdt/codecaster-permission
wsdt Jan 25, 2025
419c250
fix: shasum
wsdt Jan 26, 2025
33e4277
fix: gas estimation vals
wsdt Jan 26, 2025
80b5de0
fix: rm hardcoded value
wsdt Jan 26, 2025
73cd72a
fix: v.1.1.17
wsdt Jan 26, 2025
62acd01
Merge pull request #47 from bobanetwork/wsdt/codecaster-permission
wsdt Jan 27, 2025
390ed6a
fix: v1.1.18
wsdt Jan 27, 2025
4011698
Merge pull request #48 from bobanetwork/wsdt/fix-fee
wsdt Jan 27, 2025
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bobanetwork/snap-account-abstraction-keyring-monorepo",
"version": "1.1.13",
"version": "1.1.18",
"private": true,
"description": "An account abstraction keyring snap that integrates with MetaMask accounts on Boba Network",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion packages/site/.env.development
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
GATSBY_SNAP_ORIGIN=npm:@bobanetwork/snap-account-abstraction-keyring-hc
GATSBY_SNAP_ORIGIN=local:http://localhost:8080
USE_LOCAL_NETWORK=false
2 changes: 1 addition & 1 deletion packages/site/.env.development.hc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
GATSBY_SNAP_ORIGIN=npm:@bobanetwork/snap-account-abstraction-keyring-hc
GATSBY_SNAP_ORIGIN=local:http://localhost:8080
USE_LOCAL_NETWORK=false
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignore this.

2 changes: 1 addition & 1 deletion packages/site/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bobanetwork/snap-account-abstraction-keyring-site",
"version": "1.1.13",
"version": "1.1.18",
"private": true,
"license": "(MIT-0 OR Apache-2.0)",
"scripts": {
Expand Down
27 changes: 21 additions & 6 deletions packages/site/src/components/Buttons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const Button = styled.button`
align-items: center;
justify-content: center;
margin-top: auto;

${({ theme }) => theme.mediaQueries.small} {
width: 100%;
}
Expand All @@ -50,7 +51,7 @@ const ButtonText = styled.span`
`;

const ConnectedContainer = styled.div`
display: flex;
display: inline-flex;
align-self: flex-start;
align-items: center;
justify-content: center;
Expand All @@ -61,6 +62,8 @@ const ConnectedContainer = styled.div`
color: ${(props) => props.theme.colors.text?.inverse};
font-weight: bold;
padding: 1.2rem;
margin-right: 1rem;
margin-left: 1rem;
`;

const ConnectedIndicator = styled.div`
Expand Down Expand Up @@ -115,7 +118,7 @@ export const ConnectButton = (props: ComponentProps<typeof Button>) => {
return (
<Button id="connectButton" {...props}>
<MetaMaskFox />
<ButtonText>Connect To Boba Sepolia</ButtonText>
<ButtonText>Connect Snap</ButtonText>
</Button>
);
};
Expand Down Expand Up @@ -151,6 +154,12 @@ export const HeaderButtons = ({
updateAvailable: boolean;
onConnectClick(): unknown;
}) => {
const getNetworkName = () => {
return window.ethereum.networkVersion === '28882'
? 'Boba Sepolia'
: 'Boba Mainnet';
};

if (!state.hasMetaMask && !state.installedSnap) {
return <InstallMetaMaskButton />;
}
Expand All @@ -172,10 +181,16 @@ export const HeaderButtons = ({
}

return (
<ConnectedContainer>
<ConnectedIndicator />
<ButtonText id="snapConnected">Connected</ButtonText>
</ConnectedContainer>
<div>
<div>
<ConnectedContainer>
<ConnectedIndicator />
<ButtonText id="snapConnected">
Connected to: {getNetworkName()}
</ButtonText>
</ConnectedContainer>
</div>
</div>
);
};

Expand Down
80 changes: 61 additions & 19 deletions packages/site/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import packageInfo from '../../package.json';
import Logo from '../assets/boba-logo.png';
import { defaultSnapOrigin } from '../config';
import { MetamaskActions, MetaMaskContext } from '../hooks';
import { connectSnap, getSnap } from '../utils';
import { connectSnap, connectSnapWithNetwork, getSnap } from '../utils';

const HeaderWrapper = styled.header`
display: flex;
Expand Down Expand Up @@ -47,10 +47,10 @@ const RightContainer = styled.div`
`;

const VersionStyle = styled.p`
width: fit-content;
margin-top: 1.2rem;
font-size: 1.6rem;
margin: auto;
padding-right: 2rem;
padding-right: 4rem;
color: ${({ theme }) => theme.colors.text?.muted};
`;

Expand Down Expand Up @@ -86,35 +86,59 @@ export const Header = () => {
return (
<VersionStyle>
<div>
<b>Dapp V: </b>
{packageInfo.version}
</div>
<div>
<b>Snap V: </b>
{defaultSnapOrigin.startsWith('local') &&
`(from ${defaultSnapOrigin})` && (
<span
style={{
padding: '5px',
borderRadius: '5px',
marginRight: '10px',
}}
>
Local Snap
</span>
)}
<span
style={{
backgroundColor: '#4CAF50',
color: 'white',
padding: '5px',
borderRadius: '5px',
marginRight: '10px',
}}
>
Expected: {snapPackageInfo.version}
</span>{' '}
|
DApp: {packageInfo.version}
</span>
<span
style={{
backgroundColor: '#4CAF50',
color: 'white',
padding: '5px',
borderRadius: '5px',
}}
>
Installed: {state.installedSnap?.version}
</span>
Expected: {snapPackageInfo.version}
</span>{' '}
{state.installedSnap?.version ? (
<span
style={{
backgroundColor: '#4CAF50',
color: 'white',
padding: '5px',
borderRadius: '5px',
}}
>
Installed: {state.installedSnap?.version}
</span>
) : (
<span
style={{
backgroundColor: '#f37086',
color: 'white',
padding: '5px',
borderRadius: '5px',
}}
>
Installed: No Snap found
</span>
)}
</div>

{defaultSnapOrigin.startsWith('local') && `(from ${defaultSnapOrigin})`}
</VersionStyle>
);
};
Expand All @@ -127,6 +151,24 @@ export const Header = () => {
</LogoWrapper>
<RightContainer>
<Version />
{state.installedSnap?.version && (
<button
style={{ marginRight: '1rem' }}
onClick={async () =>
connectSnapWithNetwork(
window.ethereum.networkVersion === '28882'
? 'mainnet'
: 'sepolia',
)
}
>
{window.ethereum.networkVersion === '28882' ? (
<span>Switch To Boba Mainnet</span>
) : (
<span>Switch to Boba Sepolia</span>
)}
</button>
)}
<HeaderButtons
state={state}
onConnectClick={handleConnectClick}
Expand Down
39 changes: 14 additions & 25 deletions packages/site/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ const Index = () => {

const client = new KeyringSnapRpcClient(snapId, window.ethereum as any);
const abiCoder = new ethers.AbiCoder();

useEffect(() => {
/**
* Return the current state of the snap.
Expand Down Expand Up @@ -401,7 +400,7 @@ const Index = () => {

const sendBobaTx = async () => {
if (!snapState?.accounts || !selectedAccount) {
throw new Error('Source account not connected');
throw new Error('Please connect your wallet first!');
}

// Paymaster Setup steps (only first time or when required)
Expand Down Expand Up @@ -471,17 +470,6 @@ const Index = () => {
if (bobaPaymasterSelected) {
method = 'eth_sendUserOpBobaPM';
}
console.log({
method: 'wallet_invokeSnap',
params: {
snapId: defaultSnapOrigin,
request: {
method,
params: [transactionDetails],
id: snapState.accounts[0]?.id ?? '',
},
},
});

const submitRes = await window.ethereum.request({
method: 'wallet_invokeSnap',
Expand Down Expand Up @@ -521,7 +509,8 @@ const Index = () => {
const accountManagementMethods = [
{
name: 'Create account',
description: 'Create a 4337 account using an admin private key',
description:
'Create a 4337 account using an admin private key and a salt, which you need to write down or store to re-create the wallet.',
inputs: [
{
id: 'create-account-private-key',
Expand All @@ -534,7 +523,7 @@ const Index = () => {
},
{
id: 'create-account-salt',
title: 'Salt (optional)',
title: 'Salt (optional, write it down)',
value: salt,
type: InputType.TextField,
placeholder: 'E.g. 0x123',
Expand All @@ -551,7 +540,7 @@ const Index = () => {
{
name: 'Create account (Deterministic)',
description:
'Create a 4337 account using a deterministic key generated through the snap',
'Create a 4337 account using a deterministic key generated through the snap. If the account cannot be found or already exists, try to remove and re-install the snap via the Metamask UI.',
inputs: [
{
id: 'create-account-deterministic',
Expand Down Expand Up @@ -610,15 +599,15 @@ const Index = () => {
onChange: (event: any) =>
setTransferAmount(event.currentTarget.value),
},
{
id: 'transfer-fund-boba-paymaster',
title: 'Select boba as paymaster.',
value: bobaPaymasterSelected,
type: InputType.CheckBox,
placeholder: 'E.g. 0.00',
onChange: (event: any) =>
setBobaPaymasterSelected(event.target.checked),
},
// {
// id: 'transfer-fund-boba-paymaster',
// title: 'Select boba as paymaster.',
// value: bobaPaymasterSelected,
// type: InputType.CheckBox,
// placeholder: 'E.g. 0.00',
// onChange: (event: any) =>
// setBobaPaymasterSelected(event.target.checked),
// },
],
action: {
callback: async () => await sendBobaTx(),
Expand Down
Loading
Loading