-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [AA] First draft defaults (#837) * first draft defaults * feedback, defaults * bundler fix: number<>string defaults --------- Co-authored-by: Ino Murko <[email protected]> (cherry picked from commit 41a6aff) * [AA] optimization: paymasterAndData for aa-sdk (#871) * paymaster api * switch-to-signed * generalized, tests adapted (cherry picked from commit 710270e) * fix for crash on wallet page (#873) (cherry picked from commit e93822d) * remove unused vars (#875) (cherry picked from commit fbb0a89) --------- Co-authored-by: Riedl Kevin, Bsc <[email protected]> Co-authored-by: Sahil K <[email protected]>
- Loading branch information
1 parent
9963ad1
commit b12808e
Showing
18 changed files
with
145 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
node --trace-warnings --no-deprecation bundler.js --minBalance $MIN_BALANCE --mnemonic $MNEMONIC_OR_PK --network $L2_NODE_WEB3_URL --beneficiary $BENEFICIARY --addressManager $ADDRESS_MANAGER_ADDRESS --l1NodeWeb3Url $L1_NODE_WEB3_URL --maxBundleGas $MAX_BUNDLE_GAS --unsafe $UNSAFE | ||
node --trace-warnings --no-deprecation bundler.js --minBalance $MIN_BALANCE --mnemonic $MNEMONIC_OR_PK --network $L2_NODE_WEB3_URL --beneficiary $BENEFICIARY --addressManager $ADDRESS_MANAGER_ADDRESS --l1NodeWeb3Url $L1_NODE_WEB3_URL --maxBundleGas $MAX_BUNDLE_GAS --unsafe $UNSAFE --minStake 0.2 --minUnstakeDelay 86400 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,23 @@ | ||
import { UserOperationStruct } from '@boba/accountabstraction' | ||
import { hexConcat, hexZeroPad } from 'ethers/lib/utils' | ||
|
||
export interface IPaymasterAPIConfig { | ||
paymasterAndData?: string | ||
} | ||
|
||
/** | ||
* an API to external a UserOperation with paymaster info | ||
*/ | ||
export class PaymasterAPI { | ||
constructor(private config?: IPaymasterAPIConfig) {} | ||
|
||
/** | ||
* @param userOp a partially-filled UserOperation (without signature and paymasterAndData | ||
* note that the "preVerificationGas" is incomplete: it can't account for the | ||
* paymasterAndData value, which will only be returned by this method.. | ||
* @returns the value to put into the PaymasterAndData, undefined to leave it empty | ||
*/ | ||
async getPaymasterAndData (userOp: Partial<UserOperationStruct>): Promise<string | undefined> { | ||
return '0x' | ||
return this.config.paymasterAndData ?? '0x' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import React, { ReactNode } from 'react' | ||
import styled from 'styled-components' | ||
|
||
type VariantType = 'info' | 'success' | 'danger' | 'warning' | ||
|
||
const Badge = styled.span<{ variant: VariantType }>(({ theme, variant }) => ({ | ||
display: 'inline-block', | ||
color: `${theme.colors[variant]}`, | ||
borderRadius: '100%', | ||
margin: '0 10px', | ||
border: `1px solid ${theme.colors[variant]}`, | ||
})) | ||
|
||
const Circle = styled.span<{ variant: VariantType }>(({ theme, variant }) => ({ | ||
margin: 5, | ||
display: 'block', | ||
width: 8, | ||
height: 8, | ||
borderRadius: '50%', | ||
backgroundColor: `${theme.colors[variant]}`, | ||
boxShadow: `0 0 0 ${theme.colors[variant]}`, | ||
animation: `pulsing 1500ms ease-in-out infinite`, | ||
'@keyframes pulsing': { | ||
'0%': { | ||
boxShadow: `0 0 0 0 ${theme.colors[variant]}`, | ||
}, | ||
'70%': { | ||
boxShadow: `0 0 0 4px ${theme.colors[variant]}`, | ||
}, | ||
'100%': { | ||
boxShadow: `0 0 0 0 ${theme.colors[variant]}`, | ||
}, | ||
}, | ||
})) | ||
|
||
const PulseContainer = styled.span` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
` | ||
|
||
interface PulseBadgeProps { | ||
children: ReactNode | ||
variant: VariantType | ||
} | ||
|
||
export const PulseBadge: React.FC<PulseBadgeProps> = ({ | ||
children, | ||
variant = 'info', | ||
}) => { | ||
return ( | ||
<PulseContainer> | ||
<Badge variant={variant}> | ||
<Circle variant={variant} /> | ||
</Badge> | ||
{children} | ||
</PulseContainer> | ||
) | ||
} | ||
|
||
export default PulseBadge |
Oops, something went wrong.