@river-build/web3
Version:
Dapps for our Space and Registry contracts
61 lines • 2.14 kB
TypeScript
import { IReview, IReviewInterface, ReviewStorage } from '@river-build/generated/dev/typings/IReview';
import { ContractTransaction, ethers } from 'ethers';
import { BaseContractShim } from './BaseContractShim';
import { Address } from 'abitype';
export declare enum SpaceReviewAction {
None = -1,
Add = 0,
Update = 1,
Delete = 2
}
export interface SpaceReviewEventObject {
action: SpaceReviewAction;
user: string;
comment?: string;
rating: number;
}
export interface ReviewParams {
rating: number;
comment: string;
}
export declare class IReviewShim extends BaseContractShim<IReview, IReviewInterface> {
constructor(address: string, provider: ethers.providers.Provider | undefined);
/**
* Get the review for a user
* @param userAddress - The address of the user to get the review for
* @returns The review for the user
*/
getReview(userAddress: Address): Promise<ReviewStorage.ContentStructOutput>;
/**
* Get all reviews
* @returns All reviews
*/
getAllReviews(): Promise<[
string[],
ReviewStorage.ContentStructOutput[]
] & {
users: string[];
reviews: ReviewStorage.ContentStructOutput[];
}>;
addReview(params: ReviewParams, signer: ethers.Signer): Promise<ContractTransaction>;
updateReview(params: ReviewParams, signer: ethers.Signer): Promise<ContractTransaction>;
deleteReview(signer: ethers.Signer): Promise<ContractTransaction>;
private encodeReviewParams;
}
export declare function getSpaceReviewEventDataBin(binLogs: {
topics: Uint8Array[];
data: Uint8Array;
address: Uint8Array;
}[], from: Uint8Array): SpaceReviewEventObject;
/**
* Get the review event data from a receipt, public static for ease of use in the SDK
* @param receipt - The receipt of the transaction
* @param senderAddress - The address of the sender
* @returns The review event data
*/
export declare function getSpaceReviewEventData(logs: {
topics: string[];
data: string;
address: string;
}[], senderAddress: string): SpaceReviewEventObject;
//# sourceMappingURL=IReviewShim.d.ts.map