@opendatalabs/vana-sdk
Version:
A TypeScript library for interacting with Vana Network smart contracts.
1,256 lines • 23.8 kB
JavaScript
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var VanaPoolEntityImplementation_exports = {};
__export(VanaPoolEntityImplementation_exports, {
VanaPoolEntityABI: () => VanaPoolEntityABI,
default: () => VanaPoolEntityImplementation_default
});
module.exports = __toCommonJS(VanaPoolEntityImplementation_exports);
const VanaPoolEntityABI = [
{
inputs: [],
stateMutability: "nonpayable",
type: "constructor"
},
{
inputs: [],
name: "AccessControlBadConfirmation",
type: "error"
},
{
inputs: [
{
internalType: "address",
name: "account",
type: "address"
},
{
internalType: "bytes32",
name: "neededRole",
type: "bytes32"
}
],
name: "AccessControlUnauthorizedAccount",
type: "error"
},
{
inputs: [
{
internalType: "address",
name: "target",
type: "address"
}
],
name: "AddressEmptyCode",
type: "error"
},
{
inputs: [
{
internalType: "address",
name: "implementation",
type: "address"
}
],
name: "ERC1967InvalidImplementation",
type: "error"
},
{
inputs: [],
name: "ERC1967NonPayable",
type: "error"
},
{
inputs: [],
name: "EnforcedPause",
type: "error"
},
{
inputs: [],
name: "EntityNameAlreadyExists",
type: "error"
},
{
inputs: [],
name: "ExpectedPause",
type: "error"
},
{
inputs: [],
name: "FailedInnerCall",
type: "error"
},
{
inputs: [],
name: "InvalidAddress",
type: "error"
},
{
inputs: [],
name: "InvalidEntityId",
type: "error"
},
{
inputs: [],
name: "InvalidEntityStatus",
type: "error"
},
{
inputs: [],
name: "InvalidInitialization",
type: "error"
},
{
inputs: [],
name: "InvalidName",
type: "error"
},
{
inputs: [],
name: "InvalidParam",
type: "error"
},
{
inputs: [],
name: "InvalidRegistrationStake",
type: "error"
},
{
inputs: [],
name: "NameTooShort",
type: "error"
},
{
inputs: [],
name: "NotAuthorized",
type: "error"
},
{
inputs: [],
name: "NotEntityOwner",
type: "error"
},
{
inputs: [],
name: "NotInitializing",
type: "error"
},
{
inputs: [],
name: "ReentrancyGuardReentrantCall",
type: "error"
},
{
inputs: [],
name: "StakersStillPresent",
type: "error"
},
{
inputs: [],
name: "TransferFailed",
type: "error"
},
{
inputs: [],
name: "UUPSUnauthorizedCallContext",
type: "error"
},
{
inputs: [
{
internalType: "bytes32",
name: "slot",
type: "bytes32"
}
],
name: "UUPSUnsupportedProxiableUUID",
type: "error"
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "uint256",
name: "entityId",
type: "uint256"
},
{
indexed: false,
internalType: "address",
name: "ownerAddress",
type: "address"
},
{
indexed: false,
internalType: "string",
name: "name",
type: "string"
},
{
indexed: false,
internalType: "uint256",
name: "maxAPY",
type: "uint256"
}
],
name: "EntityCreated",
type: "event"
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "uint256",
name: "entityId",
type: "uint256"
},
{
indexed: false,
internalType: "uint256",
name: "newMaxAPY",
type: "uint256"
}
],
name: "EntityMaxAPYUpdated",
type: "event"
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "uint256",
name: "entityId",
type: "uint256"
},
{
indexed: false,
internalType: "enum IVanaPoolEntity.EntityStatus",
name: "newStatus",
type: "uint8"
}
],
name: "EntityStatusUpdated",
type: "event"
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "uint256",
name: "entityId",
type: "uint256"
},
{
indexed: false,
internalType: "address",
name: "ownerAddress",
type: "address"
},
{
indexed: false,
internalType: "string",
name: "name",
type: "string"
}
],
name: "EntityUpdated",
type: "event"
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "uint256",
name: "entityId",
type: "uint256"
},
{
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256"
}
],
name: "ForfeitedRewardsReturned",
type: "event"
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "uint64",
name: "version",
type: "uint64"
}
],
name: "Initialized",
type: "event"
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "address",
name: "account",
type: "address"
}
],
name: "Paused",
type: "event"
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "uint256",
name: "entityId",
type: "uint256"
},
{
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256"
}
],
name: "RewardsAdded",
type: "event"
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "uint256",
name: "entityId",
type: "uint256"
},
{
indexed: false,
internalType: "uint256",
name: "distributedAmount",
type: "uint256"
}
],
name: "RewardsProcessed",
type: "event"
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "bytes32",
name: "role",
type: "bytes32"
},
{
indexed: true,
internalType: "bytes32",
name: "previousAdminRole",
type: "bytes32"
},
{
indexed: true,
internalType: "bytes32",
name: "newAdminRole",
type: "bytes32"
}
],
name: "RoleAdminChanged",
type: "event"
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "bytes32",
name: "role",
type: "bytes32"
},
{
indexed: true,
internalType: "address",
name: "account",
type: "address"
},
{
indexed: true,
internalType: "address",
name: "sender",
type: "address"
}
],
name: "RoleGranted",
type: "event"
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "bytes32",
name: "role",
type: "bytes32"
},
{
indexed: true,
internalType: "address",
name: "account",
type: "address"
},
{
indexed: true,
internalType: "address",
name: "sender",
type: "address"
}
],
name: "RoleRevoked",
type: "event"
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "address",
name: "account",
type: "address"
}
],
name: "Unpaused",
type: "event"
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "address",
name: "implementation",
type: "address"
}
],
name: "Upgraded",
type: "event"
},
{
inputs: [],
name: "DEFAULT_ADMIN_ROLE",
outputs: [
{
internalType: "bytes32",
name: "",
type: "bytes32"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [],
name: "MAINTAINER_ROLE",
outputs: [
{
internalType: "bytes32",
name: "",
type: "bytes32"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [],
name: "UPGRADE_INTERFACE_VERSION",
outputs: [
{
internalType: "string",
name: "",
type: "string"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [],
name: "VANA_POOL_ROLE",
outputs: [
{
internalType: "bytes32",
name: "",
type: "bytes32"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [],
name: "activeEntitiesValues",
outputs: [
{
internalType: "uint256[]",
name: "",
type: "uint256[]"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "uint256",
name: "entityId",
type: "uint256"
}
],
name: "addRewards",
outputs: [],
stateMutability: "payable",
type: "function"
},
{
inputs: [
{
internalType: "uint256[]",
name: "entityIds",
type: "uint256[]"
},
{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}
],
name: "addTotalDistributedRewards",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{
internalType: "uint256",
name: "entityId",
type: "uint256"
}
],
name: "calculateContinuousAPYByEntity",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "uint256",
name: "exponent",
type: "uint256"
}
],
name: "calculateExponential",
outputs: [
{
internalType: "uint256",
name: "r",
type: "uint256"
}
],
stateMutability: "pure",
type: "function"
},
{
inputs: [
{
internalType: "uint256",
name: "principal",
type: "uint256"
},
{
internalType: "uint256",
name: "apy",
type: "uint256"
},
{
internalType: "uint256",
name: "time",
type: "uint256"
}
],
name: "calculateYield",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256"
}
],
stateMutability: "pure",
type: "function"
},
{
inputs: [
{
components: [
{
internalType: "address",
name: "ownerAddress",
type: "address"
},
{
internalType: "string",
name: "name",
type: "string"
}
],
internalType: "struct IVanaPoolEntity.EntityRegistrationInfo",
name: "entityRegistrationInfo",
type: "tuple"
}
],
name: "createEntity",
outputs: [],
stateMutability: "payable",
type: "function"
},
{
inputs: [
{
internalType: "uint256",
name: "entityId",
type: "uint256"
}
],
name: "entities",
outputs: [
{
components: [
{
internalType: "uint256",
name: "entityId",
type: "uint256"
},
{
internalType: "address",
name: "ownerAddress",
type: "address"
},
{
internalType: "enum IVanaPoolEntity.EntityStatus",
name: "status",
type: "uint8"
},
{
internalType: "string",
name: "name",
type: "string"
},
{
internalType: "uint256",
name: "maxAPY",
type: "uint256"
},
{
internalType: "uint256",
name: "lockedRewardPool",
type: "uint256"
},
{
internalType: "uint256",
name: "activeRewardPool",
type: "uint256"
},
{
internalType: "uint256",
name: "totalShares",
type: "uint256"
},
{
internalType: "uint256",
name: "lastUpdateTimestamp",
type: "uint256"
},
{
internalType: "uint256",
name: "totalDistributedRewards",
type: "uint256"
}
],
internalType: "struct IVanaPoolEntity.EntityInfo",
name: "",
type: "tuple"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [],
name: "entitiesCount",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "string",
name: "entityName",
type: "string"
}
],
name: "entityByName",
outputs: [
{
components: [
{
internalType: "uint256",
name: "entityId",
type: "uint256"
},
{
internalType: "address",
name: "ownerAddress",
type: "address"
},
{
internalType: "enum IVanaPoolEntity.EntityStatus",
name: "status",
type: "uint8"
},
{
internalType: "string",
name: "name",
type: "string"
},
{
internalType: "uint256",
name: "maxAPY",
type: "uint256"
},
{
internalType: "uint256",
name: "lockedRewardPool",
type: "uint256"
},
{
internalType: "uint256",
name: "activeRewardPool",
type: "uint256"
},
{
internalType: "uint256",
name: "totalShares",
type: "uint256"
},
{
internalType: "uint256",
name: "lastUpdateTimestamp",
type: "uint256"
},
{
internalType: "uint256",
name: "totalDistributedRewards",
type: "uint256"
}
],
internalType: "struct IVanaPoolEntity.EntityInfo",
name: "",
type: "tuple"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "string",
name: "entityName",
type: "string"
}
],
name: "entityNameToId",
outputs: [
{
internalType: "uint256",
name: "entityId",
type: "uint256"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "uint256",
name: "entityId",
type: "uint256"
}
],
name: "entityShareToVana",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "bytes32",
name: "role",
type: "bytes32"
}
],
name: "getRoleAdmin",
outputs: [
{
internalType: "bytes32",
name: "",
type: "bytes32"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "bytes32",
name: "role",
type: "bytes32"
},
{
internalType: "address",
name: "account",
type: "address"
}
],
name: "grantRole",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{
internalType: "bytes32",
name: "role",
type: "bytes32"
},
{
internalType: "address",
name: "account",
type: "address"
}
],
name: "hasRole",
outputs: [
{
internalType: "bool",
name: "",
type: "bool"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "address",
name: "ownerAddress",
type: "address"
},
{
internalType: "address",
name: "vanaPoolStakingAddress",
type: "address"
},
{
internalType: "uint256",
name: "initialMinRegistrationStake",
type: "uint256"
},
{
internalType: "uint256",
name: "initialMaxAPYDefault",
type: "uint256"
}
],
name: "initialize",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [],
name: "maxAPYDefault",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [],
name: "minRegistrationStake",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [],
name: "pause",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [],
name: "paused",
outputs: [
{
internalType: "bool",
name: "",
type: "bool"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "uint256",
name: "entityId",
type: "uint256"
}
],
name: "processRewards",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [],
name: "proxiableUUID",
outputs: [
{
internalType: "bytes32",
name: "",
type: "bytes32"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "bytes32",
name: "role",
type: "bytes32"
},
{
internalType: "address",
name: "callerConfirmation",
type: "address"
}
],
name: "renounceRole",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{
internalType: "uint256",
name: "entityId",
type: "uint256"
},
{
internalType: "uint256",
name: "amount",
type: "uint256"
}
],
name: "returnForfeitedRewards",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{
internalType: "bytes32",
name: "role",
type: "bytes32"
},
{
internalType: "address",
name: "account",
type: "address"
}
],
name: "revokeRole",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{
internalType: "bytes4",
name: "interfaceId",
type: "bytes4"
}
],
name: "supportsInterface",
outputs: [
{
internalType: "bool",
name: "",
type: "bool"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [],
name: "unpause",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{
internalType: "uint256",
name: "entityId",
type: "uint256"
},
{
components: [
{
internalType: "address",
name: "ownerAddress",
type: "address"
},
{
internalType: "string",
name: "name",
type: "string"
}
],
internalType: "struct IVanaPoolEntity.EntityRegistrationInfo",
name: "entityRegistrationInfo",
type: "tuple"
}
],
name: "updateEntity",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{
internalType: "uint256",
name: "entityId",
type: "uint256"
},
{
internalType: "uint256",
name: "newMaxAPY",
type: "uint256"
}
],
name: "updateEntityMaxAPY",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{
internalType: "uint256",
name: "entityId",
type: "uint256"
},
{
internalType: "uint256",
name: "shares",
type: "uint256"
},
{
internalType: "uint256",
name: "amount",
type: "uint256"
},
{
internalType: "bool",
name: "isStake",
type: "bool"
}
],
name: "updateEntityPool",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{
internalType: "uint256",
name: "newMinRegistrationStake",
type: "uint256"
}
],
name: "updateMinRegistrationStake",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{
internalType: "address",
name: "newVanaPoolStakingAddress",
type: "address"
}
],
name: "updateVanaPool",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{
internalType: "address",
name: "newImplementation",
type: "address"
},
{
internalType: "bytes",
name: "data",
type: "bytes"
}
],
name: "upgradeToAndCall",
outputs: [],
stateMutability: "payable",
type: "function"
},
{
inputs: [],
name: "vanaPoolStaking",
outputs: [
{
internalType: "contract IVanaPoolStaking",
name: "",
type: "address"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [
{
internalType: "uint256",
name: "entityId",
type: "uint256"
}
],
name: "vanaToEntityShare",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256"
}
],
stateMutability: "view",
type: "function"
},
{
inputs: [],
name: "version",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256"
}
],
stateMutability: "pure",
type: "function"
}
];
var VanaPoolEntityImplementation_default = VanaPoolEntityABI;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
VanaPoolEntityABI
});
//# sourceMappingURL=VanaPoolEntityImplementation.cjs.map