Skip to content

Commit

Permalink
fix(types): update interaction type to only use read for now
Browse files Browse the repository at this point in the history
  • Loading branch information
Atticus committed Mar 22, 2024
1 parent 10f30fe commit 2c02e90
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 20 deletions.
4 changes: 1 addition & 3 deletions src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ export type ContractConfiguration = {
}
);

export type ContractInteractionProvider<T> =
| (BaseContract<T> & ReadContract & WriteContract)
| (BaseContract<T> & ReadContract);
export type ContractInteractionProvider<T> = BaseContract<T> & ReadContract;

export function isContractConfiguration<T>(
config: ContractConfiguration,
Expand Down
4 changes: 2 additions & 2 deletions src/common/ant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ export class ANT implements ANTContract, BaseContract<ANTState> {
contractTxId: this.contract.contractTxId,
signer,
});
} else {
this.contract.connect(signer);
}
this.contract.connect(signer);

return this;
}
/**
Expand Down
2 changes: 1 addition & 1 deletion src/common/contracts/remote-contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { DefaultLogger } from '../logger.js';
export class RemoteContract<T> implements BaseContract<T>, ReadContract {
private logger: Logger;
private http: HTTPClient;
contractTxId: string;
public readonly contractTxId: string;

constructor({
url = 'https://api.arns.app',
Expand Down
15 changes: 1 addition & 14 deletions src/common/contracts/warp-contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,14 @@ import {
BaseContract,
EvaluationParameters,
ReadContract,
WriteContract,
} from '../../types.js';
import { FailedRequestError } from '../error.js';

LoggerFactory.INST.setOptions({
logLevel: 'fatal',
});

export class WarpContract<T>
implements BaseContract<T>, ReadContract, WriteContract
{
export class WarpContract<T> implements BaseContract<T>, ReadContract {
private contract: Contract<T>;
protected contractTxId: string;
private cacheUrl: string | undefined;
Expand Down Expand Up @@ -120,14 +117,4 @@ export class WarpContract<T>

return evaluationResult.result;
}
/* eslint-disable */
// @ts-ignore
async writeInteraction<I, K>({
functionName,
inputs,
evaluationOptions,
}: EvaluationParameters<{ functionName: string; inputs: I }>): Promise<K> {
/* eslint-enable */
throw new Error('Method not implemented.');
}
}

0 comments on commit 2c02e90

Please sign in to comment.