@airgap/tezos 0.13.7-beta.11
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/LICENSE.md +7 -0
- package/actions/GetKtAccountsAction.d.ts +8 -0
- package/actions/GetKtAccountsAction.js +85 -0
- package/actions/GetKtAccountsAction.js.map +1 -0
- package/airgap-coinlib-tezos.min.js +103587 -0
- package/constants.d.ts +18 -0
- package/constants.js +28 -0
- package/constants.js.map +1 -0
- package/index.d.ts +46 -0
- package/index.js +103 -0
- package/index.js.map +1 -0
- package/package.json +70 -0
- package/protocol/TezosAddress.d.ts +11 -0
- package/protocol/TezosAddress.js +102 -0
- package/protocol/TezosAddress.js.map +1 -0
- package/protocol/TezosCryptoClient.d.ts +15 -0
- package/protocol/TezosCryptoClient.js +152 -0
- package/protocol/TezosCryptoClient.js.map +1 -0
- package/protocol/TezosProtocol.d.ts +349 -0
- package/protocol/TezosProtocol.js +1853 -0
- package/protocol/TezosProtocol.js.map +1 -0
- package/protocol/TezosProtocolOptions.d.ts +29 -0
- package/protocol/TezosProtocolOptions.js +114 -0
- package/protocol/TezosProtocolOptions.js.map +1 -0
- package/protocol/TezosUtils.d.ts +40 -0
- package/protocol/TezosUtils.js +296 -0
- package/protocol/TezosUtils.js.map +1 -0
- package/protocol/contract/TezosContract.d.ts +52 -0
- package/protocol/contract/TezosContract.js +509 -0
- package/protocol/contract/TezosContract.js.map +1 -0
- package/protocol/contract/TezosContractCall.d.ts +10 -0
- package/protocol/contract/TezosContractCall.js +23 -0
- package/protocol/contract/TezosContractCall.js.map +1 -0
- package/protocol/contract/TezosContractEntrypoint.d.ts +8 -0
- package/protocol/contract/TezosContractEntrypoint.js +27 -0
- package/protocol/contract/TezosContractEntrypoint.js.map +1 -0
- package/protocol/contract/TezosContractStorage.d.ts +7 -0
- package/protocol/contract/TezosContractStorage.js +16 -0
- package/protocol/contract/TezosContractStorage.js.map +1 -0
- package/protocol/contract/remote-data/TezosContractRemoteDataFactory.d.ts +11 -0
- package/protocol/contract/remote-data/TezosContractRemoteDataFactory.js +34 -0
- package/protocol/contract/remote-data/TezosContractRemoteDataFactory.js.map +1 -0
- package/protocol/contract/remote-data/TezosStorageRemoteData.d.ts +12 -0
- package/protocol/contract/remote-data/TezosStorageRemoteData.js +151 -0
- package/protocol/contract/remote-data/TezosStorageRemoteData.js.map +1 -0
- package/protocol/domains/TezosDomains.d.ts +20 -0
- package/protocol/domains/TezosDomains.js +306 -0
- package/protocol/domains/TezosDomains.js.map +1 -0
- package/protocol/fa/TezosBTC.d.ts +12 -0
- package/protocol/fa/TezosBTC.js +107 -0
- package/protocol/fa/TezosBTC.js.map +1 -0
- package/protocol/fa/TezosBTCtez.d.ts +10 -0
- package/protocol/fa/TezosBTCtez.js +54 -0
- package/protocol/fa/TezosBTCtez.js.map +1 -0
- package/protocol/fa/TezosCTez.d.ts +10 -0
- package/protocol/fa/TezosCTez.js +51 -0
- package/protocol/fa/TezosCTez.js.map +1 -0
- package/protocol/fa/TezosDOGA.d.ts +10 -0
- package/protocol/fa/TezosDOGA.js +51 -0
- package/protocol/fa/TezosDOGA.js.map +1 -0
- package/protocol/fa/TezosETHtz.d.ts +9 -0
- package/protocol/fa/TezosETHtz.js +72 -0
- package/protocol/fa/TezosETHtz.js.map +1 -0
- package/protocol/fa/TezosFA1Protocol.d.ts +27 -0
- package/protocol/fa/TezosFA1Protocol.js +310 -0
- package/protocol/fa/TezosFA1Protocol.js.map +1 -0
- package/protocol/fa/TezosFA1p2Protocol.d.ts +8 -0
- package/protocol/fa/TezosFA1p2Protocol.js +117 -0
- package/protocol/fa/TezosFA1p2Protocol.js.map +1 -0
- package/protocol/fa/TezosFA2Protocol.d.ts +58 -0
- package/protocol/fa/TezosFA2Protocol.js +449 -0
- package/protocol/fa/TezosFA2Protocol.js.map +1 -0
- package/protocol/fa/TezosFAProtocol.d.ts +65 -0
- package/protocol/fa/TezosFAProtocol.js +510 -0
- package/protocol/fa/TezosFAProtocol.js.map +1 -0
- package/protocol/fa/TezosFAProtocolOptions.d.ts +54 -0
- package/protocol/fa/TezosFAProtocolOptions.js +228 -0
- package/protocol/fa/TezosFAProtocolOptions.js.map +1 -0
- package/protocol/fa/TezosKolibriUSD.d.ts +10 -0
- package/protocol/fa/TezosKolibriUSD.js +74 -0
- package/protocol/fa/TezosKolibriUSD.js.map +1 -0
- package/protocol/fa/TezosPlanty.d.ts +10 -0
- package/protocol/fa/TezosPlanty.js +51 -0
- package/protocol/fa/TezosPlanty.js.map +1 -0
- package/protocol/fa/TezosQUIPU.d.ts +10 -0
- package/protocol/fa/TezosQUIPU.js +54 -0
- package/protocol/fa/TezosQUIPU.js.map +1 -0
- package/protocol/fa/TezosSIRS.d.ts +10 -0
- package/protocol/fa/TezosSIRS.js +51 -0
- package/protocol/fa/TezosSIRS.js.map +1 -0
- package/protocol/fa/TezosStaker.d.ts +10 -0
- package/protocol/fa/TezosStaker.js +74 -0
- package/protocol/fa/TezosStaker.js.map +1 -0
- package/protocol/fa/TezosUBTC.d.ts +10 -0
- package/protocol/fa/TezosUBTC.js +54 -0
- package/protocol/fa/TezosUBTC.js.map +1 -0
- package/protocol/fa/TezosUDEFI.d.ts +10 -0
- package/protocol/fa/TezosUDEFI.js +54 -0
- package/protocol/fa/TezosUDEFI.js.map +1 -0
- package/protocol/fa/TezosUSD.d.ts +10 -0
- package/protocol/fa/TezosUSD.js +74 -0
- package/protocol/fa/TezosUSD.js.map +1 -0
- package/protocol/fa/TezosUSDT.d.ts +10 -0
- package/protocol/fa/TezosUSDT.js +54 -0
- package/protocol/fa/TezosUSDT.js.map +1 -0
- package/protocol/fa/TezosUUSD.d.ts +6 -0
- package/protocol/fa/TezosUUSD.js +31 -0
- package/protocol/fa/TezosUUSD.js.map +1 -0
- package/protocol/fa/TezosWRAP.d.ts +10 -0
- package/protocol/fa/TezosWRAP.js +54 -0
- package/protocol/fa/TezosWRAP.js.map +1 -0
- package/protocol/fa/TezosWrapped.d.ts +10 -0
- package/protocol/fa/TezosWrapped.js +74 -0
- package/protocol/fa/TezosWrapped.js.map +1 -0
- package/protocol/fa/TezosYOU.d.ts +6 -0
- package/protocol/fa/TezosYOU.js +31 -0
- package/protocol/fa/TezosYOU.js.map +1 -0
- package/protocol/indexerClient/TezosIndexerClient.d.ts +25 -0
- package/protocol/indexerClient/TezosIndexerClient.js +251 -0
- package/protocol/indexerClient/TezosIndexerClient.js.map +1 -0
- package/protocol/indexerClient/TezosProtocolIndexerClient.d.ts +26 -0
- package/protocol/indexerClient/TezosProtocolIndexerClient.js +3 -0
- package/protocol/indexerClient/TezosProtocolIndexerClient.js.map +1 -0
- package/protocol/kt/TezosKtAddress.d.ts +5 -0
- package/protocol/kt/TezosKtAddress.js +72 -0
- package/protocol/kt/TezosKtAddress.js.map +1 -0
- package/protocol/kt/TezosKtProtocol.d.ts +30 -0
- package/protocol/kt/TezosKtProtocol.js +317 -0
- package/protocol/kt/TezosKtProtocol.js.map +1 -0
- package/protocol/sapling/TezosSaplingAddress.d.ts +12 -0
- package/protocol/sapling/TezosSaplingAddress.js +134 -0
- package/protocol/sapling/TezosSaplingAddress.js.map +1 -0
- package/protocol/sapling/TezosSaplingCryptoClient.d.ts +34 -0
- package/protocol/sapling/TezosSaplingCryptoClient.js +241 -0
- package/protocol/sapling/TezosSaplingCryptoClient.js.map +1 -0
- package/protocol/sapling/TezosSaplingProtocol.d.ts +130 -0
- package/protocol/sapling/TezosSaplingProtocol.js +1101 -0
- package/protocol/sapling/TezosSaplingProtocol.js.map +1 -0
- package/protocol/sapling/TezosSaplingProtocolOptions.d.ts +43 -0
- package/protocol/sapling/TezosSaplingProtocolOptions.js +78 -0
- package/protocol/sapling/TezosSaplingProtocolOptions.js.map +1 -0
- package/protocol/sapling/TezosShieldedTezProtocol.d.ts +9 -0
- package/protocol/sapling/TezosShieldedTezProtocol.js +109 -0
- package/protocol/sapling/TezosShieldedTezProtocol.js.map +1 -0
- package/protocol/sapling/node/TezosSaplingNodeClient.d.ts +8 -0
- package/protocol/sapling/node/TezosSaplingNodeClient.js +78 -0
- package/protocol/sapling/node/TezosSaplingNodeClient.js.map +1 -0
- package/protocol/sapling/utils/TezosSaplingBookkeeper.d.ts +34 -0
- package/protocol/sapling/utils/TezosSaplingBookkeeper.js +586 -0
- package/protocol/sapling/utils/TezosSaplingBookkeeper.js.map +1 -0
- package/protocol/sapling/utils/TezosSaplingEncoder.d.ts +22 -0
- package/protocol/sapling/utils/TezosSaplingEncoder.js +158 -0
- package/protocol/sapling/utils/TezosSaplingEncoder.js.map +1 -0
- package/protocol/sapling/utils/TezosSaplingForger.d.ts +26 -0
- package/protocol/sapling/utils/TezosSaplingForger.js +278 -0
- package/protocol/sapling/utils/TezosSaplingForger.js.map +1 -0
- package/protocol/sapling/utils/TezosSaplingState.d.ts +17 -0
- package/protocol/sapling/utils/TezosSaplingState.js +260 -0
- package/protocol/sapling/utils/TezosSaplingState.js.map +1 -0
- package/protocol/types/TezosAddressCursor.d.ts +3 -0
- package/protocol/types/TezosAddressCursor.js +3 -0
- package/protocol/types/TezosAddressCursor.js.map +1 -0
- package/protocol/types/TezosAddressResult.d.ts +4 -0
- package/protocol/types/TezosAddressResult.js +3 -0
- package/protocol/types/TezosAddressResult.js.map +1 -0
- package/protocol/types/TezosBlockHeader.d.ts +13 -0
- package/protocol/types/TezosBlockHeader.js +3 -0
- package/protocol/types/TezosBlockHeader.js.map +1 -0
- package/protocol/types/TezosBlockMetadata.d.ts +7 -0
- package/protocol/types/TezosBlockMetadata.js +3 -0
- package/protocol/types/TezosBlockMetadata.js.map +1 -0
- package/protocol/types/TezosContractCode.d.ts +5 -0
- package/protocol/types/TezosContractCode.js +3 -0
- package/protocol/types/TezosContractCode.js.map +1 -0
- package/protocol/types/TezosOperationType.d.ts +13 -0
- package/protocol/types/TezosOperationType.js +18 -0
- package/protocol/types/TezosOperationType.js.map +1 -0
- package/protocol/types/TezosTransactionCursor.d.ts +3 -0
- package/protocol/types/TezosTransactionCursor.js +3 -0
- package/protocol/types/TezosTransactionCursor.js.map +1 -0
- package/protocol/types/TezosTransactionResult.d.ts +6 -0
- package/protocol/types/TezosTransactionResult.js +3 -0
- package/protocol/types/TezosTransactionResult.js.map +1 -0
- package/protocol/types/TezosWrappedOperation.d.ts +5 -0
- package/protocol/types/TezosWrappedOperation.js +3 -0
- package/protocol/types/TezosWrappedOperation.js.map +1 -0
- package/protocol/types/contract/BigMap.d.ts +7 -0
- package/protocol/types/contract/BigMap.js +3 -0
- package/protocol/types/contract/BigMap.js.map +1 -0
- package/protocol/types/contract/BigMapEnrtyFilter.d.ts +5 -0
- package/protocol/types/contract/BigMapEnrtyFilter.js +3 -0
- package/protocol/types/contract/BigMapEnrtyFilter.js.map +1 -0
- package/protocol/types/contract/BigMapEntry.d.ts +7 -0
- package/protocol/types/contract/BigMapEntry.js +3 -0
- package/protocol/types/contract/BigMapEntry.js.map +1 -0
- package/protocol/types/contract/BigMapRequest.d.ts +8 -0
- package/protocol/types/contract/BigMapRequest.js +3 -0
- package/protocol/types/contract/BigMapRequest.js.map +1 -0
- package/protocol/types/contract/TezosContractMetadata.d.ts +61 -0
- package/protocol/types/contract/TezosContractMetadata.js +3 -0
- package/protocol/types/contract/TezosContractMetadata.js.map +1 -0
- package/protocol/types/domains/TezosDomainsRecord.d.ts +8 -0
- package/protocol/types/domains/TezosDomainsRecord.js +3 -0
- package/protocol/types/domains/TezosDomainsRecord.js.map +1 -0
- package/protocol/types/domains/TezosDomainsReverseRecord.d.ts +5 -0
- package/protocol/types/domains/TezosDomainsReverseRecord.js +3 -0
- package/protocol/types/domains/TezosDomainsReverseRecord.js.map +1 -0
- package/protocol/types/fa/TezosFA2BalanceOfRequest.d.ts +4 -0
- package/protocol/types/fa/TezosFA2BalanceOfRequest.js +3 -0
- package/protocol/types/fa/TezosFA2BalanceOfRequest.js.map +1 -0
- package/protocol/types/fa/TezosFA2BalanceOfResponse.d.ts +5 -0
- package/protocol/types/fa/TezosFA2BalanceOfResponse.js +3 -0
- package/protocol/types/fa/TezosFA2BalanceOfResponse.js.map +1 -0
- package/protocol/types/fa/TezosFA2TransferRequest.d.ts +8 -0
- package/protocol/types/fa/TezosFA2TransferRequest.js +3 -0
- package/protocol/types/fa/TezosFA2TransferRequest.js.map +1 -0
- package/protocol/types/fa/TezosFA2UpdateOperatorRequest.d.ts +6 -0
- package/protocol/types/fa/TezosFA2UpdateOperatorRequest.js +3 -0
- package/protocol/types/fa/TezosFA2UpdateOperatorRequest.js.map +1 -0
- package/protocol/types/fa/TezosFATokenMetadata.d.ts +6 -0
- package/protocol/types/fa/TezosFATokenMetadata.js +3 -0
- package/protocol/types/fa/TezosFATokenMetadata.js.map +1 -0
- package/protocol/types/kt/TezosKtAddressCursor.d.ts +4 -0
- package/protocol/types/kt/TezosKtAddressCursor.js +3 -0
- package/protocol/types/kt/TezosKtAddressCursor.js.map +1 -0
- package/protocol/types/kt/TezosKtAddressResult.d.ts +5 -0
- package/protocol/types/kt/TezosKtAddressResult.js +3 -0
- package/protocol/types/kt/TezosKtAddressResult.js.map +1 -0
- package/protocol/types/micheline/MichelineNode.d.ts +15 -0
- package/protocol/types/micheline/MichelineNode.js +5 -0
- package/protocol/types/micheline/MichelineNode.js.map +1 -0
- package/protocol/types/micheline/MichelineNodeUtils.d.ts +6 -0
- package/protocol/types/micheline/MichelineNodeUtils.js +40 -0
- package/protocol/types/micheline/MichelineNodeUtils.js.map +1 -0
- package/protocol/types/michelson/MichelsonType.d.ts +11 -0
- package/protocol/types/michelson/MichelsonType.js +22 -0
- package/protocol/types/michelson/MichelsonType.js.map +1 -0
- package/protocol/types/michelson/MichelsonTypeMeta.d.ts +33 -0
- package/protocol/types/michelson/MichelsonTypeMeta.js +132 -0
- package/protocol/types/michelson/MichelsonTypeMeta.js.map +1 -0
- package/protocol/types/michelson/MichelsonTypeUtils.d.ts +19 -0
- package/protocol/types/michelson/MichelsonTypeUtils.js +249 -0
- package/protocol/types/michelson/MichelsonTypeUtils.js.map +1 -0
- package/protocol/types/michelson/generics/MichelsonList.d.ts +11 -0
- package/protocol/types/michelson/generics/MichelsonList.js +68 -0
- package/protocol/types/michelson/generics/MichelsonList.js.map +1 -0
- package/protocol/types/michelson/generics/MichelsonMap.d.ts +14 -0
- package/protocol/types/michelson/generics/MichelsonMap.js +118 -0
- package/protocol/types/michelson/generics/MichelsonMap.js.map +1 -0
- package/protocol/types/michelson/generics/MichelsonOption.d.ts +25 -0
- package/protocol/types/michelson/generics/MichelsonOption.js +119 -0
- package/protocol/types/michelson/generics/MichelsonOption.js.map +1 -0
- package/protocol/types/michelson/generics/MichelsonOr.d.ts +25 -0
- package/protocol/types/michelson/generics/MichelsonOr.js +132 -0
- package/protocol/types/michelson/generics/MichelsonOr.js.map +1 -0
- package/protocol/types/michelson/generics/MichelsonPair.d.ts +17 -0
- package/protocol/types/michelson/generics/MichelsonPair.js +135 -0
- package/protocol/types/michelson/generics/MichelsonPair.js.map +1 -0
- package/protocol/types/michelson/grammar/MichelsonGrammarData.d.ts +2 -0
- package/protocol/types/michelson/grammar/MichelsonGrammarData.js +4 -0
- package/protocol/types/michelson/grammar/MichelsonGrammarData.js.map +1 -0
- package/protocol/types/michelson/grammar/MichelsonGrammarInstruction.d.ts +1 -0
- package/protocol/types/michelson/grammar/MichelsonGrammarInstruction.js +4 -0
- package/protocol/types/michelson/grammar/MichelsonGrammarInstruction.js.map +1 -0
- package/protocol/types/michelson/grammar/MichelsonGrammarType.d.ts +1 -0
- package/protocol/types/michelson/grammar/MichelsonGrammarType.js +4 -0
- package/protocol/types/michelson/grammar/MichelsonGrammarType.js.map +1 -0
- package/protocol/types/michelson/primitives/MichelsonAddress.d.ts +15 -0
- package/protocol/types/michelson/primitives/MichelsonAddress.js +72 -0
- package/protocol/types/michelson/primitives/MichelsonAddress.js.map +1 -0
- package/protocol/types/michelson/primitives/MichelsonBool.d.ts +12 -0
- package/protocol/types/michelson/primitives/MichelsonBool.js +57 -0
- package/protocol/types/michelson/primitives/MichelsonBool.js.map +1 -0
- package/protocol/types/michelson/primitives/MichelsonBytes.d.ts +14 -0
- package/protocol/types/michelson/primitives/MichelsonBytes.js +75 -0
- package/protocol/types/michelson/primitives/MichelsonBytes.js.map +1 -0
- package/protocol/types/michelson/primitives/MichelsonInt.d.ts +14 -0
- package/protocol/types/michelson/primitives/MichelsonInt.js +72 -0
- package/protocol/types/michelson/primitives/MichelsonInt.js.map +1 -0
- package/protocol/types/michelson/primitives/MichelsonString.d.ts +14 -0
- package/protocol/types/michelson/primitives/MichelsonString.js +74 -0
- package/protocol/types/michelson/primitives/MichelsonString.js.map +1 -0
- package/protocol/types/michelson/primitives/MichelsonUnit.d.ts +9 -0
- package/protocol/types/michelson/primitives/MichelsonUnit.js +53 -0
- package/protocol/types/michelson/primitives/MichelsonUnit.js.map +1 -0
- package/protocol/types/operations/ActivateAccount.d.ts +7 -0
- package/protocol/types/operations/ActivateAccount.js +3 -0
- package/protocol/types/operations/ActivateAccount.js.map +1 -0
- package/protocol/types/operations/Ballot.d.ts +9 -0
- package/protocol/types/operations/Ballot.js +3 -0
- package/protocol/types/operations/Ballot.js.map +1 -0
- package/protocol/types/operations/Delegation.d.ts +11 -0
- package/protocol/types/operations/Delegation.js +3 -0
- package/protocol/types/operations/Delegation.js.map +1 -0
- package/protocol/types/operations/DoubleBakingEvidence.d.ts +8 -0
- package/protocol/types/operations/DoubleBakingEvidence.js +3 -0
- package/protocol/types/operations/DoubleBakingEvidence.js.map +1 -0
- package/protocol/types/operations/DoubleEndorsementEvidence.d.ts +16 -0
- package/protocol/types/operations/DoubleEndorsementEvidence.js +3 -0
- package/protocol/types/operations/DoubleEndorsementEvidence.js.map +1 -0
- package/protocol/types/operations/Endorsement.d.ts +6 -0
- package/protocol/types/operations/Endorsement.js +3 -0
- package/protocol/types/operations/Endorsement.js.map +1 -0
- package/protocol/types/operations/Origination.d.ts +13 -0
- package/protocol/types/operations/Origination.js +3 -0
- package/protocol/types/operations/Origination.js.map +1 -0
- package/protocol/types/operations/Proposal.d.ts +7 -0
- package/protocol/types/operations/Proposal.js +3 -0
- package/protocol/types/operations/Proposal.js.map +1 -0
- package/protocol/types/operations/Reveal.d.ts +11 -0
- package/protocol/types/operations/Reveal.js +3 -0
- package/protocol/types/operations/Reveal.js.map +1 -0
- package/protocol/types/operations/SeedNonceRevelation.d.ts +7 -0
- package/protocol/types/operations/SeedNonceRevelation.js +3 -0
- package/protocol/types/operations/SeedNonceRevelation.js.map +1 -0
- package/protocol/types/operations/TezosOperation.d.ts +4 -0
- package/protocol/types/operations/TezosOperation.js +3 -0
- package/protocol/types/operations/TezosOperation.js.map +1 -0
- package/protocol/types/operations/Transaction.d.ts +23 -0
- package/protocol/types/operations/Transaction.js +3 -0
- package/protocol/types/operations/Transaction.js.map +1 -0
- package/protocol/types/sapling/TezosSaplingAddressCursor.d.ts +4 -0
- package/protocol/types/sapling/TezosSaplingAddressCursor.js +3 -0
- package/protocol/types/sapling/TezosSaplingAddressCursor.js.map +1 -0
- package/protocol/types/sapling/TezosSaplingAddressResult.d.ts +4 -0
- package/protocol/types/sapling/TezosSaplingAddressResult.js +3 -0
- package/protocol/types/sapling/TezosSaplingAddressResult.js.map +1 -0
- package/protocol/types/sapling/TezosSaplingCiphertext.d.ts +8 -0
- package/protocol/types/sapling/TezosSaplingCiphertext.js +3 -0
- package/protocol/types/sapling/TezosSaplingCiphertext.js.map +1 -0
- package/protocol/types/sapling/TezosSaplingInput.d.ts +6 -0
- package/protocol/types/sapling/TezosSaplingInput.js +3 -0
- package/protocol/types/sapling/TezosSaplingInput.js.map +1 -0
- package/protocol/types/sapling/TezosSaplingOutput.d.ts +6 -0
- package/protocol/types/sapling/TezosSaplingOutput.js +3 -0
- package/protocol/types/sapling/TezosSaplingOutput.js.map +1 -0
- package/protocol/types/sapling/TezosSaplingStateDiff.d.ts +6 -0
- package/protocol/types/sapling/TezosSaplingStateDiff.js +3 -0
- package/protocol/types/sapling/TezosSaplingStateDiff.js.map +1 -0
- package/protocol/types/sapling/TezosSaplingStateTree.d.ts +7 -0
- package/protocol/types/sapling/TezosSaplingStateTree.js +3 -0
- package/protocol/types/sapling/TezosSaplingStateTree.js.map +1 -0
- package/protocol/types/sapling/TezosSaplingTransaction.d.ts +23 -0
- package/protocol/types/sapling/TezosSaplingTransaction.js +3 -0
- package/protocol/types/sapling/TezosSaplingTransaction.js.map +1 -0
- package/protocol/types/sapling/TezosSaplingTransactionCursor.d.ts +3 -0
- package/protocol/types/sapling/TezosSaplingTransactionCursor.js +3 -0
- package/protocol/types/sapling/TezosSaplingTransactionCursor.js.map +1 -0
- package/protocol/types/sapling/TezosSaplingTransactionResult.d.ts +6 -0
- package/protocol/types/sapling/TezosSaplingTransactionResult.js +3 -0
- package/protocol/types/sapling/TezosSaplingTransactionResult.js.map +1 -0
- package/protocol/types/utils.d.ts +8 -0
- package/protocol/types/utils.js +41 -0
- package/protocol/types/utils.js.map +1 -0
- package/readme.md +121 -0
- package/types/signed-transaction-tezos-sapling.d.ts +3 -0
- package/types/signed-transaction-tezos-sapling.js +3 -0
- package/types/signed-transaction-tezos-sapling.js.map +1 -0
- package/types/signed-transaction-tezos.d.ts +5 -0
- package/types/signed-transaction-tezos.js +3 -0
- package/types/signed-transaction-tezos.js.map +1 -0
- package/types/transaction-tezos.d.ts +14 -0
- package/types/transaction-tezos.js +3 -0
- package/types/transaction-tezos.js.map +1 -0
- package/types/unsigned-transaction-tezos-sapling.d.ts +38 -0
- package/types/unsigned-transaction-tezos-sapling.js +3 -0
- package/types/unsigned-transaction-tezos-sapling.js.map +1 -0
- package/types/unsigned-transaction-tezos.d.ts +8 -0
- package/types/unsigned-transaction-tezos.js +3 -0
- package/types/unsigned-transaction-tezos.js.map +1 -0
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
extendStatics(d, b);
|
|
11
|
+
function __() { this.constructor = d; }
|
|
12
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
18
|
+
}) : (function(o, m, k, k2) {
|
|
19
|
+
if (k2 === undefined) k2 = k;
|
|
20
|
+
o[k2] = m[k];
|
|
21
|
+
}));
|
|
22
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
23
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
24
|
+
}) : function(o, v) {
|
|
25
|
+
o["default"] = v;
|
|
26
|
+
});
|
|
27
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
35
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
36
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
37
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
38
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
39
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
40
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
44
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
45
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
46
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
47
|
+
function step(op) {
|
|
48
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
49
|
+
while (_) try {
|
|
50
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
51
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
52
|
+
switch (op[0]) {
|
|
53
|
+
case 0: case 1: t = op; break;
|
|
54
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
55
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
56
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
57
|
+
default:
|
|
58
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
59
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
60
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
61
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
62
|
+
if (t[2]) _.ops.pop();
|
|
63
|
+
_.trys.pop(); continue;
|
|
64
|
+
}
|
|
65
|
+
op = body.call(thisArg, _);
|
|
66
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
67
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
71
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
72
|
+
};
|
|
73
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
74
|
+
exports.TezosSaplingCryptoClient = void 0;
|
|
75
|
+
var bignumber_1 = __importDefault(require("@airgap/coinlib-core/dependencies/src/bignumber.js-9.0.0/bignumber"));
|
|
76
|
+
var Ed25519CryptoClient_1 = require("@airgap/coinlib-core/protocols/Ed25519CryptoClient");
|
|
77
|
+
var blake2b_1 = require("@airgap/coinlib-core/utils/blake2b");
|
|
78
|
+
var hex_1 = require("@airgap/coinlib-core/utils/hex");
|
|
79
|
+
var sapling = __importStar(require("@airgap/sapling-wasm"));
|
|
80
|
+
var nacl_1 = require("@stablelib/nacl");
|
|
81
|
+
var random_1 = require("@stablelib/random");
|
|
82
|
+
var TezosSaplingAddress_1 = require("./TezosSaplingAddress");
|
|
83
|
+
var TezosSaplingCryptoClient = /** @class */ (function (_super) {
|
|
84
|
+
__extends(TezosSaplingCryptoClient, _super);
|
|
85
|
+
function TezosSaplingCryptoClient(tezosCryptoClient) {
|
|
86
|
+
var _this = _super.call(this) || this;
|
|
87
|
+
_this.tezosCryptoClient = tezosCryptoClient;
|
|
88
|
+
_this.ockKey = 'OCK_keystringderivation_TEZOS';
|
|
89
|
+
_this.kdfKey = 'KDFSaplingForTezosV1';
|
|
90
|
+
return _this;
|
|
91
|
+
}
|
|
92
|
+
TezosSaplingCryptoClient.prototype.signMessage = function (message, keypair) {
|
|
93
|
+
return this.tezosCryptoClient.signMessage(message, keypair);
|
|
94
|
+
};
|
|
95
|
+
TezosSaplingCryptoClient.prototype.verifyMessage = function (message, signature, publicKey) {
|
|
96
|
+
return this.tezosCryptoClient.verifyMessage(message, signature, publicKey);
|
|
97
|
+
};
|
|
98
|
+
TezosSaplingCryptoClient.prototype.encryptCiphertext = function (tezosOutput, saplingDescription, rcm, esk, viewingKey) {
|
|
99
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
100
|
+
var address, _a, ovk, diversifier, pkd, symKey, nonceEnc, plaintextEnc, payloadEnc, epk, ock, nonceOut, plaintextOut, payloadOut;
|
|
101
|
+
return __generator(this, function (_b) {
|
|
102
|
+
switch (_b.label) {
|
|
103
|
+
case 0: return [4 /*yield*/, TezosSaplingAddress_1.TezosSaplingAddress.fromValue(tezosOutput.address)];
|
|
104
|
+
case 1:
|
|
105
|
+
address = _b.sent();
|
|
106
|
+
return [4 /*yield*/, Promise.all([
|
|
107
|
+
viewingKey !== undefined ? sapling.getOutgoingViewingKey(viewingKey) : undefined,
|
|
108
|
+
sapling.getDiversifiedFromRawPaymentAddress(address.raw),
|
|
109
|
+
sapling.getPkdFromRawPaymentAddress(address.raw)
|
|
110
|
+
])];
|
|
111
|
+
case 2:
|
|
112
|
+
_a = _b.sent(), ovk = _a[0], diversifier = _a[1], pkd = _a[2];
|
|
113
|
+
return [4 /*yield*/, this.getSymmetricKey(pkd, esk)];
|
|
114
|
+
case 3:
|
|
115
|
+
symKey = _b.sent();
|
|
116
|
+
nonceEnc = random_1.randomBytes(24);
|
|
117
|
+
plaintextEnc = Buffer.concat([
|
|
118
|
+
diversifier,
|
|
119
|
+
hex_1.toHexBuffer(new bignumber_1.default(tezosOutput.value), 64, '2sComplement'),
|
|
120
|
+
rcm,
|
|
121
|
+
hex_1.toHexBuffer(tezosOutput.memo.length, 32),
|
|
122
|
+
Buffer.from(tezosOutput.memo, 'hex')
|
|
123
|
+
]);
|
|
124
|
+
payloadEnc = nacl_1.secretBox(symKey, nonceEnc, plaintextEnc);
|
|
125
|
+
return [4 /*yield*/, sapling.deriveEphemeralPublicKey(diversifier, esk)];
|
|
126
|
+
case 4:
|
|
127
|
+
epk = _b.sent();
|
|
128
|
+
ock = ovk !== undefined
|
|
129
|
+
? blake2b_1.blake2bAsBytes(Buffer.concat([saplingDescription.cv, saplingDescription.cm, epk, ovk]), 256, {
|
|
130
|
+
key: Buffer.from(this.ockKey)
|
|
131
|
+
})
|
|
132
|
+
: random_1.randomBytes(32);
|
|
133
|
+
nonceOut = random_1.randomBytes(24);
|
|
134
|
+
plaintextOut = Buffer.concat([pkd, esk]);
|
|
135
|
+
payloadOut = nacl_1.secretBox(ock, nonceOut, plaintextOut);
|
|
136
|
+
return [2 /*return*/, {
|
|
137
|
+
cv: saplingDescription.cv.toString('hex'),
|
|
138
|
+
epk: epk.toString('hex'),
|
|
139
|
+
payload_enc: Buffer.from(payloadEnc).toString('hex'),
|
|
140
|
+
nonce_enc: Buffer.from(nonceEnc).toString('hex'),
|
|
141
|
+
payload_out: Buffer.from(payloadOut).toString('hex'),
|
|
142
|
+
nonce_out: Buffer.from(nonceOut).toString('hex')
|
|
143
|
+
}];
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
};
|
|
148
|
+
TezosSaplingCryptoClient.prototype.decryptCiphertextEnc = function (viewingKey, ciphertext, mode, commitment) {
|
|
149
|
+
if (mode === void 0) { mode = 'receiver'; }
|
|
150
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
151
|
+
var symKey, rawAddressFromDiversifier, ivk_1, _a, pkd_1, esk, openBox, decrypted, diversifier, amount, rcm, memo;
|
|
152
|
+
var _b;
|
|
153
|
+
return __generator(this, function (_c) {
|
|
154
|
+
switch (_c.label) {
|
|
155
|
+
case 0:
|
|
156
|
+
if (!(mode === 'receiver')) return [3 /*break*/, 3];
|
|
157
|
+
return [4 /*yield*/, sapling.getIncomingViewingKey(viewingKey)];
|
|
158
|
+
case 1:
|
|
159
|
+
ivk_1 = _c.sent();
|
|
160
|
+
return [4 /*yield*/, this.getSymmetricKey(ciphertext.epk, ivk_1)];
|
|
161
|
+
case 2:
|
|
162
|
+
symKey = _c.sent();
|
|
163
|
+
rawAddressFromDiversifier = function (diversifier) { return sapling.getRawPaymentAddressFromIncomingViewingKey(ivk_1, diversifier); };
|
|
164
|
+
return [3 /*break*/, 7];
|
|
165
|
+
case 3:
|
|
166
|
+
if (!(mode === 'sender' && commitment !== undefined)) return [3 /*break*/, 6];
|
|
167
|
+
return [4 /*yield*/, this.decryptCiphertextOut(viewingKey, ciphertext, commitment)];
|
|
168
|
+
case 4:
|
|
169
|
+
_a = _c.sent(), pkd_1 = _a.pkd, esk = _a.esk;
|
|
170
|
+
return [4 /*yield*/, this.getSymmetricKey(pkd_1, esk)];
|
|
171
|
+
case 5:
|
|
172
|
+
symKey = _c.sent();
|
|
173
|
+
rawAddressFromDiversifier = function (diversifier) { return Promise.resolve(Buffer.concat([diversifier, pkd_1])); };
|
|
174
|
+
return [3 /*break*/, 7];
|
|
175
|
+
case 6: throw new Error('Not enough data has been provided to decrypt the ciphertext');
|
|
176
|
+
case 7:
|
|
177
|
+
openBox = nacl_1.openSecretBox(symKey, Buffer.from(ciphertext.nonce_enc, 'hex'), Buffer.from(ciphertext.payload_enc, 'hex'));
|
|
178
|
+
if (openBox === null) {
|
|
179
|
+
throw new Error('Failed to decrypt sapling ciphertext (enc)');
|
|
180
|
+
}
|
|
181
|
+
decrypted = Buffer.from(openBox);
|
|
182
|
+
diversifier = decrypted.slice(0, 11);
|
|
183
|
+
amount = new bignumber_1.default(decrypted.slice(11, 19).toString('hex'), 16);
|
|
184
|
+
rcm = decrypted.slice(19, 51);
|
|
185
|
+
memo = decrypted.slice(51);
|
|
186
|
+
_b = {
|
|
187
|
+
diversifier: diversifier
|
|
188
|
+
};
|
|
189
|
+
return [4 /*yield*/, rawAddressFromDiversifier(diversifier)];
|
|
190
|
+
case 8: return [2 /*return*/, (_b.address = _c.sent(),
|
|
191
|
+
_b.amount = amount,
|
|
192
|
+
_b.rcm = rcm,
|
|
193
|
+
_b.memo = memo,
|
|
194
|
+
_b)];
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
};
|
|
199
|
+
TezosSaplingCryptoClient.prototype.decryptCiphertextOut = function (viewingKey, ciphertext, commitment) {
|
|
200
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
201
|
+
var ovk, cv, cm, epk, ock, openBox, decrypted, pkd, esk;
|
|
202
|
+
return __generator(this, function (_a) {
|
|
203
|
+
switch (_a.label) {
|
|
204
|
+
case 0: return [4 /*yield*/, sapling.getOutgoingViewingKey(viewingKey)];
|
|
205
|
+
case 1:
|
|
206
|
+
ovk = _a.sent();
|
|
207
|
+
cv = Buffer.from(ciphertext.cv, 'hex');
|
|
208
|
+
cm = Buffer.isBuffer(commitment) ? commitment : Buffer.from(commitment, 'hex');
|
|
209
|
+
epk = Buffer.from(ciphertext.epk, 'hex');
|
|
210
|
+
ock = blake2b_1.blake2bAsBytes(Buffer.concat([cv, cm, epk, ovk]), 256, {
|
|
211
|
+
key: Buffer.from(this.ockKey)
|
|
212
|
+
});
|
|
213
|
+
openBox = nacl_1.openSecretBox(ock, Buffer.from(ciphertext.nonce_out, 'hex'), Buffer.from(ciphertext.payload_out, 'hex'));
|
|
214
|
+
if (openBox === null) {
|
|
215
|
+
throw new Error('Failed to decrypt sapling ciphertext (out)');
|
|
216
|
+
}
|
|
217
|
+
decrypted = Buffer.from(openBox);
|
|
218
|
+
pkd = decrypted.slice(0, 32);
|
|
219
|
+
esk = decrypted.slice(32);
|
|
220
|
+
return [2 /*return*/, { pkd: pkd, esk: esk }];
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
};
|
|
225
|
+
TezosSaplingCryptoClient.prototype.getSymmetricKey = function (p, sk) {
|
|
226
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
227
|
+
var ka;
|
|
228
|
+
return __generator(this, function (_a) {
|
|
229
|
+
switch (_a.label) {
|
|
230
|
+
case 0: return [4 /*yield*/, sapling.keyAgreement(p, sk)];
|
|
231
|
+
case 1:
|
|
232
|
+
ka = _a.sent();
|
|
233
|
+
return [2 /*return*/, Buffer.from(blake2b_1.blake2bAsBytes(ka, 256, { key: Buffer.from(this.kdfKey) }))];
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
};
|
|
238
|
+
return TezosSaplingCryptoClient;
|
|
239
|
+
}(Ed25519CryptoClient_1.Ed25519CryptoClient));
|
|
240
|
+
exports.TezosSaplingCryptoClient = TezosSaplingCryptoClient;
|
|
241
|
+
//# sourceMappingURL=TezosSaplingCryptoClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TezosSaplingCryptoClient.js","sourceRoot":"","sources":["../../../src/protocol/sapling/TezosSaplingCryptoClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iHAA0F;AAC1F,0FAAwF;AACxF,8DAAmE;AACnE,sDAA4D;AAC5D,4DAA+C;AAE/C,wCAA0D;AAC1D,4CAA+C;AAM/C,6DAA2D;AAc3D;IAA8C,4CAAmB;IAI/D,kCAA6B,iBAAoC;QAAjE,YACE,iBAAO,SACR;QAF4B,uBAAiB,GAAjB,iBAAiB,CAAmB;QAHhD,YAAM,GAAW,+BAA+B,CAAA;QAChD,YAAM,GAAW,sBAAsB,CAAA;;IAIxD,CAAC;IAEM,8CAAW,GAAlB,UAAmB,OAAe,EAAE,OAA+D;QACjG,OAAO,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IAC7D,CAAC;IAEM,gDAAa,GAApB,UAAqB,OAAe,EAAE,SAAiB,EAAE,SAAiB;QACxE,OAAO,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,CAAC,CAAA;IAC5E,CAAC;IAEY,oDAAiB,GAA9B,UACE,WAA+B,EAC/B,kBAAmD,EACnD,GAAW,EACX,GAAW,EACX,UAAmB;;;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wBACD,IAAI,OAAO,KAAK,IAAI,EAAE;4BACpB,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAA;yBAC9D;wBACK,SAAS,GAAW,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;wBAExC,GAAG,GAAW,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;wBACpC,GAAG,GAAW,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;wBAEvC,sBAAO,EAAE,GAAG,KAAA,EAAE,GAAG,KAAA,EAAE,EAAA;;;;KACpB;IAEa,kDAAe,GAA7B,UAA8B,CAA+B,EAAE,EAAgC;;;;;4BAC1E,qBAAM,OAAO,CAAC,YAAY,CAAC,CAAC,EAAE,EAAE,CAAC,EAAA;;wBAA9C,EAAE,GAAW,SAAiC;wBAEpD,sBAAO,MAAM,CAAC,IAAI,CAAC,wBAAc,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAA;;;;KAC/E;IACH,+BAAC;AAAD,CAAC,AA9ID,CAA8C,yCAAmB,GA8IhE;AA9IY,4DAAwB"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { FeeDefaults, ICoinProtocol, ICoinSubProtocol } from '@airgap/coinlib-core';
|
|
3
|
+
import { AirGapTransactionStatus, IAirGapTransaction } from '@airgap/coinlib-core/interfaces/IAirGapTransaction';
|
|
4
|
+
import { CurrencyUnit } from '@airgap/coinlib-core/protocols/ICoinProtocol';
|
|
5
|
+
import { NonExtendedProtocol } from '@airgap/coinlib-core/protocols/NonExtendedProtocol';
|
|
6
|
+
import { ProtocolSymbols } from '@airgap/coinlib-core/utils/ProtocolSymbols';
|
|
7
|
+
import { SignedTezosTransaction } from '../../types/signed-transaction-tezos';
|
|
8
|
+
import { RawTezosSaplingTransaction, RawTezosTransaction } from '../../types/transaction-tezos';
|
|
9
|
+
import { UnsignedTezosTransaction } from '../../types/unsigned-transaction-tezos';
|
|
10
|
+
import { UnsignedTezosSaplingTransaction } from '../../types/unsigned-transaction-tezos-sapling';
|
|
11
|
+
import { TezosContract } from '../contract/TezosContract';
|
|
12
|
+
import { TezosContractCall } from '../contract/TezosContractCall';
|
|
13
|
+
import { TezosProtocol } from '../TezosProtocol';
|
|
14
|
+
import { TezosTransactionParameters } from '../types/operations/Transaction';
|
|
15
|
+
import { TezosSaplingAddressCursor } from '../types/sapling/TezosSaplingAddressCursor';
|
|
16
|
+
import { TezosSaplingAddressResult } from '../types/sapling/TezosSaplingAddressResult';
|
|
17
|
+
import { TezosSaplingTransactionCursor } from '../types/sapling/TezosSaplingTransactionCursor';
|
|
18
|
+
import { TezosSaplingTransactionResult } from '../types/sapling/TezosSaplingTransactionResult';
|
|
19
|
+
import { TezosSaplingNodeClient } from './node/TezosSaplingNodeClient';
|
|
20
|
+
import { TezosSaplingCryptoClient } from './TezosSaplingCryptoClient';
|
|
21
|
+
import { TezosSaplingProtocolOptions } from './TezosSaplingProtocolOptions';
|
|
22
|
+
import { TezosSaplingBookkeeper } from './utils/TezosSaplingBookkeeper';
|
|
23
|
+
import { TezosSaplingEncoder } from './utils/TezosSaplingEncoder';
|
|
24
|
+
import { TezosSaplingForger } from './utils/TezosSaplingForger';
|
|
25
|
+
import { TezosSaplingState } from './utils/TezosSaplingState';
|
|
26
|
+
export declare abstract class TezosSaplingProtocol extends NonExtendedProtocol implements ICoinProtocol {
|
|
27
|
+
readonly options: TezosSaplingProtocolOptions;
|
|
28
|
+
readonly symbol: string;
|
|
29
|
+
readonly name: string;
|
|
30
|
+
readonly marketSymbol: string;
|
|
31
|
+
readonly feeSymbol: string;
|
|
32
|
+
readonly feeDefaults: FeeDefaults;
|
|
33
|
+
readonly decimals: number;
|
|
34
|
+
readonly feeDecimals: number;
|
|
35
|
+
readonly identifier: ProtocolSymbols;
|
|
36
|
+
readonly units: CurrencyUnit[];
|
|
37
|
+
readonly supportsHD: boolean;
|
|
38
|
+
readonly standardDerivationPath: string;
|
|
39
|
+
readonly addressIsCaseSensitive: boolean;
|
|
40
|
+
readonly addressValidationPattern: string;
|
|
41
|
+
readonly addressPlaceholder: string;
|
|
42
|
+
readonly cryptoClient: TezosSaplingCryptoClient;
|
|
43
|
+
readonly nodeClient: TezosSaplingNodeClient;
|
|
44
|
+
readonly contract: TezosContract;
|
|
45
|
+
readonly bookkeeper: TezosSaplingBookkeeper;
|
|
46
|
+
readonly encoder: TezosSaplingEncoder;
|
|
47
|
+
readonly forger: TezosSaplingForger;
|
|
48
|
+
readonly state: TezosSaplingState;
|
|
49
|
+
readonly tezosProtocol: TezosProtocol;
|
|
50
|
+
constructor(options: TezosSaplingProtocolOptions);
|
|
51
|
+
abstract prepareContractCalls(transactions: string[]): Promise<TezosContractCall[]>;
|
|
52
|
+
abstract parseParameters(parameters: TezosTransactionParameters): Promise<string[]>;
|
|
53
|
+
getSymbol(): Promise<string>;
|
|
54
|
+
getName(): Promise<string>;
|
|
55
|
+
getMarketSymbol(): Promise<string>;
|
|
56
|
+
getFeeSymbol(): Promise<string>;
|
|
57
|
+
getDecimals(): Promise<number>;
|
|
58
|
+
getFeeDecimals(): Promise<number>;
|
|
59
|
+
getIdentifier(): Promise<ProtocolSymbols>;
|
|
60
|
+
getFeeDefaults(): Promise<FeeDefaults>;
|
|
61
|
+
getUnits(): Promise<CurrencyUnit[]>;
|
|
62
|
+
getSupportsHD(): Promise<boolean>;
|
|
63
|
+
getStandardDerivationPath(): Promise<string>;
|
|
64
|
+
getAddressIsCaseSensitive(): Promise<boolean>;
|
|
65
|
+
getAddressValidationPattern(): Promise<string>;
|
|
66
|
+
getAddressPlaceholder(): Promise<string>;
|
|
67
|
+
getOptions(): Promise<TezosSaplingProtocolOptions>;
|
|
68
|
+
initParameters(spendParams: Buffer, outputParams: Buffer): Promise<void>;
|
|
69
|
+
getBlockExplorerLinkForTxId(txId: string): Promise<string>;
|
|
70
|
+
getPublicKeyFromMnemonic(mnemonic: string, derivationPath: string, password?: string | undefined): Promise<string>;
|
|
71
|
+
getPrivateKeyFromMnemonic(mnemonic: string, derivationPath: string, password?: string | undefined): Promise<string>;
|
|
72
|
+
private getSeedFromMnemonic;
|
|
73
|
+
getPublicKeyFromHexSecret(secret: string, derivationPath: string): Promise<string>;
|
|
74
|
+
getPrivateKeyFromHexSecret(secret: string, derivationPath: string): Promise<string>;
|
|
75
|
+
getAddressFromPublicKey(viewingKey: string, cursor?: TezosSaplingAddressCursor): Promise<TezosSaplingAddressResult>;
|
|
76
|
+
getAddressesFromPublicKey(viewingKey: string, cursor?: TezosSaplingAddressCursor): Promise<TezosSaplingAddressResult[]>;
|
|
77
|
+
getAddressFromViewingKey(viewingKey: string, index: string): Promise<TezosSaplingAddressResult>;
|
|
78
|
+
getTransactionsFromPublicKey(publicKey: string, limit: number, cursor?: TezosSaplingTransactionCursor): Promise<TezosSaplingTransactionResult>;
|
|
79
|
+
signWithPrivateKey(privateKey: string, transaction: RawTezosSaplingTransaction): Promise<string>;
|
|
80
|
+
getTransactionDetails(transaction: UnsignedTezosTransaction | UnsignedTezosSaplingTransaction, data?: {
|
|
81
|
+
knownViewingKeys: string[];
|
|
82
|
+
}): Promise<IAirGapTransaction[]>;
|
|
83
|
+
getTransactionDetailsFromSigned(transaction: SignedTezosTransaction, data?: {
|
|
84
|
+
knownViewingKeys: string[];
|
|
85
|
+
}): Promise<IAirGapTransaction[]>;
|
|
86
|
+
private getTransactionDetailsFromWrappedOperation;
|
|
87
|
+
private getPartialDetailsFromContractParameters;
|
|
88
|
+
private filterOutPaybacks;
|
|
89
|
+
getBalanceOfPublicKey(publicKey: string): Promise<string>;
|
|
90
|
+
getTransactionStatuses(transactionHash: string[]): Promise<AirGapTransactionStatus[]>;
|
|
91
|
+
estimateMaxTransactionValueFromPublicKey(publicKey: string, recipients: string[], fee?: string | undefined): Promise<string>;
|
|
92
|
+
prepareTransactionFromPublicKey(publicKey: string, recipients: string[], values: string[], fee: string, data?: any): Promise<RawTezosSaplingTransaction>;
|
|
93
|
+
wrapSaplingTransactions(publicKey: string, transactionsOrString: string[] | string, fee: string, overrideFees?: boolean): Promise<RawTezosTransaction>;
|
|
94
|
+
private prepareTezosOperation;
|
|
95
|
+
prepareShieldTransaction(publicKey: string, recipient: string, value: string, fee: string, data?: {
|
|
96
|
+
overrideFees?: boolean;
|
|
97
|
+
}): Promise<RawTezosTransaction>;
|
|
98
|
+
prepareUnshieldTransaction(viewingKey: string, recipient: string, value: string, data?: any): Promise<RawTezosSaplingTransaction>;
|
|
99
|
+
prepareSaplingTransaction(viewingKey: string, recipient: string, value: string, data?: any): Promise<RawTezosSaplingTransaction>;
|
|
100
|
+
private mint;
|
|
101
|
+
private burn;
|
|
102
|
+
private chooseInputs;
|
|
103
|
+
private createPaymentOutput;
|
|
104
|
+
private createPaybackOutput;
|
|
105
|
+
private createDummyInput;
|
|
106
|
+
private createDummyOutput;
|
|
107
|
+
private getDummyAddress;
|
|
108
|
+
private createAddressBoundData;
|
|
109
|
+
private getAntiReplay;
|
|
110
|
+
broadcastTransaction(rawTransaction: any): Promise<string>;
|
|
111
|
+
signMessage(message: string, keypair: {
|
|
112
|
+
publicKey?: string | undefined;
|
|
113
|
+
privateKey: string;
|
|
114
|
+
}): Promise<string>;
|
|
115
|
+
verifyMessage(message: string, signature: string, publicKey: string): Promise<boolean>;
|
|
116
|
+
encryptAsymmetric(payload: string, publicKey: string): Promise<string>;
|
|
117
|
+
decryptAsymmetric(encryptedPayload: string, keypair: {
|
|
118
|
+
publicKey?: string | undefined;
|
|
119
|
+
privateKey: string;
|
|
120
|
+
}): Promise<string>;
|
|
121
|
+
encryptAES(payload: string, privateKey: string): Promise<string>;
|
|
122
|
+
decryptAES(encryptedPayload: string, privateKey: string): Promise<string>;
|
|
123
|
+
getBlockExplorerLinkForAddress(address: string): Promise<string>;
|
|
124
|
+
getTransactionsFromAddresses(addresses: string[], limit: number, cursor?: TezosSaplingTransactionCursor): Promise<TezosSaplingTransactionResult>;
|
|
125
|
+
getBalanceOfAddresses(addresses: string[]): Promise<string>;
|
|
126
|
+
getAvailableBalanceOfAddresses(addresses: string[]): Promise<string>;
|
|
127
|
+
getBalanceOfPublicKeyForSubProtocols(publicKey: string, subProtocols: ICoinSubProtocol[]): Promise<string[]>;
|
|
128
|
+
estimateFeeDefaultsFromPublicKey(publicKey: string, recipients: string[], values: string[], data?: any): Promise<FeeDefaults>;
|
|
129
|
+
private isRawTezosSaplingTransaction;
|
|
130
|
+
}
|