@totochain/client 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +283 -2
- package/_cjs/accounts/index.d.cts +7 -0
- package/_cjs/accounts/index.js +29 -0
- package/_cjs/accounts/keyring.d.cts +28 -0
- package/_cjs/accounts/keyring.js +102 -0
- package/_cjs/accounts/substrateSigner.d.cts +5 -0
- package/_cjs/accounts/substrateSigner.js +46 -0
- package/_cjs/accounts/types.d.cts +6 -0
- package/_cjs/accounts/types.js +2 -0
- package/_cjs/accounts/wellKnown.d.cts +24 -0
- package/_cjs/accounts/wellKnown.js +322 -0
- package/_cjs/actions/activityTracker/calculateActivityReputationAtBlock.d.cts +9 -0
- package/_cjs/actions/activityTracker/calculateActivityReputationAtBlock.js +8 -0
- package/_cjs/actions/activityTracker/decodeReputationPage.d.cts +4 -0
- package/_cjs/actions/activityTracker/decodeReputationPage.js +13 -0
- package/_cjs/actions/activityTracker/getActivityReputation.d.cts +8 -0
- package/_cjs/actions/activityTracker/getActivityReputation.js +8 -0
- package/_cjs/actions/activityTracker/getActivityReputationInfo.d.cts +9 -0
- package/_cjs/actions/activityTracker/getActivityReputationInfo.js +14 -0
- package/_cjs/actions/activityTracker/getActivityTrackerConfig.d.cts +8 -0
- package/_cjs/actions/activityTracker/getActivityTrackerConfig.js +13 -0
- package/_cjs/actions/activityTracker/getAllActivityReputations.d.cts +8 -0
- package/_cjs/actions/activityTracker/getAllActivityReputations.js +9 -0
- package/_cjs/actions/activityTracker/getAllRawActivityReputations.d.cts +8 -0
- package/_cjs/actions/activityTracker/getAllRawActivityReputations.js +9 -0
- package/_cjs/actions/activityTracker/getMaxActivityReputation.d.cts +7 -0
- package/_cjs/actions/activityTracker/getMaxActivityReputation.js +8 -0
- package/_cjs/actions/activityTracker/getRawActivityReputation.d.cts +8 -0
- package/_cjs/actions/activityTracker/getRawActivityReputation.js +8 -0
- package/_cjs/actions/activityTracker/index.d.cts +18 -0
- package/_cjs/actions/activityTracker/index.js +19 -0
- package/_cjs/actions/activityTracker/types.d.cts +20 -0
- package/_cjs/actions/activityTracker/types.js +2 -0
- package/_cjs/actions/attestation/attest.d.cts +16 -0
- package/_cjs/actions/attestation/attest.js +14 -0
- package/_cjs/actions/attestation/index.d.cts +3 -0
- package/_cjs/actions/attestation/index.js +7 -0
- package/_cjs/actions/did/createDid.d.cts +10 -0
- package/_cjs/actions/did/createDid.js +10 -0
- package/_cjs/actions/did/index.d.cts +3 -0
- package/_cjs/actions/did/index.js +6 -0
- package/_cjs/actions/fractionalNft/getCollectionsCount.d.cts +7 -0
- package/_cjs/actions/fractionalNft/getCollectionsCount.js +8 -0
- package/_cjs/actions/fractionalNft/getItemsCount.d.cts +8 -0
- package/_cjs/actions/fractionalNft/getItemsCount.js +8 -0
- package/_cjs/actions/fractionalNft/getNftInfo.d.cts +9 -0
- package/_cjs/actions/fractionalNft/getNftInfo.js +12 -0
- package/_cjs/actions/fractionalNft/getOwner.d.cts +9 -0
- package/_cjs/actions/fractionalNft/getOwner.js +8 -0
- package/_cjs/actions/fractionalNft/getTotalFnftsMinted.d.cts +7 -0
- package/_cjs/actions/fractionalNft/getTotalFnftsMinted.js +8 -0
- package/_cjs/actions/fractionalNft/getWildcardCollectionId.d.cts +7 -0
- package/_cjs/actions/fractionalNft/getWildcardCollectionId.js +8 -0
- package/_cjs/actions/fractionalNft/getWildcardDistributionMap.d.cts +8 -0
- package/_cjs/actions/fractionalNft/getWildcardDistributionMap.js +9 -0
- package/_cjs/actions/fractionalNft/getWildcardThreshold.d.cts +7 -0
- package/_cjs/actions/fractionalNft/getWildcardThreshold.js +8 -0
- package/_cjs/actions/fractionalNft/index.d.cts +18 -0
- package/_cjs/actions/fractionalNft/index.js +19 -0
- package/_cjs/actions/fractionalNft/types.d.cts +10 -0
- package/_cjs/actions/fractionalNft/types.js +2 -0
- package/_cjs/actions/handshake/getCompletedHandshakes.d.cts +8 -0
- package/_cjs/actions/handshake/getCompletedHandshakes.js +8 -0
- package/_cjs/actions/handshake/getHandshakeCount.d.cts +8 -0
- package/_cjs/actions/handshake/getHandshakeCount.js +8 -0
- package/_cjs/actions/handshake/getHandshakeStatus.d.cts +10 -0
- package/_cjs/actions/handshake/getHandshakeStatus.js +8 -0
- package/_cjs/actions/handshake/handshakeExists.d.cts +9 -0
- package/_cjs/actions/handshake/handshakeExists.js +8 -0
- package/_cjs/actions/handshake/hasHandshakeCompleted.d.cts +9 -0
- package/_cjs/actions/handshake/hasHandshakeCompleted.js +8 -0
- package/_cjs/actions/handshake/index.d.cts +12 -0
- package/_cjs/actions/handshake/index.js +13 -0
- package/_cjs/actions/handshake/types.d.cts +2 -0
- package/_cjs/actions/handshake/types.js +2 -0
- package/_cjs/actions/index.d.cts +14 -0
- package/_cjs/actions/index.js +35 -0
- package/_cjs/actions/potential/getActiveReferralShare.d.cts +8 -0
- package/_cjs/actions/potential/getActiveReferralShare.js +8 -0
- package/_cjs/actions/potential/getCycleNumber.d.cts +7 -0
- package/_cjs/actions/potential/getCycleNumber.js +8 -0
- package/_cjs/actions/potential/getCyclePotentialMinted.d.cts +7 -0
- package/_cjs/actions/potential/getCyclePotentialMinted.js +8 -0
- package/_cjs/actions/potential/getCycleSupply.d.cts +7 -0
- package/_cjs/actions/potential/getCycleSupply.js +8 -0
- package/_cjs/actions/potential/getDefaultActiveReferralShare.d.cts +7 -0
- package/_cjs/actions/potential/getDefaultActiveReferralShare.js +8 -0
- package/_cjs/actions/potential/getMaxSupply.d.cts +7 -0
- package/_cjs/actions/potential/getMaxSupply.js +8 -0
- package/_cjs/actions/potential/getMonthNumber.d.cts +7 -0
- package/_cjs/actions/potential/getMonthNumber.js +8 -0
- package/_cjs/actions/potential/getMonthPotentialMinted.d.cts +7 -0
- package/_cjs/actions/potential/getMonthPotentialMinted.js +8 -0
- package/_cjs/actions/potential/getMonthSupply.d.cts +7 -0
- package/_cjs/actions/potential/getMonthSupply.js +8 -0
- package/_cjs/actions/potential/getPotential.d.cts +8 -0
- package/_cjs/actions/potential/getPotential.js +8 -0
- package/_cjs/actions/potential/getTotalPotentialMinted.d.cts +7 -0
- package/_cjs/actions/potential/getTotalPotentialMinted.js +8 -0
- package/_cjs/actions/potential/index.d.cts +23 -0
- package/_cjs/actions/potential/index.js +25 -0
- package/_cjs/actions/referral/decodePage.d.cts +4 -0
- package/_cjs/actions/referral/decodePage.js +13 -0
- package/_cjs/actions/referral/getActiveReferrals.d.cts +9 -0
- package/_cjs/actions/referral/getActiveReferrals.js +14 -0
- package/_cjs/actions/referral/getActiveReferralsCount.d.cts +8 -0
- package/_cjs/actions/referral/getActiveReferralsCount.js +8 -0
- package/_cjs/actions/referral/getBlockProducers.d.cts +7 -0
- package/_cjs/actions/referral/getBlockProducers.js +8 -0
- package/_cjs/actions/referral/getBlockProducersPage.d.cts +8 -0
- package/_cjs/actions/referral/getBlockProducersPage.js +9 -0
- package/_cjs/actions/referral/getPendingReferrals.d.cts +8 -0
- package/_cjs/actions/referral/getPendingReferrals.js +8 -0
- package/_cjs/actions/referral/getPendingReferralsPage.d.cts +9 -0
- package/_cjs/actions/referral/getPendingReferralsPage.js +9 -0
- package/_cjs/actions/referral/getReferrer.d.cts +8 -0
- package/_cjs/actions/referral/getReferrer.js +8 -0
- package/_cjs/actions/referral/index.d.cts +16 -0
- package/_cjs/actions/referral/index.js +17 -0
- package/_cjs/actions/referral/types.d.cts +6 -0
- package/_cjs/actions/referral/types.js +2 -0
- package/_cjs/actions/reputationVoting/getTally.d.cts +9 -0
- package/_cjs/actions/reputationVoting/getTally.js +14 -0
- package/_cjs/actions/reputationVoting/getVotesForAccount.d.cts +9 -0
- package/_cjs/actions/reputationVoting/getVotesForAccount.js +16 -0
- package/_cjs/actions/reputationVoting/getVotingReputation.d.cts +8 -0
- package/_cjs/actions/reputationVoting/getVotingReputation.js +8 -0
- package/_cjs/actions/reputationVoting/index.d.cts +10 -0
- package/_cjs/actions/reputationVoting/index.js +11 -0
- package/_cjs/actions/reputationVoting/isPassing.d.cts +8 -0
- package/_cjs/actions/reputationVoting/isPassing.js +8 -0
- package/_cjs/actions/reputationVoting/types.d.cts +17 -0
- package/_cjs/actions/reputationVoting/types.js +2 -0
- package/_cjs/actions/rewardPool/getCollectionIds.d.cts +7 -0
- package/_cjs/actions/rewardPool/getCollectionIds.js +8 -0
- package/_cjs/actions/rewardPool/getItemIds.d.cts +8 -0
- package/_cjs/actions/rewardPool/getItemIds.js +8 -0
- package/_cjs/actions/rewardPool/getRewardPoolAccount.d.cts +7 -0
- package/_cjs/actions/rewardPool/getRewardPoolAccount.js +8 -0
- package/_cjs/actions/rewardPool/getRewardPoolBalance.d.cts +7 -0
- package/_cjs/actions/rewardPool/getRewardPoolBalance.js +8 -0
- package/_cjs/actions/rewardPool/index.d.cts +9 -0
- package/_cjs/actions/rewardPool/index.js +11 -0
- package/_cjs/actions/submitAndWait.d.cts +65 -0
- package/_cjs/actions/submitAndWait.js +141 -0
- package/_cjs/actions/techCommitteeManager/getSelectedTechCommittee.d.cts +7 -0
- package/_cjs/actions/techCommitteeManager/getSelectedTechCommittee.js +8 -0
- package/_cjs/actions/techCommitteeManager/getTechCommitteeCandidates.d.cts +7 -0
- package/_cjs/actions/techCommitteeManager/getTechCommitteeCandidates.js +8 -0
- package/_cjs/actions/techCommitteeManager/index.d.cts +5 -0
- package/_cjs/actions/techCommitteeManager/index.js +7 -0
- package/_cjs/actions/validatorManager/decodePairs.d.cts +8 -0
- package/_cjs/actions/validatorManager/decodePairs.js +7 -0
- package/_cjs/actions/validatorManager/getActiveValidators.d.cts +7 -0
- package/_cjs/actions/validatorManager/getActiveValidators.js +8 -0
- package/_cjs/actions/validatorManager/getOffenceValidators.d.cts +8 -0
- package/_cjs/actions/validatorManager/getOffenceValidators.js +9 -0
- package/_cjs/actions/validatorManager/getOfflineValidators.d.cts +8 -0
- package/_cjs/actions/validatorManager/getOfflineValidators.js +9 -0
- package/_cjs/actions/validatorManager/getReputationForAccount.d.cts +8 -0
- package/_cjs/actions/validatorManager/getReputationForAccount.js +8 -0
- package/_cjs/actions/validatorManager/getReputationPenaltyFor.d.cts +8 -0
- package/_cjs/actions/validatorManager/getReputationPenaltyFor.js +8 -0
- package/_cjs/actions/validatorManager/getReputations.d.cts +9 -0
- package/_cjs/actions/validatorManager/getReputations.js +9 -0
- package/_cjs/actions/validatorManager/getSelectedValidators.d.cts +7 -0
- package/_cjs/actions/validatorManager/getSelectedValidators.js +8 -0
- package/_cjs/actions/validatorManager/getValidatorCandidates.d.cts +7 -0
- package/_cjs/actions/validatorManager/getValidatorCandidates.js +8 -0
- package/_cjs/actions/validatorManager/index.d.cts +18 -0
- package/_cjs/actions/validatorManager/index.js +19 -0
- package/_cjs/actions/validatorManager/types.d.cts +10 -0
- package/_cjs/actions/validatorManager/types.js +2 -0
- package/_cjs/chains/defineChain.d.cts +18 -0
- package/_cjs/chains/defineChain.js +6 -0
- package/_cjs/chains/definitions.d.cts +65 -0
- package/_cjs/chains/definitions.js +52 -0
- package/_cjs/chains/index.d.cts +4 -0
- package/_cjs/chains/index.js +10 -0
- package/_cjs/client/createClient.d.cts +10 -0
- package/_cjs/client/createClient.js +25 -0
- package/_cjs/client/types.d.cts +7 -0
- package/_cjs/client/types.js +2 -0
- package/_cjs/crypto/claimHash.d.cts +23 -0
- package/_cjs/crypto/claimHash.js +38 -0
- package/_cjs/crypto/ctypeHash.d.cts +16 -0
- package/_cjs/crypto/ctypeHash.js +24 -0
- package/_cjs/crypto/index.d.cts +5 -0
- package/_cjs/crypto/index.js +9 -0
- package/_cjs/ctypes/definitions.d.cts +21 -0
- package/_cjs/ctypes/definitions.js +210 -0
- package/_cjs/ctypes/index.d.cts +4 -0
- package/_cjs/ctypes/index.js +21 -0
- package/_cjs/index.d.cts +22 -0
- package/_cjs/index.js +62 -0
- package/_cjs/package.json +1 -0
- package/_cjs/plugins/activityTracker.d.cts +34 -0
- package/_cjs/plugins/activityTracker.js +18 -0
- package/_cjs/plugins/fractionalNft.d.cts +31 -0
- package/_cjs/plugins/fractionalNft.js +18 -0
- package/_cjs/plugins/handshake.d.cts +32 -0
- package/_cjs/plugins/handshake.js +15 -0
- package/_cjs/plugins/index.d.cts +19 -0
- package/_cjs/plugins/index.js +21 -0
- package/_cjs/plugins/potential.d.cts +29 -0
- package/_cjs/plugins/potential.js +21 -0
- package/_cjs/plugins/referral.d.cts +17 -0
- package/_cjs/plugins/referral.js +17 -0
- package/_cjs/plugins/reputationVoting.d.cts +25 -0
- package/_cjs/plugins/reputationVoting.js +14 -0
- package/_cjs/plugins/rewardPool.d.cts +19 -0
- package/_cjs/plugins/rewardPool.js +14 -0
- package/_cjs/plugins/techCommitteeManager.d.cts +14 -0
- package/_cjs/plugins/techCommitteeManager.js +12 -0
- package/_cjs/plugins/validatorManager.d.cts +30 -0
- package/_cjs/plugins/validatorManager.js +18 -0
- package/_cjs/rpc/bundle.d.cts +4 -0
- package/_cjs/rpc/bundle.js +24 -0
- package/_cjs/rpc/call.d.cts +4 -0
- package/_cjs/rpc/call.js +12 -0
- package/_cjs/rpc/definitions.d.cts +3 -0
- package/_cjs/rpc/definitions.js +398 -0
- package/_cjs/rpc/index.d.cts +4 -0
- package/_cjs/rpc/index.js +10 -0
- package/_cjs/rpc/types.d.cts +3 -0
- package/_cjs/rpc/types.js +48 -0
- package/_cjs/types/index.d.cts +17 -0
- package/_cjs/types/index.js +5 -0
- package/_esm/accounts/index.js +3 -0
- package/_esm/accounts/keyring.js +83 -0
- package/_esm/accounts/substrateSigner.js +43 -0
- package/_esm/accounts/types.js +1 -0
- package/_esm/accounts/wellKnown.js +317 -0
- package/_esm/actions/activityTracker/calculateActivityReputationAtBlock.js +5 -0
- package/_esm/actions/activityTracker/decodeReputationPage.js +10 -0
- package/_esm/actions/activityTracker/getActivityReputation.js +5 -0
- package/_esm/actions/activityTracker/getActivityReputationInfo.js +11 -0
- package/_esm/actions/activityTracker/getActivityTrackerConfig.js +10 -0
- package/_esm/actions/activityTracker/getAllActivityReputations.js +6 -0
- package/_esm/actions/activityTracker/getAllRawActivityReputations.js +6 -0
- package/_esm/actions/activityTracker/getMaxActivityReputation.js +5 -0
- package/_esm/actions/activityTracker/getRawActivityReputation.js +5 -0
- package/_esm/actions/activityTracker/index.js +8 -0
- package/_esm/actions/activityTracker/types.js +1 -0
- package/_esm/actions/attestation/attest.js +9 -0
- package/_esm/actions/attestation/index.js +1 -0
- package/_esm/actions/did/createDid.js +6 -0
- package/_esm/actions/did/index.js +1 -0
- package/_esm/actions/fractionalNft/getCollectionsCount.js +5 -0
- package/_esm/actions/fractionalNft/getItemsCount.js +5 -0
- package/_esm/actions/fractionalNft/getNftInfo.js +9 -0
- package/_esm/actions/fractionalNft/getOwner.js +5 -0
- package/_esm/actions/fractionalNft/getTotalFnftsMinted.js +5 -0
- package/_esm/actions/fractionalNft/getWildcardCollectionId.js +5 -0
- package/_esm/actions/fractionalNft/getWildcardDistributionMap.js +6 -0
- package/_esm/actions/fractionalNft/getWildcardThreshold.js +5 -0
- package/_esm/actions/fractionalNft/index.js +8 -0
- package/_esm/actions/fractionalNft/types.js +1 -0
- package/_esm/actions/handshake/getCompletedHandshakes.js +5 -0
- package/_esm/actions/handshake/getHandshakeCount.js +5 -0
- package/_esm/actions/handshake/getHandshakeStatus.js +5 -0
- package/_esm/actions/handshake/handshakeExists.js +5 -0
- package/_esm/actions/handshake/hasHandshakeCompleted.js +5 -0
- package/_esm/actions/handshake/index.js +5 -0
- package/_esm/actions/handshake/types.js +1 -0
- package/_esm/actions/index.js +12 -0
- package/_esm/actions/potential/getActiveReferralShare.js +5 -0
- package/_esm/actions/potential/getCycleNumber.js +5 -0
- package/_esm/actions/potential/getCyclePotentialMinted.js +5 -0
- package/_esm/actions/potential/getCycleSupply.js +5 -0
- package/_esm/actions/potential/getDefaultActiveReferralShare.js +5 -0
- package/_esm/actions/potential/getMaxSupply.js +5 -0
- package/_esm/actions/potential/getMonthNumber.js +5 -0
- package/_esm/actions/potential/getMonthPotentialMinted.js +5 -0
- package/_esm/actions/potential/getMonthSupply.js +5 -0
- package/_esm/actions/potential/getPotential.js +5 -0
- package/_esm/actions/potential/getTotalPotentialMinted.js +5 -0
- package/_esm/actions/potential/index.js +11 -0
- package/_esm/actions/referral/decodePage.js +10 -0
- package/_esm/actions/referral/getActiveReferrals.js +11 -0
- package/_esm/actions/referral/getActiveReferralsCount.js +5 -0
- package/_esm/actions/referral/getBlockProducers.js +5 -0
- package/_esm/actions/referral/getBlockProducersPage.js +6 -0
- package/_esm/actions/referral/getPendingReferrals.js +5 -0
- package/_esm/actions/referral/getPendingReferralsPage.js +6 -0
- package/_esm/actions/referral/getReferrer.js +5 -0
- package/_esm/actions/referral/index.js +7 -0
- package/_esm/actions/referral/types.js +1 -0
- package/_esm/actions/reputationVoting/getTally.js +11 -0
- package/_esm/actions/reputationVoting/getVotesForAccount.js +13 -0
- package/_esm/actions/reputationVoting/getVotingReputation.js +5 -0
- package/_esm/actions/reputationVoting/index.js +4 -0
- package/_esm/actions/reputationVoting/isPassing.js +5 -0
- package/_esm/actions/reputationVoting/types.js +1 -0
- package/_esm/actions/rewardPool/getCollectionIds.js +5 -0
- package/_esm/actions/rewardPool/getItemIds.js +5 -0
- package/_esm/actions/rewardPool/getRewardPoolAccount.js +5 -0
- package/_esm/actions/rewardPool/getRewardPoolBalance.js +5 -0
- package/_esm/actions/rewardPool/index.js +4 -0
- package/_esm/actions/submitAndWait.js +132 -0
- package/_esm/actions/techCommitteeManager/getSelectedTechCommittee.js +5 -0
- package/_esm/actions/techCommitteeManager/getTechCommitteeCandidates.js +5 -0
- package/_esm/actions/techCommitteeManager/index.js +2 -0
- package/_esm/actions/validatorManager/decodePairs.js +4 -0
- package/_esm/actions/validatorManager/getActiveValidators.js +5 -0
- package/_esm/actions/validatorManager/getOffenceValidators.js +6 -0
- package/_esm/actions/validatorManager/getOfflineValidators.js +6 -0
- package/_esm/actions/validatorManager/getReputationForAccount.js +5 -0
- package/_esm/actions/validatorManager/getReputationPenaltyFor.js +5 -0
- package/_esm/actions/validatorManager/getReputations.js +6 -0
- package/_esm/actions/validatorManager/getSelectedValidators.js +5 -0
- package/_esm/actions/validatorManager/getValidatorCandidates.js +5 -0
- package/_esm/actions/validatorManager/index.js +8 -0
- package/_esm/actions/validatorManager/types.js +1 -0
- package/_esm/chains/defineChain.js +3 -0
- package/_esm/chains/definitions.js +49 -0
- package/_esm/chains/index.js +2 -0
- package/_esm/client/createClient.js +21 -0
- package/_esm/client/types.js +1 -0
- package/_esm/crypto/claimHash.js +34 -0
- package/_esm/crypto/ctypeHash.js +20 -0
- package/_esm/crypto/index.js +2 -0
- package/_esm/ctypes/definitions.js +207 -0
- package/_esm/ctypes/index.js +2 -0
- package/_esm/index.js +12 -0
- package/_esm/package.json +1 -0
- package/_esm/plugins/activityTracker.js +15 -0
- package/_esm/plugins/fractionalNft.js +15 -0
- package/_esm/plugins/handshake.js +12 -0
- package/_esm/plugins/index.js +9 -0
- package/_esm/plugins/potential.js +18 -0
- package/_esm/plugins/referral.js +14 -0
- package/_esm/plugins/reputationVoting.js +11 -0
- package/_esm/plugins/rewardPool.js +11 -0
- package/_esm/plugins/techCommitteeManager.js +9 -0
- package/_esm/plugins/validatorManager.js +15 -0
- package/_esm/rpc/bundle.js +21 -0
- package/_esm/rpc/call.js +9 -0
- package/_esm/rpc/definitions.js +395 -0
- package/_esm/rpc/index.js +3 -0
- package/_esm/rpc/types.js +45 -0
- package/_esm/types/index.js +2 -0
- package/_types/accounts/index.d.ts +7 -0
- package/_types/accounts/index.d.ts.map +1 -0
- package/_types/accounts/keyring.d.ts +28 -0
- package/_types/accounts/keyring.d.ts.map +1 -0
- package/_types/accounts/substrateSigner.d.ts +5 -0
- package/_types/accounts/substrateSigner.d.ts.map +1 -0
- package/_types/accounts/types.d.ts +6 -0
- package/_types/accounts/types.d.ts.map +1 -0
- package/_types/accounts/wellKnown.d.ts +24 -0
- package/_types/accounts/wellKnown.d.ts.map +1 -0
- package/_types/actions/activityTracker/calculateActivityReputationAtBlock.d.ts +9 -0
- package/_types/actions/activityTracker/calculateActivityReputationAtBlock.d.ts.map +1 -0
- package/_types/actions/activityTracker/decodeReputationPage.d.ts +4 -0
- package/_types/actions/activityTracker/decodeReputationPage.d.ts.map +1 -0
- package/_types/actions/activityTracker/getActivityReputation.d.ts +8 -0
- package/_types/actions/activityTracker/getActivityReputation.d.ts.map +1 -0
- package/_types/actions/activityTracker/getActivityReputationInfo.d.ts +9 -0
- package/_types/actions/activityTracker/getActivityReputationInfo.d.ts.map +1 -0
- package/_types/actions/activityTracker/getActivityTrackerConfig.d.ts +8 -0
- package/_types/actions/activityTracker/getActivityTrackerConfig.d.ts.map +1 -0
- package/_types/actions/activityTracker/getAllActivityReputations.d.ts +8 -0
- package/_types/actions/activityTracker/getAllActivityReputations.d.ts.map +1 -0
- package/_types/actions/activityTracker/getAllRawActivityReputations.d.ts +8 -0
- package/_types/actions/activityTracker/getAllRawActivityReputations.d.ts.map +1 -0
- package/_types/actions/activityTracker/getMaxActivityReputation.d.ts +7 -0
- package/_types/actions/activityTracker/getMaxActivityReputation.d.ts.map +1 -0
- package/_types/actions/activityTracker/getRawActivityReputation.d.ts +8 -0
- package/_types/actions/activityTracker/getRawActivityReputation.d.ts.map +1 -0
- package/_types/actions/activityTracker/index.d.ts +18 -0
- package/_types/actions/activityTracker/index.d.ts.map +1 -0
- package/_types/actions/activityTracker/types.d.ts +20 -0
- package/_types/actions/activityTracker/types.d.ts.map +1 -0
- package/_types/actions/attestation/attest.d.ts +16 -0
- package/_types/actions/attestation/attest.d.ts.map +1 -0
- package/_types/actions/attestation/index.d.ts +3 -0
- package/_types/actions/attestation/index.d.ts.map +1 -0
- package/_types/actions/did/createDid.d.ts +10 -0
- package/_types/actions/did/createDid.d.ts.map +1 -0
- package/_types/actions/did/index.d.ts +3 -0
- package/_types/actions/did/index.d.ts.map +1 -0
- package/_types/actions/fractionalNft/getCollectionsCount.d.ts +7 -0
- package/_types/actions/fractionalNft/getCollectionsCount.d.ts.map +1 -0
- package/_types/actions/fractionalNft/getItemsCount.d.ts +8 -0
- package/_types/actions/fractionalNft/getItemsCount.d.ts.map +1 -0
- package/_types/actions/fractionalNft/getNftInfo.d.ts +9 -0
- package/_types/actions/fractionalNft/getNftInfo.d.ts.map +1 -0
- package/_types/actions/fractionalNft/getOwner.d.ts +9 -0
- package/_types/actions/fractionalNft/getOwner.d.ts.map +1 -0
- package/_types/actions/fractionalNft/getTotalFnftsMinted.d.ts +7 -0
- package/_types/actions/fractionalNft/getTotalFnftsMinted.d.ts.map +1 -0
- package/_types/actions/fractionalNft/getWildcardCollectionId.d.ts +7 -0
- package/_types/actions/fractionalNft/getWildcardCollectionId.d.ts.map +1 -0
- package/_types/actions/fractionalNft/getWildcardDistributionMap.d.ts +8 -0
- package/_types/actions/fractionalNft/getWildcardDistributionMap.d.ts.map +1 -0
- package/_types/actions/fractionalNft/getWildcardThreshold.d.ts +7 -0
- package/_types/actions/fractionalNft/getWildcardThreshold.d.ts.map +1 -0
- package/_types/actions/fractionalNft/index.d.ts +18 -0
- package/_types/actions/fractionalNft/index.d.ts.map +1 -0
- package/_types/actions/fractionalNft/types.d.ts +10 -0
- package/_types/actions/fractionalNft/types.d.ts.map +1 -0
- package/_types/actions/handshake/getCompletedHandshakes.d.ts +8 -0
- package/_types/actions/handshake/getCompletedHandshakes.d.ts.map +1 -0
- package/_types/actions/handshake/getHandshakeCount.d.ts +8 -0
- package/_types/actions/handshake/getHandshakeCount.d.ts.map +1 -0
- package/_types/actions/handshake/getHandshakeStatus.d.ts +10 -0
- package/_types/actions/handshake/getHandshakeStatus.d.ts.map +1 -0
- package/_types/actions/handshake/handshakeExists.d.ts +9 -0
- package/_types/actions/handshake/handshakeExists.d.ts.map +1 -0
- package/_types/actions/handshake/hasHandshakeCompleted.d.ts +9 -0
- package/_types/actions/handshake/hasHandshakeCompleted.d.ts.map +1 -0
- package/_types/actions/handshake/index.d.ts +12 -0
- package/_types/actions/handshake/index.d.ts.map +1 -0
- package/_types/actions/handshake/types.d.ts +2 -0
- package/_types/actions/handshake/types.d.ts.map +1 -0
- package/_types/actions/index.d.ts +14 -0
- package/_types/actions/index.d.ts.map +1 -0
- package/_types/actions/potential/getActiveReferralShare.d.ts +8 -0
- package/_types/actions/potential/getActiveReferralShare.d.ts.map +1 -0
- package/_types/actions/potential/getCycleNumber.d.ts +7 -0
- package/_types/actions/potential/getCycleNumber.d.ts.map +1 -0
- package/_types/actions/potential/getCyclePotentialMinted.d.ts +7 -0
- package/_types/actions/potential/getCyclePotentialMinted.d.ts.map +1 -0
- package/_types/actions/potential/getCycleSupply.d.ts +7 -0
- package/_types/actions/potential/getCycleSupply.d.ts.map +1 -0
- package/_types/actions/potential/getDefaultActiveReferralShare.d.ts +7 -0
- package/_types/actions/potential/getDefaultActiveReferralShare.d.ts.map +1 -0
- package/_types/actions/potential/getMaxSupply.d.ts +7 -0
- package/_types/actions/potential/getMaxSupply.d.ts.map +1 -0
- package/_types/actions/potential/getMonthNumber.d.ts +7 -0
- package/_types/actions/potential/getMonthNumber.d.ts.map +1 -0
- package/_types/actions/potential/getMonthPotentialMinted.d.ts +7 -0
- package/_types/actions/potential/getMonthPotentialMinted.d.ts.map +1 -0
- package/_types/actions/potential/getMonthSupply.d.ts +7 -0
- package/_types/actions/potential/getMonthSupply.d.ts.map +1 -0
- package/_types/actions/potential/getPotential.d.ts +8 -0
- package/_types/actions/potential/getPotential.d.ts.map +1 -0
- package/_types/actions/potential/getTotalPotentialMinted.d.ts +7 -0
- package/_types/actions/potential/getTotalPotentialMinted.d.ts.map +1 -0
- package/_types/actions/potential/index.d.ts +23 -0
- package/_types/actions/potential/index.d.ts.map +1 -0
- package/_types/actions/referral/decodePage.d.ts +4 -0
- package/_types/actions/referral/decodePage.d.ts.map +1 -0
- package/_types/actions/referral/getActiveReferrals.d.ts +9 -0
- package/_types/actions/referral/getActiveReferrals.d.ts.map +1 -0
- package/_types/actions/referral/getActiveReferralsCount.d.ts +8 -0
- package/_types/actions/referral/getActiveReferralsCount.d.ts.map +1 -0
- package/_types/actions/referral/getBlockProducers.d.ts +7 -0
- package/_types/actions/referral/getBlockProducers.d.ts.map +1 -0
- package/_types/actions/referral/getBlockProducersPage.d.ts +8 -0
- package/_types/actions/referral/getBlockProducersPage.d.ts.map +1 -0
- package/_types/actions/referral/getPendingReferrals.d.ts +8 -0
- package/_types/actions/referral/getPendingReferrals.d.ts.map +1 -0
- package/_types/actions/referral/getPendingReferralsPage.d.ts +9 -0
- package/_types/actions/referral/getPendingReferralsPage.d.ts.map +1 -0
- package/_types/actions/referral/getReferrer.d.ts +8 -0
- package/_types/actions/referral/getReferrer.d.ts.map +1 -0
- package/_types/actions/referral/index.d.ts +16 -0
- package/_types/actions/referral/index.d.ts.map +1 -0
- package/_types/actions/referral/types.d.ts +6 -0
- package/_types/actions/referral/types.d.ts.map +1 -0
- package/_types/actions/reputationVoting/getTally.d.ts +9 -0
- package/_types/actions/reputationVoting/getTally.d.ts.map +1 -0
- package/_types/actions/reputationVoting/getVotesForAccount.d.ts +9 -0
- package/_types/actions/reputationVoting/getVotesForAccount.d.ts.map +1 -0
- package/_types/actions/reputationVoting/getVotingReputation.d.ts +8 -0
- package/_types/actions/reputationVoting/getVotingReputation.d.ts.map +1 -0
- package/_types/actions/reputationVoting/index.d.ts +10 -0
- package/_types/actions/reputationVoting/index.d.ts.map +1 -0
- package/_types/actions/reputationVoting/isPassing.d.ts +8 -0
- package/_types/actions/reputationVoting/isPassing.d.ts.map +1 -0
- package/_types/actions/reputationVoting/types.d.ts +17 -0
- package/_types/actions/reputationVoting/types.d.ts.map +1 -0
- package/_types/actions/rewardPool/getCollectionIds.d.ts +7 -0
- package/_types/actions/rewardPool/getCollectionIds.d.ts.map +1 -0
- package/_types/actions/rewardPool/getItemIds.d.ts +8 -0
- package/_types/actions/rewardPool/getItemIds.d.ts.map +1 -0
- package/_types/actions/rewardPool/getRewardPoolAccount.d.ts +7 -0
- package/_types/actions/rewardPool/getRewardPoolAccount.d.ts.map +1 -0
- package/_types/actions/rewardPool/getRewardPoolBalance.d.ts +7 -0
- package/_types/actions/rewardPool/getRewardPoolBalance.d.ts.map +1 -0
- package/_types/actions/rewardPool/index.d.ts +9 -0
- package/_types/actions/rewardPool/index.d.ts.map +1 -0
- package/_types/actions/submitAndWait.d.ts +65 -0
- package/_types/actions/submitAndWait.d.ts.map +1 -0
- package/_types/actions/techCommitteeManager/getSelectedTechCommittee.d.ts +7 -0
- package/_types/actions/techCommitteeManager/getSelectedTechCommittee.d.ts.map +1 -0
- package/_types/actions/techCommitteeManager/getTechCommitteeCandidates.d.ts +7 -0
- package/_types/actions/techCommitteeManager/getTechCommitteeCandidates.d.ts.map +1 -0
- package/_types/actions/techCommitteeManager/index.d.ts +5 -0
- package/_types/actions/techCommitteeManager/index.d.ts.map +1 -0
- package/_types/actions/validatorManager/decodePairs.d.ts +8 -0
- package/_types/actions/validatorManager/decodePairs.d.ts.map +1 -0
- package/_types/actions/validatorManager/getActiveValidators.d.ts +7 -0
- package/_types/actions/validatorManager/getActiveValidators.d.ts.map +1 -0
- package/_types/actions/validatorManager/getOffenceValidators.d.ts +8 -0
- package/_types/actions/validatorManager/getOffenceValidators.d.ts.map +1 -0
- package/_types/actions/validatorManager/getOfflineValidators.d.ts +8 -0
- package/_types/actions/validatorManager/getOfflineValidators.d.ts.map +1 -0
- package/_types/actions/validatorManager/getReputationForAccount.d.ts +8 -0
- package/_types/actions/validatorManager/getReputationForAccount.d.ts.map +1 -0
- package/_types/actions/validatorManager/getReputationPenaltyFor.d.ts +8 -0
- package/_types/actions/validatorManager/getReputationPenaltyFor.d.ts.map +1 -0
- package/_types/actions/validatorManager/getReputations.d.ts +9 -0
- package/_types/actions/validatorManager/getReputations.d.ts.map +1 -0
- package/_types/actions/validatorManager/getSelectedValidators.d.ts +7 -0
- package/_types/actions/validatorManager/getSelectedValidators.d.ts.map +1 -0
- package/_types/actions/validatorManager/getValidatorCandidates.d.ts +7 -0
- package/_types/actions/validatorManager/getValidatorCandidates.d.ts.map +1 -0
- package/_types/actions/validatorManager/index.d.ts +18 -0
- package/_types/actions/validatorManager/index.d.ts.map +1 -0
- package/_types/actions/validatorManager/types.d.ts +10 -0
- package/_types/actions/validatorManager/types.d.ts.map +1 -0
- package/_types/chains/defineChain.d.ts +18 -0
- package/_types/chains/defineChain.d.ts.map +1 -0
- package/_types/chains/definitions.d.ts +65 -0
- package/_types/chains/definitions.d.ts.map +1 -0
- package/_types/chains/index.d.ts +4 -0
- package/_types/chains/index.d.ts.map +1 -0
- package/_types/client/createClient.d.ts +10 -0
- package/_types/client/createClient.d.ts.map +1 -0
- package/_types/client/types.d.ts +7 -0
- package/_types/client/types.d.ts.map +1 -0
- package/_types/crypto/claimHash.d.ts +23 -0
- package/_types/crypto/claimHash.d.ts.map +1 -0
- package/_types/crypto/ctypeHash.d.ts +16 -0
- package/_types/crypto/ctypeHash.d.ts.map +1 -0
- package/_types/crypto/index.d.ts +5 -0
- package/_types/crypto/index.d.ts.map +1 -0
- package/_types/ctypes/definitions.d.ts +21 -0
- package/_types/ctypes/definitions.d.ts.map +1 -0
- package/_types/ctypes/index.d.ts +4 -0
- package/_types/ctypes/index.d.ts.map +1 -0
- package/_types/index.d.ts +22 -0
- package/_types/index.d.ts.map +1 -0
- package/_types/plugins/activityTracker.d.ts +34 -0
- package/_types/plugins/activityTracker.d.ts.map +1 -0
- package/_types/plugins/fractionalNft.d.ts +31 -0
- package/_types/plugins/fractionalNft.d.ts.map +1 -0
- package/_types/plugins/handshake.d.ts +32 -0
- package/_types/plugins/handshake.d.ts.map +1 -0
- package/_types/plugins/index.d.ts +19 -0
- package/_types/plugins/index.d.ts.map +1 -0
- package/_types/plugins/potential.d.ts +29 -0
- package/_types/plugins/potential.d.ts.map +1 -0
- package/_types/plugins/referral.d.ts +17 -0
- package/_types/plugins/referral.d.ts.map +1 -0
- package/_types/plugins/reputationVoting.d.ts +25 -0
- package/_types/plugins/reputationVoting.d.ts.map +1 -0
- package/_types/plugins/rewardPool.d.ts +19 -0
- package/_types/plugins/rewardPool.d.ts.map +1 -0
- package/_types/plugins/techCommitteeManager.d.ts +14 -0
- package/_types/plugins/techCommitteeManager.d.ts.map +1 -0
- package/_types/plugins/validatorManager.d.ts +30 -0
- package/_types/plugins/validatorManager.d.ts.map +1 -0
- package/_types/rpc/bundle.d.ts +4 -0
- package/_types/rpc/bundle.d.ts.map +1 -0
- package/_types/rpc/call.d.ts +4 -0
- package/_types/rpc/call.d.ts.map +1 -0
- package/_types/rpc/definitions.d.ts +3 -0
- package/_types/rpc/definitions.d.ts.map +1 -0
- package/_types/rpc/index.d.ts +4 -0
- package/_types/rpc/index.d.ts.map +1 -0
- package/_types/rpc/types.d.ts +3 -0
- package/_types/rpc/types.d.ts.map +1 -0
- package/_types/types/index.d.ts +17 -0
- package/_types/types/index.d.ts.map +1 -0
- package/package.json +173 -4
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotIncludedError = exports.SubmitTimeoutError = exports.SubscriptionFailedError = exports.DispatchFailedError = void 0;
|
|
4
|
+
exports.isDispatchFailure = isDispatchFailure;
|
|
5
|
+
exports.submitAndWait = submitAndWait;
|
|
6
|
+
/**
|
|
7
|
+
* A call the runtime rejected, carrying the pallet and variant that rejected it.
|
|
8
|
+
*
|
|
9
|
+
* The names are what callers branch on — `ctype.AlreadyExists` is an idempotent no-op, while
|
|
10
|
+
* another error from the same call is not. Parsing that back out of a message string is the
|
|
11
|
+
* failure mode this type exists to prevent, so the names stay structured.
|
|
12
|
+
*/
|
|
13
|
+
class DispatchFailedError extends Error {
|
|
14
|
+
section;
|
|
15
|
+
method;
|
|
16
|
+
docs;
|
|
17
|
+
constructor(section, method, docs = []) {
|
|
18
|
+
const detail = docs.length > 0 ? `: ${docs.join(' ').trim()}` : '';
|
|
19
|
+
super(`${section}.${method}${detail}`);
|
|
20
|
+
this.name = 'DispatchFailedError';
|
|
21
|
+
this.section = section;
|
|
22
|
+
this.method = method;
|
|
23
|
+
this.docs = docs;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.DispatchFailedError = DispatchFailedError;
|
|
27
|
+
/** Narrows an unknown error to one specific runtime rejection. */
|
|
28
|
+
function isDispatchFailure(error, section, method) {
|
|
29
|
+
return (error instanceof DispatchFailedError && error.section === section && error.method === method);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The provider abandoned the status subscription — a dropped socket, say.
|
|
33
|
+
*
|
|
34
|
+
* Distinct from the extrinsic being rejected: nothing is known about whether it executed, so a
|
|
35
|
+
* caller that retries has to treat the submission as possibly in flight.
|
|
36
|
+
*/
|
|
37
|
+
class SubscriptionFailedError extends Error {
|
|
38
|
+
internalError;
|
|
39
|
+
constructor(internalError) {
|
|
40
|
+
super(internalError instanceof Error ? internalError.message : String(internalError));
|
|
41
|
+
this.name = 'SubscriptionFailedError';
|
|
42
|
+
this.internalError = internalError;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.SubscriptionFailedError = SubscriptionFailedError;
|
|
46
|
+
/** No terminal status arrived within the budget. The extrinsic may still be in flight. */
|
|
47
|
+
class SubmitTimeoutError extends Error {
|
|
48
|
+
timeoutMs;
|
|
49
|
+
constructor(timeoutMs) {
|
|
50
|
+
super(`transaction was not included within ${timeoutMs}ms`);
|
|
51
|
+
this.name = 'SubmitTimeoutError';
|
|
52
|
+
this.timeoutMs = timeoutMs;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.SubmitTimeoutError = SubmitTimeoutError;
|
|
56
|
+
/**
|
|
57
|
+
* The extrinsic reached a status it cannot recover from — dropped, invalid, usurped, or out of
|
|
58
|
+
* time for finality. It will never be included, so a caller may resubmit.
|
|
59
|
+
*/
|
|
60
|
+
class NotIncludedError extends Error {
|
|
61
|
+
status;
|
|
62
|
+
txHash;
|
|
63
|
+
constructor(status, txHash) {
|
|
64
|
+
super(`transaction ${txHash} will not be included: ${status}`);
|
|
65
|
+
this.name = 'NotIncludedError';
|
|
66
|
+
this.status = status;
|
|
67
|
+
this.txHash = txHash;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.NotIncludedError = NotIncludedError;
|
|
71
|
+
async function submitAndWait(client, params) {
|
|
72
|
+
const { extrinsic, signer, options } = params;
|
|
73
|
+
const timeoutMs = params.timeoutMs ?? 120_000;
|
|
74
|
+
const waitFor = params.waitFor ?? 'inBlock';
|
|
75
|
+
return new Promise((resolve, reject) => {
|
|
76
|
+
let unsubscribe;
|
|
77
|
+
let settled = false;
|
|
78
|
+
const settle = () => {
|
|
79
|
+
settled = true;
|
|
80
|
+
clearTimeout(timer);
|
|
81
|
+
unsubscribe?.();
|
|
82
|
+
};
|
|
83
|
+
const timer = setTimeout(() => {
|
|
84
|
+
settle();
|
|
85
|
+
reject(new SubmitTimeoutError(timeoutMs));
|
|
86
|
+
}, timeoutMs);
|
|
87
|
+
const handle = (result) => {
|
|
88
|
+
const { status, dispatchError, internalError, txHash, events } = result;
|
|
89
|
+
// The provider gives up on the subscription — a dropped socket, say. No further status
|
|
90
|
+
// will arrive, so waiting for one would only burn the timeout.
|
|
91
|
+
if (internalError) {
|
|
92
|
+
settle();
|
|
93
|
+
reject(new SubscriptionFailedError(internalError));
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
if (status.isDropped || status.isInvalid || status.isUsurped || status.isFinalityTimeout) {
|
|
97
|
+
settle();
|
|
98
|
+
reject(new NotIncludedError(status.type, txHash.toHex()));
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
// A dispatch error is reported with the including block, so it is read before the status
|
|
102
|
+
// gate — waiting for finalization would otherwise sit on a failure already known.
|
|
103
|
+
if (dispatchError) {
|
|
104
|
+
settle();
|
|
105
|
+
if (dispatchError.isModule) {
|
|
106
|
+
const decoded = client.api.registry.findMetaError(dispatchError.asModule);
|
|
107
|
+
reject(new DispatchFailedError(decoded.section, decoded.name, decoded.docs.map(String)));
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
reject(new DispatchFailedError('runtime', dispatchError.type));
|
|
111
|
+
}
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
const reached = waitFor === 'finalized' ? status.isFinalized : status.isInBlock;
|
|
115
|
+
if (!reached)
|
|
116
|
+
return;
|
|
117
|
+
settle();
|
|
118
|
+
const interrupted = events.find(({ event }) => client.api.events['utility']?.['BatchInterrupted']?.is(event));
|
|
119
|
+
if (interrupted) {
|
|
120
|
+
reject(new Error(`utility.BatchInterrupted: a call in the batch failed (${interrupted.event.data.toString()})`));
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
resolve({
|
|
124
|
+
blockHash: (status.isFinalized ? status.asFinalized : status.asInBlock).toHex(),
|
|
125
|
+
txHash: txHash.toHex(),
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
const send = options
|
|
129
|
+
? extrinsic.signAndSend(signer, options, handle)
|
|
130
|
+
: extrinsic.signAndSend(signer, handle);
|
|
131
|
+
send.then((unsub) => {
|
|
132
|
+
unsubscribe = unsub;
|
|
133
|
+
// The callback can reach a terminal status before this assignment lands.
|
|
134
|
+
if (settled)
|
|
135
|
+
unsub();
|
|
136
|
+
}, (error) => {
|
|
137
|
+
settle();
|
|
138
|
+
reject(error);
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Client } from '../../client/types.cjs';
|
|
2
|
+
import type { Address, BlockHash } from '../../types/index.cjs';
|
|
3
|
+
export interface GetSelectedTechCommitteeParameters {
|
|
4
|
+
at?: BlockHash;
|
|
5
|
+
}
|
|
6
|
+
export declare function getSelectedTechCommittee(client: Client, { at }?: GetSelectedTechCommitteeParameters): Promise<Address[]>;
|
|
7
|
+
//# sourceMappingURL=getSelectedTechCommittee.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSelectedTechCommittee = getSelectedTechCommittee;
|
|
4
|
+
const call_js_1 = require("../../rpc/call.js");
|
|
5
|
+
async function getSelectedTechCommittee(client, { at } = {}) {
|
|
6
|
+
const result = await (0, call_js_1.callRpc)(client, 'techCommitteeManager', 'selectedCandidates', at);
|
|
7
|
+
return result.map((account) => account.toString());
|
|
8
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Client } from '../../client/types.cjs';
|
|
2
|
+
import type { Address, BlockHash } from '../../types/index.cjs';
|
|
3
|
+
export interface GetTechCommitteeCandidatesParameters {
|
|
4
|
+
at?: BlockHash;
|
|
5
|
+
}
|
|
6
|
+
export declare function getTechCommitteeCandidates(client: Client, { at }?: GetTechCommitteeCandidatesParameters): Promise<Address[]>;
|
|
7
|
+
//# sourceMappingURL=getTechCommitteeCandidates.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTechCommitteeCandidates = getTechCommitteeCandidates;
|
|
4
|
+
const call_js_1 = require("../../rpc/call.js");
|
|
5
|
+
async function getTechCommitteeCandidates(client, { at } = {}) {
|
|
6
|
+
const result = await (0, call_js_1.callRpc)(client, 'techCommitteeManager', 'candidates', at);
|
|
7
|
+
return result.map((account) => account.toString());
|
|
8
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { getSelectedTechCommittee } from './getSelectedTechCommittee.cjs';
|
|
2
|
+
export { getTechCommitteeCandidates } from './getTechCommitteeCandidates.cjs';
|
|
3
|
+
export type { GetSelectedTechCommitteeParameters } from './getSelectedTechCommittee.cjs';
|
|
4
|
+
export type { GetTechCommitteeCandidatesParameters } from './getTechCommitteeCandidates.cjs';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTechCommitteeCandidates = exports.getSelectedTechCommittee = void 0;
|
|
4
|
+
var getSelectedTechCommittee_js_1 = require("./getSelectedTechCommittee.js");
|
|
5
|
+
Object.defineProperty(exports, "getSelectedTechCommittee", { enumerable: true, get: function () { return getSelectedTechCommittee_js_1.getSelectedTechCommittee; } });
|
|
6
|
+
var getTechCommitteeCandidates_js_1 = require("./getTechCommitteeCandidates.js");
|
|
7
|
+
Object.defineProperty(exports, "getTechCommitteeCandidates", { enumerable: true, get: function () { return getTechCommitteeCandidates_js_1.getTechCommitteeCandidates; } });
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Codec } from '@polkadot/types/types';
|
|
2
|
+
import type { Address } from '../../types/index.cjs';
|
|
3
|
+
export declare function decodePairs<Key extends string, Value extends string>(raw: Codec, keyName: Key, valueName: Value): Array<{
|
|
4
|
+
[K in Key]: Address;
|
|
5
|
+
} & {
|
|
6
|
+
[V in Value]: number;
|
|
7
|
+
}>;
|
|
8
|
+
//# sourceMappingURL=decodePairs.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.decodePairs = decodePairs;
|
|
4
|
+
function decodePairs(raw, keyName, valueName) {
|
|
5
|
+
const pairs = raw.toJSON();
|
|
6
|
+
return pairs.map(([account, value]) => ({ [keyName]: account, [valueName]: value }));
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Client } from '../../client/types.cjs';
|
|
2
|
+
import type { Address, BlockHash } from '../../types/index.cjs';
|
|
3
|
+
export interface GetActiveValidatorsParameters {
|
|
4
|
+
at?: BlockHash;
|
|
5
|
+
}
|
|
6
|
+
export declare function getActiveValidators(client: Client, { at }?: GetActiveValidatorsParameters): Promise<Address[]>;
|
|
7
|
+
//# sourceMappingURL=getActiveValidators.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getActiveValidators = getActiveValidators;
|
|
4
|
+
const call_js_1 = require("../../rpc/call.js");
|
|
5
|
+
async function getActiveValidators(client, { at } = {}) {
|
|
6
|
+
const result = await (0, call_js_1.callRpc)(client, 'validatorManager', 'activeValidators', at);
|
|
7
|
+
return result.map((account) => account.toString());
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Client } from '../../client/types.cjs';
|
|
2
|
+
import type { BlockHash } from '../../types/index.cjs';
|
|
3
|
+
import type { ValidatorSession } from './types.cjs';
|
|
4
|
+
export interface GetOffenceValidatorsParameters {
|
|
5
|
+
at?: BlockHash;
|
|
6
|
+
}
|
|
7
|
+
export declare function getOffenceValidators(client: Client, { at }?: GetOffenceValidatorsParameters): Promise<ValidatorSession[]>;
|
|
8
|
+
//# sourceMappingURL=getOffenceValidators.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getOffenceValidators = getOffenceValidators;
|
|
4
|
+
const call_js_1 = require("../../rpc/call.js");
|
|
5
|
+
const decodePairs_js_1 = require("./decodePairs.js");
|
|
6
|
+
async function getOffenceValidators(client, { at } = {}) {
|
|
7
|
+
const result = await (0, call_js_1.callRpc)(client, 'validatorManager', 'offenceValidators', at);
|
|
8
|
+
return (0, decodePairs_js_1.decodePairs)(result, 'account', 'session');
|
|
9
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Client } from '../../client/types.cjs';
|
|
2
|
+
import type { BlockHash } from '../../types/index.cjs';
|
|
3
|
+
import type { ValidatorSession } from './types.cjs';
|
|
4
|
+
export interface GetOfflineValidatorsParameters {
|
|
5
|
+
at?: BlockHash;
|
|
6
|
+
}
|
|
7
|
+
export declare function getOfflineValidators(client: Client, { at }?: GetOfflineValidatorsParameters): Promise<ValidatorSession[]>;
|
|
8
|
+
//# sourceMappingURL=getOfflineValidators.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getOfflineValidators = getOfflineValidators;
|
|
4
|
+
const call_js_1 = require("../../rpc/call.js");
|
|
5
|
+
const decodePairs_js_1 = require("./decodePairs.js");
|
|
6
|
+
async function getOfflineValidators(client, { at } = {}) {
|
|
7
|
+
const result = await (0, call_js_1.callRpc)(client, 'validatorManager', 'offlineValidators', at);
|
|
8
|
+
return (0, decodePairs_js_1.decodePairs)(result, 'account', 'session');
|
|
9
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Client } from '../../client/types.cjs';
|
|
2
|
+
import type { Address, BlockHash } from '../../types/index.cjs';
|
|
3
|
+
export interface GetReputationForAccountParameters {
|
|
4
|
+
account: Address;
|
|
5
|
+
at?: BlockHash;
|
|
6
|
+
}
|
|
7
|
+
export declare function getReputationForAccount(client: Client, { account, at }: GetReputationForAccountParameters): Promise<number>;
|
|
8
|
+
//# sourceMappingURL=getReputationForAccount.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getReputationForAccount = getReputationForAccount;
|
|
4
|
+
const call_js_1 = require("../../rpc/call.js");
|
|
5
|
+
async function getReputationForAccount(client, { account, at }) {
|
|
6
|
+
const result = await (0, call_js_1.callRpc)(client, 'validatorManager', 'getReputationForAccount', account, at);
|
|
7
|
+
return result.toNumber();
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Client } from '../../client/types.cjs';
|
|
2
|
+
import type { Address, BlockHash } from '../../types/index.cjs';
|
|
3
|
+
export interface GetReputationPenaltyForParameters {
|
|
4
|
+
account: Address;
|
|
5
|
+
at?: BlockHash;
|
|
6
|
+
}
|
|
7
|
+
export declare function getReputationPenaltyFor(client: Client, { account, at }: GetReputationPenaltyForParameters): Promise<number>;
|
|
8
|
+
//# sourceMappingURL=getReputationPenaltyFor.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getReputationPenaltyFor = getReputationPenaltyFor;
|
|
4
|
+
const call_js_1 = require("../../rpc/call.js");
|
|
5
|
+
async function getReputationPenaltyFor(client, { account, at }) {
|
|
6
|
+
const result = await (0, call_js_1.callRpc)(client, 'validatorManager', 'reputationPenaltyFor', account, at);
|
|
7
|
+
return result.toNumber();
|
|
8
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Client } from '../../client/types.cjs';
|
|
2
|
+
import type { Address, BlockHash } from '../../types/index.cjs';
|
|
3
|
+
import type { AccountReputation } from './types.cjs';
|
|
4
|
+
export interface GetReputationsParameters {
|
|
5
|
+
accounts: Address[];
|
|
6
|
+
at?: BlockHash;
|
|
7
|
+
}
|
|
8
|
+
export declare function getReputations(client: Client, { accounts, at }: GetReputationsParameters): Promise<AccountReputation[]>;
|
|
9
|
+
//# sourceMappingURL=getReputations.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getReputations = getReputations;
|
|
4
|
+
const call_js_1 = require("../../rpc/call.js");
|
|
5
|
+
const decodePairs_js_1 = require("./decodePairs.js");
|
|
6
|
+
async function getReputations(client, { accounts, at }) {
|
|
7
|
+
const result = await (0, call_js_1.callRpc)(client, 'validatorManager', 'getReputations', accounts, at);
|
|
8
|
+
return (0, decodePairs_js_1.decodePairs)(result, 'account', 'reputation');
|
|
9
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Client } from '../../client/types.cjs';
|
|
2
|
+
import type { Address, BlockHash } from '../../types/index.cjs';
|
|
3
|
+
export interface GetSelectedValidatorsParameters {
|
|
4
|
+
at?: BlockHash;
|
|
5
|
+
}
|
|
6
|
+
export declare function getSelectedValidators(client: Client, { at }?: GetSelectedValidatorsParameters): Promise<Address[]>;
|
|
7
|
+
//# sourceMappingURL=getSelectedValidators.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSelectedValidators = getSelectedValidators;
|
|
4
|
+
const call_js_1 = require("../../rpc/call.js");
|
|
5
|
+
async function getSelectedValidators(client, { at } = {}) {
|
|
6
|
+
const result = await (0, call_js_1.callRpc)(client, 'validatorManager', 'selectedValidators', at);
|
|
7
|
+
return result.map((account) => account.toString());
|
|
8
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Client } from '../../client/types.cjs';
|
|
2
|
+
import type { Address, BlockHash } from '../../types/index.cjs';
|
|
3
|
+
export interface GetValidatorCandidatesParameters {
|
|
4
|
+
at?: BlockHash;
|
|
5
|
+
}
|
|
6
|
+
export declare function getValidatorCandidates(client: Client, { at }?: GetValidatorCandidatesParameters): Promise<Address[]>;
|
|
7
|
+
//# sourceMappingURL=getValidatorCandidates.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getValidatorCandidates = getValidatorCandidates;
|
|
4
|
+
const call_js_1 = require("../../rpc/call.js");
|
|
5
|
+
async function getValidatorCandidates(client, { at } = {}) {
|
|
6
|
+
const result = await (0, call_js_1.callRpc)(client, 'validatorManager', 'validatorCandidates', at);
|
|
7
|
+
return result.map((account) => account.toString());
|
|
8
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { getActiveValidators } from './getActiveValidators.cjs';
|
|
2
|
+
export { getOffenceValidators } from './getOffenceValidators.cjs';
|
|
3
|
+
export { getOfflineValidators } from './getOfflineValidators.cjs';
|
|
4
|
+
export { getReputationForAccount } from './getReputationForAccount.cjs';
|
|
5
|
+
export { getReputationPenaltyFor } from './getReputationPenaltyFor.cjs';
|
|
6
|
+
export { getReputations } from './getReputations.cjs';
|
|
7
|
+
export { getSelectedValidators } from './getSelectedValidators.cjs';
|
|
8
|
+
export { getValidatorCandidates } from './getValidatorCandidates.cjs';
|
|
9
|
+
export type { AccountReputation, ValidatorSession } from './types.cjs';
|
|
10
|
+
export type { GetActiveValidatorsParameters } from './getActiveValidators.cjs';
|
|
11
|
+
export type { GetOffenceValidatorsParameters } from './getOffenceValidators.cjs';
|
|
12
|
+
export type { GetOfflineValidatorsParameters } from './getOfflineValidators.cjs';
|
|
13
|
+
export type { GetReputationForAccountParameters } from './getReputationForAccount.cjs';
|
|
14
|
+
export type { GetReputationPenaltyForParameters } from './getReputationPenaltyFor.cjs';
|
|
15
|
+
export type { GetReputationsParameters } from './getReputations.cjs';
|
|
16
|
+
export type { GetSelectedValidatorsParameters } from './getSelectedValidators.cjs';
|
|
17
|
+
export type { GetValidatorCandidatesParameters } from './getValidatorCandidates.cjs';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getValidatorCandidates = exports.getSelectedValidators = exports.getReputations = exports.getReputationPenaltyFor = exports.getReputationForAccount = exports.getOfflineValidators = exports.getOffenceValidators = exports.getActiveValidators = void 0;
|
|
4
|
+
var getActiveValidators_js_1 = require("./getActiveValidators.js");
|
|
5
|
+
Object.defineProperty(exports, "getActiveValidators", { enumerable: true, get: function () { return getActiveValidators_js_1.getActiveValidators; } });
|
|
6
|
+
var getOffenceValidators_js_1 = require("./getOffenceValidators.js");
|
|
7
|
+
Object.defineProperty(exports, "getOffenceValidators", { enumerable: true, get: function () { return getOffenceValidators_js_1.getOffenceValidators; } });
|
|
8
|
+
var getOfflineValidators_js_1 = require("./getOfflineValidators.js");
|
|
9
|
+
Object.defineProperty(exports, "getOfflineValidators", { enumerable: true, get: function () { return getOfflineValidators_js_1.getOfflineValidators; } });
|
|
10
|
+
var getReputationForAccount_js_1 = require("./getReputationForAccount.js");
|
|
11
|
+
Object.defineProperty(exports, "getReputationForAccount", { enumerable: true, get: function () { return getReputationForAccount_js_1.getReputationForAccount; } });
|
|
12
|
+
var getReputationPenaltyFor_js_1 = require("./getReputationPenaltyFor.js");
|
|
13
|
+
Object.defineProperty(exports, "getReputationPenaltyFor", { enumerable: true, get: function () { return getReputationPenaltyFor_js_1.getReputationPenaltyFor; } });
|
|
14
|
+
var getReputations_js_1 = require("./getReputations.js");
|
|
15
|
+
Object.defineProperty(exports, "getReputations", { enumerable: true, get: function () { return getReputations_js_1.getReputations; } });
|
|
16
|
+
var getSelectedValidators_js_1 = require("./getSelectedValidators.js");
|
|
17
|
+
Object.defineProperty(exports, "getSelectedValidators", { enumerable: true, get: function () { return getSelectedValidators_js_1.getSelectedValidators; } });
|
|
18
|
+
var getValidatorCandidates_js_1 = require("./getValidatorCandidates.js");
|
|
19
|
+
Object.defineProperty(exports, "getValidatorCandidates", { enumerable: true, get: function () { return getValidatorCandidates_js_1.getValidatorCandidates; } });
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface ChainDefinition {
|
|
2
|
+
id: number;
|
|
3
|
+
name: string;
|
|
4
|
+
nativeCurrency: {
|
|
5
|
+
decimals: number;
|
|
6
|
+
name: string;
|
|
7
|
+
symbol: string;
|
|
8
|
+
};
|
|
9
|
+
rpcUrls: {
|
|
10
|
+
default: {
|
|
11
|
+
http: readonly string[];
|
|
12
|
+
webSocket?: readonly string[];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
testnet?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare function defineChain<const chain extends ChainDefinition>(chain: chain): chain;
|
|
18
|
+
//# sourceMappingURL=defineChain.d.ts.map
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export declare const totochain: {
|
|
2
|
+
readonly id: 33000;
|
|
3
|
+
readonly name: "Totochain";
|
|
4
|
+
readonly nativeCurrency: {
|
|
5
|
+
readonly decimals: 18;
|
|
6
|
+
readonly name: "Toto";
|
|
7
|
+
readonly symbol: "TOTO";
|
|
8
|
+
};
|
|
9
|
+
readonly rpcUrls: {
|
|
10
|
+
readonly default: {
|
|
11
|
+
readonly http: readonly ["https://rpc.totochain.io"];
|
|
12
|
+
readonly webSocket: readonly ["wss://rpc.totochain.io"];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
readonly testnet: false;
|
|
16
|
+
};
|
|
17
|
+
export declare const totochainTestnet: {
|
|
18
|
+
readonly id: 33001;
|
|
19
|
+
readonly name: "Totochain Testnet";
|
|
20
|
+
readonly nativeCurrency: {
|
|
21
|
+
readonly decimals: 18;
|
|
22
|
+
readonly name: "Test Toto";
|
|
23
|
+
readonly symbol: "TEST";
|
|
24
|
+
};
|
|
25
|
+
readonly rpcUrls: {
|
|
26
|
+
readonly default: {
|
|
27
|
+
readonly http: readonly ["https://rpc.testnet.totochain.io"];
|
|
28
|
+
readonly webSocket: readonly ["wss://rpc.testnet.totochain.io"];
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
readonly testnet: true;
|
|
32
|
+
};
|
|
33
|
+
export declare const totochainLocal: {
|
|
34
|
+
readonly id: 33002;
|
|
35
|
+
readonly name: "Totochain Local";
|
|
36
|
+
readonly nativeCurrency: {
|
|
37
|
+
readonly decimals: 18;
|
|
38
|
+
readonly name: "Test Toto";
|
|
39
|
+
readonly symbol: "TEST";
|
|
40
|
+
};
|
|
41
|
+
readonly rpcUrls: {
|
|
42
|
+
readonly default: {
|
|
43
|
+
readonly http: readonly ["http://127.0.0.1:9944"];
|
|
44
|
+
readonly webSocket: readonly ["ws://127.0.0.1:9944"];
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
readonly testnet: true;
|
|
48
|
+
};
|
|
49
|
+
export declare const totochainDev: {
|
|
50
|
+
readonly id: 33003;
|
|
51
|
+
readonly name: "Totochain Dev";
|
|
52
|
+
readonly nativeCurrency: {
|
|
53
|
+
readonly decimals: 18;
|
|
54
|
+
readonly name: "Test Toto";
|
|
55
|
+
readonly symbol: "TEST";
|
|
56
|
+
};
|
|
57
|
+
readonly rpcUrls: {
|
|
58
|
+
readonly default: {
|
|
59
|
+
readonly http: readonly ["http://127.0.0.1:9944"];
|
|
60
|
+
readonly webSocket: readonly ["ws://127.0.0.1:9944"];
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
readonly testnet: true;
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=definitions.d.ts.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.totochainDev = exports.totochainLocal = exports.totochainTestnet = exports.totochain = void 0;
|
|
4
|
+
const defineChain_js_1 = require("./defineChain.js");
|
|
5
|
+
exports.totochain = (0, defineChain_js_1.defineChain)({
|
|
6
|
+
id: 33000,
|
|
7
|
+
name: 'Totochain',
|
|
8
|
+
nativeCurrency: { decimals: 18, name: 'Toto', symbol: 'TOTO' },
|
|
9
|
+
rpcUrls: {
|
|
10
|
+
default: {
|
|
11
|
+
http: ['https://rpc.totochain.io'],
|
|
12
|
+
webSocket: ['wss://rpc.totochain.io'],
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
testnet: false,
|
|
16
|
+
});
|
|
17
|
+
exports.totochainTestnet = (0, defineChain_js_1.defineChain)({
|
|
18
|
+
id: 33001,
|
|
19
|
+
name: 'Totochain Testnet',
|
|
20
|
+
nativeCurrency: { decimals: 18, name: 'Test Toto', symbol: 'TEST' },
|
|
21
|
+
rpcUrls: {
|
|
22
|
+
default: {
|
|
23
|
+
http: ['https://rpc.testnet.totochain.io'],
|
|
24
|
+
webSocket: ['wss://rpc.testnet.totochain.io'],
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
testnet: true,
|
|
28
|
+
});
|
|
29
|
+
exports.totochainLocal = (0, defineChain_js_1.defineChain)({
|
|
30
|
+
id: 33002,
|
|
31
|
+
name: 'Totochain Local',
|
|
32
|
+
nativeCurrency: { decimals: 18, name: 'Test Toto', symbol: 'TEST' },
|
|
33
|
+
rpcUrls: {
|
|
34
|
+
default: {
|
|
35
|
+
http: ['http://127.0.0.1:9944'],
|
|
36
|
+
webSocket: ['ws://127.0.0.1:9944'],
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
testnet: true,
|
|
40
|
+
});
|
|
41
|
+
exports.totochainDev = (0, defineChain_js_1.defineChain)({
|
|
42
|
+
id: 33003,
|
|
43
|
+
name: 'Totochain Dev',
|
|
44
|
+
nativeCurrency: { decimals: 18, name: 'Test Toto', symbol: 'TEST' },
|
|
45
|
+
rpcUrls: {
|
|
46
|
+
default: {
|
|
47
|
+
http: ['http://127.0.0.1:9944'],
|
|
48
|
+
webSocket: ['ws://127.0.0.1:9944'],
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
testnet: true,
|
|
52
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.totochainTestnet = exports.totochainLocal = exports.totochainDev = exports.totochain = exports.defineChain = void 0;
|
|
4
|
+
var defineChain_js_1 = require("./defineChain.js");
|
|
5
|
+
Object.defineProperty(exports, "defineChain", { enumerable: true, get: function () { return defineChain_js_1.defineChain; } });
|
|
6
|
+
var definitions_js_1 = require("./definitions.js");
|
|
7
|
+
Object.defineProperty(exports, "totochain", { enumerable: true, get: function () { return definitions_js_1.totochain; } });
|
|
8
|
+
Object.defineProperty(exports, "totochainDev", { enumerable: true, get: function () { return definitions_js_1.totochainDev; } });
|
|
9
|
+
Object.defineProperty(exports, "totochainLocal", { enumerable: true, get: function () { return definitions_js_1.totochainLocal; } });
|
|
10
|
+
Object.defineProperty(exports, "totochainTestnet", { enumerable: true, get: function () { return definitions_js_1.totochainTestnet; } });
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ApiPromise } from '@polkadot/api';
|
|
2
|
+
import type { Client, Plugin } from './types.cjs';
|
|
3
|
+
export interface CreateClientOptions {
|
|
4
|
+
url: string;
|
|
5
|
+
timeoutMs?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function createClientFromApi(api: ApiPromise): Client;
|
|
8
|
+
export declare function createClient(options: CreateClientOptions): Promise<Client>;
|
|
9
|
+
export type { Client, Plugin };
|
|
10
|
+
//# sourceMappingURL=createClient.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createClientFromApi = createClientFromApi;
|
|
4
|
+
exports.createClient = createClient;
|
|
5
|
+
const api_1 = require("@polkadot/api");
|
|
6
|
+
const definitions_js_1 = require("../rpc/definitions.js");
|
|
7
|
+
const types_js_1 = require("../rpc/types.js");
|
|
8
|
+
function createClientFromApi(api) {
|
|
9
|
+
const client = {
|
|
10
|
+
api,
|
|
11
|
+
use(plugin) {
|
|
12
|
+
return Object.assign(Object.create(Object.getPrototypeOf(this)), this, plugin(this));
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
return client;
|
|
16
|
+
}
|
|
17
|
+
async function createClient(options) {
|
|
18
|
+
const provider = new api_1.WsProvider(options.url, undefined, undefined, options.timeoutMs);
|
|
19
|
+
const api = await api_1.ApiPromise.create({
|
|
20
|
+
provider: provider,
|
|
21
|
+
rpc: definitions_js_1.RPC_DEFINITIONS,
|
|
22
|
+
types: types_js_1.CHAIN_TYPES,
|
|
23
|
+
});
|
|
24
|
+
return createClientFromApi(api);
|
|
25
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ApiPromise } from '@polkadot/api';
|
|
2
|
+
export interface Client {
|
|
3
|
+
readonly api: ApiPromise;
|
|
4
|
+
use<Extension extends object>(plugin: Plugin<this, Extension>): this & Extension;
|
|
5
|
+
}
|
|
6
|
+
export type Plugin<ClientType, Extension extends object> = (client: ClientType) => Extension;
|
|
7
|
+
//# sourceMappingURL=types.d.ts.map
|