@flarenetwork/flare-periphery-contract-artifacts 0.1.0 → 0.1.2
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/coston/artifacts/contracts/ftso/implementation/FtsoManager.sol/FtsoManager.json +2 -2
- package/coston/artifacts/contracts/governance/implementation/PollingFtso.sol/PollingFtso.json +2 -2
- package/coston/artifacts/contracts/inflation/interface/IIInflationReceiverV1.sol/IIInflationReceiverV1.json +57 -0
- package/coston/artifacts/contracts/tokenPools/implementation/FtsoRewardManager.sol/FtsoRewardManager.json +6 -19
- package/coston/artifacts/contracts/tokenPools/interface/IIFtsoRewardManager.sol/IIFtsoRewardManager.json +0 -13
- package/coston/artifacts/contracts/utils/implementation/FtsoV2Upgrader.sol/FtsoV2Upgrader.json +2 -2
- package/coston2/artifacts/contracts/claiming/implementation/ClaimSetupManager.sol/ClaimSetupManager.json +2 -2
- package/coston2/artifacts/contracts/claiming/implementation/DelegationAccount.sol/DelegationAccount.json +2 -2
- package/coston2/artifacts/contracts/ftso/implementation/Ftso.sol/Ftso.json +2 -2
- package/coston2/artifacts/contracts/ftso/implementation/FtsoManager.sol/FtsoManager.json +2 -2
- package/coston2/artifacts/contracts/ftso/lib/FtsoEpoch.sol/FtsoEpoch.json +2 -2
- package/coston2/artifacts/contracts/ftso/lib/FtsoManagement.sol/FtsoManagement.json +2 -2
- package/coston2/artifacts/contracts/ftso/lib/FtsoManagerSettings.sol/FtsoManagerSettings.json +2 -2
- package/coston2/artifacts/contracts/ftso/priceProviderMockContracts/PriceProviderMockContracts.sol/MockFtsoRegistry.json +2 -2
- package/coston2/artifacts/contracts/ftso/priceProviderMockContracts/PriceProviderMockContracts.sol/MockPriceSubmitter.json +2 -2
- package/coston2/artifacts/contracts/ftso/priceProviderMockContracts/PriceProviderMockContracts.sol/MockVoterWhitelister.json +2 -2
- package/coston2/artifacts/contracts/ftso/priceProviderMockContracts/priceProviderMockFtso.sol/MockNpmFtso.json +2 -2
- package/coston2/artifacts/contracts/governance/implementation/PollingFoundation.sol/PollingFoundation.json +2 -2
- package/coston2/artifacts/contracts/governance/implementation/PollingFtso.sol/PollingFtso.json +2 -2
- package/coston2/artifacts/contracts/staking/implementation/AddressBinder.sol/AddressBinder.json +121 -0
- package/coston2/artifacts/contracts/staking/implementation/PChainStake.sol/PChainStake.json +512 -0
- package/coston2/artifacts/contracts/staking/implementation/PChainStakeMirror.sol/PChainStakeMirror.json +1299 -0
- package/coston2/artifacts/contracts/staking/implementation/PChainStakeMirrorMultiSigVoting.sol/PChainStakeMirrorMultiSigVoting.json +579 -0
- package/coston2/artifacts/contracts/staking/implementation/PChainStakeMirrorVerifier.sol/PChainStakeMirrorVerifier.json +168 -0
- package/coston2/artifacts/contracts/staking/interface/IIPChainStakeMirrorVerifier.sol/IIPChainStakeMirrorVerifier.json +72 -0
- package/coston2/artifacts/contracts/staking/lib/PChainStakeHistory.sol/PChainStakeHistory.json +24 -0
- package/coston2/artifacts/contracts/token/implementation/CombinedNat.sol/CombinedNat.json +128 -0
- package/coston2/artifacts/contracts/token/implementation/GovernanceVotePower.sol/GovernanceVotePower.json +20 -2
- package/coston2/artifacts/contracts/token/implementation/VPContract.sol/VPContract.json +2 -2
- package/coston2/artifacts/contracts/token/implementation/VPToken.sol/VPToken.json +2 -2
- package/coston2/artifacts/contracts/token/implementation/WNat.sol/WNat.json +2 -2
- package/coston2/artifacts/contracts/token/{lib → interface}/IICombinedNatBalance.sol/IICombinedNatBalance.json +33 -1
- package/coston2/artifacts/contracts/token/interface/IIGovernanceVotePower.sol/IIGovernanceVotePower.json +14 -1
- package/coston2/artifacts/contracts/tokenPools/implementation/AttestationProviderRewardManager.sol/AttestationProviderRewardManager.json +2 -2
- package/coston2/artifacts/contracts/tokenPools/implementation/DistributionToDelegators.sol/DistributionToDelegators.json +2 -2
- package/coston2/artifacts/contracts/tokenPools/implementation/Escrow.sol/Escrow.json +2 -2
- package/coston2/artifacts/contracts/tokenPools/implementation/FtsoRewardManager.sol/FtsoRewardManager.json +2 -2
- package/coston2/artifacts/contracts/tokenPools/implementation/ValidatorRewardManager.sol/ValidatorRewardManager.json +2 -2
- package/coston2/artifacts/contracts/userInterfaces/IAddressBinder.sol/IAddressBinder.json +121 -0
- package/coston2/artifacts/contracts/userInterfaces/IGovernanceVotePower.sol/IGovernanceVotePower.json +1 -1
- package/coston2/artifacts/contracts/userInterfaces/IPChainStakeMirror.sol/IPChainStakeMirror.json +575 -0
- package/coston2/artifacts/contracts/userInterfaces/IPChainStakeMirrorMultiSigVoting.sol/IPChainStakeMirrorMultiSigVoting.json +311 -0
- package/coston2/artifacts/contracts/userInterfaces/IPChainStakeMirrorVerifier.sol/IPChainStakeMirrorVerifier.json +10 -0
- package/coston2/artifacts/contracts/userInterfaces/IPChainVotePower.sol/IPChainVotePower.json +309 -0
- package/coston2/artifacts/contracts/utils/implementation/BytesLib.sol/BytesLib.json +10 -0
- package/coston2/artifacts/contracts/utils/implementation/FtsoRegistry.sol/FtsoRegistry.json +2 -2
- package/coston2/artifacts/contracts/utils/implementation/FtsoV2Upgrader.sol/FtsoV2Upgrader.json +2 -2
- package/coston2/artifacts/contracts/utils/implementation/VoterWhitelister.sol/VoterWhitelister.json +2 -2
- package/coston2/deploys/contracts.json +23 -3
- package/dist/coston/StateConnector/libs/ts/AttestationDefinitionStore.d.ts +68 -0
- package/dist/coston/StateConnector/libs/ts/AttestationDefinitionStore.d.ts.map +1 -0
- package/dist/coston/StateConnector/libs/ts/AttestationDefinitionStore.js +164 -0
- package/dist/coston/StateConnector/libs/ts/AttestationDefinitionStore.js.map +1 -0
- package/dist/coston/StateConnector/libs/ts/AttestationResponse.d.ts +33 -0
- package/dist/coston/StateConnector/libs/ts/AttestationResponse.d.ts.map +1 -0
- package/dist/coston/StateConnector/libs/ts/AttestationResponse.js +30 -0
- package/dist/coston/StateConnector/libs/ts/AttestationResponse.js.map +1 -0
- package/dist/coston/StateConnector/libs/ts/MerkleTree.d.ts +103 -0
- package/dist/coston/StateConnector/libs/ts/MerkleTree.d.ts.map +1 -0
- package/dist/coston/StateConnector/libs/ts/MerkleTree.js +212 -0
- package/dist/coston/StateConnector/libs/ts/MerkleTree.js.map +1 -0
- package/dist/coston/StateConnector/libs/ts/config-types.d.ts +143 -0
- package/dist/coston/StateConnector/libs/ts/config-types.d.ts.map +1 -0
- package/dist/coston/StateConnector/libs/ts/config-types.js +3 -0
- package/dist/coston/StateConnector/libs/ts/config-types.js.map +1 -0
- package/dist/coston/StateConnector/libs/ts/interfaces.d.ts +32 -0
- package/dist/coston/StateConnector/libs/ts/interfaces.d.ts.map +1 -0
- package/dist/coston/StateConnector/libs/ts/interfaces.js +3 -0
- package/dist/coston/StateConnector/libs/ts/interfaces.js.map +1 -0
- package/dist/coston/StateConnector/libs/ts/random.d.ts +9 -0
- package/dist/coston/StateConnector/libs/ts/random.d.ts.map +1 -0
- package/dist/coston/StateConnector/libs/ts/random.js +70 -0
- package/dist/coston/StateConnector/libs/ts/random.js.map +1 -0
- package/dist/coston/StateConnector/libs/ts/utils.d.ts +73 -0
- package/dist/coston/StateConnector/libs/ts/utils.d.ts.map +1 -0
- package/dist/coston/StateConnector/libs/ts/utils.js +282 -0
- package/dist/coston/StateConnector/libs/ts/utils.js.map +1 -0
- package/dist/coston/StateConnector/typescript/AddressValidity.d.ts +91 -0
- package/dist/coston/StateConnector/typescript/AddressValidity.d.ts.map +1 -0
- package/dist/coston/StateConnector/typescript/AddressValidity.js +9 -0
- package/dist/coston/StateConnector/typescript/AddressValidity.js.map +1 -0
- package/dist/coston/StateConnector/typescript/BalanceDecreasingTransaction.d.ts +107 -0
- package/dist/coston/StateConnector/typescript/BalanceDecreasingTransaction.d.ts.map +1 -0
- package/dist/coston/StateConnector/typescript/BalanceDecreasingTransaction.js +9 -0
- package/dist/coston/StateConnector/typescript/BalanceDecreasingTransaction.js.map +1 -0
- package/dist/coston/StateConnector/typescript/ConfirmedBlockHeightExists.d.ts +103 -0
- package/dist/coston/StateConnector/typescript/ConfirmedBlockHeightExists.d.ts.map +1 -0
- package/dist/coston/StateConnector/typescript/ConfirmedBlockHeightExists.js +9 -0
- package/dist/coston/StateConnector/typescript/ConfirmedBlockHeightExists.js.map +1 -0
- package/dist/coston/StateConnector/typescript/EVMTransaction.d.ts +160 -0
- package/dist/coston/StateConnector/typescript/EVMTransaction.d.ts.map +1 -0
- package/dist/coston/StateConnector/typescript/EVMTransaction.js +9 -0
- package/dist/coston/StateConnector/typescript/EVMTransaction.js.map +1 -0
- package/dist/coston/StateConnector/typescript/Payment.d.ts +139 -0
- package/dist/coston/StateConnector/typescript/Payment.d.ts.map +1 -0
- package/dist/coston/StateConnector/typescript/Payment.js +9 -0
- package/dist/coston/StateConnector/typescript/Payment.js.map +1 -0
- package/dist/coston/StateConnector/typescript/ReferencedPaymentNonexistence.d.ts +115 -0
- package/dist/coston/StateConnector/typescript/ReferencedPaymentNonexistence.d.ts.map +1 -0
- package/dist/coston/StateConnector/typescript/ReferencedPaymentNonexistence.js +9 -0
- package/dist/coston/StateConnector/typescript/ReferencedPaymentNonexistence.js.map +1 -0
- package/dist/coston/StateConnector/typescript/TypeTemplate.d.ts +146 -0
- package/dist/coston/StateConnector/typescript/TypeTemplate.d.ts.map +1 -0
- package/dist/coston/StateConnector/typescript/TypeTemplate.js +9 -0
- package/dist/coston/StateConnector/typescript/TypeTemplate.js.map +1 -0
- package/dist/coston/StateConnector/typescript/data-sources/data-sources.d.ts +29 -0
- package/dist/coston/StateConnector/typescript/data-sources/data-sources.d.ts.map +1 -0
- package/dist/coston/StateConnector/typescript/data-sources/data-sources.js +33 -0
- package/dist/coston/StateConnector/typescript/data-sources/data-sources.js.map +1 -0
- package/dist/coston/StateConnector/typescript/index.d.ts +9 -0
- package/dist/coston/StateConnector/typescript/index.d.ts.map +1 -0
- package/dist/coston/StateConnector/typescript/index.js +25 -0
- package/dist/coston/StateConnector/typescript/index.js.map +1 -0
- package/dist/coston/abis.d.ts.map +1 -1
- package/dist/coston/abis.js +2 -0
- package/dist/coston/abis.js.map +1 -1
- package/dist/coston/artifacts/contracts/ftso/implementation/FtsoManager.sol/FtsoManager.json +2 -2
- package/dist/coston/artifacts/contracts/governance/implementation/PollingFtso.sol/PollingFtso.json +2 -2
- package/dist/coston/artifacts/contracts/inflation/interface/IIInflationReceiverV1.sol/IIInflationReceiverV1.json +57 -0
- package/dist/coston/artifacts/contracts/tokenPools/implementation/FtsoRewardManager.sol/FtsoRewardManager.json +6 -19
- package/dist/coston/artifacts/contracts/tokenPools/interface/IIFtsoRewardManager.sol/IIFtsoRewardManager.json +0 -13
- package/dist/coston/artifacts/contracts/utils/implementation/FtsoV2Upgrader.sol/FtsoV2Upgrader.json +2 -2
- package/dist/coston/deploys/mapper.js.map +1 -1
- package/dist/coston2/abis.d.ts.map +1 -1
- package/dist/coston2/abis.js +20 -2
- package/dist/coston2/abis.js.map +1 -1
- package/dist/coston2/artifacts/contracts/claiming/implementation/ClaimSetupManager.sol/ClaimSetupManager.json +2 -2
- package/dist/coston2/artifacts/contracts/claiming/implementation/DelegationAccount.sol/DelegationAccount.json +2 -2
- package/dist/coston2/artifacts/contracts/ftso/implementation/Ftso.sol/Ftso.json +2 -2
- package/dist/coston2/artifacts/contracts/ftso/implementation/FtsoManager.sol/FtsoManager.json +2 -2
- package/dist/coston2/artifacts/contracts/ftso/lib/FtsoEpoch.sol/FtsoEpoch.json +2 -2
- package/dist/coston2/artifacts/contracts/ftso/lib/FtsoManagement.sol/FtsoManagement.json +2 -2
- package/dist/coston2/artifacts/contracts/ftso/lib/FtsoManagerSettings.sol/FtsoManagerSettings.json +2 -2
- package/dist/coston2/artifacts/contracts/ftso/priceProviderMockContracts/PriceProviderMockContracts.sol/MockFtsoRegistry.json +2 -2
- package/dist/coston2/artifacts/contracts/ftso/priceProviderMockContracts/PriceProviderMockContracts.sol/MockPriceSubmitter.json +2 -2
- package/dist/coston2/artifacts/contracts/ftso/priceProviderMockContracts/PriceProviderMockContracts.sol/MockVoterWhitelister.json +2 -2
- package/dist/coston2/artifacts/contracts/ftso/priceProviderMockContracts/priceProviderMockFtso.sol/MockNpmFtso.json +2 -2
- package/dist/coston2/artifacts/contracts/governance/implementation/PollingFoundation.sol/PollingFoundation.json +2 -2
- package/dist/coston2/artifacts/contracts/governance/implementation/PollingFtso.sol/PollingFtso.json +2 -2
- package/dist/coston2/artifacts/contracts/staking/implementation/AddressBinder.sol/AddressBinder.json +121 -0
- package/dist/coston2/artifacts/contracts/staking/implementation/PChainStake.sol/PChainStake.json +512 -0
- package/dist/coston2/artifacts/contracts/staking/implementation/PChainStakeMirror.sol/PChainStakeMirror.json +1299 -0
- package/dist/coston2/artifacts/contracts/staking/implementation/PChainStakeMirrorMultiSigVoting.sol/PChainStakeMirrorMultiSigVoting.json +579 -0
- package/dist/coston2/artifacts/contracts/staking/implementation/PChainStakeMirrorVerifier.sol/PChainStakeMirrorVerifier.json +168 -0
- package/dist/coston2/artifacts/contracts/staking/interface/IIPChainStakeMirrorVerifier.sol/IIPChainStakeMirrorVerifier.json +72 -0
- package/dist/coston2/artifacts/contracts/staking/lib/PChainStakeHistory.sol/PChainStakeHistory.json +24 -0
- package/dist/coston2/artifacts/contracts/token/implementation/CombinedNat.sol/CombinedNat.json +128 -0
- package/dist/coston2/artifacts/contracts/token/implementation/GovernanceVotePower.sol/GovernanceVotePower.json +20 -2
- package/dist/coston2/artifacts/contracts/token/implementation/VPContract.sol/VPContract.json +2 -2
- package/dist/coston2/artifacts/contracts/token/implementation/VPToken.sol/VPToken.json +2 -2
- package/dist/coston2/artifacts/contracts/token/implementation/WNat.sol/WNat.json +2 -2
- package/dist/coston2/artifacts/contracts/token/{lib → interface}/IICombinedNatBalance.sol/IICombinedNatBalance.json +33 -1
- package/dist/coston2/artifacts/contracts/token/interface/IIGovernanceVotePower.sol/IIGovernanceVotePower.json +14 -1
- package/dist/coston2/artifacts/contracts/tokenPools/implementation/AttestationProviderRewardManager.sol/AttestationProviderRewardManager.json +2 -2
- package/dist/coston2/artifacts/contracts/tokenPools/implementation/DistributionToDelegators.sol/DistributionToDelegators.json +2 -2
- package/dist/coston2/artifacts/contracts/tokenPools/implementation/Escrow.sol/Escrow.json +2 -2
- package/dist/coston2/artifacts/contracts/tokenPools/implementation/FtsoRewardManager.sol/FtsoRewardManager.json +2 -2
- package/dist/coston2/artifacts/contracts/tokenPools/implementation/ValidatorRewardManager.sol/ValidatorRewardManager.json +2 -2
- package/dist/coston2/artifacts/contracts/utils/implementation/BytesLib.sol/BytesLib.json +10 -0
- package/dist/coston2/artifacts/contracts/utils/implementation/FtsoRegistry.sol/FtsoRegistry.json +2 -2
- package/dist/coston2/artifacts/contracts/utils/implementation/FtsoV2Upgrader.sol/FtsoV2Upgrader.json +2 -2
- package/dist/coston2/artifacts/contracts/utils/implementation/VoterWhitelister.sol/VoterWhitelister.json +2 -2
- package/dist/coston2/deploys/addresses.d.ts +4 -0
- package/dist/coston2/deploys/addresses.d.ts.map +1 -1
- package/dist/coston2/deploys/addresses.js +6 -2
- package/dist/coston2/deploys/addresses.js.map +1 -1
- package/dist/coston2/deploys/contracts.json +23 -3
- package/dist/coston2/deploys/mapper.js.map +1 -1
- package/dist/flare/abis.d.ts.map +1 -1
- package/dist/flare/abis.js +20 -2
- package/dist/flare/abis.js.map +1 -1
- package/dist/flare/artifacts/contracts/claiming/implementation/ClaimSetupManager.sol/ClaimSetupManager.json +2 -2
- package/dist/flare/artifacts/contracts/claiming/implementation/DelegationAccount.sol/DelegationAccount.json +2 -2
- package/dist/flare/artifacts/contracts/ftso/implementation/Ftso.sol/Ftso.json +2 -2
- package/dist/flare/artifacts/contracts/ftso/implementation/FtsoManager.sol/FtsoManager.json +2 -2
- package/dist/flare/artifacts/contracts/ftso/lib/FtsoEpoch.sol/FtsoEpoch.json +2 -2
- package/dist/flare/artifacts/contracts/ftso/lib/FtsoManagement.sol/FtsoManagement.json +2 -2
- package/dist/flare/artifacts/contracts/ftso/lib/FtsoManagerSettings.sol/FtsoManagerSettings.json +2 -2
- package/dist/flare/artifacts/contracts/ftso/priceProviderMockContracts/PriceProviderMockContracts.sol/MockFtsoRegistry.json +2 -2
- package/dist/flare/artifacts/contracts/ftso/priceProviderMockContracts/PriceProviderMockContracts.sol/MockPriceSubmitter.json +2 -2
- package/dist/flare/artifacts/contracts/ftso/priceProviderMockContracts/PriceProviderMockContracts.sol/MockVoterWhitelister.json +2 -2
- package/dist/flare/artifacts/contracts/ftso/priceProviderMockContracts/priceProviderMockFtso.sol/MockNpmFtso.json +2 -2
- package/dist/flare/artifacts/contracts/governance/implementation/PollingFoundation.sol/PollingFoundation.json +2 -2
- package/dist/flare/artifacts/contracts/governance/implementation/PollingFtso.sol/PollingFtso.json +2 -2
- package/dist/flare/artifacts/contracts/staking/implementation/AddressBinder.sol/AddressBinder.json +121 -0
- package/dist/flare/artifacts/contracts/staking/implementation/PChainStake.sol/PChainStake.json +512 -0
- package/dist/flare/artifacts/contracts/staking/implementation/PChainStakeMirror.sol/PChainStakeMirror.json +1299 -0
- package/dist/flare/artifacts/contracts/staking/implementation/PChainStakeMirrorMultiSigVoting.sol/PChainStakeMirrorMultiSigVoting.json +579 -0
- package/dist/flare/artifacts/contracts/staking/implementation/PChainStakeMirrorVerifier.sol/PChainStakeMirrorVerifier.json +168 -0
- package/dist/flare/artifacts/contracts/staking/interface/IIPChainStakeMirrorVerifier.sol/IIPChainStakeMirrorVerifier.json +72 -0
- package/dist/flare/artifacts/contracts/staking/lib/PChainStakeHistory.sol/PChainStakeHistory.json +24 -0
- package/dist/flare/artifacts/contracts/token/implementation/CombinedNat.sol/CombinedNat.json +128 -0
- package/dist/flare/artifacts/contracts/token/implementation/GovernanceVotePower.sol/GovernanceVotePower.json +20 -2
- package/dist/flare/artifacts/contracts/token/implementation/VPContract.sol/VPContract.json +2 -2
- package/dist/flare/artifacts/contracts/token/implementation/VPToken.sol/VPToken.json +2 -2
- package/dist/flare/artifacts/contracts/token/implementation/WNat.sol/WNat.json +2 -2
- package/dist/flare/artifacts/contracts/token/{lib → interface}/IICombinedNatBalance.sol/IICombinedNatBalance.json +33 -1
- package/dist/flare/artifacts/contracts/token/interface/IIGovernanceVotePower.sol/IIGovernanceVotePower.json +14 -1
- package/dist/flare/artifacts/contracts/tokenPools/implementation/AttestationProviderRewardManager.sol/AttestationProviderRewardManager.json +2 -2
- package/dist/flare/artifacts/contracts/tokenPools/implementation/DistributionToDelegators.sol/DistributionToDelegators.json +2 -2
- package/dist/flare/artifacts/contracts/tokenPools/implementation/Escrow.sol/Escrow.json +2 -2
- package/dist/flare/artifacts/contracts/tokenPools/implementation/FtsoRewardManager.sol/FtsoRewardManager.json +2 -2
- package/dist/flare/artifacts/contracts/tokenPools/implementation/ValidatorRewardManager.sol/ValidatorRewardManager.json +2 -2
- package/dist/flare/artifacts/contracts/utils/implementation/BytesLib.sol/BytesLib.json +10 -0
- package/dist/flare/artifacts/contracts/utils/implementation/FtsoRegistry.sol/FtsoRegistry.json +2 -2
- package/dist/flare/artifacts/contracts/utils/implementation/FtsoV2Upgrader.sol/FtsoV2Upgrader.json +2 -2
- package/dist/flare/artifacts/contracts/utils/implementation/VoterWhitelister.sol/VoterWhitelister.json +2 -2
- package/dist/flare/deploys/addresses.d.ts +4 -0
- package/dist/flare/deploys/addresses.d.ts.map +1 -1
- package/dist/flare/deploys/addresses.js +6 -2
- package/dist/flare/deploys/addresses.js.map +1 -1
- package/dist/flare/deploys/contracts.json +23 -3
- package/dist/flare/deploys/mapper.js.map +1 -1
- package/dist/songbird/abis.d.ts.map +1 -1
- package/dist/songbird/abis.js +20 -14
- package/dist/songbird/abis.js.map +1 -1
- package/dist/songbird/artifacts/contracts/claiming/implementation/ClaimSetupManager.sol/ClaimSetupManager.json +2 -2
- package/dist/songbird/artifacts/contracts/ftso/implementation/FtsoManager.sol/FtsoManager.json +2 -2
- package/dist/songbird/artifacts/contracts/governance/implementation/PollingFoundation.sol/PollingFoundation.json +2 -2
- package/dist/songbird/artifacts/contracts/governance/implementation/PollingFtso.sol/PollingFtso.json +2 -2
- package/dist/songbird/artifacts/contracts/inflation/implementation/Inflation.sol/Inflation.json +273 -298
- package/dist/songbird/artifacts/contracts/inflation/implementation/InflationAllocation.sol/InflationAllocation.json +463 -0
- package/dist/songbird/artifacts/contracts/inflation/implementation/SelfDestructBurner.sol/SelfDestructBurner.json +73 -0
- package/dist/songbird/artifacts/contracts/inflation/implementation/Supply.sol/Supply.json +290 -51
- package/dist/songbird/artifacts/contracts/inflation/interface/{IIInflationSharingPercentageProvider.sol/IIInflationSharingPercentageProvider.json → IIInflationAllocation.sol/IIInflationAllocation.json} +15 -2
- package/dist/songbird/artifacts/contracts/inflation/interface/IIInflationReceiver.sol/IIInflationReceiver.json +26 -0
- package/dist/songbird/artifacts/contracts/inflation/interface/IIInflationReceiverV1.sol/IIInflationReceiverV1.json +57 -0
- package/dist/songbird/artifacts/contracts/inflation/interface/IIInflationV1.sol/IIInflationV1.json +142 -0
- package/dist/songbird/artifacts/contracts/inflation/interface/IIPreInflationCalculation.sol/IIPreInflationCalculation.json +18 -0
- package/dist/songbird/artifacts/contracts/inflation/interface/IISupply.sol/IISupply.json +6 -12
- package/dist/songbird/artifacts/contracts/inflation/lib/{RewardServices.sol/RewardServices.json → InflationRewardServices.sol/InflationRewardServices.json} +25 -6
- package/dist/songbird/artifacts/contracts/inflation/lib/InflationTimeSlots.sol/InflationTimeSlots.json +10 -0
- package/dist/songbird/artifacts/contracts/tokenPools/implementation/FtsoRewardManager.sol/FtsoRewardManager.json +2 -2
- package/dist/songbird/artifacts/contracts/tokenPools/implementation/InflationReceiver.sol/InflationReceiver.json +127 -0
- package/dist/songbird/artifacts/contracts/tokenPools/implementation/TokenPoolBase.sol/TokenPoolBase.json +10 -0
- package/dist/songbird/artifacts/contracts/tokenPools/interface/IIFtsoRewardManager.sol/IIFtsoRewardManager.json +13 -0
- package/dist/songbird/artifacts/contracts/utils/implementation/FtsoV2Upgrader.sol/FtsoV2Upgrader.json +2 -2
- package/dist/songbird/deploys/addresses.js +3 -3
- package/dist/songbird/deploys/contracts.json +3 -3
- package/dist/songbird/deploys/mapper.js.map +1 -1
- package/flare/artifacts/contracts/claiming/implementation/ClaimSetupManager.sol/ClaimSetupManager.json +2 -2
- package/flare/artifacts/contracts/claiming/implementation/DelegationAccount.sol/DelegationAccount.json +2 -2
- package/flare/artifacts/contracts/ftso/implementation/Ftso.sol/Ftso.json +2 -2
- package/flare/artifacts/contracts/ftso/implementation/FtsoManager.sol/FtsoManager.json +2 -2
- package/flare/artifacts/contracts/ftso/lib/FtsoEpoch.sol/FtsoEpoch.json +2 -2
- package/flare/artifacts/contracts/ftso/lib/FtsoManagement.sol/FtsoManagement.json +2 -2
- package/flare/artifacts/contracts/ftso/lib/FtsoManagerSettings.sol/FtsoManagerSettings.json +2 -2
- package/flare/artifacts/contracts/ftso/priceProviderMockContracts/PriceProviderMockContracts.sol/MockFtsoRegistry.json +2 -2
- package/flare/artifacts/contracts/ftso/priceProviderMockContracts/PriceProviderMockContracts.sol/MockPriceSubmitter.json +2 -2
- package/flare/artifacts/contracts/ftso/priceProviderMockContracts/PriceProviderMockContracts.sol/MockVoterWhitelister.json +2 -2
- package/flare/artifacts/contracts/ftso/priceProviderMockContracts/priceProviderMockFtso.sol/MockNpmFtso.json +2 -2
- package/flare/artifacts/contracts/governance/implementation/PollingFoundation.sol/PollingFoundation.json +2 -2
- package/flare/artifacts/contracts/governance/implementation/PollingFtso.sol/PollingFtso.json +2 -2
- package/flare/artifacts/contracts/staking/implementation/AddressBinder.sol/AddressBinder.json +121 -0
- package/flare/artifacts/contracts/staking/implementation/PChainStake.sol/PChainStake.json +512 -0
- package/flare/artifacts/contracts/staking/implementation/PChainStakeMirror.sol/PChainStakeMirror.json +1299 -0
- package/flare/artifacts/contracts/staking/implementation/PChainStakeMirrorMultiSigVoting.sol/PChainStakeMirrorMultiSigVoting.json +579 -0
- package/flare/artifacts/contracts/staking/implementation/PChainStakeMirrorVerifier.sol/PChainStakeMirrorVerifier.json +168 -0
- package/flare/artifacts/contracts/staking/interface/IIPChainStakeMirrorVerifier.sol/IIPChainStakeMirrorVerifier.json +72 -0
- package/flare/artifacts/contracts/staking/lib/PChainStakeHistory.sol/PChainStakeHistory.json +24 -0
- package/flare/artifacts/contracts/token/implementation/CombinedNat.sol/CombinedNat.json +128 -0
- package/flare/artifacts/contracts/token/implementation/GovernanceVotePower.sol/GovernanceVotePower.json +20 -2
- package/flare/artifacts/contracts/token/implementation/VPContract.sol/VPContract.json +2 -2
- package/flare/artifacts/contracts/token/implementation/VPToken.sol/VPToken.json +2 -2
- package/flare/artifacts/contracts/token/implementation/WNat.sol/WNat.json +2 -2
- package/flare/artifacts/contracts/token/{lib → interface}/IICombinedNatBalance.sol/IICombinedNatBalance.json +33 -1
- package/flare/artifacts/contracts/token/interface/IIGovernanceVotePower.sol/IIGovernanceVotePower.json +14 -1
- package/flare/artifacts/contracts/tokenPools/implementation/AttestationProviderRewardManager.sol/AttestationProviderRewardManager.json +2 -2
- package/flare/artifacts/contracts/tokenPools/implementation/DistributionToDelegators.sol/DistributionToDelegators.json +2 -2
- package/flare/artifacts/contracts/tokenPools/implementation/Escrow.sol/Escrow.json +2 -2
- package/flare/artifacts/contracts/tokenPools/implementation/FtsoRewardManager.sol/FtsoRewardManager.json +2 -2
- package/flare/artifacts/contracts/tokenPools/implementation/ValidatorRewardManager.sol/ValidatorRewardManager.json +2 -2
- package/flare/artifacts/contracts/userInterfaces/IAddressBinder.sol/IAddressBinder.json +121 -0
- package/flare/artifacts/contracts/userInterfaces/IGovernanceVotePower.sol/IGovernanceVotePower.json +1 -1
- package/flare/artifacts/contracts/userInterfaces/IPChainStakeMirror.sol/IPChainStakeMirror.json +575 -0
- package/flare/artifacts/contracts/userInterfaces/IPChainStakeMirrorMultiSigVoting.sol/IPChainStakeMirrorMultiSigVoting.json +311 -0
- package/flare/artifacts/contracts/userInterfaces/IPChainStakeMirrorVerifier.sol/IPChainStakeMirrorVerifier.json +10 -0
- package/flare/artifacts/contracts/userInterfaces/IPChainVotePower.sol/IPChainVotePower.json +309 -0
- package/flare/artifacts/contracts/utils/implementation/BytesLib.sol/BytesLib.json +10 -0
- package/flare/artifacts/contracts/utils/implementation/FtsoRegistry.sol/FtsoRegistry.json +2 -2
- package/flare/artifacts/contracts/utils/implementation/FtsoV2Upgrader.sol/FtsoV2Upgrader.json +2 -2
- package/flare/artifacts/contracts/utils/implementation/VoterWhitelister.sol/VoterWhitelister.json +2 -2
- package/flare/deploys/contracts.json +23 -3
- package/package.json +3 -2
- package/songbird/artifacts/contracts/claiming/implementation/ClaimSetupManager.sol/ClaimSetupManager.json +2 -2
- package/songbird/artifacts/contracts/ftso/implementation/FtsoManager.sol/FtsoManager.json +2 -2
- package/songbird/artifacts/contracts/governance/implementation/PollingFoundation.sol/PollingFoundation.json +2 -2
- package/songbird/artifacts/contracts/governance/implementation/PollingFtso.sol/PollingFtso.json +2 -2
- package/songbird/artifacts/contracts/inflation/implementation/Inflation.sol/Inflation.json +273 -298
- package/songbird/artifacts/contracts/inflation/implementation/InflationAllocation.sol/InflationAllocation.json +463 -0
- package/songbird/artifacts/contracts/inflation/implementation/SelfDestructBurner.sol/SelfDestructBurner.json +73 -0
- package/songbird/artifacts/contracts/inflation/implementation/Supply.sol/Supply.json +290 -51
- package/songbird/artifacts/contracts/inflation/interface/{IIInflationSharingPercentageProvider.sol/IIInflationSharingPercentageProvider.json → IIInflationAllocation.sol/IIInflationAllocation.json} +15 -2
- package/songbird/artifacts/contracts/inflation/interface/IIInflationReceiver.sol/IIInflationReceiver.json +26 -0
- package/songbird/artifacts/contracts/inflation/interface/IIInflationReceiverV1.sol/IIInflationReceiverV1.json +57 -0
- package/songbird/artifacts/contracts/inflation/interface/IIInflationV1.sol/IIInflationV1.json +142 -0
- package/songbird/artifacts/contracts/inflation/interface/IIPreInflationCalculation.sol/IIPreInflationCalculation.json +18 -0
- package/songbird/artifacts/contracts/inflation/interface/IISupply.sol/IISupply.json +6 -12
- package/songbird/artifacts/contracts/inflation/lib/{RewardServices.sol/RewardServices.json → InflationRewardServices.sol/InflationRewardServices.json} +25 -6
- package/songbird/artifacts/contracts/inflation/lib/InflationTimeSlots.sol/InflationTimeSlots.json +10 -0
- package/songbird/artifacts/contracts/tokenPools/implementation/FtsoRewardManager.sol/FtsoRewardManager.json +2 -2
- package/songbird/artifacts/contracts/tokenPools/implementation/InflationReceiver.sol/InflationReceiver.json +127 -0
- package/songbird/artifacts/contracts/tokenPools/implementation/TokenPoolBase.sol/TokenPoolBase.json +10 -0
- package/songbird/artifacts/contracts/tokenPools/interface/IIFtsoRewardManager.sol/IIFtsoRewardManager.json +13 -0
- package/songbird/artifacts/contracts/userInterfaces/IGenericRewardManager.sol/IGenericRewardManager.json +248 -0
- package/songbird/artifacts/contracts/utils/implementation/FtsoV2Upgrader.sol/FtsoV2Upgrader.json +2 -2
- package/songbird/deploys/contracts.json +3 -3
- package/dist/songbird/artifacts/contracts/governance/implementation/InflationAllocation.sol/InflationAllocation.json +0 -351
- package/dist/songbird/artifacts/contracts/inflation/interface/IIInflationPercentageProvider.sol/IIInflationPercentageProvider.json +0 -24
- package/dist/songbird/artifacts/contracts/inflation/lib/InflationAnnum.sol/InflationAnnum.json +0 -10
- package/dist/songbird/artifacts/contracts/inflation/lib/InflationAnnums.sol/InflationAnnums.json +0 -10
- package/dist/songbird/artifacts/contracts/inflation/lib/RewardService.sol/RewardService.json +0 -30
- package/songbird/artifacts/contracts/governance/implementation/InflationAllocation.sol/InflationAllocation.json +0 -351
- package/songbird/artifacts/contracts/inflation/interface/IIInflationPercentageProvider.sol/IIInflationPercentageProvider.json +0 -24
- package/songbird/artifacts/contracts/inflation/lib/InflationAnnum.sol/InflationAnnum.json +0 -10
- package/songbird/artifacts/contracts/inflation/lib/InflationAnnums.sol/InflationAnnums.json +0 -10
- package/songbird/artifacts/contracts/inflation/lib/RewardService.sol/RewardService.json +0 -30
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { TypeRecord } from "./config-types";
|
|
2
|
+
/**
|
|
3
|
+
* ABIFragment is a subset of ethers ABIFragment. It is used to define the ABI fragments
|
|
4
|
+
*/
|
|
5
|
+
export interface ABIFragment {
|
|
6
|
+
components?: ABIFragment[];
|
|
7
|
+
internalType: string;
|
|
8
|
+
name: string;
|
|
9
|
+
type: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const DEFAULT_ATTESTATION_TYPE_CONFIGS_PATH = "./node_modules/@flarenetwork/flare-periphery-contract-artifacts/coston/StateConnector/configs/";
|
|
12
|
+
export declare const MIC_SALT = "Flare";
|
|
13
|
+
export declare const ZERO_BYTES_32: string;
|
|
14
|
+
export declare const ZERO_BYTES_20: string;
|
|
15
|
+
/**
|
|
16
|
+
* Checks if the type is one of the supported Solidity type names.
|
|
17
|
+
* Note: the checks for supported numbers N in 'intN', 'uintN' and 'bytesN' is not implemented. The function is safe only under assumption
|
|
18
|
+
* that the correct types supported by the Solidity compiler are used.
|
|
19
|
+
* @param type
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
export declare function isSupportedBasicSolidityType(type: string): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Encodes attestation type name or source id as a 32-byte hex string.
|
|
25
|
+
* It takes the UTF-8 bytes of the name and pads them with zeros to 32 bytes.
|
|
26
|
+
* @param attestationTypeName
|
|
27
|
+
* @returns '0x'-prefixed hex string representing 32-bytes
|
|
28
|
+
*/
|
|
29
|
+
export declare function encodeAttestationName(attestationTypeName: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* Decodes attestation type name or source id from a 32-byte hex string.
|
|
32
|
+
* @param encoded Should be a '0x'-prefixed hex string representing exactly 32-bytes.
|
|
33
|
+
* @returns
|
|
34
|
+
*/
|
|
35
|
+
export declare function decodeAttestationName(encoded: string): string;
|
|
36
|
+
/**
|
|
37
|
+
* Given a ABI decoded object (with tuples) based on the provided JSON ABI definition,
|
|
38
|
+
* it creates a possibly nested Javascript object compatible with the ABI definitions.
|
|
39
|
+
* The function assumes that the decoded objects matches the ABI. If this is not the case,
|
|
40
|
+
* function may behave in strange ways.
|
|
41
|
+
* This is auxiliary function not intended to be used directly.
|
|
42
|
+
* @param decoded
|
|
43
|
+
* @param abi
|
|
44
|
+
* @param ignoreArray parameter for recursion call when handling of arrays are needed.
|
|
45
|
+
* @returns
|
|
46
|
+
*/
|
|
47
|
+
export declare function remapABIParsedToObjects(decoded: any, abi: ABIFragment, ignoreArray?: boolean): any;
|
|
48
|
+
/**
|
|
49
|
+
* Checks whether the struct objects are deep equal. Objects should match the ABI definition.
|
|
50
|
+
* @param struct1
|
|
51
|
+
* @param struct2
|
|
52
|
+
* @param abi
|
|
53
|
+
* @returns
|
|
54
|
+
*/
|
|
55
|
+
export declare function structsDeepEqual(struct1: any, struct2: any, abi: ABIFragment): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Loader of the attestation type definition configs
|
|
58
|
+
* @returns a map from attestation types to definition configs
|
|
59
|
+
*/
|
|
60
|
+
export declare function readAttestationTypeConfigs(configsPath?: string): Map<string, TypeRecord>;
|
|
61
|
+
/**
|
|
62
|
+
* Helper function serializing bigints to strings recursively.
|
|
63
|
+
* @param obj
|
|
64
|
+
* @returns
|
|
65
|
+
*/
|
|
66
|
+
export declare function serializeBigInts(obj: any): any;
|
|
67
|
+
/**
|
|
68
|
+
* Find the package root than contains the directory.
|
|
69
|
+
* @param moduleDir the directory of a module, typically use `__dirname`
|
|
70
|
+
* @returns the directory of the modules's package root.
|
|
71
|
+
*/
|
|
72
|
+
export declare function findPackageRoot(moduleDir: string): string;
|
|
73
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../coston/StateConnector/libs/ts/utils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,UAAU,CAAC,EAAE,WAAW,EAAE,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,qCAAqC,mGAAmG,CAAA;AACrJ,eAAO,MAAM,QAAQ,UAAU,CAAC;AAChC,eAAO,MAAM,aAAa,QAAgC,CAAC;AAC3D,eAAO,MAAM,aAAa,QAAgC,CAAC;AA+C3D;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAUlE;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,mBAAmB,EAAE,MAAM,UAYhE;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,UAUpD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,WAAW,EAAE,WAAW,UAAQ,GAAG,GAAG,CA8BhG;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,WAAW,GAAG,OAAO,CA2DtF;AACD;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,WAAW,SAAwC,GAAG,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAQvH;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,GAAG,OAOxC;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,UAiBhD"}
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.findPackageRoot = exports.serializeBigInts = exports.readAttestationTypeConfigs = exports.structsDeepEqual = exports.remapABIParsedToObjects = exports.decodeAttestationName = exports.encodeAttestationName = exports.isSupportedBasicSolidityType = exports.ZERO_BYTES_20 = exports.ZERO_BYTES_32 = exports.MIC_SALT = exports.DEFAULT_ATTESTATION_TYPE_CONFIGS_PATH = void 0;
|
|
27
|
+
const ethers_1 = require("ethers");
|
|
28
|
+
const fs_1 = require("fs");
|
|
29
|
+
const path = __importStar(require("path"));
|
|
30
|
+
exports.DEFAULT_ATTESTATION_TYPE_CONFIGS_PATH = "./node_modules/@flarenetwork/flare-periphery-contract-artifacts/coston/StateConnector/configs/";
|
|
31
|
+
exports.MIC_SALT = "Flare";
|
|
32
|
+
exports.ZERO_BYTES_32 = ethers_1.ethers.zeroPadBytes("0x", 32);
|
|
33
|
+
exports.ZERO_BYTES_20 = ethers_1.ethers.zeroPadBytes("0x", 20);
|
|
34
|
+
/**
|
|
35
|
+
* Compares values of Solidity elementary types when represented in JSON.
|
|
36
|
+
* Checks the consistency of the types and the values.
|
|
37
|
+
* @param val1
|
|
38
|
+
* @param val2
|
|
39
|
+
* @param type
|
|
40
|
+
* @returns
|
|
41
|
+
*/
|
|
42
|
+
function compareElementaryTypes(val1, val2, type) {
|
|
43
|
+
if (type.match(/^u?int\d+$/)) {
|
|
44
|
+
// Input values could be number, BigInt or string representing decimal or hex (0x-prefixed).
|
|
45
|
+
if (typeof val1 === "number" || typeof val1 === "bigint" || typeof val1 === "string") {
|
|
46
|
+
// throws if the value is not parsable as a BigInt
|
|
47
|
+
return BigInt(val1) === BigInt(val2);
|
|
48
|
+
}
|
|
49
|
+
throw new Error(`Invalid values for type '${type}': ${val1}, ${val2}`);
|
|
50
|
+
}
|
|
51
|
+
if (type.match(/^bool$/)) {
|
|
52
|
+
// values must be true or false
|
|
53
|
+
if ((val1 === true || val1 === false) && (val2 === true || val2 === false)) {
|
|
54
|
+
return val1 === val2;
|
|
55
|
+
}
|
|
56
|
+
throw new Error(`Invalid values for type '${type}': ${val1}, ${val2}`);
|
|
57
|
+
}
|
|
58
|
+
if (type.match(/^bytes\d*$/) || type.match(/^byte$/) || type.match(/^address$/)) {
|
|
59
|
+
// Input values must be be string or hex (0x-prefixed)
|
|
60
|
+
if (typeof val1 === "string" && typeof val2 === "string") {
|
|
61
|
+
const lower1 = val1.toLowerCase();
|
|
62
|
+
const lower2 = val2.toLowerCase();
|
|
63
|
+
if (/^0x[0-9a-f]+$/i.test(lower1) && /^0x[0-9a-f]+$/i.test(lower2)) {
|
|
64
|
+
return lower1 === lower2;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
throw new Error(`Invalid values for type '${type}': '${val1}', '${val2}'`);
|
|
68
|
+
}
|
|
69
|
+
if (type.match(/^string$/)) {
|
|
70
|
+
// Input values must be string
|
|
71
|
+
if (typeof val1 === "string" && typeof val2 === "string") {
|
|
72
|
+
return val1 === val2;
|
|
73
|
+
}
|
|
74
|
+
throw new Error(`Invalid values for type '${type}': '${val1}', '${val2}'`);
|
|
75
|
+
}
|
|
76
|
+
throw new Error(`Unknown or unsupported type '${type}'`);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Checks if the type is one of the supported Solidity type names.
|
|
80
|
+
* Note: the checks for supported numbers N in 'intN', 'uintN' and 'bytesN' is not implemented. The function is safe only under assumption
|
|
81
|
+
* that the correct types supported by the Solidity compiler are used.
|
|
82
|
+
* @param type
|
|
83
|
+
* @returns
|
|
84
|
+
*/
|
|
85
|
+
function isSupportedBasicSolidityType(type) {
|
|
86
|
+
//
|
|
87
|
+
return (!!type.match(/^u?int\d+$/) ||
|
|
88
|
+
!!type.match(/^bool$/) ||
|
|
89
|
+
!!type.match(/^bytes\d*$/) ||
|
|
90
|
+
!!type.match(/^byte$/) ||
|
|
91
|
+
!!type.match(/^address$/) ||
|
|
92
|
+
!!type.match(/^string$/));
|
|
93
|
+
}
|
|
94
|
+
exports.isSupportedBasicSolidityType = isSupportedBasicSolidityType;
|
|
95
|
+
/**
|
|
96
|
+
* Encodes attestation type name or source id as a 32-byte hex string.
|
|
97
|
+
* It takes the UTF-8 bytes of the name and pads them with zeros to 32 bytes.
|
|
98
|
+
* @param attestationTypeName
|
|
99
|
+
* @returns '0x'-prefixed hex string representing 32-bytes
|
|
100
|
+
*/
|
|
101
|
+
function encodeAttestationName(attestationTypeName) {
|
|
102
|
+
if (typeof attestationTypeName !== "string") {
|
|
103
|
+
throw new Error(`Attestation type name must be a string. Provided value ${attestationTypeName}`);
|
|
104
|
+
}
|
|
105
|
+
if (attestationTypeName.startsWith("0x") || attestationTypeName.startsWith("0X")) {
|
|
106
|
+
throw new Error(`Attestation type name must not start with '0x'. Provided value '${attestationTypeName}'. Possible confusion with hex encoding.`);
|
|
107
|
+
}
|
|
108
|
+
const bytes = ethers_1.ethers.toUtf8Bytes(attestationTypeName);
|
|
109
|
+
if (bytes.length > 32) {
|
|
110
|
+
throw new Error(`Attestation type name ${attestationTypeName} is too long`);
|
|
111
|
+
}
|
|
112
|
+
return ethers_1.ethers.zeroPadBytes(bytes, 32);
|
|
113
|
+
}
|
|
114
|
+
exports.encodeAttestationName = encodeAttestationName;
|
|
115
|
+
/**
|
|
116
|
+
* Decodes attestation type name or source id from a 32-byte hex string.
|
|
117
|
+
* @param encoded Should be a '0x'-prefixed hex string representing exactly 32-bytes.
|
|
118
|
+
* @returns
|
|
119
|
+
*/
|
|
120
|
+
function decodeAttestationName(encoded) {
|
|
121
|
+
if (!/^0x[0-9a-fA-F]{64}$/i.test(encoded)) {
|
|
122
|
+
throw new Error("Not a 0x-prefixed 32-byte hex string");
|
|
123
|
+
}
|
|
124
|
+
// strip trailing zeros
|
|
125
|
+
let stripped = encoded.replace(/0+$/, "");
|
|
126
|
+
// if the string is odd-length, add a zero to the end for full bytes
|
|
127
|
+
stripped = stripped.length % 2 == 0 ? stripped : stripped + "0";
|
|
128
|
+
const bytes = ethers_1.ethers.toBeArray(stripped);
|
|
129
|
+
return ethers_1.ethers.toUtf8String(bytes);
|
|
130
|
+
}
|
|
131
|
+
exports.decodeAttestationName = decodeAttestationName;
|
|
132
|
+
/**
|
|
133
|
+
* Given a ABI decoded object (with tuples) based on the provided JSON ABI definition,
|
|
134
|
+
* it creates a possibly nested Javascript object compatible with the ABI definitions.
|
|
135
|
+
* The function assumes that the decoded objects matches the ABI. If this is not the case,
|
|
136
|
+
* function may behave in strange ways.
|
|
137
|
+
* This is auxiliary function not intended to be used directly.
|
|
138
|
+
* @param decoded
|
|
139
|
+
* @param abi
|
|
140
|
+
* @param ignoreArray parameter for recursion call when handling of arrays are needed.
|
|
141
|
+
* @returns
|
|
142
|
+
*/
|
|
143
|
+
function remapABIParsedToObjects(decoded, abi, ignoreArray = false) {
|
|
144
|
+
if (abi.type == "tuple" || (abi.type == "tuple[]" && ignoreArray)) {
|
|
145
|
+
const result = {};
|
|
146
|
+
for (const [index, item] of abi.components.entries()) {
|
|
147
|
+
const key = item.name;
|
|
148
|
+
result[key] = remapABIParsedToObjects(decoded[index], item);
|
|
149
|
+
}
|
|
150
|
+
return result;
|
|
151
|
+
}
|
|
152
|
+
if (abi.type == "tuple[]") {
|
|
153
|
+
const result = [];
|
|
154
|
+
for (const item of decoded) {
|
|
155
|
+
result.push(remapABIParsedToObjects(item, abi, true));
|
|
156
|
+
}
|
|
157
|
+
return result;
|
|
158
|
+
}
|
|
159
|
+
if (abi.type.match(/^.+(\[(\d*)\])(\[(\d*)\])$/) || abi.type.match(/^.+(\[(\d+)\])$/)) {
|
|
160
|
+
throw new Error(`Nested arrays or fixed length arrays not supported. Type: ${abi.type}`);
|
|
161
|
+
}
|
|
162
|
+
// we assume here we have `type[]` where `type` is one of simple types.
|
|
163
|
+
const match = abi.type.match(/^(.+)\[\]$/);
|
|
164
|
+
if (match && isSupportedBasicSolidityType(match[1])) {
|
|
165
|
+
const result = [];
|
|
166
|
+
for (const item of decoded) {
|
|
167
|
+
result.push(item);
|
|
168
|
+
}
|
|
169
|
+
return result;
|
|
170
|
+
}
|
|
171
|
+
return decoded;
|
|
172
|
+
}
|
|
173
|
+
exports.remapABIParsedToObjects = remapABIParsedToObjects;
|
|
174
|
+
/**
|
|
175
|
+
* Checks whether the struct objects are deep equal. Objects should match the ABI definition.
|
|
176
|
+
* @param struct1
|
|
177
|
+
* @param struct2
|
|
178
|
+
* @param abi
|
|
179
|
+
* @returns
|
|
180
|
+
*/
|
|
181
|
+
function structsDeepEqual(struct1, struct2, abi) {
|
|
182
|
+
if (Object.keys(struct1).length !== Object.keys(struct2).length) {
|
|
183
|
+
return false;
|
|
184
|
+
}
|
|
185
|
+
for (const item of abi.components || []) {
|
|
186
|
+
const key = item.name;
|
|
187
|
+
const val1 = struct1[key];
|
|
188
|
+
const val2 = struct2[key];
|
|
189
|
+
if (val1 === undefined || val2 === undefined) {
|
|
190
|
+
throw new Error(`Structs must not have undefined values for ${key}`);
|
|
191
|
+
}
|
|
192
|
+
if (item.type == "tuple") {
|
|
193
|
+
if (!structsDeepEqual(struct1[key], struct2[key], item)) {
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
continue;
|
|
197
|
+
}
|
|
198
|
+
if (item.type == "tuple[]") {
|
|
199
|
+
if (val1.length != val2.length) {
|
|
200
|
+
return false;
|
|
201
|
+
}
|
|
202
|
+
for (let i = 0; i < val1.length; i++) {
|
|
203
|
+
if (!structsDeepEqual(val1[i], val2[i], item)) {
|
|
204
|
+
return false;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
continue;
|
|
208
|
+
}
|
|
209
|
+
if (item.components) {
|
|
210
|
+
throw new Error("Components should not appear in non tuple ABI fragments");
|
|
211
|
+
}
|
|
212
|
+
if (item.type.match(/^.+(\[(\d*)\])(\[(\d*)\])$/) || item.type.match(/^.+(\[(\d+)\])$/)) {
|
|
213
|
+
throw new Error(`Nested arrays or fixed length arrays not supported. Type: ${item.type}`);
|
|
214
|
+
}
|
|
215
|
+
// we assume here we have `type[]` where `type` is one of simple types.
|
|
216
|
+
const match = item.type.match(/^(.+)\[\]$/);
|
|
217
|
+
if (match && isSupportedBasicSolidityType(match[1])) {
|
|
218
|
+
if (val1.length !== val2.length) {
|
|
219
|
+
return false;
|
|
220
|
+
}
|
|
221
|
+
for (let i = 0; i < val1.length; i++) {
|
|
222
|
+
if (!compareElementaryTypes(val1[i], val2[i], item.type.slice(0, -2))) {
|
|
223
|
+
return false;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
continue;
|
|
227
|
+
}
|
|
228
|
+
if (!compareElementaryTypes(val1, val2, item.type)) {
|
|
229
|
+
return false;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
return true;
|
|
233
|
+
}
|
|
234
|
+
exports.structsDeepEqual = structsDeepEqual;
|
|
235
|
+
/**
|
|
236
|
+
* Loader of the attestation type definition configs
|
|
237
|
+
* @returns a map from attestation types to definition configs
|
|
238
|
+
*/
|
|
239
|
+
function readAttestationTypeConfigs(configsPath = exports.DEFAULT_ATTESTATION_TYPE_CONFIGS_PATH) {
|
|
240
|
+
const typeRecMap = new Map();
|
|
241
|
+
const files = (0, fs_1.readdirSync)(configsPath);
|
|
242
|
+
files.forEach((fileName) => {
|
|
243
|
+
const name = path.basename(fileName, ".json");
|
|
244
|
+
typeRecMap.set(name, JSON.parse((0, fs_1.readFileSync)(`${configsPath}/${fileName}`, "utf8")));
|
|
245
|
+
});
|
|
246
|
+
return typeRecMap;
|
|
247
|
+
}
|
|
248
|
+
exports.readAttestationTypeConfigs = readAttestationTypeConfigs;
|
|
249
|
+
/**
|
|
250
|
+
* Helper function serializing bigints to strings recursively.
|
|
251
|
+
* @param obj
|
|
252
|
+
* @returns
|
|
253
|
+
*/
|
|
254
|
+
function serializeBigInts(obj) {
|
|
255
|
+
return JSON.parse(JSON.stringify(obj, (key, value) => (typeof value === "bigint" ? value.toString() : value)));
|
|
256
|
+
}
|
|
257
|
+
exports.serializeBigInts = serializeBigInts;
|
|
258
|
+
/**
|
|
259
|
+
* Find the package root than contains the directory.
|
|
260
|
+
* @param moduleDir the directory of a module, typically use `__dirname`
|
|
261
|
+
* @returns the directory of the modules's package root.
|
|
262
|
+
*/
|
|
263
|
+
function findPackageRoot(moduleDir) {
|
|
264
|
+
let dir = path.resolve(moduleDir);
|
|
265
|
+
// eslint-disable-next-line no-constant-condition
|
|
266
|
+
while (true) {
|
|
267
|
+
const packageJson = path.resolve(dir, "package.json");
|
|
268
|
+
const hasPackageJson = (0, fs_1.existsSync)(packageJson) && (0, fs_1.statSync)(packageJson).isFile();
|
|
269
|
+
const nodeModules = path.resolve(dir, "node_modules");
|
|
270
|
+
const hasNodeModules = (0, fs_1.existsSync)(nodeModules) && (0, fs_1.statSync)(nodeModules).isDirectory();
|
|
271
|
+
if (hasPackageJson && hasNodeModules) {
|
|
272
|
+
return dir;
|
|
273
|
+
}
|
|
274
|
+
if (path.dirname(dir) === dir) {
|
|
275
|
+
// arrived at filesystem root without finding package root
|
|
276
|
+
throw new Error("Cannot find package root");
|
|
277
|
+
}
|
|
278
|
+
dir = path.dirname(dir);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
exports.findPackageRoot = findPackageRoot;
|
|
282
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../coston/StateConnector/libs/ts/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAgC;AAChC,2BAAqE;AACrE,2CAA6B;AAahB,QAAA,qCAAqC,GAAG,gGAAgG,CAAA;AACxI,QAAA,QAAQ,GAAG,OAAO,CAAC;AACnB,QAAA,aAAa,GAAG,eAAM,CAAC,YAAY,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAC9C,QAAA,aAAa,GAAG,eAAM,CAAC,YAAY,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAE3D;;;;;;;GAOG;AACH,SAAS,sBAAsB,CAAC,IAAS,EAAE,IAAS,EAAE,IAAY;IAC9D,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC;QAC3B,4FAA4F;QAC5F,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YACnF,kDAAkD;YAClD,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC;QACzC,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,4BAA4B,IAAI,MAAM,IAAI,KAAK,IAAI,EAAE,CAAC,CAAC;IAC3E,CAAC;IACD,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QACvB,+BAA+B;QAC/B,IAAI,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI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CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CACzE,CACJ,CAAC;AACN,CAAC;AAPD,4CAOC;AAED;;;;GAIG;AACH,SAAgB,eAAe,CAAC,SAAiB;IAC7C,IAAI,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAClC,iDAAiD;IACjD,OAAO,IAAI,EAAE,CAAC;QACV,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;QACtD,MAAM,cAAc,GAAG,IAAA,eAAU,EAAC,WAAW,CAAC,IAAI,IAAA,aAAQ,EAAC,WAAW,CAAC,CAAC,MAAM,EAAE,CAAC;QACjF,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;QACtD,MAAM,cAAc,GAAG,IAAA,eAAU,EAAC,WAAW,CAAC,IAAI,IAAA,aAAQ,EAAC,WAAW,CAAC,CAAC,WAAW,EAAE,CAAC;QACtF,IAAI,cAAc,IAAI,cAAc,EAAE,CAAC;YACnC,OAAO,GAAG,CAAC;QACf,CAAC;QACD,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,GAAG,EAAE,CAAC;YAC5B,0DAA0D;YAC1D,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;QAChD,CAAC;QACD,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5B,CAAC;AACL,CAAC;AAjBD,0CAiBC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
export declare namespace AddressValidity {
|
|
2
|
+
const NAME = "AddressValidity";
|
|
3
|
+
const TYPE = "0x4164647265737356616c69646974790000000000000000000000000000000000";
|
|
4
|
+
/**
|
|
5
|
+
* Toplevel request
|
|
6
|
+
*/
|
|
7
|
+
interface Request {
|
|
8
|
+
/**
|
|
9
|
+
* Attestation type id as defined for each attestation type on [this repo](https://gitlab.com/flarenetwork/state-connector-protocol/)
|
|
10
|
+
*/
|
|
11
|
+
attestationType: string;
|
|
12
|
+
/**
|
|
13
|
+
* Id of the data source.
|
|
14
|
+
*/
|
|
15
|
+
sourceId: string;
|
|
16
|
+
/**
|
|
17
|
+
* `MessageIntegrityCode` that is derived from the expected response as defined [here](/specs/attestations/hash-MIC.md#message-integrity-code).
|
|
18
|
+
*/
|
|
19
|
+
messageIntegrityCode: string;
|
|
20
|
+
/**
|
|
21
|
+
* Data defining the request. Type (struct) and interpretation is determined by the `attestationType`.
|
|
22
|
+
*/
|
|
23
|
+
requestBody: RequestBody;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Toplevel response
|
|
27
|
+
*/
|
|
28
|
+
interface Response {
|
|
29
|
+
/**
|
|
30
|
+
* Extracted from the request.
|
|
31
|
+
*/
|
|
32
|
+
attestationType: string;
|
|
33
|
+
/**
|
|
34
|
+
* Extracted from the request.
|
|
35
|
+
*/
|
|
36
|
+
sourceId: string;
|
|
37
|
+
/**
|
|
38
|
+
* The id of the state connector round in which the request was considered.
|
|
39
|
+
*/
|
|
40
|
+
votingRound: string;
|
|
41
|
+
/**
|
|
42
|
+
* The lowest timestamp used to generate the response.
|
|
43
|
+
*/
|
|
44
|
+
lowestUsedTimestamp: string;
|
|
45
|
+
/**
|
|
46
|
+
* Extracted from the request.
|
|
47
|
+
*/
|
|
48
|
+
requestBody: RequestBody;
|
|
49
|
+
/**
|
|
50
|
+
* Data defining the response. The verification rules for the construction of the response body and the type are defined per specific `attestationType`.
|
|
51
|
+
*/
|
|
52
|
+
responseBody: ResponseBody;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Toplevel proof
|
|
56
|
+
*/
|
|
57
|
+
interface Proof {
|
|
58
|
+
/**
|
|
59
|
+
* Merkle proof corresponding to the attestation response.
|
|
60
|
+
*/
|
|
61
|
+
merkleProof: string[];
|
|
62
|
+
/**
|
|
63
|
+
* Attestation response.
|
|
64
|
+
*/
|
|
65
|
+
data: Response;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Request body for AddressValidity attestation type
|
|
69
|
+
*/
|
|
70
|
+
interface RequestBody {
|
|
71
|
+
/**
|
|
72
|
+
* Address to be verified.
|
|
73
|
+
*/
|
|
74
|
+
addressStr: string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Response body for AddressValidity attestation type
|
|
78
|
+
*/
|
|
79
|
+
interface ResponseBody {
|
|
80
|
+
/**
|
|
81
|
+
* Standard form of the validated address.
|
|
82
|
+
*/
|
|
83
|
+
standardAddress: string;
|
|
84
|
+
/**
|
|
85
|
+
* Standard address hash of the validated address.
|
|
86
|
+
*/
|
|
87
|
+
standardAddressHash: string;
|
|
88
|
+
}
|
|
89
|
+
type RequestNoMic = Omit<Request, "messageIntegrityCode">;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=AddressValidity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AddressValidity.d.ts","sourceRoot":"","sources":["../../../../coston/StateConnector/typescript/AddressValidity.ts"],"names":[],"mappings":"AAAA,yBAAiB,eAAe,CAAC;IACtB,MAAM,IAAI,oBAAoB,CAAC;IAC/B,MAAM,IAAI,uEAAuE,CAAC;IAEzF;;OAEG;IACH,UAAiB,OAAO;QACpB;;WAEG;QACH,eAAe,EAAE,MAAM,CAAC;QAExB;;WAEG;QACH,QAAQ,EAAE,MAAM,CAAC;QAEjB;;WAEG;QACH,oBAAoB,EAAE,MAAM,CAAC;QAE7B;;WAEG;QACH,WAAW,EAAE,WAAW,CAAC;KAC5B;IAED;;OAEG;IACH,UAAiB,QAAQ;QACrB;;WAEG;QACH,eAAe,EAAE,MAAM,CAAC;QAExB;;WAEG;QACH,QAAQ,EAAE,MAAM,CAAC;QAEjB;;WAEG;QACH,WAAW,EAAE,MAAM,CAAC;QAEpB;;WAEG;QACH,mBAAmB,EAAE,MAAM,CAAC;QAE5B;;WAEG;QACH,WAAW,EAAE,WAAW,CAAC;QAEzB;;WAEG;QACH,YAAY,EAAE,YAAY,CAAC;KAC9B;IAED;;OAEG;IACH,UAAiB,KAAK;QAClB;;WAEG;QACH,WAAW,EAAE,MAAM,EAAE,CAAC;QAEtB;;WAEG;QACH,IAAI,EAAE,QAAQ,CAAC;KAClB;IAED;;OAEG;IACH,UAAiB,WAAW;QACxB;;WAEG;QACH,UAAU,EAAE,MAAM,CAAC;KACtB;IAED;;OAEG;IACH,UAAiB,YAAY;QACzB;;WAEG;QACH,eAAe,EAAE,MAAM,CAAC;QAExB;;WAEG;QACH,mBAAmB,EAAE,MAAM,CAAC;KAC/B;IAED,KAAY,YAAY,GAAG,IAAI,CAAC,OAAO,EAAE,sBAAsB,CAAC,CAAC;CACpE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AddressValidity = void 0;
|
|
4
|
+
var AddressValidity;
|
|
5
|
+
(function (AddressValidity) {
|
|
6
|
+
AddressValidity.NAME = "AddressValidity";
|
|
7
|
+
AddressValidity.TYPE = "0x4164647265737356616c69646974790000000000000000000000000000000000";
|
|
8
|
+
})(AddressValidity || (exports.AddressValidity = AddressValidity = {}));
|
|
9
|
+
//# sourceMappingURL=AddressValidity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AddressValidity.js","sourceRoot":"","sources":["../../../../coston/StateConnector/typescript/AddressValidity.ts"],"names":[],"mappings":";;;AAAA,IAAiB,eAAe,CAyG/B;AAzGD,WAAiB,eAAe;IACf,oBAAI,GAAG,iBAAiB,CAAC;IACzB,oBAAI,GAAG,oEAAoE,CAAC;AAuG7F,CAAC,EAzGgB,eAAe,+BAAf,eAAe,QAyG/B"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
export declare namespace BalanceDecreasingTransaction {
|
|
2
|
+
const NAME = "BalanceDecreasingTransaction";
|
|
3
|
+
const TYPE = "0x42616c616e636544656372656173696e675472616e73616374696f6e00000000";
|
|
4
|
+
/**
|
|
5
|
+
* Toplevel request
|
|
6
|
+
*/
|
|
7
|
+
interface Request {
|
|
8
|
+
/**
|
|
9
|
+
* Id of the attestation type.
|
|
10
|
+
*/
|
|
11
|
+
attestationType: string;
|
|
12
|
+
/**
|
|
13
|
+
* Id of the data source.
|
|
14
|
+
*/
|
|
15
|
+
sourceId: string;
|
|
16
|
+
/**
|
|
17
|
+
* `MessageIntegrityCode` that is derived from the expected response as defined [here](/specs/attestations/hash-MIC.md#message-integrity-code).
|
|
18
|
+
*/
|
|
19
|
+
messageIntegrityCode: string;
|
|
20
|
+
/**
|
|
21
|
+
* Data defining the request. Type (struct) and interpretation is determined by the `attestationType`.
|
|
22
|
+
*/
|
|
23
|
+
requestBody: RequestBody;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Toplevel response
|
|
27
|
+
*/
|
|
28
|
+
interface Response {
|
|
29
|
+
/**
|
|
30
|
+
* Extracted from the request.
|
|
31
|
+
*/
|
|
32
|
+
attestationType: string;
|
|
33
|
+
/**
|
|
34
|
+
* Extracted from the request.
|
|
35
|
+
*/
|
|
36
|
+
sourceId: string;
|
|
37
|
+
/**
|
|
38
|
+
* The id of the state connector round in which the request was considered. This is a security measure to prevent a collision of attestation hashes.
|
|
39
|
+
*/
|
|
40
|
+
votingRound: string;
|
|
41
|
+
/**
|
|
42
|
+
* The lowest timestamp used to generate the response.
|
|
43
|
+
*/
|
|
44
|
+
lowestUsedTimestamp: string;
|
|
45
|
+
/**
|
|
46
|
+
* Extracted from the request.
|
|
47
|
+
*/
|
|
48
|
+
requestBody: RequestBody;
|
|
49
|
+
/**
|
|
50
|
+
* Data defining the response. The verification rules for the construction of the response body and the type are defined per specific `attestationType`.
|
|
51
|
+
*/
|
|
52
|
+
responseBody: ResponseBody;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Toplevel proof
|
|
56
|
+
*/
|
|
57
|
+
interface Proof {
|
|
58
|
+
/**
|
|
59
|
+
* Merkle proof corresponding to the attestation response.
|
|
60
|
+
*/
|
|
61
|
+
merkleProof: string[];
|
|
62
|
+
/**
|
|
63
|
+
* Attestation response.
|
|
64
|
+
*/
|
|
65
|
+
data: Response;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Request body for BalanceDecreasingTransaction attestation type
|
|
69
|
+
*/
|
|
70
|
+
interface RequestBody {
|
|
71
|
+
/**
|
|
72
|
+
* Id of the payment transaction.
|
|
73
|
+
*/
|
|
74
|
+
transactionId: string;
|
|
75
|
+
/**
|
|
76
|
+
* The indicator of the address whose balance has been decreased.
|
|
77
|
+
*/
|
|
78
|
+
sourceAddressIndicator: string;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Response body for BalanceDecreasingTransaction attestation type.
|
|
82
|
+
*/
|
|
83
|
+
interface ResponseBody {
|
|
84
|
+
/**
|
|
85
|
+
* The number of the block in which the transaction is included.
|
|
86
|
+
*/
|
|
87
|
+
blockNumber: string;
|
|
88
|
+
/**
|
|
89
|
+
* The timestamps of the block in which the transaction is included.
|
|
90
|
+
*/
|
|
91
|
+
blockTimestamp: string;
|
|
92
|
+
/**
|
|
93
|
+
* Standard address hash of the address indicated by the `sourceAddressIndicator`.
|
|
94
|
+
*/
|
|
95
|
+
sourceAddressHash: string;
|
|
96
|
+
/**
|
|
97
|
+
* Amount spent by the source address in minimal units.
|
|
98
|
+
*/
|
|
99
|
+
spentAmount: string;
|
|
100
|
+
/**
|
|
101
|
+
* Standard payment reference of the transaction.
|
|
102
|
+
*/
|
|
103
|
+
standardPaymentReference: string;
|
|
104
|
+
}
|
|
105
|
+
type RequestNoMic = Omit<Request, "messageIntegrityCode">;
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=BalanceDecreasingTransaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BalanceDecreasingTransaction.d.ts","sourceRoot":"","sources":["../../../../coston/StateConnector/typescript/BalanceDecreasingTransaction.ts"],"names":[],"mappings":"AAAA,yBAAiB,4BAA4B,CAAC;IACnC,MAAM,IAAI,iCAAiC,CAAC;IAC5C,MAAM,IAAI,uEAAuE,CAAC;IAEzF;;OAEG;IACH,UAAiB,OAAO;QACpB;;WAEG;QACH,eAAe,EAAE,MAAM,CAAC;QAExB;;WAEG;QACH,QAAQ,EAAE,MAAM,CAAC;QAEjB;;WAEG;QACH,oBAAoB,EAAE,MAAM,CAAC;QAE7B;;WAEG;QACH,WAAW,EAAE,WAAW,CAAC;KAC5B;IAED;;OAEG;IACH,UAAiB,QAAQ;QACrB;;WAEG;QACH,eAAe,EAAE,MAAM,CAAC;QAExB;;WAEG;QACH,QAAQ,EAAE,MAAM,CAAC;QAEjB;;WAEG;QACH,WAAW,EAAE,MAAM,CAAC;QAEpB;;WAEG;QACH,mBAAmB,EAAE,MAAM,CAAC;QAE5B;;WAEG;QACH,WAAW,EAAE,WAAW,CAAC;QAEzB;;WAEG;QACH,YAAY,EAAE,YAAY,CAAC;KAC9B;IAED;;OAEG;IACH,UAAiB,KAAK;QAClB;;WAEG;QACH,WAAW,EAAE,MAAM,EAAE,CAAC;QAEtB;;WAEG;QACH,IAAI,EAAE,QAAQ,CAAC;KAClB;IAED;;OAEG;IACH,UAAiB,WAAW;QACxB;;WAEG;QACH,aAAa,EAAE,MAAM,CAAC;QAEtB;;WAEG;QACH,sBAAsB,EAAE,MAAM,CAAC;KAClC;IAED;;OAEG;IACH,UAAiB,YAAY;QACzB;;WAEG;QACH,WAAW,EAAE,MAAM,CAAC;QAEpB;;WAEG;QACH,cAAc,EAAE,MAAM,CAAC;QAEvB;;WAEG;QACH,iBAAiB,EAAE,MAAM,CAAC;QAE1B;;WAEG;QACH,WAAW,EAAE,MAAM,CAAC;QAEpB;;WAEG;QACH,wBAAwB,EAAE,MAAM,CAAC;KACpC;IAED,KAAY,YAAY,GAAG,IAAI,CAAC,OAAO,EAAE,sBAAsB,CAAC,CAAC;CACpE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BalanceDecreasingTransaction = void 0;
|
|
4
|
+
var BalanceDecreasingTransaction;
|
|
5
|
+
(function (BalanceDecreasingTransaction) {
|
|
6
|
+
BalanceDecreasingTransaction.NAME = "BalanceDecreasingTransaction";
|
|
7
|
+
BalanceDecreasingTransaction.TYPE = "0x42616c616e636544656372656173696e675472616e73616374696f6e00000000";
|
|
8
|
+
})(BalanceDecreasingTransaction || (exports.BalanceDecreasingTransaction = BalanceDecreasingTransaction = {}));
|
|
9
|
+
//# sourceMappingURL=BalanceDecreasingTransaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BalanceDecreasingTransaction.js","sourceRoot":"","sources":["../../../../coston/StateConnector/typescript/BalanceDecreasingTransaction.ts"],"names":[],"mappings":";;;AAAA,IAAiB,4BAA4B,CA6H5C;AA7HD,WAAiB,4BAA4B;IAC5B,iCAAI,GAAG,8BAA8B,CAAC;IACtC,iCAAI,GAAG,oEAAoE,CAAC;AA2H7F,CAAC,EA7HgB,4BAA4B,4CAA5B,4BAA4B,QA6H5C"}
|