目前我得到了这个 abi:
const stakingAbi = [
'function getStakes(address user) external view returns (Stake[] memory)',
'function stake7Days(uint128 _amount) external whenNotPaused',
'function stake14Days(uint128 _amount) external whenNotPaused',
'function stake30Days(uint128 _amount) external whenNotPaused',
'function stake90Days(uint128 _amount) external whenNotPaused'
]
该Stake
结构如下所示:
struct Stake {
uint16 bonusPercentage;
uint40 unlockTimestamp;
uint128 amount;
bool withdrawn;
}
目前 getStakes 函数不起作用,因为 Ethers 不知道是什么Stake[]
,我如何在 ABI 中定义它?