Skip to content

Commit

Permalink
chore(sdk): add .at(address) static api to deployable
Browse files Browse the repository at this point in the history
  • Loading branch information
sammccord committed Jun 18, 2024
1 parent ce70564 commit ddea55d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/sdk/src/Deployable/Deployable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ export type GenericDeployableParams = Parameters<typeof deployContract>[1];
export class Deployable {
protected _address: Address | undefined;

constructor(address?: Address) {
this._address = address;
}

public async deploy(config: Config): Promise<Address> {
return (this._address = await deployContract(
config,
Expand All @@ -20,4 +24,8 @@ export class Deployable {
protected buildParameters(_config: Config): GenericDeployableParams {
throw new DeployableParametersUnspecifiedError();
}

static at(address: Address) {
return new Deployable(address);
}
}

0 comments on commit ddea55d

Please sign in to comment.