@q-dev/gdk-sdk
Version:
Typescript Library to interact with GDK Contracts
54 lines • 2.47 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.DAOVaultInstance = void 0;
const SystemContractInstance_1 = require("../SystemContractInstance");
class DAOVaultInstance extends SystemContractInstance_1.SystemContractInstance {
constructor(signer, address) {
super(signer, "DAOVault.json", address);
}
/**
* Constructor
* @param signer ethers signer, basically the one who wants to sign the constitution hash.
* @param signature signature of the constitution hash.
* @param txOptions transaction options
*
* Constitution hash is retrieved from the DAOParameterStorage contract.
* The name of this contract in the registry is "DAO_CONF_PARAMETER_STORAGE:DAO Token Holder".
* This is the main storage for all constitution parameters.
*/
async signConstitution(signer, signature, txOptions) {
return this.submitTransaction("signConstitution", [signer, signature], txOptions);
}
async depositNative(txOptions) {
return this.submitTransaction("depositNative", [], txOptions);
}
async depositERC20(tokenAddress, amount, txOptions) {
return this.submitTransaction("depositERC20", [tokenAddress, amount], txOptions);
}
async depositNFT(tokenAddress, tokenId, txOptions) {
return this.submitTransaction("depositNFT", [tokenAddress, tokenId], txOptions);
}
async authorizeBySBT(tokenAddress, txOptions) {
return this.submitTransaction("authorizeBySBT", [tokenAddress], txOptions);
}
async withdrawNative(amount, txOptions) {
return this.submitTransaction("withdrawNative", [amount], txOptions);
}
async withdrawERC20(tokenAddress, amount, txOptions) {
return this.submitTransaction("withdrawERC20", [tokenAddress, amount], txOptions);
}
async withdrawNFT(tokenAddress, tokenId, txOptions) {
return this.submitTransaction("withdrawNFT", [tokenAddress, tokenId], txOptions);
}
async revokeSBTAuthorization(tokenAddress, txOptions) {
return this.submitTransaction("revokeSBTAuthorization", [tokenAddress], txOptions);
}
async getTimeLockInfo(user, tokenAddress) {
return this.instance.getTimeLockInfo(user, tokenAddress);
}
async getUserConstitutionData(user) {
return this.instance.getUserConstitutionData(user);
}
}
exports.DAOVaultInstance = DAOVaultInstance;
//# sourceMappingURL=DAOVaultInstance.js.map