Skip to content

Commit

Permalink
feat(ant): create ant contract class for interacting with ant contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
dtfiedler committed Mar 6, 2024
1 parent 72910ce commit 6eb7ef5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/common/ar-io.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export type ContractConfiguration = {
};

export class ArIO implements ArIOContract {
private contract: SmartWeaveContract; // TODO: this could just be SmartWeaveContract but with the generic ensures any custom setup requires the user to pass in the correct contract type
private contract: SmartWeaveContract; // TODO: this could just be scoped to WarpContract<ArIOState> | ArIORemoteContract<ArIOState>

constructor({
contract = new ArIORemoteContract<ArIOContract>({
Expand Down Expand Up @@ -95,7 +95,9 @@ export class ArIO implements ArIOContract {
export class AntContract implements ArNSAntContract {
private contract: SmartWeaveContract;

constructor({ contract }: Required<ContractConfiguration>) {
constructor({ contractTxId, contract = new ArIORemoteContract({
contractTxId,
}) }: { contractTxId: string } & ContractConfiguration) {
this.contract = contract;
}

Expand Down

0 comments on commit 6eb7ef5

Please sign in to comment.