-
Notifications
You must be signed in to change notification settings - Fork 105
Smart Backend Wallets #709
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
Changes from 7 commits
68c21b6
05491fe
082b54a
1b87760
fc12095
aaa5691
dbc567f
941e55d
51bd785
17245a1
7bb1b80
a6ece2b
8984844
f4ec6f9
550dc14
3256832
38b46c6
3a47e77
a3957ba
ef64f4c
b5503b9
b64dff4
c1986ef
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 |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| -- AlterTable | ||
| ALTER TABLE "wallet_details" ADD COLUMN "entrypointAddress" TEXT; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -97,6 +97,7 @@ model WalletDetails { | |
| // Smart Backend Wallet | ||
| accountSignerAddress String? @map("accountSignerAddress") /// this, and either local, aws or gcp encryptedJson, are required for smart wallet | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: This naming confused me because
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the Between |
||
| accountFactoryAddress String? @map("accountFactoryAddress") /// optional even for smart wallet, if not available default factory will be used | ||
| entrypointAddress String? @map("entrypointAddress") /// optional even for smart wallet, if not available SDK will use default entrypoint | ||
|
|
||
| @@map("wallet_details") | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,7 +13,7 @@ interface CreateLocalWallet { | |
| * Create a local wallet with a random private key | ||
| * Does not store the wallet in the database | ||
| */ | ||
| export const createLocalWallet = async () => { | ||
| export const createRandomLocalWallet = async () => { | ||
|
||
| const pk = generatePrivateKey(); | ||
| const account = privateKeyToAccount({ | ||
| client: thirdwebClient, | ||
|
|
@@ -44,10 +44,10 @@ export const createLocalWallet = async () => { | |
| /** | ||
| * Creates a local wallet and stores it in the database | ||
| */ | ||
| export const createAndStoreLocalWallet = async ({ | ||
| export const createLocalWalletDetails = async ({ | ||
| label, | ||
| }: CreateLocalWallet): Promise<string> => { | ||
| const { account, encryptedJson } = await createLocalWallet(); | ||
| const { account, encryptedJson } = await createRandomLocalWallet(); | ||
|
|
||
| await createWalletDetails({ | ||
| type: "local", | ||
|
|
||
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.
Note from our convo: can you check if signing on different chains result in the same output. If so, we could default to a testnet (Sepolia?).