@airgap/tezos 0.13.10 → 0.13.11-beta.1
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 +11 -9
- package/airgap-coinlib-tezos.min.js +0 -145616
- package/index.d.ts +0 -1
- package/index.js +0 -18
- package/index.js.map +0 -1
- package/v0/actions/GetKtAccountsAction.d.ts +0 -8
- package/v0/actions/GetKtAccountsAction.js +0 -87
- package/v0/actions/GetKtAccountsAction.js.map +0 -1
- package/v0/constants.d.ts +0 -18
- package/v0/constants.js +0 -28
- package/v0/constants.js.map +0 -1
- package/v0/index.d.ts +0 -46
- package/v0/index.js +0 -146
- package/v0/index.js.map +0 -1
- package/v0/protocol/TezosAddress.d.ts +0 -11
- package/v0/protocol/TezosAddress.js +0 -107
- package/v0/protocol/TezosAddress.js.map +0 -1
- package/v0/protocol/TezosCryptoClient.d.ts +0 -15
- package/v0/protocol/TezosCryptoClient.js +0 -160
- package/v0/protocol/TezosCryptoClient.js.map +0 -1
- package/v0/protocol/TezosProtocol.d.ts +0 -349
- package/v0/protocol/TezosProtocol.js +0 -1861
- package/v0/protocol/TezosProtocol.js.map +0 -1
- package/v0/protocol/TezosProtocolOptions.d.ts +0 -29
- package/v0/protocol/TezosProtocolOptions.js +0 -116
- package/v0/protocol/TezosProtocolOptions.js.map +0 -1
- package/v0/protocol/TezosUtils.d.ts +0 -40
- package/v0/protocol/TezosUtils.js +0 -301
- package/v0/protocol/TezosUtils.js.map +0 -1
- package/v0/protocol/contract/TezosContract.d.ts +0 -52
- package/v0/protocol/contract/TezosContract.js +0 -508
- package/v0/protocol/contract/TezosContract.js.map +0 -1
- package/v0/protocol/contract/TezosContractCall.d.ts +0 -11
- package/v0/protocol/contract/TezosContractCall.js +0 -23
- package/v0/protocol/contract/TezosContractCall.js.map +0 -1
- package/v0/protocol/contract/TezosContractEntrypoint.d.ts +0 -8
- package/v0/protocol/contract/TezosContractEntrypoint.js +0 -27
- package/v0/protocol/contract/TezosContractEntrypoint.js.map +0 -1
- package/v0/protocol/contract/TezosContractStorage.d.ts +0 -7
- package/v0/protocol/contract/TezosContractStorage.js +0 -16
- package/v0/protocol/contract/TezosContractStorage.js.map +0 -1
- package/v0/protocol/contract/remote-data/TezosContractRemoteDataFactory.d.ts +0 -11
- package/v0/protocol/contract/remote-data/TezosContractRemoteDataFactory.js +0 -36
- package/v0/protocol/contract/remote-data/TezosContractRemoteDataFactory.js.map +0 -1
- package/v0/protocol/contract/remote-data/TezosStorageRemoteData.d.ts +0 -12
- package/v0/protocol/contract/remote-data/TezosStorageRemoteData.js +0 -152
- package/v0/protocol/contract/remote-data/TezosStorageRemoteData.js.map +0 -1
- package/v0/protocol/domains/TezosDomains.d.ts +0 -20
- package/v0/protocol/domains/TezosDomains.js +0 -310
- package/v0/protocol/domains/TezosDomains.js.map +0 -1
- package/v0/protocol/fa/TezosBTC.d.ts +0 -12
- package/v0/protocol/fa/TezosBTC.js +0 -109
- package/v0/protocol/fa/TezosBTC.js.map +0 -1
- package/v0/protocol/fa/TezosBTCtez.d.ts +0 -10
- package/v0/protocol/fa/TezosBTCtez.js +0 -56
- package/v0/protocol/fa/TezosBTCtez.js.map +0 -1
- package/v0/protocol/fa/TezosCTez.d.ts +0 -10
- package/v0/protocol/fa/TezosCTez.js +0 -53
- package/v0/protocol/fa/TezosCTez.js.map +0 -1
- package/v0/protocol/fa/TezosDOGA.d.ts +0 -10
- package/v0/protocol/fa/TezosDOGA.js +0 -53
- package/v0/protocol/fa/TezosDOGA.js.map +0 -1
- package/v0/protocol/fa/TezosETHtz.d.ts +0 -9
- package/v0/protocol/fa/TezosETHtz.js +0 -74
- package/v0/protocol/fa/TezosETHtz.js.map +0 -1
- package/v0/protocol/fa/TezosFA1Protocol.d.ts +0 -27
- package/v0/protocol/fa/TezosFA1Protocol.js +0 -312
- package/v0/protocol/fa/TezosFA1Protocol.js.map +0 -1
- package/v0/protocol/fa/TezosFA1p2Protocol.d.ts +0 -8
- package/v0/protocol/fa/TezosFA1p2Protocol.js +0 -119
- package/v0/protocol/fa/TezosFA1p2Protocol.js.map +0 -1
- package/v0/protocol/fa/TezosFA2Protocol.d.ts +0 -58
- package/v0/protocol/fa/TezosFA2Protocol.js +0 -452
- package/v0/protocol/fa/TezosFA2Protocol.js.map +0 -1
- package/v0/protocol/fa/TezosFAProtocol.d.ts +0 -65
- package/v0/protocol/fa/TezosFAProtocol.js +0 -455
- package/v0/protocol/fa/TezosFAProtocol.js.map +0 -1
- package/v0/protocol/fa/TezosFAProtocolOptions.d.ts +0 -54
- package/v0/protocol/fa/TezosFAProtocolOptions.js +0 -230
- package/v0/protocol/fa/TezosFAProtocolOptions.js.map +0 -1
- package/v0/protocol/fa/TezosKolibriUSD.d.ts +0 -10
- package/v0/protocol/fa/TezosKolibriUSD.js +0 -76
- package/v0/protocol/fa/TezosKolibriUSD.js.map +0 -1
- package/v0/protocol/fa/TezosPlanty.d.ts +0 -10
- package/v0/protocol/fa/TezosPlanty.js +0 -53
- package/v0/protocol/fa/TezosPlanty.js.map +0 -1
- package/v0/protocol/fa/TezosQUIPU.d.ts +0 -10
- package/v0/protocol/fa/TezosQUIPU.js +0 -56
- package/v0/protocol/fa/TezosQUIPU.js.map +0 -1
- package/v0/protocol/fa/TezosSIRS.d.ts +0 -10
- package/v0/protocol/fa/TezosSIRS.js +0 -53
- package/v0/protocol/fa/TezosSIRS.js.map +0 -1
- package/v0/protocol/fa/TezosStaker.d.ts +0 -10
- package/v0/protocol/fa/TezosStaker.js +0 -76
- package/v0/protocol/fa/TezosStaker.js.map +0 -1
- package/v0/protocol/fa/TezosUBTC.d.ts +0 -10
- package/v0/protocol/fa/TezosUBTC.js +0 -56
- package/v0/protocol/fa/TezosUBTC.js.map +0 -1
- package/v0/protocol/fa/TezosUDEFI.d.ts +0 -10
- package/v0/protocol/fa/TezosUDEFI.js +0 -56
- package/v0/protocol/fa/TezosUDEFI.js.map +0 -1
- package/v0/protocol/fa/TezosUSD.d.ts +0 -10
- package/v0/protocol/fa/TezosUSD.js +0 -76
- package/v0/protocol/fa/TezosUSD.js.map +0 -1
- package/v0/protocol/fa/TezosUSDT.d.ts +0 -10
- package/v0/protocol/fa/TezosUSDT.js +0 -56
- package/v0/protocol/fa/TezosUSDT.js.map +0 -1
- package/v0/protocol/fa/TezosUUSD.d.ts +0 -6
- package/v0/protocol/fa/TezosUUSD.js +0 -33
- package/v0/protocol/fa/TezosUUSD.js.map +0 -1
- package/v0/protocol/fa/TezosWRAP.d.ts +0 -10
- package/v0/protocol/fa/TezosWRAP.js +0 -56
- package/v0/protocol/fa/TezosWRAP.js.map +0 -1
- package/v0/protocol/fa/TezosWrapped.d.ts +0 -10
- package/v0/protocol/fa/TezosWrapped.js +0 -76
- package/v0/protocol/fa/TezosWrapped.js.map +0 -1
- package/v0/protocol/fa/TezosYOU.d.ts +0 -6
- package/v0/protocol/fa/TezosYOU.js +0 -33
- package/v0/protocol/fa/TezosYOU.js.map +0 -1
- package/v0/protocol/fa/metadata/BigMapTokenMetadataIndexer.d.ts +0 -13
- package/v0/protocol/fa/metadata/BigMapTokenMetadataIndexer.js +0 -180
- package/v0/protocol/fa/metadata/BigMapTokenMetadataIndexer.js.map +0 -1
- package/v0/protocol/fa/metadata/ObjktTokenMetadataIndexer.d.ts +0 -8
- package/v0/protocol/fa/metadata/ObjktTokenMetadataIndexer.js +0 -97
- package/v0/protocol/fa/metadata/ObjktTokenMetadataIndexer.js.map +0 -1
- package/v0/protocol/fa/metadata/TokenMetadataIndexer.d.ts +0 -4
- package/v0/protocol/fa/metadata/TokenMetadataIndexer.js +0 -3
- package/v0/protocol/fa/metadata/TokenMetadataIndexer.js.map +0 -1
- package/v0/protocol/indexerClient/TezosIndexerClient.d.ts +0 -29
- package/v0/protocol/indexerClient/TezosIndexerClient.js +0 -269
- package/v0/protocol/indexerClient/TezosIndexerClient.js.map +0 -1
- package/v0/protocol/indexerClient/TezosProtocolIndexerClient.d.ts +0 -30
- package/v0/protocol/indexerClient/TezosProtocolIndexerClient.js +0 -3
- package/v0/protocol/indexerClient/TezosProtocolIndexerClient.js.map +0 -1
- package/v0/protocol/kt/TezosKtAddress.d.ts +0 -5
- package/v0/protocol/kt/TezosKtAddress.js +0 -74
- package/v0/protocol/kt/TezosKtAddress.js.map +0 -1
- package/v0/protocol/kt/TezosKtProtocol.d.ts +0 -30
- package/v0/protocol/kt/TezosKtProtocol.js +0 -320
- package/v0/protocol/kt/TezosKtProtocol.js.map +0 -1
- package/v0/protocol/sapling/TezosSaplingAddress.d.ts +0 -12
- package/v0/protocol/sapling/TezosSaplingAddress.js +0 -141
- package/v0/protocol/sapling/TezosSaplingAddress.js.map +0 -1
- package/v0/protocol/sapling/TezosSaplingCryptoClient.d.ts +0 -34
- package/v0/protocol/sapling/TezosSaplingCryptoClient.js +0 -248
- package/v0/protocol/sapling/TezosSaplingCryptoClient.js.map +0 -1
- package/v0/protocol/sapling/TezosSaplingProtocol.d.ts +0 -135
- package/v0/protocol/sapling/TezosSaplingProtocol.js +0 -1182
- package/v0/protocol/sapling/TezosSaplingProtocol.js.map +0 -1
- package/v0/protocol/sapling/TezosSaplingProtocolOptions.d.ts +0 -45
- package/v0/protocol/sapling/TezosSaplingProtocolOptions.js +0 -73
- package/v0/protocol/sapling/TezosSaplingProtocolOptions.js.map +0 -1
- package/v0/protocol/sapling/TezosShieldedTezProtocol.d.ts +0 -12
- package/v0/protocol/sapling/TezosShieldedTezProtocol.js +0 -144
- package/v0/protocol/sapling/TezosShieldedTezProtocol.js.map +0 -1
- package/v0/protocol/sapling/injector/TezosSaplingInjectorClient.d.ts +0 -6
- package/v0/protocol/sapling/injector/TezosSaplingInjectorClient.js +0 -68
- package/v0/protocol/sapling/injector/TezosSaplingInjectorClient.js.map +0 -1
- package/v0/protocol/sapling/node/TezosSaplingNodeClient.d.ts +0 -8
- package/v0/protocol/sapling/node/TezosSaplingNodeClient.js +0 -78
- package/v0/protocol/sapling/node/TezosSaplingNodeClient.js.map +0 -1
- package/v0/protocol/sapling/utils/TezosSaplingBookkeeper.d.ts +0 -34
- package/v0/protocol/sapling/utils/TezosSaplingBookkeeper.js +0 -591
- package/v0/protocol/sapling/utils/TezosSaplingBookkeeper.js.map +0 -1
- package/v0/protocol/sapling/utils/TezosSaplingEncoder.d.ts +0 -22
- package/v0/protocol/sapling/utils/TezosSaplingEncoder.js +0 -158
- package/v0/protocol/sapling/utils/TezosSaplingEncoder.js.map +0 -1
- package/v0/protocol/sapling/utils/TezosSaplingForger.d.ts +0 -27
- package/v0/protocol/sapling/utils/TezosSaplingForger.js +0 -304
- package/v0/protocol/sapling/utils/TezosSaplingForger.js.map +0 -1
- package/v0/protocol/sapling/utils/TezosSaplingState.d.ts +0 -17
- package/v0/protocol/sapling/utils/TezosSaplingState.js +0 -266
- package/v0/protocol/sapling/utils/TezosSaplingState.js.map +0 -1
- package/v0/protocol/types/TezosAddressCursor.d.ts +0 -3
- package/v0/protocol/types/TezosAddressCursor.js +0 -3
- package/v0/protocol/types/TezosAddressCursor.js.map +0 -1
- package/v0/protocol/types/TezosAddressResult.d.ts +0 -4
- package/v0/protocol/types/TezosAddressResult.js +0 -3
- package/v0/protocol/types/TezosAddressResult.js.map +0 -1
- package/v0/protocol/types/TezosBlockHeader.d.ts +0 -13
- package/v0/protocol/types/TezosBlockHeader.js +0 -3
- package/v0/protocol/types/TezosBlockHeader.js.map +0 -1
- package/v0/protocol/types/TezosBlockMetadata.d.ts +0 -7
- package/v0/protocol/types/TezosBlockMetadata.js +0 -3
- package/v0/protocol/types/TezosBlockMetadata.js.map +0 -1
- package/v0/protocol/types/TezosContractCode.d.ts +0 -5
- package/v0/protocol/types/TezosContractCode.js +0 -3
- package/v0/protocol/types/TezosContractCode.js.map +0 -1
- package/v0/protocol/types/TezosOperationType.d.ts +0 -13
- package/v0/protocol/types/TezosOperationType.js +0 -18
- package/v0/protocol/types/TezosOperationType.js.map +0 -1
- package/v0/protocol/types/TezosTransactionCursor.d.ts +0 -3
- package/v0/protocol/types/TezosTransactionCursor.js +0 -3
- package/v0/protocol/types/TezosTransactionCursor.js.map +0 -1
- package/v0/protocol/types/TezosTransactionResult.d.ts +0 -6
- package/v0/protocol/types/TezosTransactionResult.js +0 -3
- package/v0/protocol/types/TezosTransactionResult.js.map +0 -1
- package/v0/protocol/types/TezosWrappedOperation.d.ts +0 -5
- package/v0/protocol/types/TezosWrappedOperation.js +0 -3
- package/v0/protocol/types/TezosWrappedOperation.js.map +0 -1
- package/v0/protocol/types/contract/BigMap.d.ts +0 -7
- package/v0/protocol/types/contract/BigMap.js +0 -3
- package/v0/protocol/types/contract/BigMap.js.map +0 -1
- package/v0/protocol/types/contract/BigMapEntry.d.ts +0 -8
- package/v0/protocol/types/contract/BigMapEntry.js +0 -3
- package/v0/protocol/types/contract/BigMapEntry.js.map +0 -1
- package/v0/protocol/types/contract/BigMapEntryFilter.d.ts +0 -5
- package/v0/protocol/types/contract/BigMapEntryFilter.js +0 -3
- package/v0/protocol/types/contract/BigMapEntryFilter.js.map +0 -1
- package/v0/protocol/types/contract/BigMapRequest.d.ts +0 -10
- package/v0/protocol/types/contract/BigMapRequest.js +0 -3
- package/v0/protocol/types/contract/BigMapRequest.js.map +0 -1
- package/v0/protocol/types/contract/TezosContractMetadata.d.ts +0 -61
- package/v0/protocol/types/contract/TezosContractMetadata.js +0 -3
- package/v0/protocol/types/contract/TezosContractMetadata.js.map +0 -1
- package/v0/protocol/types/domains/TezosDomainsRecord.d.ts +0 -8
- package/v0/protocol/types/domains/TezosDomainsRecord.js +0 -3
- package/v0/protocol/types/domains/TezosDomainsRecord.js.map +0 -1
- package/v0/protocol/types/domains/TezosDomainsReverseRecord.d.ts +0 -5
- package/v0/protocol/types/domains/TezosDomainsReverseRecord.js +0 -3
- package/v0/protocol/types/domains/TezosDomainsReverseRecord.js.map +0 -1
- package/v0/protocol/types/fa/TezosFA2BalanceOfRequest.d.ts +0 -4
- package/v0/protocol/types/fa/TezosFA2BalanceOfRequest.js +0 -3
- package/v0/protocol/types/fa/TezosFA2BalanceOfRequest.js.map +0 -1
- package/v0/protocol/types/fa/TezosFA2BalanceOfResponse.d.ts +0 -5
- package/v0/protocol/types/fa/TezosFA2BalanceOfResponse.js +0 -3
- package/v0/protocol/types/fa/TezosFA2BalanceOfResponse.js.map +0 -1
- package/v0/protocol/types/fa/TezosFA2TransferRequest.d.ts +0 -8
- package/v0/protocol/types/fa/TezosFA2TransferRequest.js +0 -3
- package/v0/protocol/types/fa/TezosFA2TransferRequest.js.map +0 -1
- package/v0/protocol/types/fa/TezosFA2UpdateOperatorRequest.d.ts +0 -6
- package/v0/protocol/types/fa/TezosFA2UpdateOperatorRequest.js +0 -3
- package/v0/protocol/types/fa/TezosFA2UpdateOperatorRequest.js.map +0 -1
- package/v0/protocol/types/fa/TezosFATokenMetadata.d.ts +0 -6
- package/v0/protocol/types/fa/TezosFATokenMetadata.js +0 -3
- package/v0/protocol/types/fa/TezosFATokenMetadata.js.map +0 -1
- package/v0/protocol/types/kt/TezosKtAddressCursor.d.ts +0 -4
- package/v0/protocol/types/kt/TezosKtAddressCursor.js +0 -3
- package/v0/protocol/types/kt/TezosKtAddressCursor.js.map +0 -1
- package/v0/protocol/types/kt/TezosKtAddressResult.d.ts +0 -5
- package/v0/protocol/types/kt/TezosKtAddressResult.js +0 -3
- package/v0/protocol/types/kt/TezosKtAddressResult.js.map +0 -1
- package/v0/protocol/types/micheline/MichelineNode.d.ts +0 -15
- package/v0/protocol/types/micheline/MichelineNode.js +0 -5
- package/v0/protocol/types/micheline/MichelineNode.js.map +0 -1
- package/v0/protocol/types/micheline/MichelineNodeUtils.d.ts +0 -6
- package/v0/protocol/types/micheline/MichelineNodeUtils.js +0 -40
- package/v0/protocol/types/micheline/MichelineNodeUtils.js.map +0 -1
- package/v0/protocol/types/michelson/MichelsonType.d.ts +0 -11
- package/v0/protocol/types/michelson/MichelsonType.js +0 -22
- package/v0/protocol/types/michelson/MichelsonType.js.map +0 -1
- package/v0/protocol/types/michelson/MichelsonTypeMeta.d.ts +0 -33
- package/v0/protocol/types/michelson/MichelsonTypeMeta.js +0 -136
- package/v0/protocol/types/michelson/MichelsonTypeMeta.js.map +0 -1
- package/v0/protocol/types/michelson/MichelsonTypeUtils.d.ts +0 -19
- package/v0/protocol/types/michelson/MichelsonTypeUtils.js +0 -251
- package/v0/protocol/types/michelson/MichelsonTypeUtils.js.map +0 -1
- package/v0/protocol/types/michelson/generics/MichelsonList.d.ts +0 -11
- package/v0/protocol/types/michelson/generics/MichelsonList.js +0 -70
- package/v0/protocol/types/michelson/generics/MichelsonList.js.map +0 -1
- package/v0/protocol/types/michelson/generics/MichelsonMap.d.ts +0 -14
- package/v0/protocol/types/michelson/generics/MichelsonMap.js +0 -120
- package/v0/protocol/types/michelson/generics/MichelsonMap.js.map +0 -1
- package/v0/protocol/types/michelson/generics/MichelsonOption.d.ts +0 -25
- package/v0/protocol/types/michelson/generics/MichelsonOption.js +0 -121
- package/v0/protocol/types/michelson/generics/MichelsonOption.js.map +0 -1
- package/v0/protocol/types/michelson/generics/MichelsonOr.d.ts +0 -25
- package/v0/protocol/types/michelson/generics/MichelsonOr.js +0 -134
- package/v0/protocol/types/michelson/generics/MichelsonOr.js.map +0 -1
- package/v0/protocol/types/michelson/generics/MichelsonPair.d.ts +0 -17
- package/v0/protocol/types/michelson/generics/MichelsonPair.js +0 -139
- package/v0/protocol/types/michelson/generics/MichelsonPair.js.map +0 -1
- package/v0/protocol/types/michelson/grammar/MichelsonGrammarData.d.ts +0 -2
- package/v0/protocol/types/michelson/grammar/MichelsonGrammarData.js +0 -4
- package/v0/protocol/types/michelson/grammar/MichelsonGrammarData.js.map +0 -1
- package/v0/protocol/types/michelson/grammar/MichelsonGrammarInstruction.d.ts +0 -1
- package/v0/protocol/types/michelson/grammar/MichelsonGrammarInstruction.js +0 -4
- package/v0/protocol/types/michelson/grammar/MichelsonGrammarInstruction.js.map +0 -1
- package/v0/protocol/types/michelson/grammar/MichelsonGrammarType.d.ts +0 -1
- package/v0/protocol/types/michelson/grammar/MichelsonGrammarType.js +0 -4
- package/v0/protocol/types/michelson/grammar/MichelsonGrammarType.js.map +0 -1
- package/v0/protocol/types/michelson/primitives/MichelsonAddress.d.ts +0 -15
- package/v0/protocol/types/michelson/primitives/MichelsonAddress.js +0 -74
- package/v0/protocol/types/michelson/primitives/MichelsonAddress.js.map +0 -1
- package/v0/protocol/types/michelson/primitives/MichelsonBool.d.ts +0 -12
- package/v0/protocol/types/michelson/primitives/MichelsonBool.js +0 -59
- package/v0/protocol/types/michelson/primitives/MichelsonBool.js.map +0 -1
- package/v0/protocol/types/michelson/primitives/MichelsonBytes.d.ts +0 -14
- package/v0/protocol/types/michelson/primitives/MichelsonBytes.js +0 -77
- package/v0/protocol/types/michelson/primitives/MichelsonBytes.js.map +0 -1
- package/v0/protocol/types/michelson/primitives/MichelsonInt.d.ts +0 -14
- package/v0/protocol/types/michelson/primitives/MichelsonInt.js +0 -74
- package/v0/protocol/types/michelson/primitives/MichelsonInt.js.map +0 -1
- package/v0/protocol/types/michelson/primitives/MichelsonString.d.ts +0 -14
- package/v0/protocol/types/michelson/primitives/MichelsonString.js +0 -76
- package/v0/protocol/types/michelson/primitives/MichelsonString.js.map +0 -1
- package/v0/protocol/types/michelson/primitives/MichelsonUnit.d.ts +0 -9
- package/v0/protocol/types/michelson/primitives/MichelsonUnit.js +0 -55
- package/v0/protocol/types/michelson/primitives/MichelsonUnit.js.map +0 -1
- package/v0/protocol/types/operations/ActivateAccount.d.ts +0 -7
- package/v0/protocol/types/operations/ActivateAccount.js +0 -3
- package/v0/protocol/types/operations/ActivateAccount.js.map +0 -1
- package/v0/protocol/types/operations/Ballot.d.ts +0 -9
- package/v0/protocol/types/operations/Ballot.js +0 -3
- package/v0/protocol/types/operations/Ballot.js.map +0 -1
- package/v0/protocol/types/operations/Delegation.d.ts +0 -11
- package/v0/protocol/types/operations/Delegation.js +0 -3
- package/v0/protocol/types/operations/Delegation.js.map +0 -1
- package/v0/protocol/types/operations/DoubleBakingEvidence.d.ts +0 -8
- package/v0/protocol/types/operations/DoubleBakingEvidence.js +0 -3
- package/v0/protocol/types/operations/DoubleBakingEvidence.js.map +0 -1
- package/v0/protocol/types/operations/DoubleEndorsementEvidence.d.ts +0 -16
- package/v0/protocol/types/operations/DoubleEndorsementEvidence.js +0 -3
- package/v0/protocol/types/operations/DoubleEndorsementEvidence.js.map +0 -1
- package/v0/protocol/types/operations/Endorsement.d.ts +0 -6
- package/v0/protocol/types/operations/Endorsement.js +0 -3
- package/v0/protocol/types/operations/Endorsement.js.map +0 -1
- package/v0/protocol/types/operations/Origination.d.ts +0 -13
- package/v0/protocol/types/operations/Origination.js +0 -3
- package/v0/protocol/types/operations/Origination.js.map +0 -1
- package/v0/protocol/types/operations/Proposal.d.ts +0 -7
- package/v0/protocol/types/operations/Proposal.js +0 -3
- package/v0/protocol/types/operations/Proposal.js.map +0 -1
- package/v0/protocol/types/operations/Reveal.d.ts +0 -11
- package/v0/protocol/types/operations/Reveal.js +0 -3
- package/v0/protocol/types/operations/Reveal.js.map +0 -1
- package/v0/protocol/types/operations/SeedNonceRevelation.d.ts +0 -7
- package/v0/protocol/types/operations/SeedNonceRevelation.js +0 -3
- package/v0/protocol/types/operations/SeedNonceRevelation.js.map +0 -1
- package/v0/protocol/types/operations/TezosOperation.d.ts +0 -4
- package/v0/protocol/types/operations/TezosOperation.js +0 -3
- package/v0/protocol/types/operations/TezosOperation.js.map +0 -1
- package/v0/protocol/types/operations/Transaction.d.ts +0 -23
- package/v0/protocol/types/operations/Transaction.js +0 -3
- package/v0/protocol/types/operations/Transaction.js.map +0 -1
- package/v0/protocol/types/sapling/TezosSaplingAddressCursor.d.ts +0 -4
- package/v0/protocol/types/sapling/TezosSaplingAddressCursor.js +0 -3
- package/v0/protocol/types/sapling/TezosSaplingAddressCursor.js.map +0 -1
- package/v0/protocol/types/sapling/TezosSaplingAddressResult.d.ts +0 -4
- package/v0/protocol/types/sapling/TezosSaplingAddressResult.js +0 -3
- package/v0/protocol/types/sapling/TezosSaplingAddressResult.js.map +0 -1
- package/v0/protocol/types/sapling/TezosSaplingCiphertext.d.ts +0 -8
- package/v0/protocol/types/sapling/TezosSaplingCiphertext.js +0 -3
- package/v0/protocol/types/sapling/TezosSaplingCiphertext.js.map +0 -1
- package/v0/protocol/types/sapling/TezosSaplingInput.d.ts +0 -6
- package/v0/protocol/types/sapling/TezosSaplingInput.js +0 -3
- package/v0/protocol/types/sapling/TezosSaplingInput.js.map +0 -1
- package/v0/protocol/types/sapling/TezosSaplingOutput.d.ts +0 -6
- package/v0/protocol/types/sapling/TezosSaplingOutput.js +0 -3
- package/v0/protocol/types/sapling/TezosSaplingOutput.js.map +0 -1
- package/v0/protocol/types/sapling/TezosSaplingStateDiff.d.ts +0 -6
- package/v0/protocol/types/sapling/TezosSaplingStateDiff.js +0 -3
- package/v0/protocol/types/sapling/TezosSaplingStateDiff.js.map +0 -1
- package/v0/protocol/types/sapling/TezosSaplingStateTree.d.ts +0 -7
- package/v0/protocol/types/sapling/TezosSaplingStateTree.js +0 -3
- package/v0/protocol/types/sapling/TezosSaplingStateTree.js.map +0 -1
- package/v0/protocol/types/sapling/TezosSaplingTransaction.d.ts +0 -23
- package/v0/protocol/types/sapling/TezosSaplingTransaction.js +0 -3
- package/v0/protocol/types/sapling/TezosSaplingTransaction.js.map +0 -1
- package/v0/protocol/types/sapling/TezosSaplingTransactionCursor.d.ts +0 -3
- package/v0/protocol/types/sapling/TezosSaplingTransactionCursor.js +0 -3
- package/v0/protocol/types/sapling/TezosSaplingTransactionCursor.js.map +0 -1
- package/v0/protocol/types/sapling/TezosSaplingTransactionResult.d.ts +0 -6
- package/v0/protocol/types/sapling/TezosSaplingTransactionResult.js +0 -3
- package/v0/protocol/types/sapling/TezosSaplingTransactionResult.js.map +0 -1
- package/v0/protocol/types/utils.d.ts +0 -8
- package/v0/protocol/types/utils.js +0 -41
- package/v0/protocol/types/utils.js.map +0 -1
- package/v0/serializer/schemas/v2/transaction-sign-request-tezos-sapling.json +0 -127
- package/v0/serializer/schemas/v2/transaction-sign-request-tezos.json +0 -29
- package/v0/serializer/schemas/v2/transaction-sign-response-tezos-sapling.json +0 -19
- package/v0/serializer/schemas/v2/transaction-sign-response-tezos.json +0 -19
- package/v0/serializer/schemas/v3/transaction-sign-request-tezos-sapling.json +0 -133
- package/v0/serializer/schemas/v3/transaction-sign-request-tezos.json +0 -29
- package/v0/serializer/schemas/v3/transaction-sign-response-tezos-sapling.json +0 -19
- package/v0/serializer/schemas/v3/transaction-sign-response-tezos.json +0 -19
- package/v0/serializer/validators/transaction-validator.d.ts +0 -15
- package/v0/serializer/validators/transaction-validator.js +0 -107
- package/v0/serializer/validators/transaction-validator.js.map +0 -1
- package/v0/serializer/validators/transaction-xtz-btc-validator.d.ts +0 -18
- package/v0/serializer/validators/transaction-xtz-btc-validator.js +0 -170
- package/v0/serializer/validators/transaction-xtz-btc-validator.js.map +0 -1
- package/v0/serializer/validators/validators.d.ts +0 -1
- package/v0/serializer/validators/validators.js +0 -115
- package/v0/serializer/validators/validators.js.map +0 -1
- package/v0/types/signed-transaction-tezos-sapling.d.ts +0 -3
- package/v0/types/signed-transaction-tezos-sapling.js +0 -3
- package/v0/types/signed-transaction-tezos-sapling.js.map +0 -1
- package/v0/types/signed-transaction-tezos.d.ts +0 -5
- package/v0/types/signed-transaction-tezos.js +0 -3
- package/v0/types/signed-transaction-tezos.js.map +0 -1
- package/v0/types/transaction-tezos.d.ts +0 -14
- package/v0/types/transaction-tezos.js +0 -3
- package/v0/types/transaction-tezos.js.map +0 -1
- package/v0/types/unsigned-transaction-tezos-sapling.d.ts +0 -38
- package/v0/types/unsigned-transaction-tezos-sapling.js +0 -3
- package/v0/types/unsigned-transaction-tezos-sapling.js.map +0 -1
- package/v0/types/unsigned-transaction-tezos.d.ts +0 -8
- package/v0/types/unsigned-transaction-tezos.js +0 -3
- package/v0/types/unsigned-transaction-tezos.js.map +0 -1
- package/v1/block-explorer/TzKTBlockExplorer.d.ts +0 -9
- package/v1/block-explorer/TzKTBlockExplorer.js +0 -72
- package/v1/block-explorer/TzKTBlockExplorer.js.map +0 -1
- package/v1/block-explorer/factory.d.ts +0 -3
- package/v1/block-explorer/factory.js +0 -17
- package/v1/block-explorer/factory.js.map +0 -1
- package/v1/contract/TezosContract.d.ts +0 -52
- package/v1/contract/TezosContract.js +0 -508
- package/v1/contract/TezosContract.js.map +0 -1
- package/v1/contract/TezosContractCall.d.ts +0 -11
- package/v1/contract/TezosContractCall.js +0 -23
- package/v1/contract/TezosContractCall.js.map +0 -1
- package/v1/contract/TezosContractEntrypoint.d.ts +0 -9
- package/v1/contract/TezosContractEntrypoint.js +0 -27
- package/v1/contract/TezosContractEntrypoint.js.map +0 -1
- package/v1/contract/TezosContractStorage.d.ts +0 -7
- package/v1/contract/TezosContractStorage.js +0 -16
- package/v1/contract/TezosContractStorage.js.map +0 -1
- package/v1/contract/remote-data/TezosContractRemoteDataFactory.d.ts +0 -11
- package/v1/contract/remote-data/TezosContractRemoteDataFactory.js +0 -36
- package/v1/contract/remote-data/TezosContractRemoteDataFactory.js.map +0 -1
- package/v1/contract/remote-data/TezosStorageRemoteData.d.ts +0 -12
- package/v1/contract/remote-data/TezosStorageRemoteData.js +0 -152
- package/v1/contract/remote-data/TezosStorageRemoteData.js.map +0 -1
- package/v1/crypto/TezosCryptoClient.d.ts +0 -13
- package/v1/crypto/TezosCryptoClient.js +0 -153
- package/v1/crypto/TezosCryptoClient.js.map +0 -1
- package/v1/crypto/TezosSaplingCryptoClient.d.ts +0 -25
- package/v1/crypto/TezosSaplingCryptoClient.js +0 -222
- package/v1/crypto/TezosSaplingCryptoClient.js.map +0 -1
- package/v1/data/TezosAddress.d.ts +0 -9
- package/v1/data/TezosAddress.js +0 -27
- package/v1/data/TezosAddress.js.map +0 -1
- package/v1/data/TezosSaplingAddress.d.ts +0 -14
- package/v1/data/TezosSaplingAddress.js +0 -105
- package/v1/data/TezosSaplingAddress.js.map +0 -1
- package/v1/index.d.ts +0 -52
- package/v1/index.js +0 -82
- package/v1/index.js.map +0 -1
- package/v1/indexer/TezosIndexerClient.d.ts +0 -31
- package/v1/indexer/TezosIndexerClient.js +0 -3
- package/v1/indexer/TezosIndexerClient.js.map +0 -1
- package/v1/indexer/TzKTIndexerClient.d.ts +0 -31
- package/v1/indexer/TzKTIndexerClient.js +0 -283
- package/v1/indexer/TzKTIndexerClient.js.map +0 -1
- package/v1/indexer/factory.d.ts +0 -3
- package/v1/indexer/factory.js +0 -17
- package/v1/indexer/factory.js.map +0 -1
- package/v1/indexer/token-metadata/BigMapTokenMetadataIndexerClient.d.ts +0 -12
- package/v1/indexer/token-metadata/BigMapTokenMetadataIndexerClient.js +0 -178
- package/v1/indexer/token-metadata/BigMapTokenMetadataIndexerClient.js.map +0 -1
- package/v1/indexer/token-metadata/ObjktTokenMetadataIndexerClient.d.ts +0 -8
- package/v1/indexer/token-metadata/ObjktTokenMetadataIndexerClient.js +0 -95
- package/v1/indexer/token-metadata/ObjktTokenMetadataIndexerClient.js.map +0 -1
- package/v1/indexer/token-metadata/TokenMetadataIndexerClient.d.ts +0 -4
- package/v1/indexer/token-metadata/TokenMetadataIndexerClient.js +0 -3
- package/v1/indexer/token-metadata/TokenMetadataIndexerClient.js.map +0 -1
- package/v1/injector/TezosSaplingInjectorClient.d.ts +0 -6
- package/v1/injector/TezosSaplingInjectorClient.js +0 -68
- package/v1/injector/TezosSaplingInjectorClient.js.map +0 -1
- package/v1/module/TezosModule.d.ts +0 -11
- package/v1/module/TezosModule.js +0 -202
- package/v1/module/TezosModule.js.map +0 -1
- package/v1/node/TezosSaplingNodeClient.d.ts +0 -8
- package/v1/node/TezosSaplingNodeClient.js +0 -78
- package/v1/node/TezosSaplingNodeClient.js.map +0 -1
- package/v1/protocol/TezosProtocol.d.ts +0 -72
- package/v1/protocol/TezosProtocol.js +0 -968
- package/v1/protocol/TezosProtocol.js.map +0 -1
- package/v1/protocol/fa/TezosFA1Protocol.d.ts +0 -30
- package/v1/protocol/fa/TezosFA1Protocol.js +0 -211
- package/v1/protocol/fa/TezosFA1Protocol.js.map +0 -1
- package/v1/protocol/fa/TezosFA1p2Protocol.d.ts +0 -19
- package/v1/protocol/fa/TezosFA1p2Protocol.js +0 -122
- package/v1/protocol/fa/TezosFA1p2Protocol.js.map +0 -1
- package/v1/protocol/fa/TezosFA2Protocol.d.ts +0 -40
- package/v1/protocol/fa/TezosFA2Protocol.js +0 -305
- package/v1/protocol/fa/TezosFA2Protocol.js.map +0 -1
- package/v1/protocol/fa/TezosFAProtocol.d.ts +0 -76
- package/v1/protocol/fa/TezosFAProtocol.js +0 -574
- package/v1/protocol/fa/TezosFAProtocol.js.map +0 -1
- package/v1/protocol/fa/tokens/BTCTezProtocol.d.ts +0 -14
- package/v1/protocol/fa/tokens/BTCTezProtocol.js +0 -74
- package/v1/protocol/fa/tokens/BTCTezProtocol.js.map +0 -1
- package/v1/protocol/fa/tokens/CTezProtocol.d.ts +0 -14
- package/v1/protocol/fa/tokens/CTezProtocol.js +0 -74
- package/v1/protocol/fa/tokens/CTezProtocol.js.map +0 -1
- package/v1/protocol/fa/tokens/DogamiProtocol.d.ts +0 -14
- package/v1/protocol/fa/tokens/DogamiProtocol.js +0 -74
- package/v1/protocol/fa/tokens/DogamiProtocol.js.map +0 -1
- package/v1/protocol/fa/tokens/ETHTezProtocol.d.ts +0 -18
- package/v1/protocol/fa/tokens/ETHTezProtocol.js +0 -117
- package/v1/protocol/fa/tokens/ETHTezProtocol.js.map +0 -1
- package/v1/protocol/fa/tokens/KolibriUSDProtocol.d.ts +0 -18
- package/v1/protocol/fa/tokens/KolibriUSDProtocol.js +0 -117
- package/v1/protocol/fa/tokens/KolibriUSDProtocol.js.map +0 -1
- package/v1/protocol/fa/tokens/PlentyProtocol.d.ts +0 -18
- package/v1/protocol/fa/tokens/PlentyProtocol.js +0 -117
- package/v1/protocol/fa/tokens/PlentyProtocol.js.map +0 -1
- package/v1/protocol/fa/tokens/QuipuswapProtocol.d.ts +0 -14
- package/v1/protocol/fa/tokens/QuipuswapProtocol.js +0 -74
- package/v1/protocol/fa/tokens/QuipuswapProtocol.js.map +0 -1
- package/v1/protocol/fa/tokens/SiriusProtocol.d.ts +0 -14
- package/v1/protocol/fa/tokens/SiriusProtocol.js +0 -74
- package/v1/protocol/fa/tokens/SiriusProtocol.js.map +0 -1
- package/v1/protocol/fa/tokens/StakerProtocol.d.ts +0 -18
- package/v1/protocol/fa/tokens/StakerProtocol.js +0 -117
- package/v1/protocol/fa/tokens/StakerProtocol.js.map +0 -1
- package/v1/protocol/fa/tokens/TetherUSDProtocol.d.ts +0 -14
- package/v1/protocol/fa/tokens/TetherUSDProtocol.js +0 -74
- package/v1/protocol/fa/tokens/TetherUSDProtocol.js.map +0 -1
- package/v1/protocol/fa/tokens/TzBTCProtocol.d.ts +0 -14
- package/v1/protocol/fa/tokens/TzBTCProtocol.js +0 -74
- package/v1/protocol/fa/tokens/TzBTCProtocol.js.map +0 -1
- package/v1/protocol/fa/tokens/UBTCProtocol.d.ts +0 -14
- package/v1/protocol/fa/tokens/UBTCProtocol.js +0 -74
- package/v1/protocol/fa/tokens/UBTCProtocol.js.map +0 -1
- package/v1/protocol/fa/tokens/UDEFIProtocol.d.ts +0 -14
- package/v1/protocol/fa/tokens/UDEFIProtocol.js +0 -74
- package/v1/protocol/fa/tokens/UDEFIProtocol.js.map +0 -1
- package/v1/protocol/fa/tokens/USDTezProtocol.d.ts +0 -14
- package/v1/protocol/fa/tokens/USDTezProtocol.js +0 -74
- package/v1/protocol/fa/tokens/USDTezProtocol.js.map +0 -1
- package/v1/protocol/fa/tokens/UUSDProtocol.d.ts +0 -14
- package/v1/protocol/fa/tokens/UUSDProtocol.js +0 -74
- package/v1/protocol/fa/tokens/UUSDProtocol.js.map +0 -1
- package/v1/protocol/fa/tokens/WrapProtocol.d.ts +0 -14
- package/v1/protocol/fa/tokens/WrapProtocol.js +0 -74
- package/v1/protocol/fa/tokens/WrapProtocol.js.map +0 -1
- package/v1/protocol/fa/tokens/WrappedTezosProtocol.d.ts +0 -14
- package/v1/protocol/fa/tokens/WrappedTezosProtocol.js +0 -74
- package/v1/protocol/fa/tokens/WrappedTezosProtocol.js.map +0 -1
- package/v1/protocol/fa/tokens/YouProtocol.d.ts +0 -14
- package/v1/protocol/fa/tokens/YouProtocol.js +0 -74
- package/v1/protocol/fa/tokens/YouProtocol.js.map +0 -1
- package/v1/protocol/kt/TezosKtProtocol.d.ts +0 -17
- package/v1/protocol/kt/TezosKtProtocol.js +0 -501
- package/v1/protocol/kt/TezosKtProtocol.js.map +0 -1
- package/v1/protocol/sapling/TezosSaplingProtocol.d.ts +0 -103
- package/v1/protocol/sapling/TezosSaplingProtocol.js +0 -1031
- package/v1/protocol/sapling/TezosSaplingProtocol.js.map +0 -1
- package/v1/protocol/sapling/TezosShieldedTezProtocol.d.ts +0 -17
- package/v1/protocol/sapling/TezosShieldedTezProtocol.js +0 -185
- package/v1/protocol/sapling/TezosShieldedTezProtocol.js.map +0 -1
- package/v1/serializer/v3/schemas/converter/transaction-converter.d.ts +0 -13
- package/v1/serializer/v3/schemas/converter/transaction-converter.js +0 -59
- package/v1/serializer/v3/schemas/converter/transaction-converter.js.map +0 -1
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-tezos-sapling.d.ts +0 -4
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-tezos-sapling.js +0 -3
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-tezos-sapling.js.map +0 -1
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-tezos.d.ts +0 -8
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-tezos.js +0 -3
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-tezos.js.map +0 -1
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-tezos-sapling.d.ts +0 -3
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-tezos-sapling.js +0 -3
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-tezos-sapling.js.map +0 -1
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-tezos.d.ts +0 -3
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-tezos.js +0 -3
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-tezos.js.map +0 -1
- package/v1/serializer/v3/schemas/generated/transaction-sign-request-tezos-sapling.json +0 -145
- package/v1/serializer/v3/schemas/generated/transaction-sign-request-tezos.json +0 -29
- package/v1/serializer/v3/schemas/generated/transaction-sign-response-tezos-sapling.json +0 -19
- package/v1/serializer/v3/schemas/generated/transaction-sign-response-tezos.json +0 -19
- package/v1/serializer/v3/serializer-companion.d.ts +0 -15
- package/v1/serializer/v3/serializer-companion.js +0 -521
- package/v1/serializer/v3/serializer-companion.js.map +0 -1
- package/v1/serializer/v3/validators/transaction-validator.d.ts +0 -14
- package/v1/serializer/v3/validators/transaction-validator.js +0 -179
- package/v1/serializer/v3/validators/transaction-validator.js.map +0 -1
- package/v1/serializer/v3/validators/validators.d.ts +0 -4
- package/v1/serializer/v3/validators/validators.js +0 -108
- package/v1/serializer/v3/validators/validators.js.map +0 -1
- package/v1/types/address.d.ts +0 -7
- package/v1/types/address.js +0 -3
- package/v1/types/address.js.map +0 -1
- package/v1/types/block/TezosBlockHeader.d.ts +0 -13
- package/v1/types/block/TezosBlockHeader.js +0 -3
- package/v1/types/block/TezosBlockHeader.js.map +0 -1
- package/v1/types/block-explorer.d.ts +0 -6
- package/v1/types/block-explorer.js +0 -3
- package/v1/types/block-explorer.js.map +0 -1
- package/v1/types/contract/TezosContractCode.d.ts +0 -5
- package/v1/types/contract/TezosContractCode.js +0 -3
- package/v1/types/contract/TezosContractCode.js.map +0 -1
- package/v1/types/contract/TezosContractMetadata.d.ts +0 -61
- package/v1/types/contract/TezosContractMetadata.js +0 -3
- package/v1/types/contract/TezosContractMetadata.js.map +0 -1
- package/v1/types/contract/bigmap/BigMap.d.ts +0 -7
- package/v1/types/contract/bigmap/BigMap.js +0 -3
- package/v1/types/contract/bigmap/BigMap.js.map +0 -1
- package/v1/types/contract/bigmap/BigMapEnrtyFilter.d.ts +0 -5
- package/v1/types/contract/bigmap/BigMapEnrtyFilter.js +0 -3
- package/v1/types/contract/bigmap/BigMapEnrtyFilter.js.map +0 -1
- package/v1/types/contract/bigmap/BigMapEntry.d.ts +0 -8
- package/v1/types/contract/bigmap/BigMapEntry.js +0 -3
- package/v1/types/contract/bigmap/BigMapEntry.js.map +0 -1
- package/v1/types/contract/bigmap/BigMapRequest.d.ts +0 -10
- package/v1/types/contract/bigmap/BigMapRequest.js +0 -3
- package/v1/types/contract/bigmap/BigMapRequest.js.map +0 -1
- package/v1/types/fa/TezosFA1ContractEntrypoint.d.ts +0 -1
- package/v1/types/fa/TezosFA1ContractEntrypoint.js +0 -3
- package/v1/types/fa/TezosFA1ContractEntrypoint.js.map +0 -1
- package/v1/types/fa/TezosFA1p2ContractEntrypoint.d.ts +0 -2
- package/v1/types/fa/TezosFA1p2ContractEntrypoint.js +0 -3
- package/v1/types/fa/TezosFA1p2ContractEntrypoint.js.map +0 -1
- package/v1/types/fa/TezosFA2BalanceOfRequest.d.ts +0 -4
- package/v1/types/fa/TezosFA2BalanceOfRequest.js +0 -3
- package/v1/types/fa/TezosFA2BalanceOfRequest.js.map +0 -1
- package/v1/types/fa/TezosFA2BalanceOfResponse.d.ts +0 -5
- package/v1/types/fa/TezosFA2BalanceOfResponse.js +0 -3
- package/v1/types/fa/TezosFA2BalanceOfResponse.js.map +0 -1
- package/v1/types/fa/TezosFA2ContractEntrypoint.d.ts +0 -1
- package/v1/types/fa/TezosFA2ContractEntrypoint.js +0 -3
- package/v1/types/fa/TezosFA2ContractEntrypoint.js.map +0 -1
- package/v1/types/fa/TezosFA2TransferRequest.d.ts +0 -8
- package/v1/types/fa/TezosFA2TransferRequest.js +0 -3
- package/v1/types/fa/TezosFA2TransferRequest.js.map +0 -1
- package/v1/types/fa/TezosFA2UpdateOperatorRequest.d.ts +0 -6
- package/v1/types/fa/TezosFA2UpdateOperatorRequest.js +0 -3
- package/v1/types/fa/TezosFA2UpdateOperatorRequest.js.map +0 -1
- package/v1/types/fa/TezosFATokenMetadata.d.ts +0 -6
- package/v1/types/fa/TezosFATokenMetadata.js +0 -3
- package/v1/types/fa/TezosFATokenMetadata.js.map +0 -1
- package/v1/types/indexer.d.ts +0 -6
- package/v1/types/indexer.js +0 -3
- package/v1/types/indexer.js.map +0 -1
- package/v1/types/micheline/MichelineNode.d.ts +0 -15
- package/v1/types/micheline/MichelineNode.js +0 -5
- package/v1/types/micheline/MichelineNode.js.map +0 -1
- package/v1/types/micheline/MichelineNodeUtils.d.ts +0 -6
- package/v1/types/micheline/MichelineNodeUtils.js +0 -40
- package/v1/types/micheline/MichelineNodeUtils.js.map +0 -1
- package/v1/types/michelson/MichelsonType.d.ts +0 -11
- package/v1/types/michelson/MichelsonType.js +0 -22
- package/v1/types/michelson/MichelsonType.js.map +0 -1
- package/v1/types/michelson/MichelsonTypeMeta.d.ts +0 -33
- package/v1/types/michelson/MichelsonTypeMeta.js +0 -136
- package/v1/types/michelson/MichelsonTypeMeta.js.map +0 -1
- package/v1/types/michelson/MichelsonTypeUtils.d.ts +0 -19
- package/v1/types/michelson/MichelsonTypeUtils.js +0 -251
- package/v1/types/michelson/MichelsonTypeUtils.js.map +0 -1
- package/v1/types/michelson/generics/MichelsonList.d.ts +0 -11
- package/v1/types/michelson/generics/MichelsonList.js +0 -70
- package/v1/types/michelson/generics/MichelsonList.js.map +0 -1
- package/v1/types/michelson/generics/MichelsonMap.d.ts +0 -14
- package/v1/types/michelson/generics/MichelsonMap.js +0 -120
- package/v1/types/michelson/generics/MichelsonMap.js.map +0 -1
- package/v1/types/michelson/generics/MichelsonOption.d.ts +0 -25
- package/v1/types/michelson/generics/MichelsonOption.js +0 -121
- package/v1/types/michelson/generics/MichelsonOption.js.map +0 -1
- package/v1/types/michelson/generics/MichelsonOr.d.ts +0 -25
- package/v1/types/michelson/generics/MichelsonOr.js +0 -134
- package/v1/types/michelson/generics/MichelsonOr.js.map +0 -1
- package/v1/types/michelson/generics/MichelsonPair.d.ts +0 -17
- package/v1/types/michelson/generics/MichelsonPair.js +0 -139
- package/v1/types/michelson/generics/MichelsonPair.js.map +0 -1
- package/v1/types/michelson/grammar/MichelsonGrammarData.d.ts +0 -2
- package/v1/types/michelson/grammar/MichelsonGrammarData.js +0 -4
- package/v1/types/michelson/grammar/MichelsonGrammarData.js.map +0 -1
- package/v1/types/michelson/grammar/MichelsonGrammarInstruction.d.ts +0 -1
- package/v1/types/michelson/grammar/MichelsonGrammarInstruction.js +0 -4
- package/v1/types/michelson/grammar/MichelsonGrammarInstruction.js.map +0 -1
- package/v1/types/michelson/grammar/MichelsonGrammarType.d.ts +0 -1
- package/v1/types/michelson/grammar/MichelsonGrammarType.js +0 -4
- package/v1/types/michelson/grammar/MichelsonGrammarType.js.map +0 -1
- package/v1/types/michelson/primitives/MichelsonAddress.d.ts +0 -15
- package/v1/types/michelson/primitives/MichelsonAddress.js +0 -74
- package/v1/types/michelson/primitives/MichelsonAddress.js.map +0 -1
- package/v1/types/michelson/primitives/MichelsonBool.d.ts +0 -12
- package/v1/types/michelson/primitives/MichelsonBool.js +0 -59
- package/v1/types/michelson/primitives/MichelsonBool.js.map +0 -1
- package/v1/types/michelson/primitives/MichelsonBytes.d.ts +0 -14
- package/v1/types/michelson/primitives/MichelsonBytes.js +0 -77
- package/v1/types/michelson/primitives/MichelsonBytes.js.map +0 -1
- package/v1/types/michelson/primitives/MichelsonInt.d.ts +0 -14
- package/v1/types/michelson/primitives/MichelsonInt.js +0 -74
- package/v1/types/michelson/primitives/MichelsonInt.js.map +0 -1
- package/v1/types/michelson/primitives/MichelsonString.d.ts +0 -14
- package/v1/types/michelson/primitives/MichelsonString.js +0 -76
- package/v1/types/michelson/primitives/MichelsonString.js.map +0 -1
- package/v1/types/michelson/primitives/MichelsonUnit.d.ts +0 -9
- package/v1/types/michelson/primitives/MichelsonUnit.js +0 -55
- package/v1/types/michelson/primitives/MichelsonUnit.js.map +0 -1
- package/v1/types/network.d.ts +0 -4
- package/v1/types/network.js +0 -9
- package/v1/types/network.js.map +0 -1
- package/v1/types/node.d.ts +0 -78
- package/v1/types/node.js +0 -3
- package/v1/types/node.js.map +0 -1
- package/v1/types/operations/TezosOperationType.d.ts +0 -13
- package/v1/types/operations/TezosOperationType.js +0 -18
- package/v1/types/operations/TezosOperationType.js.map +0 -1
- package/v1/types/operations/TezosWrappedOperation.d.ts +0 -5
- package/v1/types/operations/TezosWrappedOperation.js +0 -3
- package/v1/types/operations/TezosWrappedOperation.js.map +0 -1
- package/v1/types/operations/kinds/ActivateAccount.d.ts +0 -7
- package/v1/types/operations/kinds/ActivateAccount.js +0 -3
- package/v1/types/operations/kinds/ActivateAccount.js.map +0 -1
- package/v1/types/operations/kinds/Ballot.d.ts +0 -9
- package/v1/types/operations/kinds/Ballot.js +0 -3
- package/v1/types/operations/kinds/Ballot.js.map +0 -1
- package/v1/types/operations/kinds/Delegation.d.ts +0 -11
- package/v1/types/operations/kinds/Delegation.js +0 -3
- package/v1/types/operations/kinds/Delegation.js.map +0 -1
- package/v1/types/operations/kinds/DoubleBakingEvidence.d.ts +0 -8
- package/v1/types/operations/kinds/DoubleBakingEvidence.js +0 -3
- package/v1/types/operations/kinds/DoubleBakingEvidence.js.map +0 -1
- package/v1/types/operations/kinds/DoubleEndorsementEvidence.d.ts +0 -16
- package/v1/types/operations/kinds/DoubleEndorsementEvidence.js +0 -3
- package/v1/types/operations/kinds/DoubleEndorsementEvidence.js.map +0 -1
- package/v1/types/operations/kinds/Endorsement.d.ts +0 -6
- package/v1/types/operations/kinds/Endorsement.js +0 -3
- package/v1/types/operations/kinds/Endorsement.js.map +0 -1
- package/v1/types/operations/kinds/Origination.d.ts +0 -13
- package/v1/types/operations/kinds/Origination.js +0 -3
- package/v1/types/operations/kinds/Origination.js.map +0 -1
- package/v1/types/operations/kinds/Proposal.d.ts +0 -7
- package/v1/types/operations/kinds/Proposal.js +0 -3
- package/v1/types/operations/kinds/Proposal.js.map +0 -1
- package/v1/types/operations/kinds/Reveal.d.ts +0 -11
- package/v1/types/operations/kinds/Reveal.js +0 -3
- package/v1/types/operations/kinds/Reveal.js.map +0 -1
- package/v1/types/operations/kinds/SeedNonceRevelation.d.ts +0 -7
- package/v1/types/operations/kinds/SeedNonceRevelation.js +0 -3
- package/v1/types/operations/kinds/SeedNonceRevelation.js.map +0 -1
- package/v1/types/operations/kinds/TezosOperation.d.ts +0 -4
- package/v1/types/operations/kinds/TezosOperation.js +0 -3
- package/v1/types/operations/kinds/TezosOperation.js.map +0 -1
- package/v1/types/operations/kinds/Transaction.d.ts +0 -24
- package/v1/types/operations/kinds/Transaction.js +0 -3
- package/v1/types/operations/kinds/Transaction.js.map +0 -1
- package/v1/types/protocol.d.ts +0 -62
- package/v1/types/protocol.js +0 -3
- package/v1/types/protocol.js.map +0 -1
- package/v1/types/sapling/TezosSaplingCiphertext.d.ts +0 -8
- package/v1/types/sapling/TezosSaplingCiphertext.js +0 -3
- package/v1/types/sapling/TezosSaplingCiphertext.js.map +0 -1
- package/v1/types/sapling/TezosSaplingExternalMethodProvider.d.ts +0 -10
- package/v1/types/sapling/TezosSaplingExternalMethodProvider.js +0 -3
- package/v1/types/sapling/TezosSaplingExternalMethodProvider.js.map +0 -1
- package/v1/types/sapling/TezosSaplingInput.d.ts +0 -6
- package/v1/types/sapling/TezosSaplingInput.js +0 -3
- package/v1/types/sapling/TezosSaplingInput.js.map +0 -1
- package/v1/types/sapling/TezosSaplingOutput.d.ts +0 -6
- package/v1/types/sapling/TezosSaplingOutput.js +0 -3
- package/v1/types/sapling/TezosSaplingOutput.js.map +0 -1
- package/v1/types/sapling/TezosSaplingStateDiff.d.ts +0 -6
- package/v1/types/sapling/TezosSaplingStateDiff.js +0 -3
- package/v1/types/sapling/TezosSaplingStateDiff.js.map +0 -1
- package/v1/types/sapling/TezosSaplingStateTree.d.ts +0 -7
- package/v1/types/sapling/TezosSaplingStateTree.js +0 -3
- package/v1/types/sapling/TezosSaplingStateTree.js.map +0 -1
- package/v1/types/sapling/TezosSaplingTransaction.d.ts +0 -23
- package/v1/types/sapling/TezosSaplingTransaction.js +0 -3
- package/v1/types/sapling/TezosSaplingTransaction.js.map +0 -1
- package/v1/types/sapling/TezosSaplingTransactionCursor.d.ts +0 -3
- package/v1/types/sapling/TezosSaplingTransactionCursor.js +0 -3
- package/v1/types/sapling/TezosSaplingTransactionCursor.js.map +0 -1
- package/v1/types/sapling/TezosSaplingTransactionResult.d.ts +0 -6
- package/v1/types/sapling/TezosSaplingTransactionResult.js +0 -3
- package/v1/types/sapling/TezosSaplingTransactionResult.js.map +0 -1
- package/v1/types/transaction.d.ts +0 -30
- package/v1/types/transaction.js +0 -3
- package/v1/types/transaction.js.map +0 -1
- package/v1/utils/address.d.ts +0 -2
- package/v1/utils/address.js +0 -13
- package/v1/utils/address.js.map +0 -1
- package/v1/utils/bip.d.ts +0 -2
- package/v1/utils/bip.js +0 -14
- package/v1/utils/bip.js.map +0 -1
- package/v1/utils/convert.d.ts +0 -4
- package/v1/utils/convert.js +0 -33
- package/v1/utils/convert.js.map +0 -1
- package/v1/utils/encoding.d.ts +0 -52
- package/v1/utils/encoding.js +0 -104
- package/v1/utils/encoding.js.map +0 -1
- package/v1/utils/fa.d.ts +0 -2
- package/v1/utils/fa.js +0 -13
- package/v1/utils/fa.js.map +0 -1
- package/v1/utils/key.d.ts +0 -4
- package/v1/utils/key.js +0 -43
- package/v1/utils/key.js.map +0 -1
- package/v1/utils/micheline.d.ts +0 -8
- package/v1/utils/micheline.js +0 -41
- package/v1/utils/micheline.js.map +0 -1
- package/v1/utils/operations.d.ts +0 -12
- package/v1/utils/operations.js +0 -72
- package/v1/utils/operations.js.map +0 -1
- package/v1/utils/pack.d.ts +0 -10
- package/v1/utils/pack.js +0 -252
- package/v1/utils/pack.js.map +0 -1
- package/v1/utils/protocol/fa/TezosFA1Accountant.d.ts +0 -9
- package/v1/utils/protocol/fa/TezosFA1Accountant.js +0 -76
- package/v1/utils/protocol/fa/TezosFA1Accountant.js.map +0 -1
- package/v1/utils/protocol/fa/TezosFA2Accountant.d.ts +0 -12
- package/v1/utils/protocol/fa/TezosFA2Accountant.js +0 -113
- package/v1/utils/protocol/fa/TezosFA2Accountant.js.map +0 -1
- package/v1/utils/protocol/fa/TezosFAAccountant.d.ts +0 -8
- package/v1/utils/protocol/fa/TezosFAAccountant.js +0 -95
- package/v1/utils/protocol/fa/TezosFAAccountant.js.map +0 -1
- package/v1/utils/protocol/sapling/TezosSaplingAccountant.d.ts +0 -32
- package/v1/utils/protocol/sapling/TezosSaplingAccountant.js +0 -589
- package/v1/utils/protocol/sapling/TezosSaplingAccountant.js.map +0 -1
- package/v1/utils/protocol/sapling/TezosSaplingEncoder.d.ts +0 -22
- package/v1/utils/protocol/sapling/TezosSaplingEncoder.js +0 -158
- package/v1/utils/protocol/sapling/TezosSaplingEncoder.js.map +0 -1
- package/v1/utils/protocol/sapling/TezosSaplingForger.d.ts +0 -27
- package/v1/utils/protocol/sapling/TezosSaplingForger.js +0 -304
- package/v1/utils/protocol/sapling/TezosSaplingForger.js.map +0 -1
- package/v1/utils/protocol/sapling/TezosSaplingState.d.ts +0 -17
- package/v1/utils/protocol/sapling/TezosSaplingState.js +0 -266
- package/v1/utils/protocol/sapling/TezosSaplingState.js.map +0 -1
- package/v1/utils/protocol/tezos/TezosAccountant.d.ts +0 -13
- package/v1/utils/protocol/tezos/TezosAccountant.js +0 -177
- package/v1/utils/protocol/tezos/TezosAccountant.js.map +0 -1
- package/v1/utils/protocol/tezos/TezosForger.d.ts +0 -6
- package/v1/utils/protocol/tezos/TezosForger.js +0 -82
- package/v1/utils/protocol/tezos/TezosForger.js.map +0 -1
- package/v1/utils/signature.d.ts +0 -2
- package/v1/utils/signature.js +0 -23
- package/v1/utils/signature.js.map +0 -1
- package/v1/utils/transaction.d.ts +0 -9
- package/v1/utils/transaction.js +0 -26
- package/v1/utils/transaction.js.map +0 -1
|
@@ -1,1182 +0,0 @@
|
|
|
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
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __assign = (this && this.__assign) || function () {
|
|
18
|
-
__assign = Object.assign || function(t) {
|
|
19
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
-
s = arguments[i];
|
|
21
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
-
t[p] = s[p];
|
|
23
|
-
}
|
|
24
|
-
return t;
|
|
25
|
-
};
|
|
26
|
-
return __assign.apply(this, arguments);
|
|
27
|
-
};
|
|
28
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
29
|
-
if (k2 === undefined) k2 = k;
|
|
30
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
31
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
32
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
33
|
-
}
|
|
34
|
-
Object.defineProperty(o, k2, desc);
|
|
35
|
-
}) : (function(o, m, k, k2) {
|
|
36
|
-
if (k2 === undefined) k2 = k;
|
|
37
|
-
o[k2] = m[k];
|
|
38
|
-
}));
|
|
39
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
40
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
41
|
-
}) : function(o, v) {
|
|
42
|
-
o["default"] = v;
|
|
43
|
-
});
|
|
44
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
45
|
-
if (mod && mod.__esModule) return mod;
|
|
46
|
-
var result = {};
|
|
47
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
48
|
-
__setModuleDefault(result, mod);
|
|
49
|
-
return result;
|
|
50
|
-
};
|
|
51
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
52
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
53
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
54
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
55
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
56
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
57
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
58
|
-
});
|
|
59
|
-
};
|
|
60
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
61
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
62
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
63
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
64
|
-
function step(op) {
|
|
65
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
66
|
-
while (_) try {
|
|
67
|
-
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;
|
|
68
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
69
|
-
switch (op[0]) {
|
|
70
|
-
case 0: case 1: t = op; break;
|
|
71
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
72
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
73
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
74
|
-
default:
|
|
75
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
76
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
77
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
78
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
79
|
-
if (t[2]) _.ops.pop();
|
|
80
|
-
_.trys.pop(); continue;
|
|
81
|
-
}
|
|
82
|
-
op = body.call(thisArg, _);
|
|
83
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
84
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
88
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
89
|
-
if (ar || !(i in from)) {
|
|
90
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
91
|
-
ar[i] = from[i];
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
95
|
-
};
|
|
96
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
97
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
98
|
-
};
|
|
99
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
100
|
-
exports.TezosSaplingProtocol = void 0;
|
|
101
|
-
var bignumber_1 = __importDefault(require("@airgap/coinlib-core/dependencies/src/bignumber.js-9.0.0/bignumber"));
|
|
102
|
-
// @ts-ignore
|
|
103
|
-
var bip39_2_5_0_1 = require("@airgap/coinlib-core/dependencies/src/bip39-2.5.0");
|
|
104
|
-
var errors_1 = require("@airgap/coinlib-core/errors");
|
|
105
|
-
var coinlib_error_1 = require("@airgap/coinlib-core/errors/coinlib-error");
|
|
106
|
-
var NonExtendedProtocol_1 = require("@airgap/coinlib-core/protocols/NonExtendedProtocol");
|
|
107
|
-
var array_1 = require("@airgap/coinlib-core/utils/array");
|
|
108
|
-
var sapling = __importStar(require("@airgap/sapling-wasm"));
|
|
109
|
-
var random_1 = require("@stablelib/random");
|
|
110
|
-
var TezosContract_1 = require("../contract/TezosContract");
|
|
111
|
-
var TezosAddress_1 = require("../TezosAddress");
|
|
112
|
-
var TezosProtocol_1 = require("../TezosProtocol");
|
|
113
|
-
var TezosProtocolOptions_1 = require("../TezosProtocolOptions");
|
|
114
|
-
var TezosUtils_1 = require("../TezosUtils");
|
|
115
|
-
var MichelsonAddress_1 = require("../types/michelson/primitives/MichelsonAddress");
|
|
116
|
-
var TezosOperationType_1 = require("../types/TezosOperationType");
|
|
117
|
-
var TezosSaplingInjectorClient_1 = require("./injector/TezosSaplingInjectorClient");
|
|
118
|
-
var TezosSaplingNodeClient_1 = require("./node/TezosSaplingNodeClient");
|
|
119
|
-
var TezosSaplingAddress_1 = require("./TezosSaplingAddress");
|
|
120
|
-
var TezosSaplingCryptoClient_1 = require("./TezosSaplingCryptoClient");
|
|
121
|
-
var TezosSaplingBookkeeper_1 = require("./utils/TezosSaplingBookkeeper");
|
|
122
|
-
var TezosSaplingEncoder_1 = require("./utils/TezosSaplingEncoder");
|
|
123
|
-
var TezosSaplingForger_1 = require("./utils/TezosSaplingForger");
|
|
124
|
-
var TezosSaplingState_1 = require("./utils/TezosSaplingState");
|
|
125
|
-
var TezosSaplingProtocol = /** @class */ (function (_super) {
|
|
126
|
-
__extends(TezosSaplingProtocol, _super);
|
|
127
|
-
function TezosSaplingProtocol(options) {
|
|
128
|
-
var _this = this;
|
|
129
|
-
var _a, _b, _c, _d, _e, _f;
|
|
130
|
-
_this = _super.call(this) || this;
|
|
131
|
-
_this.options = options;
|
|
132
|
-
_this.supportsHD = false;
|
|
133
|
-
_this.addressIsCaseSensitive = true;
|
|
134
|
-
_this.addressValidationPattern = '^(zet1[1-9A-Za-z]{65}|tz1[1-9A-Za-z]{33})$';
|
|
135
|
-
_this.addressPlaceholder = 'zet1...';
|
|
136
|
-
_this.tezosProtocol = new TezosProtocol_1.TezosProtocol(new TezosProtocolOptions_1.TezosProtocolOptions(_this.options.network, new TezosProtocolOptions_1.TezosProtocolConfig()));
|
|
137
|
-
_this.name = options.config.name;
|
|
138
|
-
_this.symbol = (_a = options.config.symbol) !== null && _a !== void 0 ? _a : _this.tezosProtocol.symbol;
|
|
139
|
-
_this.marketSymbol = (_b = options.config.marketSymbol) !== null && _b !== void 0 ? _b : _this.tezosProtocol.marketSymbol;
|
|
140
|
-
_this.feeSymbol = _this.tezosProtocol.feeSymbol;
|
|
141
|
-
_this.feeDefaults = (_c = options.config.feeDefaults) !== null && _c !== void 0 ? _c : _this.tezosProtocol.feeDefaults;
|
|
142
|
-
_this.decimals = (_d = options.config.decimals) !== null && _d !== void 0 ? _d : _this.tezosProtocol.decimals;
|
|
143
|
-
_this.feeDecimals = _this.tezosProtocol.feeDecimals;
|
|
144
|
-
_this.identifier = (_e = options.config.identifier) !== null && _e !== void 0 ? _e : _this.tezosProtocol.identifier;
|
|
145
|
-
_this.units = (_f = _this.options.config.units) !== null && _f !== void 0 ? _f : _this.tezosProtocol.units;
|
|
146
|
-
_this.standardDerivationPath = _this.tezosProtocol.standardDerivationPath;
|
|
147
|
-
_this.cryptoClient = new TezosSaplingCryptoClient_1.TezosSaplingCryptoClient(_this.tezosProtocol.cryptoClient);
|
|
148
|
-
_this.nodeClient = _this.options.config.contractAddress
|
|
149
|
-
? new TezosSaplingNodeClient_1.TezosSaplingNodeClient(_this.options.network.rpcUrl, _this.options.config.contractAddress)
|
|
150
|
-
: undefined;
|
|
151
|
-
_this.contract = _this.options.config.contractAddress
|
|
152
|
-
? new TezosContract_1.TezosContract(_this.options.config.contractAddress, _this.options.network)
|
|
153
|
-
: undefined;
|
|
154
|
-
_this.injectorClient =
|
|
155
|
-
_this.options.config.injectorUrl && _this.options.config.contractAddress
|
|
156
|
-
? new TezosSaplingInjectorClient_1.TezosSaplingInjectorClient(_this.options.config.injectorUrl, _this.options.config.contractAddress)
|
|
157
|
-
: undefined;
|
|
158
|
-
_this.state = new TezosSaplingState_1.TezosSaplingState(_this.options.config.merkleTreeHeight);
|
|
159
|
-
_this.encoder = new TezosSaplingEncoder_1.TezosSaplingEncoder();
|
|
160
|
-
_this.forger = new TezosSaplingForger_1.TezosSaplingForger(_this.cryptoClient, _this.state, _this.encoder, _this.options.config.externalProvider);
|
|
161
|
-
_this.bookkeeper = new TezosSaplingBookkeeper_1.TezosSaplingBookkeeper(_this.identifier, _this.options.network, _this.cryptoClient, _this.encoder);
|
|
162
|
-
return _this;
|
|
163
|
-
}
|
|
164
|
-
TezosSaplingProtocol.prototype.getSymbol = function () {
|
|
165
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
166
|
-
return __generator(this, function (_a) {
|
|
167
|
-
return [2 /*return*/, this.symbol];
|
|
168
|
-
});
|
|
169
|
-
});
|
|
170
|
-
};
|
|
171
|
-
TezosSaplingProtocol.prototype.getName = function () {
|
|
172
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
173
|
-
return __generator(this, function (_a) {
|
|
174
|
-
return [2 /*return*/, this.name];
|
|
175
|
-
});
|
|
176
|
-
});
|
|
177
|
-
};
|
|
178
|
-
TezosSaplingProtocol.prototype.getMarketSymbol = function () {
|
|
179
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
180
|
-
return __generator(this, function (_a) {
|
|
181
|
-
return [2 /*return*/, this.marketSymbol];
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
};
|
|
185
|
-
TezosSaplingProtocol.prototype.getFeeSymbol = function () {
|
|
186
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
187
|
-
return __generator(this, function (_a) {
|
|
188
|
-
return [2 /*return*/, this.feeSymbol];
|
|
189
|
-
});
|
|
190
|
-
});
|
|
191
|
-
};
|
|
192
|
-
TezosSaplingProtocol.prototype.getDecimals = function () {
|
|
193
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
194
|
-
return __generator(this, function (_a) {
|
|
195
|
-
return [2 /*return*/, this.decimals];
|
|
196
|
-
});
|
|
197
|
-
});
|
|
198
|
-
};
|
|
199
|
-
TezosSaplingProtocol.prototype.getFeeDecimals = function () {
|
|
200
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
201
|
-
return __generator(this, function (_a) {
|
|
202
|
-
return [2 /*return*/, this.feeDecimals];
|
|
203
|
-
});
|
|
204
|
-
});
|
|
205
|
-
};
|
|
206
|
-
TezosSaplingProtocol.prototype.getIdentifier = function () {
|
|
207
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
208
|
-
return __generator(this, function (_a) {
|
|
209
|
-
return [2 /*return*/, this.identifier];
|
|
210
|
-
});
|
|
211
|
-
});
|
|
212
|
-
};
|
|
213
|
-
TezosSaplingProtocol.prototype.getFeeDefaults = function () {
|
|
214
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
215
|
-
return __generator(this, function (_a) {
|
|
216
|
-
return [2 /*return*/, this.feeDefaults];
|
|
217
|
-
});
|
|
218
|
-
});
|
|
219
|
-
};
|
|
220
|
-
TezosSaplingProtocol.prototype.getUnits = function () {
|
|
221
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
222
|
-
return __generator(this, function (_a) {
|
|
223
|
-
return [2 /*return*/, this.units];
|
|
224
|
-
});
|
|
225
|
-
});
|
|
226
|
-
};
|
|
227
|
-
TezosSaplingProtocol.prototype.getSupportsHD = function () {
|
|
228
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
229
|
-
return __generator(this, function (_a) {
|
|
230
|
-
return [2 /*return*/, this.supportsHD];
|
|
231
|
-
});
|
|
232
|
-
});
|
|
233
|
-
};
|
|
234
|
-
TezosSaplingProtocol.prototype.getStandardDerivationPath = function () {
|
|
235
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
236
|
-
return __generator(this, function (_a) {
|
|
237
|
-
return [2 /*return*/, this.standardDerivationPath];
|
|
238
|
-
});
|
|
239
|
-
});
|
|
240
|
-
};
|
|
241
|
-
TezosSaplingProtocol.prototype.getAddressIsCaseSensitive = function () {
|
|
242
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
243
|
-
return __generator(this, function (_a) {
|
|
244
|
-
return [2 /*return*/, this.addressIsCaseSensitive];
|
|
245
|
-
});
|
|
246
|
-
});
|
|
247
|
-
};
|
|
248
|
-
TezosSaplingProtocol.prototype.getAddressValidationPattern = function () {
|
|
249
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
250
|
-
return __generator(this, function (_a) {
|
|
251
|
-
return [2 /*return*/, this.addressValidationPattern];
|
|
252
|
-
});
|
|
253
|
-
});
|
|
254
|
-
};
|
|
255
|
-
TezosSaplingProtocol.prototype.getAddressPlaceholder = function () {
|
|
256
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
257
|
-
return __generator(this, function (_a) {
|
|
258
|
-
return [2 /*return*/, this.addressPlaceholder];
|
|
259
|
-
});
|
|
260
|
-
});
|
|
261
|
-
};
|
|
262
|
-
TezosSaplingProtocol.prototype.getOptions = function () {
|
|
263
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
264
|
-
return __generator(this, function (_a) {
|
|
265
|
-
return [2 /*return*/, this.options];
|
|
266
|
-
});
|
|
267
|
-
});
|
|
268
|
-
};
|
|
269
|
-
TezosSaplingProtocol.prototype.getContractAddress = function () {
|
|
270
|
-
var _a;
|
|
271
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
272
|
-
return __generator(this, function (_b) {
|
|
273
|
-
return [2 /*return*/, (_a = this.contract) === null || _a === void 0 ? void 0 : _a.address];
|
|
274
|
-
});
|
|
275
|
-
});
|
|
276
|
-
};
|
|
277
|
-
TezosSaplingProtocol.prototype.setContractAddress = function (address, configuration) {
|
|
278
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
279
|
-
return __generator(this, function (_a) {
|
|
280
|
-
this.options.config.contractAddress = address;
|
|
281
|
-
this.nodeClient = new TezosSaplingNodeClient_1.TezosSaplingNodeClient(this.options.network.rpcUrl, address);
|
|
282
|
-
this.contract = new TezosContract_1.TezosContract(address, this.options.network);
|
|
283
|
-
this.options.config.injectorUrl = configuration === null || configuration === void 0 ? void 0 : configuration.injectorUrl;
|
|
284
|
-
this.injectorClient = new TezosSaplingInjectorClient_1.TezosSaplingInjectorClient(configuration === null || configuration === void 0 ? void 0 : configuration.injectorUrl, address);
|
|
285
|
-
return [2 /*return*/];
|
|
286
|
-
});
|
|
287
|
-
});
|
|
288
|
-
};
|
|
289
|
-
TezosSaplingProtocol.prototype.initParameters = function (spendParams, outputParams) {
|
|
290
|
-
var _a;
|
|
291
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
292
|
-
var externalInitParameters;
|
|
293
|
-
return __generator(this, function (_b) {
|
|
294
|
-
switch (_b.label) {
|
|
295
|
-
case 0:
|
|
296
|
-
externalInitParameters = (_a = this.options.config.externalProvider) === null || _a === void 0 ? void 0 : _a.initParameters;
|
|
297
|
-
if (!(externalInitParameters !== undefined)) return [3 /*break*/, 2];
|
|
298
|
-
return [4 /*yield*/, externalInitParameters(spendParams, outputParams)];
|
|
299
|
-
case 1:
|
|
300
|
-
_b.sent();
|
|
301
|
-
return [3 /*break*/, 4];
|
|
302
|
-
case 2: return [4 /*yield*/, sapling.initParameters(spendParams, outputParams)];
|
|
303
|
-
case 3:
|
|
304
|
-
_b.sent();
|
|
305
|
-
_b.label = 4;
|
|
306
|
-
case 4: return [2 /*return*/];
|
|
307
|
-
}
|
|
308
|
-
});
|
|
309
|
-
});
|
|
310
|
-
};
|
|
311
|
-
TezosSaplingProtocol.prototype.getBlockExplorerLinkForTxId = function (txId) {
|
|
312
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
313
|
-
return __generator(this, function (_a) {
|
|
314
|
-
return [2 /*return*/, this.tezosProtocol.getBlockExplorerLinkForTxId(txId)];
|
|
315
|
-
});
|
|
316
|
-
});
|
|
317
|
-
};
|
|
318
|
-
TezosSaplingProtocol.prototype.getPublicKeyFromMnemonic = function (mnemonic, derivationPath, password) {
|
|
319
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
320
|
-
var seed;
|
|
321
|
-
return __generator(this, function (_a) {
|
|
322
|
-
seed = this.getSeedFromMnemonic(mnemonic, password);
|
|
323
|
-
return [2 /*return*/, this.getPublicKeyFromHexSecret(seed.toString('hex'), derivationPath)];
|
|
324
|
-
});
|
|
325
|
-
});
|
|
326
|
-
};
|
|
327
|
-
TezosSaplingProtocol.prototype.getPrivateKeyFromMnemonic = function (mnemonic, derivationPath, password) {
|
|
328
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
329
|
-
var seed;
|
|
330
|
-
return __generator(this, function (_a) {
|
|
331
|
-
seed = this.getSeedFromMnemonic(mnemonic, password);
|
|
332
|
-
return [2 /*return*/, this.getPrivateKeyFromHexSecret(seed.toString('hex'), derivationPath)];
|
|
333
|
-
});
|
|
334
|
-
});
|
|
335
|
-
};
|
|
336
|
-
TezosSaplingProtocol.prototype.getSeedFromMnemonic = function (mnemonic, password) {
|
|
337
|
-
var seed = (0, bip39_2_5_0_1.mnemonicToSeed)(mnemonic, password);
|
|
338
|
-
// We xor the two halves of the BIP-39 seed, as does `tezos-client`
|
|
339
|
-
var first32 = seed.slice(0, 32);
|
|
340
|
-
var second32 = seed.slice(32);
|
|
341
|
-
return Buffer.from(first32.map(function (byte, index) { return byte ^ second32[index]; }));
|
|
342
|
-
};
|
|
343
|
-
TezosSaplingProtocol.prototype.getPublicKeyFromHexSecret = function (secret, derivationPath) {
|
|
344
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
345
|
-
var viewingKey;
|
|
346
|
-
return __generator(this, function (_a) {
|
|
347
|
-
switch (_a.label) {
|
|
348
|
-
case 0: return [4 /*yield*/, sapling.getExtendedFullViewingKey(secret, derivationPath)];
|
|
349
|
-
case 1:
|
|
350
|
-
viewingKey = _a.sent();
|
|
351
|
-
return [2 /*return*/, viewingKey.toString('hex')];
|
|
352
|
-
}
|
|
353
|
-
});
|
|
354
|
-
});
|
|
355
|
-
};
|
|
356
|
-
TezosSaplingProtocol.prototype.getPrivateKeyFromHexSecret = function (secret, derivationPath) {
|
|
357
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
358
|
-
var xsk;
|
|
359
|
-
return __generator(this, function (_a) {
|
|
360
|
-
switch (_a.label) {
|
|
361
|
-
case 0: return [4 /*yield*/, sapling.getExtendedSpendingKey(secret, derivationPath)];
|
|
362
|
-
case 1:
|
|
363
|
-
xsk = _a.sent();
|
|
364
|
-
return [2 /*return*/, xsk.toString('hex')];
|
|
365
|
-
}
|
|
366
|
-
});
|
|
367
|
-
});
|
|
368
|
-
};
|
|
369
|
-
TezosSaplingProtocol.prototype.getAddressFromPublicKey = function (viewingKey, cursor) {
|
|
370
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
371
|
-
var current, _a, address, _b;
|
|
372
|
-
return __generator(this, function (_c) {
|
|
373
|
-
switch (_c.label) {
|
|
374
|
-
case 0:
|
|
375
|
-
if (!((cursor === null || cursor === void 0 ? void 0 : cursor.hasNext) && (cursor === null || cursor === void 0 ? void 0 : cursor.diversifierIndex))) return [3 /*break*/, 2];
|
|
376
|
-
return [4 /*yield*/, TezosSaplingAddress_1.TezosSaplingAddress.fromViewingKey(viewingKey, cursor.diversifierIndex)];
|
|
377
|
-
case 1:
|
|
378
|
-
_a = _c.sent();
|
|
379
|
-
return [3 /*break*/, 3];
|
|
380
|
-
case 2:
|
|
381
|
-
_a = undefined;
|
|
382
|
-
_c.label = 3;
|
|
383
|
-
case 3:
|
|
384
|
-
current = _a;
|
|
385
|
-
if (!current) return [3 /*break*/, 5];
|
|
386
|
-
return [4 /*yield*/, TezosSaplingAddress_1.TezosSaplingAddress.next(viewingKey, current)];
|
|
387
|
-
case 4:
|
|
388
|
-
_b = _c.sent();
|
|
389
|
-
return [3 /*break*/, 7];
|
|
390
|
-
case 5: return [4 /*yield*/, TezosSaplingAddress_1.TezosSaplingAddress.fromViewingKey(viewingKey)];
|
|
391
|
-
case 6:
|
|
392
|
-
_b = _c.sent();
|
|
393
|
-
_c.label = 7;
|
|
394
|
-
case 7:
|
|
395
|
-
address = _b;
|
|
396
|
-
return [2 /*return*/, {
|
|
397
|
-
address: address.asString(),
|
|
398
|
-
cursor: {
|
|
399
|
-
hasNext: address.diversifierIndex !== undefined,
|
|
400
|
-
diversifierIndex: address.diversifierIndex
|
|
401
|
-
}
|
|
402
|
-
}];
|
|
403
|
-
}
|
|
404
|
-
});
|
|
405
|
-
});
|
|
406
|
-
};
|
|
407
|
-
TezosSaplingProtocol.prototype.getAddressesFromPublicKey = function (viewingKey, cursor) {
|
|
408
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
409
|
-
return __generator(this, function (_a) {
|
|
410
|
-
switch (_a.label) {
|
|
411
|
-
case 0: return [4 /*yield*/, this.getAddressFromPublicKey(viewingKey, cursor)];
|
|
412
|
-
case 1: return [2 /*return*/, [_a.sent()]];
|
|
413
|
-
}
|
|
414
|
-
});
|
|
415
|
-
});
|
|
416
|
-
};
|
|
417
|
-
TezosSaplingProtocol.prototype.getAddressFromViewingKey = function (viewingKey, index) {
|
|
418
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
419
|
-
var address;
|
|
420
|
-
return __generator(this, function (_a) {
|
|
421
|
-
switch (_a.label) {
|
|
422
|
-
case 0: return [4 /*yield*/, TezosSaplingAddress_1.TezosSaplingAddress.fromViewingKey(viewingKey, index)];
|
|
423
|
-
case 1:
|
|
424
|
-
address = _a.sent();
|
|
425
|
-
return [2 /*return*/, {
|
|
426
|
-
address: address.asString(),
|
|
427
|
-
cursor: {
|
|
428
|
-
hasNext: address.diversifierIndex !== undefined,
|
|
429
|
-
diversifierIndex: address.diversifierIndex
|
|
430
|
-
}
|
|
431
|
-
}];
|
|
432
|
-
}
|
|
433
|
-
});
|
|
434
|
-
});
|
|
435
|
-
};
|
|
436
|
-
TezosSaplingProtocol.prototype.getTransactionsFromPublicKey = function (publicKey, limit, cursor) {
|
|
437
|
-
var _a;
|
|
438
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
439
|
-
var saplingStateDiff, incoming, outgoing, page, pageStart, pageEnd, commitmentsAndCiphertexts, inputs, airGapIncoming, airGapOutgoing;
|
|
440
|
-
var _this = this;
|
|
441
|
-
return __generator(this, function (_b) {
|
|
442
|
-
switch (_b.label) {
|
|
443
|
-
case 0:
|
|
444
|
-
if (this.nodeClient === undefined) {
|
|
445
|
-
return [2 /*return*/, {
|
|
446
|
-
transactions: [],
|
|
447
|
-
cursor: { page: 0 }
|
|
448
|
-
}];
|
|
449
|
-
}
|
|
450
|
-
return [4 /*yield*/, this.nodeClient.getSaplingStateDiff()];
|
|
451
|
-
case 1:
|
|
452
|
-
saplingStateDiff = _b.sent();
|
|
453
|
-
incoming = [];
|
|
454
|
-
outgoing = [];
|
|
455
|
-
page = (_a = cursor === null || cursor === void 0 ? void 0 : cursor.page) !== null && _a !== void 0 ? _a : 0;
|
|
456
|
-
pageStart = page * limit;
|
|
457
|
-
pageEnd = pageStart + limit;
|
|
458
|
-
_b.label = 2;
|
|
459
|
-
case 2:
|
|
460
|
-
if (!(incoming.length + outgoing.length < limit && pageStart < saplingStateDiff.commitments_and_ciphertexts.length)) return [3 /*break*/, 4];
|
|
461
|
-
commitmentsAndCiphertexts = saplingStateDiff.commitments_and_ciphertexts
|
|
462
|
-
.map(function (_a, index) {
|
|
463
|
-
var commitment = _a[0], ciphertext = _a[1];
|
|
464
|
-
return [commitment, ciphertext, new bignumber_1.default(index)];
|
|
465
|
-
})
|
|
466
|
-
.reverse()
|
|
467
|
-
.slice(pageStart, pageEnd);
|
|
468
|
-
return [4 /*yield*/, Promise.all([
|
|
469
|
-
this.bookkeeper.getIncomingInputs(publicKey, commitmentsAndCiphertexts),
|
|
470
|
-
this.bookkeeper.getOutgoingInputs(publicKey, commitmentsAndCiphertexts)
|
|
471
|
-
])];
|
|
472
|
-
case 3:
|
|
473
|
-
inputs = _b.sent();
|
|
474
|
-
incoming.push.apply(incoming, inputs[0]);
|
|
475
|
-
outgoing.push.apply(outgoing, inputs[1]);
|
|
476
|
-
page += 1;
|
|
477
|
-
pageStart += limit;
|
|
478
|
-
pageEnd += limit;
|
|
479
|
-
return [3 /*break*/, 2];
|
|
480
|
-
case 4: return [4 /*yield*/, Promise.all(incoming.map(function (input) { return __awaiter(_this, void 0, void 0, function () {
|
|
481
|
-
return __generator(this, function (_a) {
|
|
482
|
-
return [2 /*return*/, ({
|
|
483
|
-
from: ['Shielded Pool'],
|
|
484
|
-
to: [input.address],
|
|
485
|
-
isInbound: true,
|
|
486
|
-
amount: input.value,
|
|
487
|
-
fee: '0',
|
|
488
|
-
protocolIdentifier: this.identifier,
|
|
489
|
-
network: this.options.network
|
|
490
|
-
})];
|
|
491
|
-
});
|
|
492
|
-
}); }))];
|
|
493
|
-
case 5:
|
|
494
|
-
airGapIncoming = _b.sent();
|
|
495
|
-
return [4 /*yield*/, Promise.all(outgoing.map(function (input) { return __awaiter(_this, void 0, void 0, function () {
|
|
496
|
-
var _a;
|
|
497
|
-
return __generator(this, function (_b) {
|
|
498
|
-
switch (_b.label) {
|
|
499
|
-
case 0:
|
|
500
|
-
_a = {};
|
|
501
|
-
return [4 /*yield*/, this.getAddressFromPublicKey(publicKey)];
|
|
502
|
-
case 1: return [2 /*return*/, (_a.from = [(_b.sent()).address],
|
|
503
|
-
_a.to = [input.address],
|
|
504
|
-
_a.isInbound = false,
|
|
505
|
-
_a.amount = input.value,
|
|
506
|
-
_a.fee = '0',
|
|
507
|
-
_a.protocolIdentifier = this.identifier,
|
|
508
|
-
_a.network = this.options.network,
|
|
509
|
-
_a)];
|
|
510
|
-
}
|
|
511
|
-
});
|
|
512
|
-
}); }))];
|
|
513
|
-
case 6:
|
|
514
|
-
airGapOutgoing = _b.sent();
|
|
515
|
-
return [2 /*return*/, {
|
|
516
|
-
transactions: airGapIncoming.concat(airGapOutgoing),
|
|
517
|
-
cursor: { page: page + 1 }
|
|
518
|
-
}];
|
|
519
|
-
}
|
|
520
|
-
});
|
|
521
|
-
});
|
|
522
|
-
};
|
|
523
|
-
TezosSaplingProtocol.prototype.signWithPrivateKey = function (privateKey, transaction) {
|
|
524
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
525
|
-
var stateTree, boundData, forgedTransaction;
|
|
526
|
-
return __generator(this, function (_a) {
|
|
527
|
-
switch (_a.label) {
|
|
528
|
-
case 0: return [4 /*yield*/, this.state.getStateTreeFromStateDiff(transaction.stateDiff)];
|
|
529
|
-
case 1:
|
|
530
|
-
stateTree = _a.sent();
|
|
531
|
-
boundData = transaction.unshieldTarget && transaction.unshieldTarget.length > 0
|
|
532
|
-
? this.createAddressBoundData(transaction.unshieldTarget)
|
|
533
|
-
: undefined;
|
|
534
|
-
return [4 /*yield*/, this.forger.forgeSaplingTransaction(transaction.ins, transaction.outs, stateTree, this.getAntiReplay(transaction.chainId, transaction.contractAddress), boundData, Buffer.from(privateKey, 'hex'))];
|
|
535
|
-
case 2:
|
|
536
|
-
forgedTransaction = _a.sent();
|
|
537
|
-
return [2 /*return*/, this.encoder.encodeTransaction(forgedTransaction).toString('hex')];
|
|
538
|
-
}
|
|
539
|
-
});
|
|
540
|
-
});
|
|
541
|
-
};
|
|
542
|
-
TezosSaplingProtocol.prototype.getTransactionDetails = function (transaction, data) {
|
|
543
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
544
|
-
var tx, airGapTxs, unshieldTarget, from, details, wrappedOperation, _a, _b, _c;
|
|
545
|
-
return __generator(this, function (_d) {
|
|
546
|
-
switch (_d.label) {
|
|
547
|
-
case 0:
|
|
548
|
-
tx = transaction.transaction;
|
|
549
|
-
airGapTxs = [];
|
|
550
|
-
if (!this.isRawTezosSaplingTransaction(tx)) return [3 /*break*/, 2];
|
|
551
|
-
unshieldTarget = tx.unshieldTarget.length > 0 ? tx.unshieldTarget : undefined;
|
|
552
|
-
return [4 /*yield*/, this.getAddressFromPublicKey(transaction.publicKey).then(function (address) { return TezosSaplingAddress_1.TezosSaplingAddress.fromValue(address.address, address.cursor.diversifierIndex); })];
|
|
553
|
-
case 1:
|
|
554
|
-
from = _d.sent();
|
|
555
|
-
details = this.bookkeeper
|
|
556
|
-
.getUnsignedTransactionDetails(from, tx.ins, tx.outs, unshieldTarget)
|
|
557
|
-
.map(function (details) { return (__assign(__assign({}, details), { extra: __assign(__assign({}, details.extra), { destination: tx.contractAddress, chainId: tx.chainId }), transactionDetails: tx })); });
|
|
558
|
-
airGapTxs.push.apply(airGapTxs, details);
|
|
559
|
-
return [3 /*break*/, 5];
|
|
560
|
-
case 2: return [4 /*yield*/, this.tezosProtocol.unforgeUnsignedTezosWrappedOperation(tx.binaryTransaction)];
|
|
561
|
-
case 3:
|
|
562
|
-
wrappedOperation = _d.sent();
|
|
563
|
-
_b = (_a = airGapTxs.push).apply;
|
|
564
|
-
_c = [airGapTxs];
|
|
565
|
-
return [4 /*yield*/, this.getTransactionDetailsFromWrappedOperation(wrappedOperation, data === null || data === void 0 ? void 0 : data.knownViewingKeys)];
|
|
566
|
-
case 4:
|
|
567
|
-
_b.apply(_a, _c.concat([(_d.sent())]));
|
|
568
|
-
_d.label = 5;
|
|
569
|
-
case 5: return [2 /*return*/, this.filterOutPaybacks(airGapTxs)];
|
|
570
|
-
}
|
|
571
|
-
});
|
|
572
|
-
});
|
|
573
|
-
};
|
|
574
|
-
TezosSaplingProtocol.prototype.getTransactionDetailsFromSigned = function (transaction, data) {
|
|
575
|
-
var _a;
|
|
576
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
577
|
-
var airGapTxs, tx, defaultDetails, partialDetails, wrappedOperation, _b, _c, _d, _e, partialDetails;
|
|
578
|
-
return __generator(this, function (_f) {
|
|
579
|
-
switch (_f.label) {
|
|
580
|
-
case 0:
|
|
581
|
-
airGapTxs = [];
|
|
582
|
-
tx = transaction.transaction;
|
|
583
|
-
defaultDetails = {
|
|
584
|
-
from: ['Shielded Pool'],
|
|
585
|
-
to: ['Shielded Pool'],
|
|
586
|
-
isInbound: false,
|
|
587
|
-
amount: '0',
|
|
588
|
-
fee: '0',
|
|
589
|
-
protocolIdentifier: this.identifier,
|
|
590
|
-
network: this.options.network
|
|
591
|
-
};
|
|
592
|
-
if (!((_a = this.contract) === null || _a === void 0 ? void 0 : _a.areValidParameters(tx))) return [3 /*break*/, 2];
|
|
593
|
-
return [4 /*yield*/, this.getPartialDetailsFromContractParameters(tx, data === null || data === void 0 ? void 0 : data.knownViewingKeys)];
|
|
594
|
-
case 1:
|
|
595
|
-
partialDetails = _f.sent();
|
|
596
|
-
airGapTxs.push.apply(airGapTxs, partialDetails.map(function (partial) { return (__assign(__assign({}, defaultDetails), partial)); }));
|
|
597
|
-
return [3 /*break*/, 7];
|
|
598
|
-
case 2:
|
|
599
|
-
_f.trys.push([2, 5, , 7]);
|
|
600
|
-
return [4 /*yield*/, this.tezosProtocol.unforgeSignedTezosWrappedOperation(tx)];
|
|
601
|
-
case 3:
|
|
602
|
-
wrappedOperation = _f.sent();
|
|
603
|
-
_c = (_b = airGapTxs.push).apply;
|
|
604
|
-
_d = [airGapTxs];
|
|
605
|
-
return [4 /*yield*/, this.getTransactionDetailsFromWrappedOperation(wrappedOperation, data === null || data === void 0 ? void 0 : data.knownViewingKeys)];
|
|
606
|
-
case 4:
|
|
607
|
-
_c.apply(_b, _d.concat([(_f.sent())]));
|
|
608
|
-
return [3 /*break*/, 7];
|
|
609
|
-
case 5:
|
|
610
|
-
_e = _f.sent();
|
|
611
|
-
return [4 /*yield*/, this.bookkeeper.getTransactionsPartialDetails([tx], data === null || data === void 0 ? void 0 : data.knownViewingKeys)];
|
|
612
|
-
case 6:
|
|
613
|
-
partialDetails = _f.sent();
|
|
614
|
-
airGapTxs.push.apply(airGapTxs, partialDetails.map(function (partial) { return (__assign(__assign({}, defaultDetails), partial)); }));
|
|
615
|
-
return [3 /*break*/, 7];
|
|
616
|
-
case 7: return [2 /*return*/, this.filterOutPaybacks(airGapTxs)];
|
|
617
|
-
}
|
|
618
|
-
});
|
|
619
|
-
});
|
|
620
|
-
};
|
|
621
|
-
TezosSaplingProtocol.prototype.getTransactionDetailsFromWrappedOperation = function (operation, knownViewingKeys) {
|
|
622
|
-
if (knownViewingKeys === void 0) { knownViewingKeys = []; }
|
|
623
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
624
|
-
var contractOperations, details;
|
|
625
|
-
var _this = this;
|
|
626
|
-
return __generator(this, function (_a) {
|
|
627
|
-
switch (_a.label) {
|
|
628
|
-
case 0:
|
|
629
|
-
contractOperations = operation.contents.filter(function (content) {
|
|
630
|
-
return content.kind === TezosOperationType_1.TezosOperationType.TRANSACTION && content.parameters !== undefined;
|
|
631
|
-
});
|
|
632
|
-
return [4 /*yield*/, Promise.all(contractOperations.map(function (operation) { return __awaiter(_this, void 0, void 0, function () {
|
|
633
|
-
var saplingDetails;
|
|
634
|
-
var _this = this;
|
|
635
|
-
return __generator(this, function (_a) {
|
|
636
|
-
switch (_a.label) {
|
|
637
|
-
case 0: return [4 /*yield*/, this.getPartialDetailsFromContractParameters(operation.parameters, knownViewingKeys)];
|
|
638
|
-
case 1:
|
|
639
|
-
saplingDetails = _a.sent();
|
|
640
|
-
return [2 /*return*/, saplingDetails.map(function (partials) { return (__assign(__assign({ from: [operation.source], to: ['Shielded Pool'], isInbound: false, amount: operation.amount, fee: operation.fee, protocolIdentifier: _this.identifier, network: _this.options.network }, partials), { transactionDetails: operation })); })];
|
|
641
|
-
}
|
|
642
|
-
});
|
|
643
|
-
}); }))];
|
|
644
|
-
case 1:
|
|
645
|
-
details = _a.sent();
|
|
646
|
-
return [2 /*return*/, (0, array_1.flattenArray)(details)];
|
|
647
|
-
}
|
|
648
|
-
});
|
|
649
|
-
});
|
|
650
|
-
};
|
|
651
|
-
TezosSaplingProtocol.prototype.getPartialDetailsFromContractParameters = function (rawOrParsed, knownViewingKeys) {
|
|
652
|
-
if (knownViewingKeys === void 0) { knownViewingKeys = []; }
|
|
653
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
654
|
-
var parameters, txs;
|
|
655
|
-
return __generator(this, function (_a) {
|
|
656
|
-
switch (_a.label) {
|
|
657
|
-
case 0:
|
|
658
|
-
parameters = typeof rawOrParsed === 'string' ? (this.contract ? this.contract.parseParameters(rawOrParsed) : JSON.parse(rawOrParsed)) : rawOrParsed;
|
|
659
|
-
return [4 /*yield*/, this.parseParameters(parameters)];
|
|
660
|
-
case 1:
|
|
661
|
-
txs = _a.sent();
|
|
662
|
-
return [2 /*return*/, this.bookkeeper.getTransactionsPartialDetails(txs, knownViewingKeys)];
|
|
663
|
-
}
|
|
664
|
-
});
|
|
665
|
-
});
|
|
666
|
-
};
|
|
667
|
-
TezosSaplingProtocol.prototype.filterOutPaybacks = function (airGapTxs) {
|
|
668
|
-
var filtered = airGapTxs.filter(function (details) {
|
|
669
|
-
if (details.from.length !== details.to.length) {
|
|
670
|
-
return true;
|
|
671
|
-
}
|
|
672
|
-
var fromSet = new Set(details.from);
|
|
673
|
-
var toSet = new Set(details.to);
|
|
674
|
-
return Array.from(fromSet).some(function (address) { return !toSet.has(address); });
|
|
675
|
-
});
|
|
676
|
-
return filtered.length > 0 ? filtered : airGapTxs;
|
|
677
|
-
};
|
|
678
|
-
TezosSaplingProtocol.prototype.getBalanceOfPublicKey = function (publicKey) {
|
|
679
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
680
|
-
var saplingStateDiff, unspends, balance;
|
|
681
|
-
return __generator(this, function (_a) {
|
|
682
|
-
switch (_a.label) {
|
|
683
|
-
case 0:
|
|
684
|
-
if (this.nodeClient === undefined) {
|
|
685
|
-
return [2 /*return*/, '0'];
|
|
686
|
-
}
|
|
687
|
-
return [4 /*yield*/, this.nodeClient.getSaplingStateDiff()];
|
|
688
|
-
case 1:
|
|
689
|
-
saplingStateDiff = _a.sent();
|
|
690
|
-
return [4 /*yield*/, this.bookkeeper.getUnspends(publicKey, saplingStateDiff.commitments_and_ciphertexts, saplingStateDiff.nullifiers)];
|
|
691
|
-
case 2:
|
|
692
|
-
unspends = _a.sent();
|
|
693
|
-
balance = unspends.reduce(function (sum, next) { return sum.plus(next.value); }, new bignumber_1.default(0));
|
|
694
|
-
return [2 /*return*/, balance.toString()];
|
|
695
|
-
}
|
|
696
|
-
});
|
|
697
|
-
});
|
|
698
|
-
};
|
|
699
|
-
TezosSaplingProtocol.prototype.getTransactionStatuses = function (transactionHash) {
|
|
700
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
701
|
-
return __generator(this, function (_a) {
|
|
702
|
-
throw new Error('Method not implemented.');
|
|
703
|
-
});
|
|
704
|
-
});
|
|
705
|
-
};
|
|
706
|
-
TezosSaplingProtocol.prototype.estimateMaxTransactionValueFromPublicKey = function (publicKey, recipients, fee) {
|
|
707
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
708
|
-
return __generator(this, function (_a) {
|
|
709
|
-
return [2 /*return*/, this.getBalanceOfPublicKey(publicKey)];
|
|
710
|
-
});
|
|
711
|
-
});
|
|
712
|
-
};
|
|
713
|
-
TezosSaplingProtocol.prototype.prepareTransactionFromPublicKey = function (publicKey, recipients, values, fee, data) {
|
|
714
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
715
|
-
var recipient, value;
|
|
716
|
-
return __generator(this, function (_a) {
|
|
717
|
-
if (recipients.length > 1 && values.length > 1) {
|
|
718
|
-
return [2 /*return*/, Promise.reject('Multiple sapling transactions are not supported')];
|
|
719
|
-
}
|
|
720
|
-
if (recipients.length === 0 && values.length === 0) {
|
|
721
|
-
return [2 /*return*/, Promise.reject('No recpients and values have been provided')];
|
|
722
|
-
}
|
|
723
|
-
recipient = recipients[0];
|
|
724
|
-
value = values[0];
|
|
725
|
-
if (TezosAddress_1.TezosAddress.isTzAddress(recipient)) {
|
|
726
|
-
return [2 /*return*/, this.prepareUnshieldTransaction(publicKey, recipient, value, data)];
|
|
727
|
-
}
|
|
728
|
-
else if (TezosSaplingAddress_1.TezosSaplingAddress.isZetAddress(recipient)) {
|
|
729
|
-
return [2 /*return*/, this.prepareSaplingTransaction(publicKey, recipient, value, data)];
|
|
730
|
-
}
|
|
731
|
-
return [2 /*return*/, Promise.reject("Invalid recpient, expected a 'tz' or 'zet' address, got ".concat(recipient))];
|
|
732
|
-
});
|
|
733
|
-
});
|
|
734
|
-
};
|
|
735
|
-
TezosSaplingProtocol.prototype.wrapSaplingTransactions = function (publicKey, transactionsOrString, fee, overrideFees) {
|
|
736
|
-
if (overrideFees === void 0) { overrideFees = false; }
|
|
737
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
738
|
-
var operations, parameters, transactions, contractCalls, tezosWrappedOperation, binaryTx, error_1, rpcErrors, cannotPayStorageFee, balanceTooLowError;
|
|
739
|
-
var _this = this;
|
|
740
|
-
return __generator(this, function (_a) {
|
|
741
|
-
switch (_a.label) {
|
|
742
|
-
case 0:
|
|
743
|
-
if (this.contract === undefined) {
|
|
744
|
-
throw new errors_1.PropertyUndefinedError(coinlib_error_1.Domain.TEZOS, 'Contract address not set.');
|
|
745
|
-
}
|
|
746
|
-
if (!(typeof transactionsOrString === 'string' && this.contract.areValidParameters(transactionsOrString))) return [3 /*break*/, 1];
|
|
747
|
-
parameters = this.contract.parseParameters(transactionsOrString);
|
|
748
|
-
operations = [this.prepareTezosOperation(parameters, fee)];
|
|
749
|
-
return [3 /*break*/, 3];
|
|
750
|
-
case 1:
|
|
751
|
-
transactions = Array.isArray(transactionsOrString) ? transactionsOrString : [transactionsOrString];
|
|
752
|
-
return [4 /*yield*/, this.prepareContractCalls(transactions)];
|
|
753
|
-
case 2:
|
|
754
|
-
contractCalls = _a.sent();
|
|
755
|
-
operations = contractCalls.map(function (contractCall) { var _a; return _this.prepareTezosOperation(contractCall.toJSON(), fee, (_a = contractCall.amount) === null || _a === void 0 ? void 0 : _a.toString()); });
|
|
756
|
-
_a.label = 3;
|
|
757
|
-
case 3:
|
|
758
|
-
_a.trys.push([3, 6, , 7]);
|
|
759
|
-
return [4 /*yield*/, this.tezosProtocol.prepareOperations(publicKey, operations, overrideFees)];
|
|
760
|
-
case 4:
|
|
761
|
-
tezosWrappedOperation = _a.sent();
|
|
762
|
-
return [4 /*yield*/, this.tezosProtocol.forgeTezosOperation(tezosWrappedOperation)];
|
|
763
|
-
case 5:
|
|
764
|
-
binaryTx = _a.sent();
|
|
765
|
-
return [2 /*return*/, { binaryTransaction: binaryTx }];
|
|
766
|
-
case 6:
|
|
767
|
-
error_1 = _a.sent();
|
|
768
|
-
console.error(error_1);
|
|
769
|
-
if (error_1.code !== undefined && error_1.code === errors_1.ProtocolErrorType.TRANSACTION_FAILED) {
|
|
770
|
-
rpcErrors = error_1.data;
|
|
771
|
-
cannotPayStorageFee = rpcErrors.find(function (error) { return error.id.endsWith('.contract.cannot_pay_storage_fee'); });
|
|
772
|
-
if (cannotPayStorageFee) {
|
|
773
|
-
throw new errors_1.BalanceError(coinlib_error_1.Domain.TEZOS, 'Balance too low, cannot pay for storage fee');
|
|
774
|
-
}
|
|
775
|
-
balanceTooLowError = rpcErrors.find(function (error) { return error.id.endsWith('.contract.balance_too_low'); });
|
|
776
|
-
if (balanceTooLowError) {
|
|
777
|
-
throw new errors_1.BalanceError(coinlib_error_1.Domain.TEZOS, 'Balance too low');
|
|
778
|
-
}
|
|
779
|
-
}
|
|
780
|
-
throw error_1;
|
|
781
|
-
case 7: return [2 /*return*/];
|
|
782
|
-
}
|
|
783
|
-
});
|
|
784
|
-
});
|
|
785
|
-
};
|
|
786
|
-
TezosSaplingProtocol.prototype.prepareTezosOperation = function (parameters, fee, amount) {
|
|
787
|
-
if (amount === void 0) { amount = '0'; }
|
|
788
|
-
return {
|
|
789
|
-
kind: TezosOperationType_1.TezosOperationType.TRANSACTION,
|
|
790
|
-
fee: fee,
|
|
791
|
-
amount: amount,
|
|
792
|
-
destination: this.options.config.contractAddress,
|
|
793
|
-
parameters: parameters
|
|
794
|
-
};
|
|
795
|
-
};
|
|
796
|
-
TezosSaplingProtocol.prototype.prepareShieldTransaction = function (publicKey, recipient, value, fee, data) {
|
|
797
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
798
|
-
var encodedTransaction;
|
|
799
|
-
return __generator(this, function (_a) {
|
|
800
|
-
switch (_a.label) {
|
|
801
|
-
case 0: return [4 /*yield*/, this.mint(recipient, value)];
|
|
802
|
-
case 1:
|
|
803
|
-
encodedTransaction = _a.sent();
|
|
804
|
-
return [2 /*return*/, this.wrapSaplingTransactions(publicKey, [encodedTransaction], fee, data === null || data === void 0 ? void 0 : data.overrideFees)];
|
|
805
|
-
}
|
|
806
|
-
});
|
|
807
|
-
});
|
|
808
|
-
};
|
|
809
|
-
TezosSaplingProtocol.prototype.prepareUnshieldTransaction = function (viewingKey, recipient, value, data) {
|
|
810
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
811
|
-
var burnTransaction;
|
|
812
|
-
return __generator(this, function (_a) {
|
|
813
|
-
switch (_a.label) {
|
|
814
|
-
case 0:
|
|
815
|
-
if (!TezosAddress_1.TezosAddress.isTzAddress(recipient)) {
|
|
816
|
-
return [2 /*return*/, Promise.reject("Invalid recpient, expected a 'tz' address, got ".concat(recipient))];
|
|
817
|
-
}
|
|
818
|
-
return [4 /*yield*/, this.burn(viewingKey, value)];
|
|
819
|
-
case 1:
|
|
820
|
-
burnTransaction = _a.sent();
|
|
821
|
-
return [2 /*return*/, __assign(__assign({}, burnTransaction), { unshieldTarget: recipient })];
|
|
822
|
-
}
|
|
823
|
-
});
|
|
824
|
-
});
|
|
825
|
-
};
|
|
826
|
-
TezosSaplingProtocol.prototype.prepareSaplingTransaction = function (viewingKey, recipient, value, data) {
|
|
827
|
-
var _a, _b;
|
|
828
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
829
|
-
var dummyInputsAmount, dummyOutputsAmount, _c, stateDiff, chainId, _d, inputs, toSpend, address, paymentOutput, _e, paybackOutput, _f, dummyInputs, dummyOutputs;
|
|
830
|
-
var _this = this;
|
|
831
|
-
return __generator(this, function (_g) {
|
|
832
|
-
switch (_g.label) {
|
|
833
|
-
case 0:
|
|
834
|
-
if (this.nodeClient === undefined || this.options.config.contractAddress === undefined) {
|
|
835
|
-
throw new errors_1.PropertyUndefinedError(coinlib_error_1.Domain.TEZOS, 'Contract address not set.');
|
|
836
|
-
}
|
|
837
|
-
if (!TezosSaplingAddress_1.TezosSaplingAddress.isZetAddress(recipient)) {
|
|
838
|
-
return [2 /*return*/, Promise.reject("Invalid recpient, expected a 'zet' address, got ".concat(recipient))];
|
|
839
|
-
}
|
|
840
|
-
dummyInputsAmount = Math.max(new bignumber_1.default((_a = data === null || data === void 0 ? void 0 : data.dummyInputs) !== null && _a !== void 0 ? _a : 0).toNumber(), 0);
|
|
841
|
-
dummyOutputsAmount = Math.max(new bignumber_1.default((_b = data === null || data === void 0 ? void 0 : data.dummyOutputs) !== null && _b !== void 0 ? _b : 0).toNumber(), 0);
|
|
842
|
-
return [4 /*yield*/, Promise.all([
|
|
843
|
-
this.nodeClient.getSaplingStateDiff(),
|
|
844
|
-
this.nodeClient.getChainId()
|
|
845
|
-
])];
|
|
846
|
-
case 1:
|
|
847
|
-
_c = _g.sent(), stateDiff = _c[0], chainId = _c[1];
|
|
848
|
-
return [4 /*yield*/, this.chooseInputs(viewingKey, stateDiff.commitments_and_ciphertexts, stateDiff.nullifiers, value)];
|
|
849
|
-
case 2:
|
|
850
|
-
_d = _g.sent(), inputs = _d[0], toSpend = _d[1];
|
|
851
|
-
return [4 /*yield*/, this.getAddressFromPublicKey(viewingKey).then(function (address) {
|
|
852
|
-
return TezosSaplingAddress_1.TezosSaplingAddress.fromValue(address.address, address.cursor.diversifierIndex);
|
|
853
|
-
})];
|
|
854
|
-
case 3:
|
|
855
|
-
address = _g.sent();
|
|
856
|
-
_e = this.createPaymentOutput;
|
|
857
|
-
return [4 /*yield*/, TezosSaplingAddress_1.TezosSaplingAddress.fromValue(recipient)];
|
|
858
|
-
case 4:
|
|
859
|
-
paymentOutput = _e.apply(this, [_g.sent(), value]);
|
|
860
|
-
paybackOutput = this.createPaybackOutput(address, toSpend, value);
|
|
861
|
-
return [4 /*yield*/, Promise.all([
|
|
862
|
-
Promise.all(Array.from({ length: dummyInputsAmount }, function (_v, _k) { return _this.createDummyInput(address); })),
|
|
863
|
-
Promise.all(Array.from({ length: dummyOutputsAmount }, function (_v, _k) { return _this.createDummyOutput(); }))
|
|
864
|
-
])];
|
|
865
|
-
case 5:
|
|
866
|
-
_f = _g.sent(), dummyInputs = _f[0], dummyOutputs = _f[1];
|
|
867
|
-
return [2 /*return*/, {
|
|
868
|
-
ins: inputs.concat(dummyInputs),
|
|
869
|
-
outs: __spreadArray([paymentOutput, paybackOutput], dummyOutputs, true).filter(function (output) { return output !== undefined; }),
|
|
870
|
-
contractAddress: this.options.config.contractAddress,
|
|
871
|
-
chainId: chainId,
|
|
872
|
-
stateDiff: stateDiff,
|
|
873
|
-
unshieldTarget: ''
|
|
874
|
-
}];
|
|
875
|
-
}
|
|
876
|
-
});
|
|
877
|
-
});
|
|
878
|
-
};
|
|
879
|
-
TezosSaplingProtocol.prototype.mint = function (recipient, value) {
|
|
880
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
881
|
-
var _a, saplingStateDiff, chainId, output, stateTree, forgedTransaction;
|
|
882
|
-
var _b;
|
|
883
|
-
return __generator(this, function (_c) {
|
|
884
|
-
switch (_c.label) {
|
|
885
|
-
case 0:
|
|
886
|
-
if (this.nodeClient === undefined || this.options.config.contractAddress === undefined) {
|
|
887
|
-
throw new errors_1.PropertyUndefinedError(coinlib_error_1.Domain.TEZOS, 'Contract address not set.');
|
|
888
|
-
}
|
|
889
|
-
if (!TezosSaplingAddress_1.TezosSaplingAddress.isZetAddress(recipient)) {
|
|
890
|
-
return [2 /*return*/, Promise.reject("Invalid recipient, expected a 'zet' address, got ".concat(recipient))];
|
|
891
|
-
}
|
|
892
|
-
return [4 /*yield*/, Promise.all([
|
|
893
|
-
this.nodeClient.getSaplingStateDiff(),
|
|
894
|
-
this.nodeClient.getChainId()
|
|
895
|
-
])];
|
|
896
|
-
case 1:
|
|
897
|
-
_a = _c.sent(), saplingStateDiff = _a[0], chainId = _a[1];
|
|
898
|
-
_b = {};
|
|
899
|
-
return [4 /*yield*/, TezosSaplingAddress_1.TezosSaplingAddress.fromValue(recipient)];
|
|
900
|
-
case 2:
|
|
901
|
-
output = (_b.address = (_c.sent()).asString(),
|
|
902
|
-
_b.value = value,
|
|
903
|
-
_b.memo = Buffer.alloc(this.options.config.memoSize).toString('hex'),
|
|
904
|
-
_b.browsable = true,
|
|
905
|
-
_b);
|
|
906
|
-
return [4 /*yield*/, this.state.getStateTreeFromStateDiff(saplingStateDiff, true)];
|
|
907
|
-
case 3:
|
|
908
|
-
stateTree = _c.sent();
|
|
909
|
-
return [4 /*yield*/, this.forger.forgeSaplingTransaction([], [output], stateTree, this.getAntiReplay(chainId, this.options.config.contractAddress))];
|
|
910
|
-
case 4:
|
|
911
|
-
forgedTransaction = _c.sent();
|
|
912
|
-
return [2 /*return*/, this.encoder.encodeTransaction(forgedTransaction).toString('hex')];
|
|
913
|
-
}
|
|
914
|
-
});
|
|
915
|
-
});
|
|
916
|
-
};
|
|
917
|
-
TezosSaplingProtocol.prototype.burn = function (viewingKey, value) {
|
|
918
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
919
|
-
var _a, stateDiff, chainId, _b, inputs, toSpend, paybackOutput;
|
|
920
|
-
var _c;
|
|
921
|
-
return __generator(this, function (_d) {
|
|
922
|
-
switch (_d.label) {
|
|
923
|
-
case 0:
|
|
924
|
-
if (this.nodeClient === undefined || this.options.config.contractAddress === undefined) {
|
|
925
|
-
throw new errors_1.PropertyUndefinedError(coinlib_error_1.Domain.TEZOS, 'Contract address not set.');
|
|
926
|
-
}
|
|
927
|
-
return [4 /*yield*/, Promise.all([
|
|
928
|
-
this.nodeClient.getSaplingStateDiff(),
|
|
929
|
-
this.nodeClient.getChainId()
|
|
930
|
-
])];
|
|
931
|
-
case 1:
|
|
932
|
-
_a = _d.sent(), stateDiff = _a[0], chainId = _a[1];
|
|
933
|
-
return [4 /*yield*/, this.chooseInputs(viewingKey, stateDiff.commitments_and_ciphertexts, stateDiff.nullifiers, value)];
|
|
934
|
-
case 2:
|
|
935
|
-
_b = _d.sent(), inputs = _b[0], toSpend = _b[1];
|
|
936
|
-
_c = {};
|
|
937
|
-
return [4 /*yield*/, this.getAddressFromPublicKey(viewingKey)];
|
|
938
|
-
case 3:
|
|
939
|
-
paybackOutput = (_c.address = (_d.sent()).address,
|
|
940
|
-
_c.value = toSpend.minus(value).toString(),
|
|
941
|
-
_c.memo = Buffer.alloc(this.options.config.memoSize).toString('hex'),
|
|
942
|
-
_c.browsable = true,
|
|
943
|
-
_c);
|
|
944
|
-
return [2 /*return*/, {
|
|
945
|
-
ins: inputs,
|
|
946
|
-
outs: [paybackOutput],
|
|
947
|
-
contractAddress: this.options.config.contractAddress,
|
|
948
|
-
chainId: chainId,
|
|
949
|
-
stateDiff: stateDiff,
|
|
950
|
-
unshieldTarget: ''
|
|
951
|
-
}];
|
|
952
|
-
}
|
|
953
|
-
});
|
|
954
|
-
});
|
|
955
|
-
};
|
|
956
|
-
TezosSaplingProtocol.prototype.chooseInputs = function (viewingKey, commitmentsWithCiphertext, nullifiers, value) {
|
|
957
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
958
|
-
var unspends, balance, chosenUnspends, toSpend, _i, unspends_1, unspend;
|
|
959
|
-
return __generator(this, function (_a) {
|
|
960
|
-
switch (_a.label) {
|
|
961
|
-
case 0: return [4 /*yield*/, this.bookkeeper.getUnspends(viewingKey, commitmentsWithCiphertext, nullifiers)];
|
|
962
|
-
case 1:
|
|
963
|
-
unspends = _a.sent();
|
|
964
|
-
balance = this.bookkeeper.sumNotes(unspends);
|
|
965
|
-
if (balance.lt(value)) {
|
|
966
|
-
return [2 /*return*/, Promise.reject('Not enough balance')];
|
|
967
|
-
}
|
|
968
|
-
chosenUnspends = [];
|
|
969
|
-
toSpend = new bignumber_1.default(0);
|
|
970
|
-
for (_i = 0, unspends_1 = unspends; _i < unspends_1.length; _i++) {
|
|
971
|
-
unspend = unspends_1[_i];
|
|
972
|
-
if (toSpend.gte(value)) {
|
|
973
|
-
break;
|
|
974
|
-
}
|
|
975
|
-
toSpend = toSpend.plus(unspend.value);
|
|
976
|
-
chosenUnspends.push(unspend);
|
|
977
|
-
}
|
|
978
|
-
return [2 /*return*/, [chosenUnspends, toSpend]];
|
|
979
|
-
}
|
|
980
|
-
});
|
|
981
|
-
});
|
|
982
|
-
};
|
|
983
|
-
TezosSaplingProtocol.prototype.createPaymentOutput = function (address, value, memo) {
|
|
984
|
-
if (memo === void 0) { memo = Buffer.alloc(this.options.config.memoSize); }
|
|
985
|
-
return {
|
|
986
|
-
address: address.asString(),
|
|
987
|
-
value: new bignumber_1.default(value).toString(),
|
|
988
|
-
memo: memo.toString('hex'),
|
|
989
|
-
browsable: true
|
|
990
|
-
};
|
|
991
|
-
};
|
|
992
|
-
TezosSaplingProtocol.prototype.createPaybackOutput = function (address, toSpend, value, memo) {
|
|
993
|
-
if (memo === void 0) { memo = Buffer.alloc(this.options.config.memoSize); }
|
|
994
|
-
var paybackValue = toSpend.minus(value);
|
|
995
|
-
return paybackValue.gt(0)
|
|
996
|
-
? {
|
|
997
|
-
address: address.asString(),
|
|
998
|
-
value: paybackValue.toString(),
|
|
999
|
-
memo: memo.toString('hex'),
|
|
1000
|
-
browsable: true
|
|
1001
|
-
}
|
|
1002
|
-
: undefined;
|
|
1003
|
-
};
|
|
1004
|
-
TezosSaplingProtocol.prototype.createDummyInput = function (address) {
|
|
1005
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1006
|
-
var rcm;
|
|
1007
|
-
return __generator(this, function (_a) {
|
|
1008
|
-
switch (_a.label) {
|
|
1009
|
-
case 0: return [4 /*yield*/, sapling.randR()];
|
|
1010
|
-
case 1:
|
|
1011
|
-
rcm = _a.sent();
|
|
1012
|
-
return [2 /*return*/, {
|
|
1013
|
-
rcm: rcm.toString('hex'),
|
|
1014
|
-
pos: '0',
|
|
1015
|
-
value: '0',
|
|
1016
|
-
address: address.asString()
|
|
1017
|
-
}];
|
|
1018
|
-
}
|
|
1019
|
-
});
|
|
1020
|
-
});
|
|
1021
|
-
};
|
|
1022
|
-
TezosSaplingProtocol.prototype.createDummyOutput = function () {
|
|
1023
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1024
|
-
var address, memo;
|
|
1025
|
-
return __generator(this, function (_a) {
|
|
1026
|
-
switch (_a.label) {
|
|
1027
|
-
case 0: return [4 /*yield*/, this.getDummyAddress()];
|
|
1028
|
-
case 1:
|
|
1029
|
-
address = _a.sent();
|
|
1030
|
-
memo = (0, random_1.randomBytes)(this.options.config.memoSize);
|
|
1031
|
-
return [2 /*return*/, {
|
|
1032
|
-
address: address.address,
|
|
1033
|
-
value: '0',
|
|
1034
|
-
memo: Buffer.from(memo).toString('hex'),
|
|
1035
|
-
browsable: false
|
|
1036
|
-
}];
|
|
1037
|
-
}
|
|
1038
|
-
});
|
|
1039
|
-
});
|
|
1040
|
-
};
|
|
1041
|
-
TezosSaplingProtocol.prototype.getDummyAddress = function () {
|
|
1042
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1043
|
-
var seed, viewingKey;
|
|
1044
|
-
return __generator(this, function (_a) {
|
|
1045
|
-
switch (_a.label) {
|
|
1046
|
-
case 0:
|
|
1047
|
-
seed = (0, random_1.randomBytes)(32);
|
|
1048
|
-
return [4 /*yield*/, this.getPublicKeyFromHexSecret(Buffer.from(seed).toString('hex'), this.standardDerivationPath)];
|
|
1049
|
-
case 1:
|
|
1050
|
-
viewingKey = _a.sent();
|
|
1051
|
-
return [2 /*return*/, this.getAddressFromPublicKey(viewingKey)];
|
|
1052
|
-
}
|
|
1053
|
-
});
|
|
1054
|
-
});
|
|
1055
|
-
};
|
|
1056
|
-
TezosSaplingProtocol.prototype.createAddressBoundData = function (address) {
|
|
1057
|
-
var michelson = MichelsonAddress_1.MichelsonAddress.from(TezosUtils_1.TezosUtils.encodeTzAddress(address));
|
|
1058
|
-
return TezosUtils_1.TezosUtils.packMichelsonType(michelson);
|
|
1059
|
-
};
|
|
1060
|
-
TezosSaplingProtocol.prototype.getAntiReplay = function (chainId, contractAddress) {
|
|
1061
|
-
return contractAddress + chainId;
|
|
1062
|
-
};
|
|
1063
|
-
TezosSaplingProtocol.prototype.broadcastTransaction = function (rawTransaction) {
|
|
1064
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1065
|
-
var hash, error_2;
|
|
1066
|
-
return __generator(this, function (_a) {
|
|
1067
|
-
switch (_a.label) {
|
|
1068
|
-
case 0:
|
|
1069
|
-
if (!this.injectorClient) {
|
|
1070
|
-
throw new errors_1.PropertyUndefinedError(coinlib_error_1.Domain.TEZOS, "Can't broadcast a sapling transaction, an injector service URL or contract address has not be set.");
|
|
1071
|
-
}
|
|
1072
|
-
_a.label = 1;
|
|
1073
|
-
case 1:
|
|
1074
|
-
_a.trys.push([1, 3, , 4]);
|
|
1075
|
-
return [4 /*yield*/, this.injectorClient.injectTransaction(rawTransaction)];
|
|
1076
|
-
case 2:
|
|
1077
|
-
hash = _a.sent();
|
|
1078
|
-
return [2 /*return*/, hash];
|
|
1079
|
-
case 3:
|
|
1080
|
-
error_2 = _a.sent();
|
|
1081
|
-
throw new errors_1.NetworkError(coinlib_error_1.Domain.TEZOS, error_2);
|
|
1082
|
-
case 4: return [2 /*return*/];
|
|
1083
|
-
}
|
|
1084
|
-
});
|
|
1085
|
-
});
|
|
1086
|
-
};
|
|
1087
|
-
TezosSaplingProtocol.prototype.signMessage = function (message, keypair) {
|
|
1088
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1089
|
-
return __generator(this, function (_a) {
|
|
1090
|
-
return [2 /*return*/, this.tezosProtocol.signMessage(message, keypair)];
|
|
1091
|
-
});
|
|
1092
|
-
});
|
|
1093
|
-
};
|
|
1094
|
-
TezosSaplingProtocol.prototype.verifyMessage = function (message, signature, publicKey) {
|
|
1095
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1096
|
-
return __generator(this, function (_a) {
|
|
1097
|
-
return [2 /*return*/, this.tezosProtocol.verifyMessage(message, signature, publicKey)];
|
|
1098
|
-
});
|
|
1099
|
-
});
|
|
1100
|
-
};
|
|
1101
|
-
TezosSaplingProtocol.prototype.encryptAsymmetric = function (payload, publicKey) {
|
|
1102
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1103
|
-
return __generator(this, function (_a) {
|
|
1104
|
-
return [2 /*return*/, this.encryptAsymmetric(payload, publicKey)];
|
|
1105
|
-
});
|
|
1106
|
-
});
|
|
1107
|
-
};
|
|
1108
|
-
TezosSaplingProtocol.prototype.decryptAsymmetric = function (encryptedPayload, keypair) {
|
|
1109
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1110
|
-
return __generator(this, function (_a) {
|
|
1111
|
-
return [2 /*return*/, this.decryptAsymmetric(encryptedPayload, keypair)];
|
|
1112
|
-
});
|
|
1113
|
-
});
|
|
1114
|
-
};
|
|
1115
|
-
TezosSaplingProtocol.prototype.encryptAES = function (payload, privateKey) {
|
|
1116
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1117
|
-
return __generator(this, function (_a) {
|
|
1118
|
-
return [2 /*return*/, this.encryptAES(payload, privateKey)];
|
|
1119
|
-
});
|
|
1120
|
-
});
|
|
1121
|
-
};
|
|
1122
|
-
TezosSaplingProtocol.prototype.decryptAES = function (encryptedPayload, privateKey) {
|
|
1123
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1124
|
-
return __generator(this, function (_a) {
|
|
1125
|
-
return [2 /*return*/, this.decryptAES(encryptedPayload, privateKey)];
|
|
1126
|
-
});
|
|
1127
|
-
});
|
|
1128
|
-
};
|
|
1129
|
-
TezosSaplingProtocol.prototype.getBlockExplorerLinkForAddress = function (address) {
|
|
1130
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1131
|
-
return __generator(this, function (_a) {
|
|
1132
|
-
throw new Error('Method `getBlockExplorerLinkForAddress` not supported.');
|
|
1133
|
-
});
|
|
1134
|
-
});
|
|
1135
|
-
};
|
|
1136
|
-
TezosSaplingProtocol.prototype.getTransactionsFromAddresses = function (addresses, limit, cursor) {
|
|
1137
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1138
|
-
return __generator(this, function (_a) {
|
|
1139
|
-
throw new Error('Method `getTransactionsFromAddresses` not supported.');
|
|
1140
|
-
});
|
|
1141
|
-
});
|
|
1142
|
-
};
|
|
1143
|
-
TezosSaplingProtocol.prototype.getBalanceOfAddresses = function (addresses) {
|
|
1144
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1145
|
-
return __generator(this, function (_a) {
|
|
1146
|
-
throw new Error('Method `getBalanceOfAddresses` not supported.');
|
|
1147
|
-
});
|
|
1148
|
-
});
|
|
1149
|
-
};
|
|
1150
|
-
TezosSaplingProtocol.prototype.getAvailableBalanceOfAddresses = function (addresses) {
|
|
1151
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1152
|
-
return __generator(this, function (_a) {
|
|
1153
|
-
throw new Error('Method `getAvailableBalanceOfAddresses` not supported.');
|
|
1154
|
-
});
|
|
1155
|
-
});
|
|
1156
|
-
};
|
|
1157
|
-
TezosSaplingProtocol.prototype.getBalanceOfPublicKeyForSubProtocols = function (publicKey, subProtocols) {
|
|
1158
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1159
|
-
return __generator(this, function (_a) {
|
|
1160
|
-
throw new Error('Method `getBalanceOfPublicKeyForSubProtocols` not supported.');
|
|
1161
|
-
});
|
|
1162
|
-
});
|
|
1163
|
-
};
|
|
1164
|
-
TezosSaplingProtocol.prototype.estimateFeeDefaultsFromPublicKey = function (publicKey, recipients, values, data) {
|
|
1165
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1166
|
-
return __generator(this, function (_a) {
|
|
1167
|
-
throw new Error('Method `estimateFeeDefaultsFromPublicKey` not supported.');
|
|
1168
|
-
});
|
|
1169
|
-
});
|
|
1170
|
-
};
|
|
1171
|
-
TezosSaplingProtocol.prototype.isRawTezosSaplingTransaction = function (transaction) {
|
|
1172
|
-
return (transaction instanceof Object &&
|
|
1173
|
-
'ins' in transaction &&
|
|
1174
|
-
'outs' in transaction &&
|
|
1175
|
-
'contractAddress' in transaction &&
|
|
1176
|
-
'chainId' in transaction &&
|
|
1177
|
-
'stateDiff' in transaction);
|
|
1178
|
-
};
|
|
1179
|
-
return TezosSaplingProtocol;
|
|
1180
|
-
}(NonExtendedProtocol_1.NonExtendedProtocol));
|
|
1181
|
-
exports.TezosSaplingProtocol = TezosSaplingProtocol;
|
|
1182
|
-
//# sourceMappingURL=TezosSaplingProtocol.js.map
|