Skip to content

Commit

Permalink
feat: added getter for Ed25519Account
Browse files Browse the repository at this point in the history
  • Loading branch information
mpsc0x committed Oct 14, 2024
1 parent 56ab1d0 commit ca4fbe7
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/clients/aptosProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
AccountAddress,
Ed25519PrivateKey,
Account,
Ed25519Account,
} from "@aptos-labs/ts-sdk";
import { PathLike } from "fs";
import fs from "fs";
Expand Down Expand Up @@ -180,11 +181,20 @@ export class AptosProvider {
return this.aptos;
}

/** Returns the profile account by name if found. */
public getProfileAccountByName(profileName: string): Ed25519PrivateKey {
/** Returns the profile private key by name if found. */
public getProfileAccountPrivateKeyByName(
profileName: string,
): Ed25519PrivateKey {
return this.profileAccountMap.get(profileName);
}

/** Returns the profile private key by name if found. */
public getProfileAccountByName(profileName: string): Ed25519Account {
return Account.fromPrivateKey({
privateKey: this.getProfileAccountPrivateKeyByName(profileName),
});
}

/** Returns the profile address by name if found. */
public getProfileAddressByName(profileName: string): AccountAddress {
return this.profileAddressMap.get(profileName);
Expand Down

0 comments on commit ca4fbe7

Please sign in to comment.