@river-build/web3
Version:
Dapps for our Space and Registry contracts
30 lines • 1.24 kB
JavaScript
import { IDropFacetShim } from './IDropFacetShim';
import { BigNumber } from 'ethers';
import { IRiverPointsShim } from './IRiverPointsShim';
import { IERC721AShim } from './IERC721AShim';
export class RiverAirdropDapp {
// river airdrop isn't on all chains, so the facets might be undefined
drop;
riverPoints;
erc721A;
constructor(config, provider) {
if (config.addresses.riverAirdrop) {
this.drop = new IDropFacetShim(config.addresses.riverAirdrop, provider);
this.riverPoints = new IRiverPointsShim(config.addresses.riverAirdrop, provider);
this.erc721A = new IERC721AShim(config.addresses.riverAirdrop, provider);
}
}
async getCurrentStreak(walletAddress) {
return this.riverPoints?.read.getCurrentStreak(walletAddress) ?? BigNumber.from(0);
}
async getLastCheckIn(walletAddress) {
return this.riverPoints?.read.getLastCheckIn(walletAddress) ?? BigNumber.from(0);
}
async checkIn(signer) {
return this.riverPoints?.write(signer).checkIn();
}
async balanceOf(walletAddress) {
return this.erc721A?.read.balanceOf(walletAddress) ?? BigNumber.from(0);
}
}
//# sourceMappingURL=RiverAirdropDapp.js.map