Skip to content

Commit

Permalink
remove some unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
gaetbout committed Apr 29, 2024
1 parent a8a046f commit 86b2d4a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 35 deletions.
4 changes: 2 additions & 2 deletions lib/accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
num,
uint256,
} from "starknet";
import { ArgentSigner, KeyPair, ethAddress, loadContract, randomStarknetKeyPair, strkAddress } from ".";
import { KeyPair, MultisigSigner, ethAddress, loadContract, randomStarknetKeyPair, strkAddress } from ".";
import { provider } from "./provider";

export class ArgentAccount extends Account {
Expand Down Expand Up @@ -102,7 +102,7 @@ async function deployAccountInner(params: DeployAccountParams): Promise<
const calls = fundingCall ? [fundingCall] : [];

const transactionVersion = finalParams.useTxV3 ? RPC.ETransactionVersion.V3 : RPC.ETransactionVersion.V2;
const signer = new ArgentSigner(finalParams.owner);
const signer = new MultisigSigner([finalParams.owner]);
const account = new ArgentAccount(provider, contractAddress, signer, "1", transactionVersion);

let transactionHash;
Expand Down
33 changes: 0 additions & 33 deletions lib/signers/signers.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import {
CairoCustomEnum,
CairoOption,
CairoOptionVariant,
Call,
CallData,
Calldata,
DeclareSignerDetails,
DeployAccountSignerDetails,
InvocationsSignerDetails,
Expand All @@ -21,7 +18,6 @@ import {
encode,
hash,
num,
shortString,
stark,
transaction,
typedData,
Expand Down Expand Up @@ -145,29 +141,8 @@ export class MultisigSigner extends RawSigner {
}
}

export class ArgentSigner extends MultisigSigner {
constructor(public owner: KeyPair = randomStarknetKeyPair()) {
super([owner]);
}
}

export abstract class KeyPair extends RawSigner {
abstract get signer(): CairoCustomEnum;
abstract get guid(): bigint;
abstract get storedValue(): bigint;

public get compiledSigner(): Calldata {
return CallData.compile([this.signer]);
}

public get signerAsOption() {
return new CairoOption(CairoOptionVariant.Some, {
signer: this.signer,
});
}
public get compiledSignerAsOption() {
return CallData.compile([this.signerAsOption]);
}
}

export class StarknetKeyPair extends KeyPair {
Expand All @@ -186,14 +161,6 @@ export class StarknetKeyPair extends KeyPair {
return BigInt(ec.starkCurve.getStarkKey(this.pk));
}

public get guid() {
return BigInt(hash.computePoseidonHash(shortString.encodeShortString("Starknet Signer"), this.publicKey));
}

public get storedValue() {
return this.publicKey;
}

public get signer(): CairoCustomEnum {
return new CairoCustomEnum({ Starknet: { signer: this.publicKey } });
}
Expand Down

0 comments on commit 86b2d4a

Please sign in to comment.