-
Notifications
You must be signed in to change notification settings - Fork 37
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
Support custom Accounts #148
Comments
Maybe we can simply expose our existing |
So, this happens to work, some things could be improved from the UX side, but if you are in need, by extending the import { Account } from "@shardlabs/starknet-hardhat-plugin/dist/src/account";
import { TransactionHashPrefix, StarknetChainId } from "@shardlabs/starknet-hardhat-plugin/dist/src/constants";
class MyAccount extends Account {
// alternatively replace the constructor with a static initialize method if you need async code
public constructor(...) {
super(...);
}
protected getMessageHash(
transactionHashPrefix: TransactionHashPrefix,
accountAddress: string,
callArray: Call[],
nonce: string,
maxFee: string,
version: string,
chainId: StarknetChainId
): string {
throw new Error("Method not implemented.");
}
protected getSignatures(messageHash: string): bigint[] {
throw new Error("Method not implemented.");
}
deployAccount(options?: DeployAccountOptions | undefined): Promise<string> {
throw new Error("Method not implemented.");
}
} Usage example: const myAccount = new MyAccount(...);
// fund the account before deploying it
// ...
await myAccount.deployAccount();
// declare and deploy
const contractFactory = starknet.getContractFactory(...);
await myAccount.declare(contractFactory);
const contract = await myAccount.deploy(contractFactory);
await myAccount.invoke(contract, ...); For more info see how |
As discussed with a user (Phil26 on Discord), the approach suggested in the previous post has bad UX. Here is what exactly Phil said in the Discord thread:
|
Can work on this one |
Currently only OpenZeppelin and ArgentX are supported:
as discussed here with Lauri: https://discord.com/channels/793094838509764618/961564209387282453
and here: https://discord.com/channels/793094838509764618/965952148418490418
The text was updated successfully, but these errors were encountered: