type
Last updated
import {
// Core types
AccountIdInput,
BalanceInput,
TokenPrecision_CESS,
// Audit types
ChallengeInfo,
MinerSnapShot,
SpaceProofInfo,
// Sminer types
MinerInfo,
// File Bank types
FileMetadata,
// Event types
Event_UploadDeclaration,
// HTTP types
GatewayResponse
} from '@cessnetwork/types';
// Use the types in your application
const challenge: ChallengeInfo = {
minerSnapshot: {
idleSpace: BigInt(1000000),
serviceSpace: BigInt(500000),
serviceBloomFilter: [],
spaceProofInfo: {
miner: "cX...",
front: 0,
rear: 10,
poisKey: { g: "0x...", n: "0x..." },
accumulator: "0x..."
},
teeSignature: "0x..."
},
challengeElement: {
start: Date.now(),
idleSlip: 1,
serviceSlip: 1,
verifySlip: 1,
spaceParam: [],
serviceParam: {
randomIndexList: [1, 2, 3],
randomList: ["0x...", "0x..."]
}
},
proveInfo: {
assign: 1,
idleProve: null,
serviceProve: null
}
};
// Common input types for API parameters
const accountId: AccountIdInput = "cXhT9Xh3DhrBMDmXcGeMPDmTzDm1J8vDxBtKvogV33pShnWS";
const balance: BalanceInput = BigInt(1000000000000000000); // 1 CESS tokenimport {
TokenPrecision_CESS,
StakeForOneTB,
BlockInterval,
Size,
AddressSs58Format,
NumberOfDataCopies,
SegmentSize,
FragmentSize
} from '@cessnetwork/types';
// Token precision for CESS (10^18)
console.log(TokenPrecision_CESS); // 1000000000000000000n
// Size constants
console.log(Size.SIZE_1GiB); // 1073741824
// Address format for mainnet and testnet
console.log(AddressSs58Format.MAIN_NET); // 11331