@airgap/tezos 0.13.45-beta.3 → 0.13.45-beta.4
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/package.json +5 -5
- package/v0/actions/GetKtAccountsAction.js +81 -11
- package/v0/actions/GetKtAccountsAction.js.map +1 -1
- package/v0/constants.js +6 -6
- package/v0/constants.js.map +1 -1
- package/v0/index.js +38 -38
- package/v0/index.js.map +1 -1
- package/v0/protocol/TezosAddress.d.ts +1 -0
- package/v0/protocol/TezosAddress.js +81 -41
- package/v0/protocol/TezosAddress.js.map +1 -1
- package/v0/protocol/TezosCryptoClient.d.ts +1 -0
- package/v0/protocol/TezosCryptoClient.js +123 -68
- package/v0/protocol/TezosCryptoClient.js.map +1 -1
- package/v0/protocol/TezosProtocol.js +1631 -978
- package/v0/protocol/TezosProtocol.js.map +1 -1
- package/v0/protocol/TezosProtocolOptions.d.ts +1 -1
- package/v0/protocol/TezosProtocolOptions.js +98 -26
- package/v0/protocol/TezosProtocolOptions.js.map +1 -1
- package/v0/protocol/TezosUtils.d.ts +1 -0
- package/v0/protocol/TezosUtils.js +165 -131
- package/v0/protocol/TezosUtils.js.map +1 -1
- package/v0/protocol/contract/TezosContract.js +472 -243
- package/v0/protocol/contract/TezosContract.js.map +1 -1
- package/v0/protocol/contract/TezosContractCall.js +10 -8
- package/v0/protocol/contract/TezosContractCall.js.map +1 -1
- package/v0/protocol/contract/TezosContractEntrypoint.js +19 -14
- package/v0/protocol/contract/TezosContractEntrypoint.js.map +1 -1
- package/v0/protocol/contract/TezosContractStorage.js +9 -8
- package/v0/protocol/contract/TezosContractStorage.js.map +1 -1
- package/v0/protocol/contract/remote-data/TezosContractRemoteDataFactory.js +25 -8
- package/v0/protocol/contract/remote-data/TezosContractRemoteDataFactory.js.map +1 -1
- package/v0/protocol/contract/remote-data/TezosStorageRemoteData.js +113 -39
- package/v0/protocol/contract/remote-data/TezosStorageRemoteData.js.map +1 -1
- package/v0/protocol/domains/TezosDomains.js +270 -165
- package/v0/protocol/domains/TezosDomains.js.map +1 -1
- package/v0/protocol/fa/TezosBTC.js +98 -19
- package/v0/protocol/fa/TezosBTC.js.map +1 -1
- package/v0/protocol/fa/TezosBTCtez.js +48 -17
- package/v0/protocol/fa/TezosBTCtez.js.map +1 -1
- package/v0/protocol/fa/TezosCTez.js +45 -17
- package/v0/protocol/fa/TezosCTez.js.map +1 -1
- package/v0/protocol/fa/TezosDOGA.js +45 -17
- package/v0/protocol/fa/TezosDOGA.js.map +1 -1
- package/v0/protocol/fa/TezosETHtz.js +68 -10
- package/v0/protocol/fa/TezosETHtz.js.map +1 -1
- package/v0/protocol/fa/TezosFA1Protocol.js +276 -119
- package/v0/protocol/fa/TezosFA1Protocol.js.map +1 -1
- package/v0/protocol/fa/TezosFA1p2Protocol.js +101 -22
- package/v0/protocol/fa/TezosFA1p2Protocol.js.map +1 -1
- package/v0/protocol/fa/TezosFA2Protocol.js +402 -213
- package/v0/protocol/fa/TezosFA2Protocol.js.map +1 -1
- package/v0/protocol/fa/TezosFAProtocol.js +418 -211
- package/v0/protocol/fa/TezosFAProtocol.js.map +1 -1
- package/v0/protocol/fa/TezosFAProtocolOptions.d.ts +2 -2
- package/v0/protocol/fa/TezosFAProtocolOptions.js +195 -92
- package/v0/protocol/fa/TezosFAProtocolOptions.js.map +1 -1
- package/v0/protocol/fa/TezosKolibriUSD.js +70 -11
- package/v0/protocol/fa/TezosKolibriUSD.js.map +1 -1
- package/v0/protocol/fa/TezosPlanty.js +45 -17
- package/v0/protocol/fa/TezosPlanty.js.map +1 -1
- package/v0/protocol/fa/TezosQUIPU.js +48 -17
- package/v0/protocol/fa/TezosQUIPU.js.map +1 -1
- package/v0/protocol/fa/TezosSIRS.js +45 -17
- package/v0/protocol/fa/TezosSIRS.js.map +1 -1
- package/v0/protocol/fa/TezosStaker.js +70 -11
- package/v0/protocol/fa/TezosStaker.js.map +1 -1
- package/v0/protocol/fa/TezosUBTC.js +48 -17
- package/v0/protocol/fa/TezosUBTC.js.map +1 -1
- package/v0/protocol/fa/TezosUDEFI.js +48 -17
- package/v0/protocol/fa/TezosUDEFI.js.map +1 -1
- package/v0/protocol/fa/TezosUSD.js +70 -11
- package/v0/protocol/fa/TezosUSD.js.map +1 -1
- package/v0/protocol/fa/TezosUSDT.js +48 -17
- package/v0/protocol/fa/TezosUSDT.js.map +1 -1
- package/v0/protocol/fa/TezosUUSD.js +27 -8
- package/v0/protocol/fa/TezosUUSD.js.map +1 -1
- package/v0/protocol/fa/TezosUXTZ.js +48 -17
- package/v0/protocol/fa/TezosUXTZ.js.map +1 -1
- package/v0/protocol/fa/TezosWRAP.js +48 -17
- package/v0/protocol/fa/TezosWRAP.js.map +1 -1
- package/v0/protocol/fa/TezosWrapped.js +70 -11
- package/v0/protocol/fa/TezosWrapped.js.map +1 -1
- package/v0/protocol/fa/TezosYOU.js +27 -8
- package/v0/protocol/fa/TezosYOU.js.map +1 -1
- package/v0/protocol/fa/metadata/BigMapTokenMetadataIndexer.js +162 -84
- package/v0/protocol/fa/metadata/BigMapTokenMetadataIndexer.js.map +1 -1
- package/v0/protocol/fa/metadata/ObjktTokenMetadataIndexer.js +87 -37
- package/v0/protocol/fa/metadata/ObjktTokenMetadataIndexer.js.map +1 -1
- package/v0/protocol/indexerClient/TezosIndexerClient.js +259 -115
- package/v0/protocol/indexerClient/TezosIndexerClient.js.map +1 -1
- package/v0/protocol/kt/TezosKtAddress.js +67 -7
- package/v0/protocol/kt/TezosKtAddress.js.map +1 -1
- package/v0/protocol/kt/TezosKtProtocol.js +309 -161
- package/v0/protocol/kt/TezosKtProtocol.js.map +1 -1
- package/v0/protocol/sapling/TezosSaplingAddress.d.ts +1 -0
- package/v0/protocol/sapling/TezosSaplingAddress.js +117 -46
- package/v0/protocol/sapling/TezosSaplingAddress.js.map +1 -1
- package/v0/protocol/sapling/TezosSaplingCryptoClient.d.ts +1 -0
- package/v0/protocol/sapling/TezosSaplingCryptoClient.js +220 -125
- package/v0/protocol/sapling/TezosSaplingCryptoClient.js.map +1 -1
- package/v0/protocol/sapling/TezosSaplingProtocol.d.ts +1 -0
- package/v0/protocol/sapling/TezosSaplingProtocol.js +1127 -600
- package/v0/protocol/sapling/TezosSaplingProtocol.js.map +1 -1
- package/v0/protocol/sapling/TezosSaplingProtocolOptions.d.ts +1 -0
- package/v0/protocol/sapling/TezosSaplingProtocolOptions.js +61 -32
- package/v0/protocol/sapling/TezosSaplingProtocolOptions.js.map +1 -1
- package/v0/protocol/sapling/TezosShieldedTezProtocol.js +134 -50
- package/v0/protocol/sapling/TezosShieldedTezProtocol.js.map +1 -1
- package/v0/protocol/sapling/injector/TezosSaplingInjectorClient.js +56 -10
- package/v0/protocol/sapling/injector/TezosSaplingInjectorClient.js.map +1 -1
- package/v0/protocol/sapling/node/TezosSaplingNodeClient.js +67 -12
- package/v0/protocol/sapling/node/TezosSaplingNodeClient.js.map +1 -1
- package/v0/protocol/sapling/utils/TezosSaplingBookkeeper.d.ts +1 -0
- package/v0/protocol/sapling/utils/TezosSaplingBookkeeper.js +539 -221
- package/v0/protocol/sapling/utils/TezosSaplingBookkeeper.js.map +1 -1
- package/v0/protocol/sapling/utils/TezosSaplingEncoder.d.ts +1 -0
- package/v0/protocol/sapling/utils/TezosSaplingEncoder.js +104 -101
- package/v0/protocol/sapling/utils/TezosSaplingEncoder.js.map +1 -1
- package/v0/protocol/sapling/utils/TezosSaplingForger.d.ts +1 -0
- package/v0/protocol/sapling/utils/TezosSaplingForger.js +266 -107
- package/v0/protocol/sapling/utils/TezosSaplingForger.js.map +1 -1
- package/v0/protocol/sapling/utils/TezosSaplingState.js +239 -110
- package/v0/protocol/sapling/utils/TezosSaplingState.js.map +1 -1
- package/v0/protocol/types/TezosOperationType.js +1 -1
- package/v0/protocol/types/TezosOperationType.js.map +1 -1
- package/v0/protocol/types/contract/BigMapEntry.d.ts +1 -1
- package/v0/protocol/types/contract/TezosContractMetadata.d.ts +2 -2
- package/v0/protocol/types/micheline/MichelineNode.d.ts +7 -7
- package/v0/protocol/types/micheline/MichelineNodeUtils.js +13 -9
- package/v0/protocol/types/micheline/MichelineNodeUtils.js.map +1 -1
- package/v0/protocol/types/michelson/MichelsonType.d.ts +1 -0
- package/v0/protocol/types/michelson/MichelsonType.js +12 -11
- package/v0/protocol/types/michelson/MichelsonType.js.map +1 -1
- package/v0/protocol/types/michelson/MichelsonTypeMeta.js +92 -45
- package/v0/protocol/types/michelson/MichelsonTypeMeta.js.map +1 -1
- package/v0/protocol/types/michelson/MichelsonTypeUtils.d.ts +1 -0
- package/v0/protocol/types/michelson/MichelsonTypeUtils.js +219 -58
- package/v0/protocol/types/michelson/MichelsonTypeUtils.js.map +1 -1
- package/v0/protocol/types/michelson/generics/MichelsonList.js +43 -24
- package/v0/protocol/types/michelson/generics/MichelsonList.js.map +1 -1
- package/v0/protocol/types/michelson/generics/MichelsonMap.js +61 -39
- package/v0/protocol/types/michelson/generics/MichelsonMap.js.map +1 -1
- package/v0/protocol/types/michelson/generics/MichelsonOption.d.ts +1 -1
- package/v0/protocol/types/michelson/generics/MichelsonOption.js +75 -46
- package/v0/protocol/types/michelson/generics/MichelsonOption.js.map +1 -1
- package/v0/protocol/types/michelson/generics/MichelsonOr.d.ts +1 -1
- package/v0/protocol/types/michelson/generics/MichelsonOr.js +76 -50
- package/v0/protocol/types/michelson/generics/MichelsonOr.js.map +1 -1
- package/v0/protocol/types/michelson/generics/MichelsonPair.js +85 -52
- package/v0/protocol/types/michelson/generics/MichelsonPair.js.map +1 -1
- package/v0/protocol/types/michelson/grammar/MichelsonGrammarData.d.ts +1 -1
- package/v0/protocol/types/michelson/grammar/MichelsonGrammarInstruction.d.ts +1 -1
- package/v0/protocol/types/michelson/grammar/MichelsonGrammarType.d.ts +1 -1
- package/v0/protocol/types/michelson/primitives/MichelsonAddress.d.ts +1 -0
- package/v0/protocol/types/michelson/primitives/MichelsonAddress.js +47 -28
- package/v0/protocol/types/michelson/primitives/MichelsonAddress.js.map +1 -1
- package/v0/protocol/types/michelson/primitives/MichelsonBool.js +39 -20
- package/v0/protocol/types/michelson/primitives/MichelsonBool.js.map +1 -1
- package/v0/protocol/types/michelson/primitives/MichelsonBytes.d.ts +1 -0
- package/v0/protocol/types/michelson/primitives/MichelsonBytes.js +54 -35
- package/v0/protocol/types/michelson/primitives/MichelsonBytes.js.map +1 -1
- package/v0/protocol/types/michelson/primitives/MichelsonInt.d.ts +1 -0
- package/v0/protocol/types/michelson/primitives/MichelsonInt.js +49 -30
- package/v0/protocol/types/michelson/primitives/MichelsonInt.js.map +1 -1
- package/v0/protocol/types/michelson/primitives/MichelsonString.d.ts +1 -0
- package/v0/protocol/types/michelson/primitives/MichelsonString.js +52 -33
- package/v0/protocol/types/michelson/primitives/MichelsonString.js.map +1 -1
- package/v0/protocol/types/michelson/primitives/MichelsonUnit.js +34 -14
- package/v0/protocol/types/michelson/primitives/MichelsonUnit.js.map +1 -1
- package/v0/protocol/types/sapling/TezosSaplingStateTree.d.ts +1 -1
- package/v0/protocol/types/sapling/TezosSaplingTransaction.d.ts +1 -0
- package/v0/protocol/types/utils.js +10 -8
- package/v0/protocol/types/utils.js.map +1 -1
- package/v0/serializer/validators/transaction-validator.js +78 -29
- package/v0/serializer/validators/transaction-validator.js.map +1 -1
- package/v0/serializer/validators/transaction-xtz-btc-validator.js +129 -55
- package/v0/serializer/validators/transaction-xtz-btc-validator.js.map +1 -1
- package/v0/serializer/validators/validators.js +103 -43
- package/v0/serializer/validators/validators.js.map +1 -1
- package/v1/block-explorer/TzKTBlockExplorer.js +61 -12
- package/v1/block-explorer/TzKTBlockExplorer.js.map +1 -1
- package/v1/block-explorer/factory.js +5 -4
- package/v1/block-explorer/factory.js.map +1 -1
- package/v1/contract/TezosContract.js +471 -242
- package/v1/contract/TezosContract.js.map +1 -1
- package/v1/contract/TezosContractCall.js +10 -8
- package/v1/contract/TezosContractCall.js.map +1 -1
- package/v1/contract/TezosContractEntrypoint.d.ts +1 -1
- package/v1/contract/TezosContractEntrypoint.js +19 -14
- package/v1/contract/TezosContractEntrypoint.js.map +1 -1
- package/v1/contract/TezosContractStorage.js +9 -8
- package/v1/contract/TezosContractStorage.js.map +1 -1
- package/v1/contract/remote-data/TezosContractRemoteDataFactory.js +25 -8
- package/v1/contract/remote-data/TezosContractRemoteDataFactory.js.map +1 -1
- package/v1/contract/remote-data/TezosStorageRemoteData.js +113 -39
- package/v1/contract/remote-data/TezosStorageRemoteData.js.map +1 -1
- package/v1/crypto/TezosCryptoClient.d.ts +1 -0
- package/v1/crypto/TezosCryptoClient.js +117 -64
- package/v1/crypto/TezosCryptoClient.js.map +1 -1
- package/v1/crypto/TezosSaplingCryptoClient.d.ts +1 -0
- package/v1/crypto/TezosSaplingCryptoClient.js +194 -116
- package/v1/crypto/TezosSaplingCryptoClient.js.map +1 -1
- package/v1/data/TezosAddress.js +14 -13
- package/v1/data/TezosAddress.js.map +1 -1
- package/v1/data/TezosSaplingAddress.d.ts +1 -0
- package/v1/data/TezosSaplingAddress.js +94 -29
- package/v1/data/TezosSaplingAddress.js.map +1 -1
- package/v1/domains/TezosDomains.js +270 -165
- package/v1/domains/TezosDomains.js.map +1 -1
- package/v1/index.js +39 -39
- package/v1/index.js.map +1 -1
- package/v1/indexer/TzKTIndexerClient.js +270 -126
- package/v1/indexer/TzKTIndexerClient.js.map +1 -1
- package/v1/indexer/factory.js +5 -4
- package/v1/indexer/factory.js.map +1 -1
- package/v1/indexer/token-metadata/BigMapTokenMetadataIndexerClient.js +161 -83
- package/v1/indexer/token-metadata/BigMapTokenMetadataIndexerClient.js.map +1 -1
- package/v1/indexer/token-metadata/ObjktTokenMetadataIndexerClient.js +85 -36
- package/v1/indexer/token-metadata/ObjktTokenMetadataIndexerClient.js.map +1 -1
- package/v1/injector/TezosSaplingInjectorClient.js +56 -10
- package/v1/injector/TezosSaplingInjectorClient.js.map +1 -1
- package/v1/module/TezosModule.js +155 -88
- package/v1/module/TezosModule.js.map +1 -1
- package/v1/module.js +3 -2
- package/v1/module.js.map +1 -1
- package/v1/node/TezosSaplingNodeClient.js +67 -12
- package/v1/node/TezosSaplingNodeClient.js.map +1 -1
- package/v1/protocol/TezosProtocol.js +1385 -848
- package/v1/protocol/TezosProtocol.js.map +1 -1
- package/v1/protocol/fa/TezosFA1Protocol.js +205 -81
- package/v1/protocol/fa/TezosFA1Protocol.js.map +1 -1
- package/v1/protocol/fa/TezosFA1p2Protocol.js +111 -32
- package/v1/protocol/fa/TezosFA1p2Protocol.js.map +1 -1
- package/v1/protocol/fa/TezosFA2Protocol.js +332 -174
- package/v1/protocol/fa/TezosFA2Protocol.js.map +1 -1
- package/v1/protocol/fa/TezosFAProtocol.js +528 -255
- package/v1/protocol/fa/TezosFAProtocol.js.map +1 -1
- package/v1/protocol/fa/tokens/BTCTezProtocol.d.ts +2 -2
- package/v1/protocol/fa/tokens/BTCTezProtocol.js +47 -30
- package/v1/protocol/fa/tokens/BTCTezProtocol.js.map +1 -1
- package/v1/protocol/fa/tokens/CTezProtocol.d.ts +2 -2
- package/v1/protocol/fa/tokens/CTezProtocol.js +47 -27
- package/v1/protocol/fa/tokens/CTezProtocol.js.map +1 -1
- package/v1/protocol/fa/tokens/DogamiProtocol.d.ts +2 -2
- package/v1/protocol/fa/tokens/DogamiProtocol.js +47 -27
- package/v1/protocol/fa/tokens/DogamiProtocol.js.map +1 -1
- package/v1/protocol/fa/tokens/ETHTezProtocol.d.ts +2 -2
- package/v1/protocol/fa/tokens/ETHTezProtocol.js +90 -30
- package/v1/protocol/fa/tokens/ETHTezProtocol.js.map +1 -1
- package/v1/protocol/fa/tokens/KolibriUSDProtocol.d.ts +2 -2
- package/v1/protocol/fa/tokens/KolibriUSDProtocol.js +90 -30
- package/v1/protocol/fa/tokens/KolibriUSDProtocol.js.map +1 -1
- package/v1/protocol/fa/tokens/PlentyProtocol.d.ts +2 -2
- package/v1/protocol/fa/tokens/PlentyProtocol.js +90 -30
- package/v1/protocol/fa/tokens/PlentyProtocol.js.map +1 -1
- package/v1/protocol/fa/tokens/QuipuswapProtocol.d.ts +2 -2
- package/v1/protocol/fa/tokens/QuipuswapProtocol.js +47 -30
- package/v1/protocol/fa/tokens/QuipuswapProtocol.js.map +1 -1
- package/v1/protocol/fa/tokens/SiriusProtocol.d.ts +2 -2
- package/v1/protocol/fa/tokens/SiriusProtocol.js +47 -27
- package/v1/protocol/fa/tokens/SiriusProtocol.js.map +1 -1
- package/v1/protocol/fa/tokens/StakerProtocol.d.ts +2 -2
- package/v1/protocol/fa/tokens/StakerProtocol.js +90 -30
- package/v1/protocol/fa/tokens/StakerProtocol.js.map +1 -1
- package/v1/protocol/fa/tokens/TetherUSDProtocol.d.ts +2 -2
- package/v1/protocol/fa/tokens/TetherUSDProtocol.js +47 -30
- package/v1/protocol/fa/tokens/TetherUSDProtocol.js.map +1 -1
- package/v1/protocol/fa/tokens/TzBTCProtocol.d.ts +2 -2
- package/v1/protocol/fa/tokens/TzBTCProtocol.js +47 -27
- package/v1/protocol/fa/tokens/TzBTCProtocol.js.map +1 -1
- package/v1/protocol/fa/tokens/UBTCProtocol.d.ts +2 -2
- package/v1/protocol/fa/tokens/UBTCProtocol.js +47 -30
- package/v1/protocol/fa/tokens/UBTCProtocol.js.map +1 -1
- package/v1/protocol/fa/tokens/UDEFIProtocol.d.ts +2 -2
- package/v1/protocol/fa/tokens/UDEFIProtocol.js +47 -30
- package/v1/protocol/fa/tokens/UDEFIProtocol.js.map +1 -1
- package/v1/protocol/fa/tokens/USDTezProtocol.d.ts +2 -2
- package/v1/protocol/fa/tokens/USDTezProtocol.js +47 -27
- package/v1/protocol/fa/tokens/USDTezProtocol.js.map +1 -1
- package/v1/protocol/fa/tokens/UUSDProtocol.d.ts +2 -2
- package/v1/protocol/fa/tokens/UUSDProtocol.js +47 -30
- package/v1/protocol/fa/tokens/UUSDProtocol.js.map +1 -1
- package/v1/protocol/fa/tokens/UXTZProtocol.d.ts +2 -2
- package/v1/protocol/fa/tokens/UXTZProtocol.js +47 -30
- package/v1/protocol/fa/tokens/UXTZProtocol.js.map +1 -1
- package/v1/protocol/fa/tokens/WrapProtocol.d.ts +2 -2
- package/v1/protocol/fa/tokens/WrapProtocol.js +47 -30
- package/v1/protocol/fa/tokens/WrapProtocol.js.map +1 -1
- package/v1/protocol/fa/tokens/WrappedTezosProtocol.d.ts +2 -2
- package/v1/protocol/fa/tokens/WrappedTezosProtocol.js +47 -27
- package/v1/protocol/fa/tokens/WrappedTezosProtocol.js.map +1 -1
- package/v1/protocol/fa/tokens/YouProtocol.d.ts +2 -2
- package/v1/protocol/fa/tokens/YouProtocol.js +47 -30
- package/v1/protocol/fa/tokens/YouProtocol.js.map +1 -1
- package/v1/protocol/fa/tokens/stXTZProtocol.d.ts +2 -2
- package/v1/protocol/fa/tokens/stXTZProtocol.js +47 -30
- package/v1/protocol/fa/tokens/stXTZProtocol.js.map +1 -1
- package/v1/protocol/kt/TezosKtProtocol.js +498 -254
- package/v1/protocol/kt/TezosKtProtocol.js.map +1 -1
- package/v1/protocol/sapling/TezosSaplingProtocol.d.ts +1 -0
- package/v1/protocol/sapling/TezosSaplingProtocol.js +933 -532
- package/v1/protocol/sapling/TezosSaplingProtocol.js.map +1 -1
- package/v1/protocol/sapling/TezosShieldedTezProtocol.js +164 -72
- package/v1/protocol/sapling/TezosShieldedTezProtocol.js.map +1 -1
- package/v1/serializer/v3/schemas/converter/transaction-converter.js +26 -14
- package/v1/serializer/v3/schemas/converter/transaction-converter.js.map +1 -1
- package/v1/serializer/v3/serializer-companion.js +188 -103
- package/v1/serializer/v3/serializer-companion.js.map +1 -1
- package/v1/serializer/v3/validators/transaction-validator.js +143 -54
- package/v1/serializer/v3/validators/transaction-validator.js.map +1 -1
- package/v1/serializer/v3/validators/validators.js +100 -40
- package/v1/serializer/v3/validators/validators.js.map +1 -1
- package/v1/types/block-explorer.d.ts +1 -1
- package/v1/types/contract/TezosContractMetadata.d.ts +2 -2
- package/v1/types/contract/bigmap/BigMapEntry.d.ts +1 -1
- package/v1/types/crypto.d.ts +2 -2
- package/v1/types/fa/TezosFA1ContractEntrypoint.d.ts +1 -1
- package/v1/types/fa/TezosFA1p2ContractEntrypoint.d.ts +1 -1
- package/v1/types/fa/TezosFA2ContractEntrypoint.d.ts +1 -1
- package/v1/types/indexer.d.ts +1 -1
- package/v1/types/micheline/MichelineNode.d.ts +7 -7
- package/v1/types/micheline/MichelineNodeUtils.js +13 -9
- package/v1/types/micheline/MichelineNodeUtils.js.map +1 -1
- package/v1/types/michelson/MichelsonType.d.ts +1 -0
- package/v1/types/michelson/MichelsonType.js +12 -11
- package/v1/types/michelson/MichelsonType.js.map +1 -1
- package/v1/types/michelson/MichelsonTypeMeta.js +92 -45
- package/v1/types/michelson/MichelsonTypeMeta.js.map +1 -1
- package/v1/types/michelson/MichelsonTypeUtils.d.ts +1 -0
- package/v1/types/michelson/MichelsonTypeUtils.js +219 -58
- package/v1/types/michelson/MichelsonTypeUtils.js.map +1 -1
- package/v1/types/michelson/generics/MichelsonList.js +43 -24
- package/v1/types/michelson/generics/MichelsonList.js.map +1 -1
- package/v1/types/michelson/generics/MichelsonMap.js +61 -39
- package/v1/types/michelson/generics/MichelsonMap.js.map +1 -1
- package/v1/types/michelson/generics/MichelsonOption.d.ts +1 -1
- package/v1/types/michelson/generics/MichelsonOption.js +75 -46
- package/v1/types/michelson/generics/MichelsonOption.js.map +1 -1
- package/v1/types/michelson/generics/MichelsonOr.d.ts +1 -1
- package/v1/types/michelson/generics/MichelsonOr.js +76 -50
- package/v1/types/michelson/generics/MichelsonOr.js.map +1 -1
- package/v1/types/michelson/generics/MichelsonPair.js +85 -52
- package/v1/types/michelson/generics/MichelsonPair.js.map +1 -1
- package/v1/types/michelson/grammar/MichelsonGrammarData.d.ts +1 -1
- package/v1/types/michelson/grammar/MichelsonGrammarInstruction.d.ts +1 -1
- package/v1/types/michelson/grammar/MichelsonGrammarType.d.ts +1 -1
- package/v1/types/michelson/primitives/MichelsonAddress.d.ts +1 -0
- package/v1/types/michelson/primitives/MichelsonAddress.js +47 -28
- package/v1/types/michelson/primitives/MichelsonAddress.js.map +1 -1
- package/v1/types/michelson/primitives/MichelsonBool.js +39 -20
- package/v1/types/michelson/primitives/MichelsonBool.js.map +1 -1
- package/v1/types/michelson/primitives/MichelsonBytes.d.ts +1 -0
- package/v1/types/michelson/primitives/MichelsonBytes.js +54 -35
- package/v1/types/michelson/primitives/MichelsonBytes.js.map +1 -1
- package/v1/types/michelson/primitives/MichelsonInt.d.ts +1 -0
- package/v1/types/michelson/primitives/MichelsonInt.js +49 -30
- package/v1/types/michelson/primitives/MichelsonInt.js.map +1 -1
- package/v1/types/michelson/primitives/MichelsonString.d.ts +1 -0
- package/v1/types/michelson/primitives/MichelsonString.js +52 -33
- package/v1/types/michelson/primitives/MichelsonString.js.map +1 -1
- package/v1/types/michelson/primitives/MichelsonUnit.js +34 -14
- package/v1/types/michelson/primitives/MichelsonUnit.js.map +1 -1
- package/v1/types/network.js +1 -1
- package/v1/types/network.js.map +1 -1
- package/v1/types/operations/TezosOperationType.js +1 -1
- package/v1/types/operations/TezosOperationType.js.map +1 -1
- package/v1/types/protocol.d.ts +3 -3
- package/v1/types/sapling/TezosSaplingExternalMethodProvider.d.ts +1 -0
- package/v1/types/sapling/TezosSaplingStateTree.d.ts +1 -1
- package/v1/types/sapling/TezosSaplingTransaction.d.ts +1 -0
- package/v1/types/staking/TezosDelegatorAction.js +1 -1
- package/v1/types/staking/TezosDelegatorAction.js.map +1 -1
- package/v1/utils/address.js +7 -6
- package/v1/utils/address.js.map +1 -1
- package/v1/utils/bip.d.ts +1 -0
- package/v1/utils/bip.js +7 -6
- package/v1/utils/bip.js.map +1 -1
- package/v1/utils/convert.js +8 -7
- package/v1/utils/convert.js.map +1 -1
- package/v1/utils/encoding.d.ts +1 -0
- package/v1/utils/encoding.js +64 -74
- package/v1/utils/encoding.js.map +1 -1
- package/v1/utils/fa.js +3 -2
- package/v1/utils/fa.js.map +1 -1
- package/v1/utils/key.js +12 -9
- package/v1/utils/key.js.map +1 -1
- package/v1/utils/micheline.js +10 -8
- package/v1/utils/micheline.js.map +1 -1
- package/v1/utils/operations.js +22 -21
- package/v1/utils/operations.js.map +1 -1
- package/v1/utils/pack.d.ts +1 -0
- package/v1/utils/pack.js +107 -65
- package/v1/utils/pack.js.map +1 -1
- package/v1/utils/protocol/fa/TezosFA1Accountant.js +52 -24
- package/v1/utils/protocol/fa/TezosFA1Accountant.js.map +1 -1
- package/v1/utils/protocol/fa/TezosFA2Accountant.js +77 -40
- package/v1/utils/protocol/fa/TezosFA2Accountant.js.map +1 -1
- package/v1/utils/protocol/fa/TezosFAAccountant.js +89 -21
- package/v1/utils/protocol/fa/TezosFAAccountant.js.map +1 -1
- package/v1/utils/protocol/instance.js +26 -90
- package/v1/utils/protocol/instance.js.map +1 -1
- package/v1/utils/protocol/sapling/TezosSaplingAccountant.d.ts +1 -0
- package/v1/utils/protocol/sapling/TezosSaplingAccountant.js +539 -221
- package/v1/utils/protocol/sapling/TezosSaplingAccountant.js.map +1 -1
- package/v1/utils/protocol/sapling/TezosSaplingEncoder.d.ts +1 -0
- package/v1/utils/protocol/sapling/TezosSaplingEncoder.js +104 -101
- package/v1/utils/protocol/sapling/TezosSaplingEncoder.js.map +1 -1
- package/v1/utils/protocol/sapling/TezosSaplingForger.d.ts +1 -0
- package/v1/utils/protocol/sapling/TezosSaplingForger.js +266 -107
- package/v1/utils/protocol/sapling/TezosSaplingForger.js.map +1 -1
- package/v1/utils/protocol/sapling/TezosSaplingState.js +239 -110
- package/v1/utils/protocol/sapling/TezosSaplingState.js.map +1 -1
- package/v1/utils/protocol/tezos/TezosAccountant.js +166 -97
- package/v1/utils/protocol/tezos/TezosAccountant.js.map +1 -1
- package/v1/utils/protocol/tezos/TezosForger.js +76 -21
- package/v1/utils/protocol/tezos/TezosForger.js.map +1 -1
- package/v1/utils/signature.js +6 -5
- package/v1/utils/signature.js.map +1 -1
- package/v1/utils/transaction.d.ts +5 -4
- package/v1/utils/transaction.js +3 -3
- package/v1/utils/transaction.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/v0/protocol/types/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/v0/protocol/types/utils.ts"],"names":[],"mappings":";;;AAIA,SAAgB,eAAe,CAAC,IAAa;IAC3C,OAAO,wBAAwB,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;AAC1C,CAAC;AAFD,0CAEC;AAED,SAAS,wBAAwB,CAAC,IAAa,EAAE,cAAsB;IACrE,OAAO,CACL,oBAAoB,CAAC,KAAK,EAAE,IAAI,CAAC;QACjC,oBAAoB,CAAC,QAAQ,EAAE,IAAI,CAAC;QACpC,oBAAoB,CAAC,OAAO,EAAE,IAAI,CAAC;QACnC,kCAAkC,CAAC,IAAI,CAAC;QACxC,4BAA4B,CAAC,IAAI,EAAE,cAAc,CAAC,CACnD,CAAA;AACH,CAAC;AAED,SAAgB,oBAAoB,CAAuC,IAAO,EAAE,IAAa;IAC/F,OAAO,IAAI,YAAY,MAAM,IAAI,IAAI,IAAI,IAAI,CAAA;AAC/C,CAAC;AAFD,oDAEC;AAED,SAAgB,kCAAkC,CAAC,IAAa;IAC9D,OAAO,IAAI,YAAY,MAAM,IAAI,MAAM,IAAI,IAAI,CAAA;AACjD,CAAC;AAFD,gFAEC;AAED,SAAgB,+BAA+B,CAC7C,IAAO,EACP,IAAa;IAEb,OAAO,kCAAkC,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,CAAA;AACvE,CAAC;AALD,0EAKC;AAED,IAAM,mCAAmC,GAAW,CAAC,CAAA;AACrD,SAAgB,mBAAmB,CAAC,IAAa,EAAE,SAAyB;IAAzB,0BAAA,EAAA,gBAAyB;IAC1E,OAAO,4BAA4B,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,mCAAmC,GAAG,CAAC,CAAC,CAAA;AACpG,CAAC;AAFD,kDAEC;AAED,SAAS,4BAA4B,CAAC,IAAa,EAAE,cAAsB;IACzE,OAAO,CACL,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QACnB,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC;YAChB,8EAA8E;YAC9E,sHAAsH;YACtH,cAAc,GAAG,mCAAmC;YACpD,IAAI,CAAC,KAAK,CAAC,UAAC,OAAgB,IAAK,OAAA,wBAAwB,CAAC,OAAO,EAAE,cAAc,GAAG,CAAC,CAAC,EAArD,CAAqD,CAAC,CAAC,CAC3F,CAAA;AACH,CAAC"}
|
|
@@ -1,19 +1,55 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
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;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
2
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
39
|
exports.TezosTransactionValidatorFactoryV2 = exports.TezosTransactionValidatorFactory = exports.TezosTransactionValidator = void 0;
|
|
4
40
|
// tslint:disable: max-classes-per-file
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
41
|
+
var validate_1 = require("@airgap/coinlib-core/dependencies/src/validate.js-0.13.1/validate");
|
|
42
|
+
var serializer_1 = require("@airgap/serializer");
|
|
43
|
+
var unsignedTransactionConstraints = {
|
|
8
44
|
binaryTransaction: {
|
|
9
45
|
isValidTezosUnsignedTransaction: true,
|
|
10
46
|
presence: { allowEmpty: false },
|
|
11
47
|
type: 'String'
|
|
12
48
|
}
|
|
13
49
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
50
|
+
var success = function () { return undefined; };
|
|
51
|
+
var error = function (errors) { return errors; };
|
|
52
|
+
var signedTransactionConstraints = {
|
|
17
53
|
transaction: {
|
|
18
54
|
isValidTezosSignedTransaction: true,
|
|
19
55
|
presence: { allowEmpty: false },
|
|
@@ -24,35 +60,48 @@ const signedTransactionConstraints = {
|
|
|
24
60
|
type: 'String'
|
|
25
61
|
}
|
|
26
62
|
};
|
|
27
|
-
|
|
28
|
-
|
|
63
|
+
var TezosTransactionValidator = /** @class */ (function () {
|
|
64
|
+
function TezosTransactionValidator(version) {
|
|
65
|
+
if (version === void 0) { version = 'v3'; }
|
|
29
66
|
this.version = version;
|
|
30
67
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
68
|
+
TezosTransactionValidator.prototype.validateUnsignedTransaction = function (unsignedTx) {
|
|
69
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
70
|
+
var rawTx;
|
|
71
|
+
return __generator(this, function (_a) {
|
|
72
|
+
rawTx = unsignedTx.transaction;
|
|
73
|
+
if (this.version === 'v3') {
|
|
74
|
+
(0, serializer_1.validateSyncScheme)({});
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
(0, serializer_1.validateSyncSchemeV2)({});
|
|
78
|
+
}
|
|
79
|
+
return [2 /*return*/, (0, validate_1.async)(rawTx, unsignedTransactionConstraints).then(success, error)];
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
TezosTransactionValidator.prototype.validateSignedTransaction = function (signedTx) {
|
|
42
84
|
return (0, validate_1.async)(signedTx, signedTransactionConstraints).then(success, error);
|
|
43
|
-
}
|
|
44
|
-
|
|
85
|
+
};
|
|
86
|
+
return TezosTransactionValidator;
|
|
87
|
+
}());
|
|
45
88
|
exports.TezosTransactionValidator = TezosTransactionValidator;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return new TezosTransactionValidator('v3');
|
|
89
|
+
var TezosTransactionValidatorFactory = /** @class */ (function () {
|
|
90
|
+
function TezosTransactionValidatorFactory() {
|
|
49
91
|
}
|
|
50
|
-
|
|
92
|
+
TezosTransactionValidatorFactory.prototype.create = function () {
|
|
93
|
+
return new TezosTransactionValidator('v3');
|
|
94
|
+
};
|
|
95
|
+
return TezosTransactionValidatorFactory;
|
|
96
|
+
}());
|
|
51
97
|
exports.TezosTransactionValidatorFactory = TezosTransactionValidatorFactory;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return new TezosTransactionValidator('v2');
|
|
98
|
+
var TezosTransactionValidatorFactoryV2 = /** @class */ (function () {
|
|
99
|
+
function TezosTransactionValidatorFactoryV2() {
|
|
55
100
|
}
|
|
56
|
-
|
|
101
|
+
TezosTransactionValidatorFactoryV2.prototype.create = function () {
|
|
102
|
+
return new TezosTransactionValidator('v2');
|
|
103
|
+
};
|
|
104
|
+
return TezosTransactionValidatorFactoryV2;
|
|
105
|
+
}());
|
|
57
106
|
exports.TezosTransactionValidatorFactoryV2 = TezosTransactionValidatorFactoryV2;
|
|
58
107
|
//# sourceMappingURL=transaction-validator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction-validator.js","sourceRoot":"","sources":["../../../../src/v0/serializer/validators/transaction-validator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transaction-validator.js","sourceRoot":"","sources":["../../../../src/v0/serializer/validators/transaction-validator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAuC;AACvC,8FAAyF;AACzF,iDAO2B;AAK3B,IAAM,8BAA8B,GAAG;IACrC,iBAAiB,EAAE;QACjB,+BAA+B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,yBAAyB,CAAC,IAAI,CAAC,CAAA;IAC5C,CAAC;IACH,uCAAC;AAAD,CAAC,AAJD,IAIC;AAJY,4EAAgC;AAM7C;IAAA;IAIA,CAAC;IAHQ,mDAAM,GAAb;QACE,OAAO,IAAI,yBAAyB,CAAC,IAAI,CAAC,CAAA;IAC5C,CAAC;IACH,yCAAC;AAAD,CAAC,AAJD,IAIC;AAJY,gFAAkC"}
|
|
@@ -1,24 +1,60 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
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;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
2
38
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
39
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
40
|
};
|
|
5
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
42
|
exports.TezosBTCTransactionValidatorFactoryV2 = exports.TezosBTCTransactionValidatorFactory = exports.TezosBTCTransactionValidator = void 0;
|
|
7
43
|
// tslint:disable: max-classes-per-file
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
44
|
+
var bignumber_1 = __importDefault(require("@airgap/coinlib-core/dependencies/src/bignumber.js-9.0.0/bignumber"));
|
|
45
|
+
var validate_1 = require("@airgap/coinlib-core/dependencies/src/validate.js-0.13.1/validate");
|
|
46
|
+
var serializer_1 = require("@airgap/serializer");
|
|
47
|
+
var TezosBTC_1 = require("../../protocol/fa/TezosBTC");
|
|
48
|
+
var unsignedTransactionConstraints = {
|
|
13
49
|
binaryTransaction: {
|
|
14
50
|
isValidTezosUnsignedTransaction: true,
|
|
15
51
|
presence: { allowEmpty: false },
|
|
16
52
|
type: 'String'
|
|
17
53
|
}
|
|
18
54
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
55
|
+
var success = function () { return undefined; };
|
|
56
|
+
var error = function (errors) { return errors; };
|
|
57
|
+
var signedTransactionConstraints = {
|
|
22
58
|
transaction: {
|
|
23
59
|
isValidTezosSignedTransaction: true,
|
|
24
60
|
presence: { allowEmpty: false },
|
|
@@ -29,68 +65,106 @@ const signedTransactionConstraints = {
|
|
|
29
65
|
type: 'String'
|
|
30
66
|
}
|
|
31
67
|
};
|
|
32
|
-
|
|
33
|
-
|
|
68
|
+
var TezosBTCTransactionValidator = /** @class */ (function () {
|
|
69
|
+
function TezosBTCTransactionValidator(version) {
|
|
70
|
+
if (version === void 0) { version = 'v3'; }
|
|
34
71
|
this.version = version;
|
|
35
72
|
}
|
|
36
|
-
|
|
37
|
-
return
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
73
|
+
TezosBTCTransactionValidator.prototype.validateUnsignedTransaction = function (unsignedTx) {
|
|
74
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
75
|
+
var _this = this;
|
|
76
|
+
return __generator(this, function (_a) {
|
|
77
|
+
return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
|
|
78
|
+
var protocol, unforged, rawTx, errors;
|
|
79
|
+
var _this = this;
|
|
80
|
+
return __generator(this, function (_a) {
|
|
81
|
+
switch (_a.label) {
|
|
82
|
+
case 0:
|
|
83
|
+
protocol = new TezosBTC_1.TezosBTC();
|
|
84
|
+
return [4 /*yield*/, protocol.unforgeUnsignedTezosWrappedOperation(unsignedTx.transaction.binaryTransaction)];
|
|
85
|
+
case 1:
|
|
86
|
+
unforged = _a.sent();
|
|
87
|
+
rawTx = unsignedTx.transaction;
|
|
88
|
+
if (this.version === 'v3') {
|
|
89
|
+
(0, serializer_1.validateSyncScheme)({});
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
(0, serializer_1.validateSyncSchemeV2)({});
|
|
93
|
+
}
|
|
94
|
+
unforged.contents.forEach(function (operation) { return __awaiter(_this, void 0, void 0, function () {
|
|
95
|
+
var spendTransaction, errors_1, error_1;
|
|
96
|
+
return __generator(this, function (_a) {
|
|
97
|
+
switch (_a.label) {
|
|
98
|
+
case 0:
|
|
99
|
+
spendTransaction = operation;
|
|
100
|
+
_a.label = 1;
|
|
101
|
+
case 1:
|
|
102
|
+
_a.trys.push([1, 3, , 4]);
|
|
103
|
+
this.assertDestination(protocol, spendTransaction);
|
|
104
|
+
this.assertParameters(spendTransaction);
|
|
105
|
+
this.assertNoHiddenXTZAmount(spendTransaction);
|
|
106
|
+
return [4 /*yield*/, (0, validate_1.async)(rawTx, unsignedTransactionConstraints).then(success, error)];
|
|
107
|
+
case 2:
|
|
108
|
+
errors_1 = _a.sent();
|
|
109
|
+
resolve(errors_1);
|
|
110
|
+
return [3 /*break*/, 4];
|
|
111
|
+
case 3:
|
|
112
|
+
error_1 = _a.sent();
|
|
113
|
+
reject(error_1);
|
|
114
|
+
return [3 /*break*/, 4];
|
|
115
|
+
case 4: return [2 /*return*/];
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
}); });
|
|
119
|
+
return [4 /*yield*/, (0, validate_1.async)(rawTx, unsignedTransactionConstraints).then(success, error)];
|
|
120
|
+
case 2:
|
|
121
|
+
errors = _a.sent();
|
|
122
|
+
resolve(errors);
|
|
123
|
+
return [2 /*return*/];
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
}); })];
|
|
59
127
|
});
|
|
60
|
-
const errors = await (0, validate_1.async)(rawTx, unsignedTransactionConstraints).then(success, error);
|
|
61
|
-
resolve(errors);
|
|
62
128
|
});
|
|
63
|
-
}
|
|
64
|
-
validateSignedTransaction(signedTx) {
|
|
129
|
+
};
|
|
130
|
+
TezosBTCTransactionValidator.prototype.validateSignedTransaction = function (signedTx) {
|
|
65
131
|
return (0, validate_1.async)(signedTx, signedTransactionConstraints).then(success, error);
|
|
66
|
-
}
|
|
67
|
-
assertDestination(protocol, transaction) {
|
|
132
|
+
};
|
|
133
|
+
TezosBTCTransactionValidator.prototype.assertDestination = function (protocol, transaction) {
|
|
68
134
|
if (transaction.destination !== protocol.options.config.contractAddress) {
|
|
69
|
-
throw new Error(
|
|
135
|
+
throw new Error("the contract address for a xtz-btc transfer must be ".concat(protocol.options.config.contractAddress, ", but is ").concat(transaction.destination));
|
|
70
136
|
}
|
|
71
|
-
}
|
|
72
|
-
assertParameters(transaction) {
|
|
73
|
-
|
|
137
|
+
};
|
|
138
|
+
TezosBTCTransactionValidator.prototype.assertParameters = function (transaction) {
|
|
139
|
+
var _a;
|
|
140
|
+
if (((_a = transaction.parameters) === null || _a === void 0 ? void 0 : _a.entrypoint) === undefined) {
|
|
74
141
|
throw new Error('a contract transaction for xtz-btc should have an entrypoint defined');
|
|
75
142
|
}
|
|
76
|
-
}
|
|
77
|
-
assertNoHiddenXTZAmount(transaction) {
|
|
143
|
+
};
|
|
144
|
+
TezosBTCTransactionValidator.prototype.assertNoHiddenXTZAmount = function (transaction) {
|
|
78
145
|
if (!new bignumber_1.default(transaction.amount).eq(0)) {
|
|
79
146
|
throw new Error('a contract call cannot have the specified amount other than 0');
|
|
80
147
|
}
|
|
81
|
-
}
|
|
82
|
-
|
|
148
|
+
};
|
|
149
|
+
return TezosBTCTransactionValidator;
|
|
150
|
+
}());
|
|
83
151
|
exports.TezosBTCTransactionValidator = TezosBTCTransactionValidator;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
return new TezosBTCTransactionValidator('v3');
|
|
152
|
+
var TezosBTCTransactionValidatorFactory = /** @class */ (function () {
|
|
153
|
+
function TezosBTCTransactionValidatorFactory() {
|
|
87
154
|
}
|
|
88
|
-
|
|
155
|
+
TezosBTCTransactionValidatorFactory.prototype.create = function () {
|
|
156
|
+
return new TezosBTCTransactionValidator('v3');
|
|
157
|
+
};
|
|
158
|
+
return TezosBTCTransactionValidatorFactory;
|
|
159
|
+
}());
|
|
89
160
|
exports.TezosBTCTransactionValidatorFactory = TezosBTCTransactionValidatorFactory;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
return new TezosBTCTransactionValidator('v2');
|
|
161
|
+
var TezosBTCTransactionValidatorFactoryV2 = /** @class */ (function () {
|
|
162
|
+
function TezosBTCTransactionValidatorFactoryV2() {
|
|
93
163
|
}
|
|
94
|
-
|
|
164
|
+
TezosBTCTransactionValidatorFactoryV2.prototype.create = function () {
|
|
165
|
+
return new TezosBTCTransactionValidator('v2');
|
|
166
|
+
};
|
|
167
|
+
return TezosBTCTransactionValidatorFactoryV2;
|
|
168
|
+
}());
|
|
95
169
|
exports.TezosBTCTransactionValidatorFactoryV2 = TezosBTCTransactionValidatorFactoryV2;
|
|
96
170
|
//# sourceMappingURL=transaction-xtz-btc-validator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction-xtz-btc-validator.js","sourceRoot":"","sources":["../../../../src/v0/serializer/validators/transaction-xtz-btc-validator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transaction-xtz-btc-validator.js","sourceRoot":"","sources":["../../../../src/v0/serializer/validators/transaction-xtz-btc-validator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAuC;AACvC,iHAA0F;AAC1F,8FAAyF;AACzF,iDAO2B;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ACH,CAAC;IAEO,8DAAuB,GAA/B,UAAgC,WAAsC;QACpE,IAAI,CAAC,IAAI,mBAAS,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;YAC5C,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAA;SACjF;IACH,CAAC;IACH,mCAAC;AAAD,CAAC,AAxDD,IAwDC;AAxDY,oEAA4B;AA0DzC;IAAA;IAIA,CAAC;IAHQ,oDAAM,GAAb;QACE,OAAO,IAAI,4BAA4B,CAAC,IAAI,CAAC,CAAA;IAC/C,CAAC;IACH,0CAAC;AAAD,CAAC,AAJD,IAIC;AAJY,kFAAmC;AAMhD;IAAA;IAIA,CAAC;IAHQ,sDAAM,GAAb;QACE,OAAO,IAAI,4BAA4B,CAAC,IAAI,CAAC,CAAA;IAC/C,CAAC;IACH,4CAAC;AAAD,CAAC,AAJD,IAIC;AAJY,sFAAqC"}
|
|
@@ -1,55 +1,115 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
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;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
2
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
validate_1.validators.isValidTezosUnsignedTransaction = (binaryTx)
|
|
6
|
-
|
|
7
|
-
|
|
39
|
+
var validate_1 = require("@airgap/coinlib-core/dependencies/src/validate.js-0.13.1/validate");
|
|
40
|
+
var TezosProtocol_1 = require("../../protocol/TezosProtocol");
|
|
41
|
+
validate_1.validators.isValidTezosUnsignedTransaction = function (binaryTx) {
|
|
42
|
+
var rawTx = { binaryTransaction: binaryTx };
|
|
43
|
+
var unsignedTx = {
|
|
8
44
|
transaction: rawTx,
|
|
9
45
|
publicKey: '',
|
|
10
46
|
callbackURL: ''
|
|
11
47
|
};
|
|
12
|
-
return new Promise(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
48
|
+
return new Promise(function (resolve, reject) { return __awaiter(void 0, void 0, void 0, function () {
|
|
49
|
+
var protocol, error_1;
|
|
50
|
+
return __generator(this, function (_a) {
|
|
51
|
+
switch (_a.label) {
|
|
52
|
+
case 0:
|
|
53
|
+
if (binaryTx === null || typeof binaryTx === 'undefined') {
|
|
54
|
+
reject('not a valid Tezos transaction');
|
|
55
|
+
}
|
|
56
|
+
protocol = new TezosProtocol_1.TezosProtocol();
|
|
57
|
+
// allow empty values by default (needs to be checked by "presence" check)
|
|
58
|
+
if (binaryTx === null || typeof binaryTx === 'undefined') {
|
|
59
|
+
reject();
|
|
60
|
+
}
|
|
61
|
+
_a.label = 1;
|
|
62
|
+
case 1:
|
|
63
|
+
_a.trys.push([1, 3, , 4]);
|
|
64
|
+
return [4 /*yield*/, protocol.getTransactionDetails(unsignedTx)];
|
|
65
|
+
case 2:
|
|
66
|
+
_a.sent();
|
|
67
|
+
resolve();
|
|
68
|
+
return [3 /*break*/, 4];
|
|
69
|
+
case 3:
|
|
70
|
+
error_1 = _a.sent();
|
|
71
|
+
// console.log(error)
|
|
72
|
+
reject('not a valid Tezos transaction');
|
|
73
|
+
return [3 /*break*/, 4];
|
|
74
|
+
case 4: return [2 /*return*/];
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}); });
|
|
30
78
|
};
|
|
31
|
-
validate_1.validators.isValidTezosSignedTransaction = (signedTransaction)
|
|
32
|
-
|
|
79
|
+
validate_1.validators.isValidTezosSignedTransaction = function (signedTransaction) {
|
|
80
|
+
var signedTx = {
|
|
33
81
|
accountIdentifier: '',
|
|
34
82
|
transaction: signedTransaction
|
|
35
83
|
};
|
|
36
|
-
return new Promise(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
84
|
+
return new Promise(function (resolve, reject) { return __awaiter(void 0, void 0, void 0, function () {
|
|
85
|
+
var protocol, error_2;
|
|
86
|
+
return __generator(this, function (_a) {
|
|
87
|
+
switch (_a.label) {
|
|
88
|
+
case 0:
|
|
89
|
+
if (signedTransaction === null || typeof signedTransaction === 'undefined') {
|
|
90
|
+
reject('not a valid Tezos transaction');
|
|
91
|
+
}
|
|
92
|
+
protocol = new TezosProtocol_1.TezosProtocol();
|
|
93
|
+
// allow empty values by default (needs to be checked by "presence" check)
|
|
94
|
+
if (signedTransaction === null || typeof signedTransaction === 'undefined') {
|
|
95
|
+
reject();
|
|
96
|
+
}
|
|
97
|
+
_a.label = 1;
|
|
98
|
+
case 1:
|
|
99
|
+
_a.trys.push([1, 3, , 4]);
|
|
100
|
+
return [4 /*yield*/, protocol.getTransactionDetailsFromSigned(signedTx)];
|
|
101
|
+
case 2:
|
|
102
|
+
_a.sent();
|
|
103
|
+
resolve();
|
|
104
|
+
return [3 /*break*/, 4];
|
|
105
|
+
case 3:
|
|
106
|
+
error_2 = _a.sent();
|
|
107
|
+
// console.log(error)
|
|
108
|
+
reject('not a valid Tezos transaction');
|
|
109
|
+
return [3 /*break*/, 4];
|
|
110
|
+
case 4: return [2 /*return*/];
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
}); });
|
|
54
114
|
};
|
|
55
115
|
//# sourceMappingURL=validators.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.js","sourceRoot":"","sources":["../../../../src/v0/serializer/validators/validators.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validators.js","sourceRoot":"","sources":["../../../../src/v0/serializer/validators/validators.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8FAA8F;AAC9F,8DAA4D;AAM5D,qBAAU,CAAC,+BAA+B,GAAG,UAAC,QAAgB;IAC5D,IAAM,KAAK,GAAwB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,CAAA;IAClE,IAAM,UAAU,GAA6B;QAC3C,WAAW,EAAE,KAAK;QAClB,SAAS,EAAE,EAAE;QACb,WAAW,EAAE,EAAE;KAChB,CAAA;IAED,OAAO,IAAI,OAAO,CAAO,UAAO,OAAO,EAAE,MAAM;;;;;oBAC7C,IAAI,QAAQ,KAAK,IAAI,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE;wBACxD,MAAM,CAAC,+BAA+B,CAAC,CAAA;qBACxC;oBACK,QAAQ,GAAG,IAAI,6BAAa,EAAE,CAAA;oBACpC,0EAA0E;oBAC1E,IAAI,QAAQ,KAAK,IAAI,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE;wBACxD,MAAM,EAAE,CAAA;qBACT;;;;oBAEC,qBAAM,QAAQ,CAAC,qBAAqB,CAAC,UAAU,CAAC,EAAA;;oBAAhD,SAAgD,CAAA;oBAChD,OAAO,EAAE,CAAA;;;;oBAET,qBAAqB;oBACrB,MAAM,CAAC,+BAA+B,CAAC,CAAA;;;;;SAE1C,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,qBAAU,CAAC,6BAA6B,GAAG,UAAC,iBAAyB;IACnE,IA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