@airgap/tezos 0.13.11-beta.0 → 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/module.d.ts +0 -3
- package/v1/module.js +0 -24
- package/v1/module.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,968 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
-
function step(op) {
|
|
27
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (_) try {
|
|
29
|
-
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;
|
|
30
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
-
switch (op[0]) {
|
|
32
|
-
case 0: case 1: t = op; break;
|
|
33
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
-
default:
|
|
37
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
-
if (t[2]) _.ops.pop();
|
|
42
|
-
_.trys.pop(); continue;
|
|
43
|
-
}
|
|
44
|
-
op = body.call(thisArg, _);
|
|
45
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
50
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
51
|
-
};
|
|
52
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
-
exports.createTezosProtocolOptions = exports.TEZOS_GHOSTNET_PROTOCOL_NETWORK = exports.TEZOS_MAINNET_PROTOCOL_NETWORK = exports.createTezosProtocol = exports.TezosProtocolImpl = exports.TEZOS_ACCOUNT_METADATA = exports.TEZOS_DERIVATION_PATH = exports.TEZOS_UNITS = void 0;
|
|
54
|
-
var coinlib_core_1 = require("@airgap/coinlib-core");
|
|
55
|
-
var index_1 = __importDefault(require("@airgap/coinlib-core/dependencies/src/axios-0.19.0/index"));
|
|
56
|
-
var bignumber_1 = __importDefault(require("@airgap/coinlib-core/dependencies/src/bignumber.js-9.0.0/bignumber"));
|
|
57
|
-
// @ts-ignore
|
|
58
|
-
var index_2 = require("@airgap/coinlib-core/dependencies/src/bip39-2.5.0/index");
|
|
59
|
-
var src_1 = require("@airgap/coinlib-core/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src");
|
|
60
|
-
var errors_1 = require("@airgap/coinlib-core/errors");
|
|
61
|
-
var module_kit_1 = require("@airgap/module-kit");
|
|
62
|
-
var TezosCryptoClient_1 = require("../crypto/TezosCryptoClient");
|
|
63
|
-
var TezosAddress_1 = require("../data/TezosAddress");
|
|
64
|
-
var factory_1 = require("../indexer/factory");
|
|
65
|
-
var network_1 = require("../types/network");
|
|
66
|
-
var TezosOperationType_1 = require("../types/operations/TezosOperationType");
|
|
67
|
-
var key_1 = require("../utils/key");
|
|
68
|
-
var operations_1 = require("../utils/operations");
|
|
69
|
-
var TezosAccountant_1 = require("../utils/protocol/tezos/TezosAccountant");
|
|
70
|
-
var TezosForger_1 = require("../utils/protocol/tezos/TezosForger");
|
|
71
|
-
var signature_1 = require("../utils/signature");
|
|
72
|
-
// Implementation
|
|
73
|
-
var MAX_OPERATIONS_PER_GROUP = 200;
|
|
74
|
-
var MAX_GAS_PER_BLOCK = 5200000;
|
|
75
|
-
var GAS_LIMIT_PLACEHOLDER = '1040000';
|
|
76
|
-
var STORAGE_LIMIT_PLACEHOLDER = '60000';
|
|
77
|
-
var FEE_PLACEHOLDER = '0';
|
|
78
|
-
var MINIMAL_FEE = 100;
|
|
79
|
-
var MINIMAL_FEE_PER_GAS_UNIT = 0.1;
|
|
80
|
-
var MINIMAL_FEE_PER_BYTE = 1;
|
|
81
|
-
exports.TEZOS_UNITS = {
|
|
82
|
-
tez: {
|
|
83
|
-
symbol: { value: 'XTZ', market: 'xtz' },
|
|
84
|
-
decimals: 6
|
|
85
|
-
},
|
|
86
|
-
mutez: {
|
|
87
|
-
symbol: { value: 'mutez' },
|
|
88
|
-
decimals: 0
|
|
89
|
-
},
|
|
90
|
-
nanotez: {
|
|
91
|
-
symbol: { value: 'nanotez' },
|
|
92
|
-
decimals: -3
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
exports.TEZOS_DERIVATION_PATH = "m/44h/1729h/0h/0h";
|
|
96
|
-
exports.TEZOS_ACCOUNT_METADATA = {
|
|
97
|
-
standardDerivationPath: exports.TEZOS_DERIVATION_PATH,
|
|
98
|
-
address: {
|
|
99
|
-
isCaseSensitive: true,
|
|
100
|
-
placeholder: 'tz1...',
|
|
101
|
-
regex: '^((tz1|tz2|tz3|KT1)[1-9A-Za-z]{33}|zet1[1-9A-Za-z]{65})$'
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
var TezosProtocolImpl = /** @class */ (function () {
|
|
105
|
-
function TezosProtocolImpl(options) {
|
|
106
|
-
// Common
|
|
107
|
-
this.units = exports.TEZOS_UNITS;
|
|
108
|
-
this.feeDefaults = {
|
|
109
|
-
low: (0, module_kit_1.newAmount)(0.00142, 'tez').blockchain(this.units),
|
|
110
|
-
medium: (0, module_kit_1.newAmount)(0.00152, 'tez').blockchain(this.units),
|
|
111
|
-
high: (0, module_kit_1.newAmount)(0.003, 'tez').blockchain(this.units)
|
|
112
|
-
};
|
|
113
|
-
this.metadata = {
|
|
114
|
-
identifier: coinlib_core_1.MainProtocolSymbols.XTZ,
|
|
115
|
-
name: 'Tezos',
|
|
116
|
-
units: this.units,
|
|
117
|
-
mainUnit: 'tez',
|
|
118
|
-
fee: {
|
|
119
|
-
defaults: this.feeDefaults
|
|
120
|
-
},
|
|
121
|
-
account: exports.TEZOS_ACCOUNT_METADATA
|
|
122
|
-
};
|
|
123
|
-
this.options = createTezosProtocolOptions(options.network);
|
|
124
|
-
this.forger = new TezosForger_1.TezosForger();
|
|
125
|
-
this.accountant = new TezosAccountant_1.TezosAccountant(this.forger, this.options.network);
|
|
126
|
-
this.indexerClient = (0, factory_1.createTezosIndexerClient)(this.options.network.indexer);
|
|
127
|
-
this.cryptoClient = new TezosCryptoClient_1.TezosCryptoClient();
|
|
128
|
-
}
|
|
129
|
-
TezosProtocolImpl.prototype.getMetadata = function () {
|
|
130
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
131
|
-
return __generator(this, function (_a) {
|
|
132
|
-
return [2 /*return*/, this.metadata];
|
|
133
|
-
});
|
|
134
|
-
});
|
|
135
|
-
};
|
|
136
|
-
TezosProtocolImpl.prototype.getAddressFromPublicKey = function (publicKey) {
|
|
137
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
138
|
-
return __generator(this, function (_a) {
|
|
139
|
-
return [2 /*return*/, TezosAddress_1.TezosAddress.fromPublicKey(publicKey).asString()];
|
|
140
|
-
});
|
|
141
|
-
});
|
|
142
|
-
};
|
|
143
|
-
TezosProtocolImpl.prototype.getDetailsFromTransaction = function (transaction, _publicKey) {
|
|
144
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
145
|
-
return __generator(this, function (_a) {
|
|
146
|
-
return [2 /*return*/, this.accountant.getDetailsFromTransaction(transaction)];
|
|
147
|
-
});
|
|
148
|
-
});
|
|
149
|
-
};
|
|
150
|
-
TezosProtocolImpl.prototype.verifyMessageWithPublicKey = function (message, signature, publicKey) {
|
|
151
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
152
|
-
var encodedSignature, hexPublicKey;
|
|
153
|
-
return __generator(this, function (_a) {
|
|
154
|
-
encodedSignature = (0, signature_1.convertSignature)(signature, 'encoded');
|
|
155
|
-
hexPublicKey = (0, key_1.convertPublicKey)(publicKey, 'hex');
|
|
156
|
-
return [2 /*return*/, this.cryptoClient.verifyMessage(message, encodedSignature.value, hexPublicKey.value)];
|
|
157
|
-
});
|
|
158
|
-
});
|
|
159
|
-
};
|
|
160
|
-
TezosProtocolImpl.prototype.encryptAsymmetricWithPublicKey = function (payload, publicKey) {
|
|
161
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
162
|
-
var hexPublicKey;
|
|
163
|
-
return __generator(this, function (_a) {
|
|
164
|
-
hexPublicKey = (0, key_1.convertPublicKey)(publicKey, 'hex');
|
|
165
|
-
return [2 /*return*/, this.cryptoClient.encryptAsymmetric(payload, hexPublicKey.value)];
|
|
166
|
-
});
|
|
167
|
-
});
|
|
168
|
-
};
|
|
169
|
-
// Offline
|
|
170
|
-
TezosProtocolImpl.prototype.getKeyPairFromSecret = function (secret, derivationPath) {
|
|
171
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
172
|
-
return __generator(this, function (_a) {
|
|
173
|
-
switch (secret.type) {
|
|
174
|
-
case 'hex':
|
|
175
|
-
return [2 /*return*/, this.getKeyPairFromHexSecret(secret.value, derivationPath)];
|
|
176
|
-
case 'mnemonic':
|
|
177
|
-
return [2 /*return*/, this.getKeyPairFromMnemonic(secret.value, secret.password, derivationPath)];
|
|
178
|
-
default:
|
|
179
|
-
(0, coinlib_core_1.assertNever)(secret);
|
|
180
|
-
throw new errors_1.UnsupportedError(coinlib_core_1.Domain.TEZOS, 'Unsupported secret type.');
|
|
181
|
-
}
|
|
182
|
-
return [2 /*return*/];
|
|
183
|
-
});
|
|
184
|
-
});
|
|
185
|
-
};
|
|
186
|
-
TezosProtocolImpl.prototype.getKeyPairFromHexSecret = function (secret, derivationPath) {
|
|
187
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
188
|
-
var keyPair;
|
|
189
|
-
return __generator(this, function (_a) {
|
|
190
|
-
keyPair = (0, src_1.generateWalletUsingDerivationPath)(Buffer.from(secret, 'hex'), derivationPath);
|
|
191
|
-
// should we maybe return encoded keys, i.e. edsk... and edpk... strings?
|
|
192
|
-
return [2 /*return*/, {
|
|
193
|
-
secretKey: (0, module_kit_1.newSecretKey)(Buffer.from(keyPair.secretKey).toString('hex'), 'hex'),
|
|
194
|
-
publicKey: (0, module_kit_1.newPublicKey)(Buffer.from(keyPair.publicKey).toString('hex'), 'hex')
|
|
195
|
-
}];
|
|
196
|
-
});
|
|
197
|
-
});
|
|
198
|
-
};
|
|
199
|
-
TezosProtocolImpl.prototype.getKeyPairFromMnemonic = function (mnemonic, password, derivationPath) {
|
|
200
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
201
|
-
var secret;
|
|
202
|
-
return __generator(this, function (_a) {
|
|
203
|
-
secret = (0, index_2.mnemonicToSeed)(mnemonic, password);
|
|
204
|
-
return [2 /*return*/, this.getKeyPairFromHexSecret(secret.toString('hex'), derivationPath)];
|
|
205
|
-
});
|
|
206
|
-
});
|
|
207
|
-
};
|
|
208
|
-
TezosProtocolImpl.prototype.signTransactionWithSecretKey = function (transaction, secretKey) {
|
|
209
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
210
|
-
var hexSecretKey, binaryTransaction, opSignature, signedOp;
|
|
211
|
-
return __generator(this, function (_a) {
|
|
212
|
-
hexSecretKey = (0, key_1.convertSecretKey)(secretKey, 'hex');
|
|
213
|
-
binaryTransaction = Buffer.from(transaction.binary, 'hex');
|
|
214
|
-
opSignature = this.cryptoClient.operationSignature(Buffer.from(hexSecretKey.value, 'hex'), binaryTransaction);
|
|
215
|
-
signedOp = Buffer.concat([binaryTransaction, opSignature]);
|
|
216
|
-
return [2 /*return*/, (0, module_kit_1.newSignedTransaction)({ binary: signedOp.toString('hex') })];
|
|
217
|
-
});
|
|
218
|
-
});
|
|
219
|
-
};
|
|
220
|
-
TezosProtocolImpl.prototype.signMessageWithKeyPair = function (message, keyPair) {
|
|
221
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
222
|
-
var hexSecretKey, signature;
|
|
223
|
-
return __generator(this, function (_a) {
|
|
224
|
-
switch (_a.label) {
|
|
225
|
-
case 0:
|
|
226
|
-
hexSecretKey = (0, key_1.convertSecretKey)(keyPair.secretKey, 'hex');
|
|
227
|
-
return [4 /*yield*/, this.cryptoClient.signMessage(message, { privateKey: hexSecretKey.value })];
|
|
228
|
-
case 1:
|
|
229
|
-
signature = _a.sent();
|
|
230
|
-
return [2 /*return*/, (0, module_kit_1.newSignature)(signature, 'encoded')];
|
|
231
|
-
}
|
|
232
|
-
});
|
|
233
|
-
});
|
|
234
|
-
};
|
|
235
|
-
TezosProtocolImpl.prototype.decryptAsymmetricWithKeyPair = function (payload, keyPair) {
|
|
236
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
237
|
-
var hexSecretKey, hexPublicKey;
|
|
238
|
-
return __generator(this, function (_a) {
|
|
239
|
-
hexSecretKey = (0, key_1.convertSecretKey)(keyPair.secretKey, 'hex');
|
|
240
|
-
hexPublicKey = (0, key_1.convertPublicKey)(keyPair.publicKey, 'hex');
|
|
241
|
-
return [2 /*return*/, this.cryptoClient.decryptAsymmetric(payload, { publicKey: hexPublicKey.value, privateKey: hexSecretKey.value })];
|
|
242
|
-
});
|
|
243
|
-
});
|
|
244
|
-
};
|
|
245
|
-
TezosProtocolImpl.prototype.encryptAESWithSecretKey = function (payload, secretKey) {
|
|
246
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
247
|
-
var hexSecretKey;
|
|
248
|
-
return __generator(this, function (_a) {
|
|
249
|
-
hexSecretKey = (0, key_1.convertSecretKey)(secretKey, 'hex');
|
|
250
|
-
return [2 /*return*/, this.cryptoClient.encryptAES(payload, hexSecretKey.value)];
|
|
251
|
-
});
|
|
252
|
-
});
|
|
253
|
-
};
|
|
254
|
-
TezosProtocolImpl.prototype.decryptAESWithSecretKey = function (payload, secretKey) {
|
|
255
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
256
|
-
var hexSecretKey;
|
|
257
|
-
return __generator(this, function (_a) {
|
|
258
|
-
hexSecretKey = (0, key_1.convertSecretKey)(secretKey, 'hex');
|
|
259
|
-
return [2 /*return*/, this.cryptoClient.decryptAES(payload, hexSecretKey.value)];
|
|
260
|
-
});
|
|
261
|
-
});
|
|
262
|
-
};
|
|
263
|
-
// Online
|
|
264
|
-
TezosProtocolImpl.prototype.getNetwork = function () {
|
|
265
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
266
|
-
return __generator(this, function (_a) {
|
|
267
|
-
return [2 /*return*/, this.options.network];
|
|
268
|
-
});
|
|
269
|
-
});
|
|
270
|
-
};
|
|
271
|
-
TezosProtocolImpl.prototype.getTransactionsForPublicKey = function (publicKey, limit, cursor) {
|
|
272
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
273
|
-
var address;
|
|
274
|
-
return __generator(this, function (_a) {
|
|
275
|
-
switch (_a.label) {
|
|
276
|
-
case 0: return [4 /*yield*/, this.getAddressFromPublicKey(publicKey)];
|
|
277
|
-
case 1:
|
|
278
|
-
address = _a.sent();
|
|
279
|
-
return [2 /*return*/, this.getTransactionsForAddress(address, limit, cursor)];
|
|
280
|
-
}
|
|
281
|
-
});
|
|
282
|
-
});
|
|
283
|
-
};
|
|
284
|
-
TezosProtocolImpl.prototype.getTransactionsForAddress = function (address, limit, cursor) {
|
|
285
|
-
var _a;
|
|
286
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
287
|
-
var transactions;
|
|
288
|
-
var _this = this;
|
|
289
|
-
return __generator(this, function (_b) {
|
|
290
|
-
switch (_b.label) {
|
|
291
|
-
case 0: return [4 /*yield*/, this.indexerClient.getTransactions(address, limit, cursor === null || cursor === void 0 ? void 0 : cursor.offset)];
|
|
292
|
-
case 1:
|
|
293
|
-
transactions = _b.sent();
|
|
294
|
-
return [2 /*return*/, {
|
|
295
|
-
transactions: transactions.map(function (transaction) { return (__assign(__assign({}, transaction), { network: _this.options.network })); }),
|
|
296
|
-
cursor: {
|
|
297
|
-
hasNext: transactions.length >= limit,
|
|
298
|
-
offset: ((_a = cursor === null || cursor === void 0 ? void 0 : cursor.offset) !== null && _a !== void 0 ? _a : 0) + transactions.length
|
|
299
|
-
}
|
|
300
|
-
}];
|
|
301
|
-
}
|
|
302
|
-
});
|
|
303
|
-
});
|
|
304
|
-
};
|
|
305
|
-
TezosProtocolImpl.prototype.getBalanceOfPublicKey = function (publicKey) {
|
|
306
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
307
|
-
var address;
|
|
308
|
-
return __generator(this, function (_a) {
|
|
309
|
-
switch (_a.label) {
|
|
310
|
-
case 0: return [4 /*yield*/, this.getAddressFromPublicKey(publicKey)];
|
|
311
|
-
case 1:
|
|
312
|
-
address = _a.sent();
|
|
313
|
-
return [2 /*return*/, this.getBalanceOfAddress(address)];
|
|
314
|
-
}
|
|
315
|
-
});
|
|
316
|
-
});
|
|
317
|
-
};
|
|
318
|
-
TezosProtocolImpl.prototype.getBalanceOfAddress = function (address) {
|
|
319
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
320
|
-
var balance, data, error_1;
|
|
321
|
-
return __generator(this, function (_a) {
|
|
322
|
-
switch (_a.label) {
|
|
323
|
-
case 0:
|
|
324
|
-
balance = new bignumber_1.default(0);
|
|
325
|
-
_a.label = 1;
|
|
326
|
-
case 1:
|
|
327
|
-
_a.trys.push([1, 3, , 4]);
|
|
328
|
-
return [4 /*yield*/, index_1.default.get("".concat(this.options.network.rpcUrl, "/chains/main/blocks/head/context/contracts/").concat(address, "/balance"))];
|
|
329
|
-
case 2:
|
|
330
|
-
data = (_a.sent()).data;
|
|
331
|
-
balance = new bignumber_1.default(data);
|
|
332
|
-
return [3 /*break*/, 4];
|
|
333
|
-
case 3:
|
|
334
|
-
error_1 = _a.sent();
|
|
335
|
-
// if node returns 404 (which means 'no account found'), go with 0 balance
|
|
336
|
-
if (error_1.response && error_1.response.status !== 404) {
|
|
337
|
-
throw new errors_1.NetworkError(coinlib_core_1.Domain.TEZOS, error_1);
|
|
338
|
-
}
|
|
339
|
-
return [3 /*break*/, 4];
|
|
340
|
-
case 4: return [2 /*return*/, { total: (0, module_kit_1.newAmount)(balance, 'blockchain') }];
|
|
341
|
-
}
|
|
342
|
-
});
|
|
343
|
-
});
|
|
344
|
-
};
|
|
345
|
-
TezosProtocolImpl.prototype.getTransactionMaxAmountWithPublicKey = function (publicKey, to, configuration) {
|
|
346
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
347
|
-
var total, adjustedTotal;
|
|
348
|
-
return __generator(this, function (_a) {
|
|
349
|
-
switch (_a.label) {
|
|
350
|
-
case 0: return [4 /*yield*/, this.getBalanceOfPublicKey(publicKey)];
|
|
351
|
-
case 1:
|
|
352
|
-
total = (_a.sent()).total;
|
|
353
|
-
adjustedTotal = new bignumber_1.default((0, module_kit_1.newAmount)(total).convert('mutez', this.units).value).minus(1) // Tezos accounts can never be empty. We must leave at least 1 mutez behind.
|
|
354
|
-
;
|
|
355
|
-
return [2 /*return*/, this.getTansactionMaxAmountWithBalance(publicKey, adjustedTotal, to, configuration === null || configuration === void 0 ? void 0 : configuration.fee)];
|
|
356
|
-
}
|
|
357
|
-
});
|
|
358
|
-
});
|
|
359
|
-
};
|
|
360
|
-
TezosProtocolImpl.prototype.getTansactionMaxAmountWithBalance = function (publicKey, balance, to, fee) {
|
|
361
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
362
|
-
var maxFee, estimatedFee, error_2, rpcErrors, balanceTooLowError, excess, newMaxBalance, amountWithoutFees;
|
|
363
|
-
return __generator(this, function (_a) {
|
|
364
|
-
switch (_a.label) {
|
|
365
|
-
case 0:
|
|
366
|
-
if (!(fee !== undefined)) return [3 /*break*/, 1];
|
|
367
|
-
maxFee = fee;
|
|
368
|
-
return [3 /*break*/, 4];
|
|
369
|
-
case 1:
|
|
370
|
-
_a.trys.push([1, 3, , 4]);
|
|
371
|
-
return [4 /*yield*/, this.getTransactionFeeWithPublicKey(publicKey, to.map(function (recipient) { return ({
|
|
372
|
-
to: recipient,
|
|
373
|
-
amount: (0, module_kit_1.newAmount)(balance.div(to.length).decimalPlaces(0, bignumber_1.default.ROUND_CEIL), 'blockchain')
|
|
374
|
-
}); }))];
|
|
375
|
-
case 2:
|
|
376
|
-
estimatedFee = _a.sent();
|
|
377
|
-
maxFee = (0, module_kit_1.newAmount)(estimatedFee.medium).blockchain(this.units);
|
|
378
|
-
if (balance.lte(maxFee.value)) {
|
|
379
|
-
maxFee = (0, module_kit_1.newAmount)(0, 'blockchain');
|
|
380
|
-
}
|
|
381
|
-
return [3 /*break*/, 4];
|
|
382
|
-
case 3:
|
|
383
|
-
error_2 = _a.sent();
|
|
384
|
-
if (error_2.code !== undefined && error_2.code === errors_1.ProtocolErrorType.TRANSACTION_FAILED && Array.isArray(error_2.data)) {
|
|
385
|
-
rpcErrors = error_2.data;
|
|
386
|
-
balanceTooLowError = rpcErrors.find(function (error) { return error.id.endsWith('.contract.balance_too_low'); });
|
|
387
|
-
if (balanceTooLowError !== undefined && balanceTooLowError.amount !== undefined && balanceTooLowError.balance !== undefined) {
|
|
388
|
-
excess = new bignumber_1.default(balanceTooLowError.amount).minus(new bignumber_1.default(balanceTooLowError.balance).minus(1));
|
|
389
|
-
newMaxBalance = balance.minus(excess);
|
|
390
|
-
if (newMaxBalance.gt(0)) {
|
|
391
|
-
return [2 /*return*/, this.getTansactionMaxAmountWithBalance(publicKey, newMaxBalance, to, fee)];
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
throw error_2;
|
|
396
|
-
case 4:
|
|
397
|
-
maxFee = (0, module_kit_1.newAmount)(maxFee).blockchain(this.units);
|
|
398
|
-
amountWithoutFees = balance.minus(maxFee.value);
|
|
399
|
-
if (amountWithoutFees.isNegative()) {
|
|
400
|
-
amountWithoutFees = new bignumber_1.default(0);
|
|
401
|
-
}
|
|
402
|
-
return [2 /*return*/, (0, module_kit_1.newAmount)(amountWithoutFees, 'blockchain')];
|
|
403
|
-
}
|
|
404
|
-
});
|
|
405
|
-
});
|
|
406
|
-
};
|
|
407
|
-
TezosProtocolImpl.prototype.getTransactionFeeWithPublicKey = function (publicKey, details) {
|
|
408
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
409
|
-
var operations, i, recipient, transaction;
|
|
410
|
-
return __generator(this, function (_a) {
|
|
411
|
-
if (details.length === 0) {
|
|
412
|
-
return [2 /*return*/, this.feeDefaults];
|
|
413
|
-
}
|
|
414
|
-
operations = [];
|
|
415
|
-
for (i = 0; i < details.length; ++i) {
|
|
416
|
-
recipient = details[i].to;
|
|
417
|
-
transaction = {
|
|
418
|
-
kind: TezosOperationType_1.TezosOperationType.TRANSACTION,
|
|
419
|
-
amount: (0, module_kit_1.newAmount)(details[i].amount).blockchain(this.units).value,
|
|
420
|
-
destination: recipient,
|
|
421
|
-
fee: '0'
|
|
422
|
-
};
|
|
423
|
-
operations.push(transaction);
|
|
424
|
-
}
|
|
425
|
-
return [2 /*return*/, this.getOperationFeeDefaults(publicKey, operations)];
|
|
426
|
-
});
|
|
427
|
-
});
|
|
428
|
-
};
|
|
429
|
-
TezosProtocolImpl.prototype.getOperationFeeDefaults = function (publicKey, operations) {
|
|
430
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
431
|
-
var estimated, hasReveal, estimatedFee, feeStepFactor, lowFee, mediumFee, highFee;
|
|
432
|
-
return __generator(this, function (_a) {
|
|
433
|
-
switch (_a.label) {
|
|
434
|
-
case 0: return [4 /*yield*/, this.prepareOperations(publicKey, operations)];
|
|
435
|
-
case 1:
|
|
436
|
-
estimated = _a.sent();
|
|
437
|
-
hasReveal = estimated.contents.some(function (op) { return op.kind === TezosOperationType_1.TezosOperationType.REVEAL; });
|
|
438
|
-
estimatedFee = estimated.contents
|
|
439
|
-
.reduce(function (current, next) {
|
|
440
|
-
if (next.fee !== undefined) {
|
|
441
|
-
return current.plus(new bignumber_1.default(next.fee));
|
|
442
|
-
}
|
|
443
|
-
return current;
|
|
444
|
-
}, new bignumber_1.default(0))
|
|
445
|
-
.minus(hasReveal ? operations_1.REVEAL_FEE : 0)
|
|
446
|
-
.div(hasReveal ? estimated.contents.length - 1 : estimated.contents.length);
|
|
447
|
-
feeStepFactor = new bignumber_1.default(0.2);
|
|
448
|
-
lowFee = estimatedFee;
|
|
449
|
-
mediumFee = lowFee.plus(lowFee.times(feeStepFactor).integerValue(bignumber_1.default.ROUND_FLOOR));
|
|
450
|
-
highFee = mediumFee.plus(mediumFee.times(feeStepFactor).integerValue(bignumber_1.default.ROUND_FLOOR));
|
|
451
|
-
return [2 /*return*/, {
|
|
452
|
-
low: (0, module_kit_1.newAmount)(lowFee, 'blockchain'),
|
|
453
|
-
medium: (0, module_kit_1.newAmount)(mediumFee, 'blockchain'),
|
|
454
|
-
high: (0, module_kit_1.newAmount)(highFee, 'blockchain')
|
|
455
|
-
}];
|
|
456
|
-
}
|
|
457
|
-
});
|
|
458
|
-
});
|
|
459
|
-
};
|
|
460
|
-
TezosProtocolImpl.prototype.prepareTransactionWithPublicKey = function (publicKey, details, configuration) {
|
|
461
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
462
|
-
var transactions;
|
|
463
|
-
return __generator(this, function (_a) {
|
|
464
|
-
switch (_a.label) {
|
|
465
|
-
case 0:
|
|
466
|
-
if (details.length > MAX_OPERATIONS_PER_GROUP) {
|
|
467
|
-
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.TEZOS, "this transaction exceeds the maximum allowed number of transactions per operation (".concat(MAX_OPERATIONS_PER_GROUP, "). Please use the \"prepareTransactionsFromPublicKey\" method instead."));
|
|
468
|
-
}
|
|
469
|
-
return [4 /*yield*/, this.prepareTransactionsWithPublicKey(publicKey, details, configuration)];
|
|
470
|
-
case 1:
|
|
471
|
-
transactions = _a.sent();
|
|
472
|
-
if (transactions.length === 1) {
|
|
473
|
-
return [2 /*return*/, transactions[0]];
|
|
474
|
-
}
|
|
475
|
-
else {
|
|
476
|
-
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.TEZOS, 'Transaction could not be prepared. More or less than 1 operations have been generated.');
|
|
477
|
-
}
|
|
478
|
-
return [2 /*return*/];
|
|
479
|
-
}
|
|
480
|
-
});
|
|
481
|
-
});
|
|
482
|
-
};
|
|
483
|
-
TezosProtocolImpl.prototype.broadcastTransaction = function (transaction) {
|
|
484
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
485
|
-
var injectionResponse;
|
|
486
|
-
return __generator(this, function (_a) {
|
|
487
|
-
switch (_a.label) {
|
|
488
|
-
case 0: return [4 /*yield*/, index_1.default
|
|
489
|
-
.post("".concat(this.options.network.rpcUrl, "/injection/operation?chain=main"), JSON.stringify(transaction.binary), {
|
|
490
|
-
headers: { 'content-type': 'application/json' }
|
|
491
|
-
})
|
|
492
|
-
.catch(function (error) {
|
|
493
|
-
throw new errors_1.NetworkError(coinlib_core_1.Domain.TEZOS, error);
|
|
494
|
-
})
|
|
495
|
-
// returns hash if successful
|
|
496
|
-
];
|
|
497
|
-
case 1:
|
|
498
|
-
injectionResponse = (_a.sent()).data;
|
|
499
|
-
// returns hash if successful
|
|
500
|
-
return [2 /*return*/, injectionResponse];
|
|
501
|
-
}
|
|
502
|
-
});
|
|
503
|
-
});
|
|
504
|
-
};
|
|
505
|
-
// Custom
|
|
506
|
-
TezosProtocolImpl.prototype.forgeOperation = function (wrappedOperation) {
|
|
507
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
508
|
-
return __generator(this, function (_a) {
|
|
509
|
-
return [2 /*return*/, this.forger.forgeOperation(wrappedOperation)];
|
|
510
|
-
});
|
|
511
|
-
});
|
|
512
|
-
};
|
|
513
|
-
TezosProtocolImpl.prototype.unforgeOperation = function (forged, type) {
|
|
514
|
-
if (type === void 0) { type = 'unsigned'; }
|
|
515
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
516
|
-
return __generator(this, function (_a) {
|
|
517
|
-
return [2 /*return*/, this.forger.unforgeOperation(forged, type)];
|
|
518
|
-
});
|
|
519
|
-
});
|
|
520
|
-
};
|
|
521
|
-
TezosProtocolImpl.prototype.prepareTransactionsWithPublicKey = function (publicKey, details, configuration) {
|
|
522
|
-
var _a;
|
|
523
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
524
|
-
var operationsPerGroup, fee, estimatedFee, wrappedFee, address, operations, results, currentCounter, counter, branch, accountManager, _b, total, transferable, balance, transactions, allOperations, numberOfGroups, startingCounter, i, start, end, operationsGroup, wrappedOperationWithEstimatedGas, forged;
|
|
525
|
-
return __generator(this, function (_c) {
|
|
526
|
-
switch (_c.label) {
|
|
527
|
-
case 0:
|
|
528
|
-
operationsPerGroup = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.operationsPerGroup) !== null && _a !== void 0 ? _a : MAX_OPERATIONS_PER_GROUP;
|
|
529
|
-
if (!((configuration === null || configuration === void 0 ? void 0 : configuration.fee) !== undefined)) return [3 /*break*/, 1];
|
|
530
|
-
fee = configuration.fee;
|
|
531
|
-
return [3 /*break*/, 3];
|
|
532
|
-
case 1: return [4 /*yield*/, this.getTransactionFeeWithPublicKey(publicKey, details)];
|
|
533
|
-
case 2:
|
|
534
|
-
estimatedFee = _c.sent();
|
|
535
|
-
fee = estimatedFee.medium;
|
|
536
|
-
_c.label = 3;
|
|
537
|
-
case 3:
|
|
538
|
-
wrappedFee = new bignumber_1.default((0, module_kit_1.newAmount)(fee).blockchain(this.units).value);
|
|
539
|
-
return [4 /*yield*/, this.getAddressFromPublicKey(publicKey)];
|
|
540
|
-
case 4:
|
|
541
|
-
address = _c.sent();
|
|
542
|
-
operations = [];
|
|
543
|
-
return [4 /*yield*/, Promise.all([
|
|
544
|
-
index_1.default.get("".concat(this.options.network.rpcUrl, "/chains/main/blocks/head/context/contracts/").concat(address, "/counter")),
|
|
545
|
-
index_1.default.get("".concat(this.options.network.rpcUrl, "/chains/main/blocks/head~2/hash")),
|
|
546
|
-
index_1.default.get("".concat(this.options.network.rpcUrl, "/chains/main/blocks/head/context/contracts/").concat(address, "/manager_key"))
|
|
547
|
-
]).catch(function (error) {
|
|
548
|
-
throw new errors_1.NetworkError(coinlib_core_1.Domain.TEZOS, error);
|
|
549
|
-
})];
|
|
550
|
-
case 5:
|
|
551
|
-
results = _c.sent();
|
|
552
|
-
currentCounter = new bignumber_1.default(results[0].data);
|
|
553
|
-
counter = currentCounter.plus(1);
|
|
554
|
-
branch = results[1].data;
|
|
555
|
-
accountManager = results[2].data;
|
|
556
|
-
// check if we have revealed the address already
|
|
557
|
-
if (!accountManager) {
|
|
558
|
-
operations.push((0, operations_1.createRevealOperation)(counter, publicKey, address));
|
|
559
|
-
counter = counter.plus(1);
|
|
560
|
-
}
|
|
561
|
-
return [4 /*yield*/, this.getBalanceOfPublicKey(publicKey)];
|
|
562
|
-
case 6:
|
|
563
|
-
_b = _c.sent(), total = _b.total, transferable = _b.transferable;
|
|
564
|
-
balance = new bignumber_1.default((0, module_kit_1.newAmount)(transferable !== null && transferable !== void 0 ? transferable : total).blockchain(this.units).value);
|
|
565
|
-
transactions = [];
|
|
566
|
-
return [4 /*yield*/, this.createTransactionOperations(operations, details, wrappedFee, address, counter, balance)];
|
|
567
|
-
case 7:
|
|
568
|
-
allOperations = _c.sent();
|
|
569
|
-
allOperations = operations.concat(allOperations); // if we have a reveal in operations, we need to make sure it is present in the allOperations array
|
|
570
|
-
numberOfGroups = Math.ceil(allOperations.length / operationsPerGroup);
|
|
571
|
-
startingCounter = numberOfGroups > 1 ? currentCounter.plus(1) : undefined;
|
|
572
|
-
i = 0;
|
|
573
|
-
_c.label = 8;
|
|
574
|
-
case 8:
|
|
575
|
-
if (!(i < numberOfGroups)) return [3 /*break*/, 12];
|
|
576
|
-
start = i * operationsPerGroup;
|
|
577
|
-
end = start + operationsPerGroup;
|
|
578
|
-
operationsGroup = allOperations.slice(start, end);
|
|
579
|
-
return [4 /*yield*/, this.estimateAndReplaceLimitsAndFee({
|
|
580
|
-
branch: branch,
|
|
581
|
-
contents: operationsGroup
|
|
582
|
-
}, false, startingCounter)];
|
|
583
|
-
case 9:
|
|
584
|
-
wrappedOperationWithEstimatedGas = _c.sent();
|
|
585
|
-
return [4 /*yield*/, this.forgeOperation(wrappedOperationWithEstimatedGas)];
|
|
586
|
-
case 10:
|
|
587
|
-
forged = _c.sent();
|
|
588
|
-
transactions.push((0, module_kit_1.newUnsignedTransaction)({ binary: forged }));
|
|
589
|
-
_c.label = 11;
|
|
590
|
-
case 11:
|
|
591
|
-
i++;
|
|
592
|
-
return [3 /*break*/, 8];
|
|
593
|
-
case 12: return [2 /*return*/, transactions];
|
|
594
|
-
}
|
|
595
|
-
});
|
|
596
|
-
});
|
|
597
|
-
};
|
|
598
|
-
TezosProtocolImpl.prototype.prepareOperations = function (publicKey, operationRequests, overrideParameters) {
|
|
599
|
-
if (overrideParameters === void 0) { overrideParameters = true; }
|
|
600
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
601
|
-
var counter, branch, operations, address, results, accountManager, hasRevealInOperationRequests, operationPromises, _a, _b, _c, wrappedOperation;
|
|
602
|
-
var _this = this;
|
|
603
|
-
return __generator(this, function (_d) {
|
|
604
|
-
switch (_d.label) {
|
|
605
|
-
case 0:
|
|
606
|
-
counter = new bignumber_1.default(1);
|
|
607
|
-
operations = [];
|
|
608
|
-
return [4 /*yield*/, this.getAddressFromPublicKey(publicKey)];
|
|
609
|
-
case 1:
|
|
610
|
-
address = _d.sent();
|
|
611
|
-
return [4 /*yield*/, Promise.all([
|
|
612
|
-
index_1.default.get("".concat(this.options.network.rpcUrl, "/chains/main/blocks/head/context/contracts/").concat(address, "/counter")),
|
|
613
|
-
index_1.default.get("".concat(this.options.network.rpcUrl, "/chains/main/blocks/head~2/hash")),
|
|
614
|
-
index_1.default.get("".concat(this.options.network.rpcUrl, "/chains/main/blocks/head/context/contracts/").concat(address, "/manager_key"))
|
|
615
|
-
]).catch(function (error) {
|
|
616
|
-
throw new errors_1.NetworkError(coinlib_core_1.Domain.TEZOS, error);
|
|
617
|
-
})];
|
|
618
|
-
case 2:
|
|
619
|
-
results = _d.sent();
|
|
620
|
-
counter = new bignumber_1.default(results[0].data).plus(1);
|
|
621
|
-
branch = results[1].data;
|
|
622
|
-
accountManager = results[2].data;
|
|
623
|
-
hasRevealInOperationRequests = operationRequests.some(function (request) { return request.kind === TezosOperationType_1.TezosOperationType.REVEAL; });
|
|
624
|
-
// check if we have revealed the address already
|
|
625
|
-
if (!accountManager && !hasRevealInOperationRequests) {
|
|
626
|
-
operations.push((0, operations_1.createRevealOperation)(counter, publicKey, address));
|
|
627
|
-
counter = counter.plus(1);
|
|
628
|
-
}
|
|
629
|
-
operationPromises = operationRequests.map(function (operationRequest, index) { return __awaiter(_this, void 0, void 0, function () {
|
|
630
|
-
var recipient, receivingBalance, total, defaultCounter, defaultFee, defaultGasLimit, defaultStorageLimit, revealOperation, delegationOperation, transactionOperation, originationOperation;
|
|
631
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
632
|
-
return __generator(this, function (_w) {
|
|
633
|
-
switch (_w.label) {
|
|
634
|
-
case 0:
|
|
635
|
-
// TODO: Handle activation burn
|
|
636
|
-
if (!operationRequest.kind) {
|
|
637
|
-
throw new errors_1.PropertyUndefinedError(coinlib_core_1.Domain.TEZOS, 'property "kind" was not defined');
|
|
638
|
-
}
|
|
639
|
-
recipient = operationRequest.destination;
|
|
640
|
-
if (!(recipient && recipient.toLowerCase().startsWith('tz'))) return [3 /*break*/, 2];
|
|
641
|
-
return [4 /*yield*/, this.getBalanceOfAddress(recipient)];
|
|
642
|
-
case 1:
|
|
643
|
-
total = (_w.sent()).total;
|
|
644
|
-
receivingBalance = new bignumber_1.default((0, module_kit_1.newAmount)(total).blockchain(this.units).value);
|
|
645
|
-
_w.label = 2;
|
|
646
|
-
case 2:
|
|
647
|
-
defaultCounter = counter.plus(index).toFixed() // TODO: Handle counter if we have some operations without counters in the array
|
|
648
|
-
;
|
|
649
|
-
defaultFee = FEE_PLACEHOLDER;
|
|
650
|
-
defaultGasLimit = '10300';
|
|
651
|
-
defaultStorageLimit = receivingBalance && receivingBalance.isZero() && recipient && recipient.toLowerCase().startsWith('tz') ? '300' : '0' // taken from eztz
|
|
652
|
-
;
|
|
653
|
-
switch (operationRequest.kind) {
|
|
654
|
-
// TODO: Handle if the dApp already provides a reveal operation
|
|
655
|
-
case TezosOperationType_1.TezosOperationType.REVEAL:
|
|
656
|
-
revealOperation = operationRequest;
|
|
657
|
-
if (!revealOperation.public_key) {
|
|
658
|
-
throw new errors_1.PropertyUndefinedError(coinlib_core_1.Domain.TEZOS, 'property "public_key" was not defined');
|
|
659
|
-
}
|
|
660
|
-
revealOperation.source = (_a = revealOperation.source) !== null && _a !== void 0 ? _a : address;
|
|
661
|
-
revealOperation.counter = (_b = revealOperation.counter) !== null && _b !== void 0 ? _b : defaultCounter;
|
|
662
|
-
revealOperation.fee = (_c = revealOperation.fee) !== null && _c !== void 0 ? _c : defaultFee;
|
|
663
|
-
revealOperation.gas_limit = (_d = revealOperation.gas_limit) !== null && _d !== void 0 ? _d : defaultGasLimit;
|
|
664
|
-
revealOperation.storage_limit = (_e = revealOperation.storage_limit) !== null && _e !== void 0 ? _e : defaultStorageLimit;
|
|
665
|
-
return [2 /*return*/, revealOperation];
|
|
666
|
-
case TezosOperationType_1.TezosOperationType.DELEGATION:
|
|
667
|
-
delegationOperation = operationRequest;
|
|
668
|
-
// The delegate property is optional, so we don't have any mandatory properties to check for
|
|
669
|
-
delegationOperation.source = (_f = delegationOperation.source) !== null && _f !== void 0 ? _f : address;
|
|
670
|
-
delegationOperation.counter = (_g = delegationOperation.counter) !== null && _g !== void 0 ? _g : defaultCounter;
|
|
671
|
-
delegationOperation.fee = (_h = delegationOperation.fee) !== null && _h !== void 0 ? _h : defaultFee;
|
|
672
|
-
delegationOperation.gas_limit = (_j = delegationOperation.gas_limit) !== null && _j !== void 0 ? _j : defaultGasLimit;
|
|
673
|
-
delegationOperation.storage_limit = (_k = delegationOperation.storage_limit) !== null && _k !== void 0 ? _k : defaultStorageLimit;
|
|
674
|
-
return [2 /*return*/, delegationOperation];
|
|
675
|
-
case TezosOperationType_1.TezosOperationType.TRANSACTION:
|
|
676
|
-
transactionOperation = operationRequest;
|
|
677
|
-
if (!transactionOperation.amount) {
|
|
678
|
-
throw new errors_1.PropertyUndefinedError(coinlib_core_1.Domain.TEZOS, 'property "amount" was not defined');
|
|
679
|
-
}
|
|
680
|
-
if (!transactionOperation.destination) {
|
|
681
|
-
throw new errors_1.PropertyUndefinedError(coinlib_core_1.Domain.TEZOS, 'property "destination" was not defined');
|
|
682
|
-
}
|
|
683
|
-
transactionOperation.source = (_l = transactionOperation.source) !== null && _l !== void 0 ? _l : address;
|
|
684
|
-
transactionOperation.counter = (_m = transactionOperation.counter) !== null && _m !== void 0 ? _m : defaultCounter;
|
|
685
|
-
transactionOperation.fee = (_o = transactionOperation.fee) !== null && _o !== void 0 ? _o : defaultFee;
|
|
686
|
-
transactionOperation.gas_limit = (_p = transactionOperation.gas_limit) !== null && _p !== void 0 ? _p : GAS_LIMIT_PLACEHOLDER;
|
|
687
|
-
transactionOperation.storage_limit = (_q = transactionOperation.storage_limit) !== null && _q !== void 0 ? _q : STORAGE_LIMIT_PLACEHOLDER;
|
|
688
|
-
return [2 /*return*/, transactionOperation];
|
|
689
|
-
case TezosOperationType_1.TezosOperationType.ORIGINATION:
|
|
690
|
-
originationOperation = operationRequest;
|
|
691
|
-
if (!originationOperation.balance) {
|
|
692
|
-
throw new errors_1.PropertyUndefinedError(coinlib_core_1.Domain.TEZOS, 'property "balance" was not defined');
|
|
693
|
-
}
|
|
694
|
-
if (!originationOperation.script) {
|
|
695
|
-
throw new errors_1.PropertyUndefinedError(coinlib_core_1.Domain.TEZOS, 'property "script" was not defined');
|
|
696
|
-
}
|
|
697
|
-
originationOperation.source = (_r = originationOperation.source) !== null && _r !== void 0 ? _r : address;
|
|
698
|
-
originationOperation.counter = (_s = originationOperation.counter) !== null && _s !== void 0 ? _s : defaultCounter;
|
|
699
|
-
originationOperation.fee = (_t = originationOperation.fee) !== null && _t !== void 0 ? _t : defaultFee;
|
|
700
|
-
originationOperation.gas_limit = (_u = originationOperation.gas_limit) !== null && _u !== void 0 ? _u : GAS_LIMIT_PLACEHOLDER;
|
|
701
|
-
originationOperation.storage_limit = (_v = originationOperation.storage_limit) !== null && _v !== void 0 ? _v : STORAGE_LIMIT_PLACEHOLDER;
|
|
702
|
-
return [2 /*return*/, originationOperation];
|
|
703
|
-
case TezosOperationType_1.TezosOperationType.ENDORSEMENT:
|
|
704
|
-
case TezosOperationType_1.TezosOperationType.SEED_NONCE_REVELATION:
|
|
705
|
-
case TezosOperationType_1.TezosOperationType.DOUBLE_ENDORSEMENT_EVIDENCE:
|
|
706
|
-
case TezosOperationType_1.TezosOperationType.DOUBLE_BAKING_EVIDENCE:
|
|
707
|
-
case TezosOperationType_1.TezosOperationType.ACTIVATE_ACCOUNT:
|
|
708
|
-
case TezosOperationType_1.TezosOperationType.PROPOSALS:
|
|
709
|
-
case TezosOperationType_1.TezosOperationType.BALLOT:
|
|
710
|
-
// Do not change anything
|
|
711
|
-
return [2 /*return*/, operationRequest];
|
|
712
|
-
default:
|
|
713
|
-
(0, coinlib_core_1.assertNever)(operationRequest.kind);
|
|
714
|
-
throw new errors_1.UnsupportedError(coinlib_core_1.Domain.TEZOS, "unsupported operation type \"".concat(JSON.stringify(operationRequest.kind), "\""));
|
|
715
|
-
}
|
|
716
|
-
return [2 /*return*/];
|
|
717
|
-
}
|
|
718
|
-
});
|
|
719
|
-
}); });
|
|
720
|
-
_b = (_a = operations.push).apply;
|
|
721
|
-
_c = [operations];
|
|
722
|
-
return [4 /*yield*/, Promise.all(operationPromises)];
|
|
723
|
-
case 3:
|
|
724
|
-
_b.apply(_a, _c.concat([(_d.sent())]));
|
|
725
|
-
wrappedOperation = {
|
|
726
|
-
branch: branch,
|
|
727
|
-
contents: operations
|
|
728
|
-
};
|
|
729
|
-
return [2 /*return*/, this.estimateAndReplaceLimitsAndFee(wrappedOperation, overrideParameters)];
|
|
730
|
-
}
|
|
731
|
-
});
|
|
732
|
-
});
|
|
733
|
-
};
|
|
734
|
-
TezosProtocolImpl.prototype.estimateAndReplaceLimitsAndFee = function (wrappedOperation, overrideParameters, startingCounter) {
|
|
735
|
-
if (overrideParameters === void 0) { overrideParameters = true; }
|
|
736
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
737
|
-
var fakeSignature, opKinds, contents, block, body, forgedOperation, gasLimitTotal, response, fee, nonRevealOperations, feePerOperation_1;
|
|
738
|
-
return __generator(this, function (_a) {
|
|
739
|
-
switch (_a.label) {
|
|
740
|
-
case 0:
|
|
741
|
-
fakeSignature = 'sigUHx32f9wesZ1n2BWpixXz4AQaZggEtchaQNHYGRCoWNAXx45WGW2ua3apUUUAGMLPwAU41QoaFCzVSL61VaessLg4YbbP';
|
|
742
|
-
opKinds = [
|
|
743
|
-
TezosOperationType_1.TezosOperationType.TRANSACTION,
|
|
744
|
-
TezosOperationType_1.TezosOperationType.REVEAL,
|
|
745
|
-
TezosOperationType_1.TezosOperationType.ORIGINATION,
|
|
746
|
-
TezosOperationType_1.TezosOperationType.DELEGATION
|
|
747
|
-
];
|
|
748
|
-
contents = wrappedOperation.contents.map(function (operation, i) {
|
|
749
|
-
if (!opKinds.includes(operation.kind)) {
|
|
750
|
-
return operation;
|
|
751
|
-
}
|
|
752
|
-
var op = operation;
|
|
753
|
-
var gasValue = new bignumber_1.default(MAX_GAS_PER_BLOCK).dividedToIntegerBy(wrappedOperation.contents.length);
|
|
754
|
-
var gas_limit = new bignumber_1.default(GAS_LIMIT_PLACEHOLDER).gt(gasValue) ? gasValue : GAS_LIMIT_PLACEHOLDER;
|
|
755
|
-
var counter = startingCounter ? startingCounter.plus(i).toString() : op.counter;
|
|
756
|
-
return __assign(__assign({}, operation), { gas_limit: gas_limit, counter: counter });
|
|
757
|
-
});
|
|
758
|
-
return [4 /*yield*/, index_1.default.get("".concat(this.options.network.rpcUrl, "/chains/main/blocks/head"))];
|
|
759
|
-
case 1:
|
|
760
|
-
block = (_a.sent()).data;
|
|
761
|
-
body = {
|
|
762
|
-
chain_id: block.chain_id,
|
|
763
|
-
operation: {
|
|
764
|
-
branch: wrappedOperation.branch,
|
|
765
|
-
contents: contents,
|
|
766
|
-
signature: fakeSignature // signature will not be checked, so it is ok to always use this one
|
|
767
|
-
}
|
|
768
|
-
};
|
|
769
|
-
return [4 /*yield*/, this.forgeOperation(wrappedOperation)];
|
|
770
|
-
case 2:
|
|
771
|
-
forgedOperation = _a.sent();
|
|
772
|
-
gasLimitTotal = 0;
|
|
773
|
-
return [4 /*yield*/, index_1.default
|
|
774
|
-
.post("".concat(this.options.network.rpcUrl, "/chains/main/blocks/head/helpers/scripts/run_operation"), body, {
|
|
775
|
-
headers: { 'Content-Type': 'application/json' }
|
|
776
|
-
})
|
|
777
|
-
.catch(function (runOperationError) {
|
|
778
|
-
throw new errors_1.NetworkError(coinlib_core_1.Domain.TEZOS, runOperationError);
|
|
779
|
-
})];
|
|
780
|
-
case 3:
|
|
781
|
-
response = _a.sent();
|
|
782
|
-
if (wrappedOperation.contents.length !== response.data.contents.length) {
|
|
783
|
-
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.TEZOS, "Run Operation did not return same number of operations. Locally we have ".concat(wrappedOperation.contents.length, ", but got back ").concat(response.data.contents.length));
|
|
784
|
-
}
|
|
785
|
-
wrappedOperation.contents.forEach(function (content, i) {
|
|
786
|
-
var metadata = response.data.contents[i].metadata;
|
|
787
|
-
if (metadata.operation_result) {
|
|
788
|
-
var result = metadata.operation_result;
|
|
789
|
-
var gasLimit_1 = 0;
|
|
790
|
-
var storageLimit_1 = 0;
|
|
791
|
-
// If there are internal operations, we first add gas and storage used of internal operations
|
|
792
|
-
if (metadata.internal_operation_results) {
|
|
793
|
-
metadata.internal_operation_results.forEach(function (internalOperation) {
|
|
794
|
-
if (internalOperation === null || internalOperation === void 0 ? void 0 : internalOperation.result) {
|
|
795
|
-
if (internalOperation.result.errors) {
|
|
796
|
-
throw new errors_1.TransactionError(coinlib_core_1.Domain.TEZOS, 'An internal operation produced an error', internalOperation.result.errors);
|
|
797
|
-
}
|
|
798
|
-
gasLimit_1 += Math.ceil(Number(internalOperation.result.consumed_milligas) / 1000);
|
|
799
|
-
if (internalOperation.result.paid_storage_size_diff) {
|
|
800
|
-
storageLimit_1 += Number(internalOperation.result.paid_storage_size_diff);
|
|
801
|
-
}
|
|
802
|
-
if (internalOperation.result.originated_contracts) {
|
|
803
|
-
storageLimit_1 += internalOperation.result.originated_contracts.length * 257;
|
|
804
|
-
}
|
|
805
|
-
if (internalOperation.result.allocated_destination_contract) {
|
|
806
|
-
storageLimit_1 += 257;
|
|
807
|
-
}
|
|
808
|
-
}
|
|
809
|
-
});
|
|
810
|
-
}
|
|
811
|
-
if (result.errors) {
|
|
812
|
-
throw new errors_1.TransactionError(coinlib_core_1.Domain.TEZOS, 'The operation produced an error', result.errors);
|
|
813
|
-
}
|
|
814
|
-
// Add gas and storage used by operation
|
|
815
|
-
gasLimit_1 += Math.ceil(Number(result.consumed_milligas) / 1000);
|
|
816
|
-
if (result.paid_storage_size_diff) {
|
|
817
|
-
storageLimit_1 += Number(result.paid_storage_size_diff);
|
|
818
|
-
}
|
|
819
|
-
if (result.originated_contracts) {
|
|
820
|
-
storageLimit_1 += result.originated_contracts.length * 257;
|
|
821
|
-
}
|
|
822
|
-
if (result.allocated_destination_contract) {
|
|
823
|
-
storageLimit_1 += 257;
|
|
824
|
-
}
|
|
825
|
-
// in prepareTransactionsFromPublicKey() we invoke this method with overrideParameters = false
|
|
826
|
-
if ((content.gas_limit && overrideParameters) || content.gas_limit === GAS_LIMIT_PLACEHOLDER) {
|
|
827
|
-
;
|
|
828
|
-
content.gas_limit = gasLimit_1.toString();
|
|
829
|
-
}
|
|
830
|
-
if ((content.storage_limit && overrideParameters) || content.storage_limit === STORAGE_LIMIT_PLACEHOLDER) {
|
|
831
|
-
;
|
|
832
|
-
content.storage_limit = storageLimit_1.toString();
|
|
833
|
-
}
|
|
834
|
-
gasLimitTotal += gasLimit_1;
|
|
835
|
-
}
|
|
836
|
-
});
|
|
837
|
-
if (overrideParameters || wrappedOperation.contents.some(function (operation) { return (operation === null || operation === void 0 ? void 0 : operation.fee) === FEE_PLACEHOLDER; })) {
|
|
838
|
-
fee = MINIMAL_FEE +
|
|
839
|
-
MINIMAL_FEE_PER_BYTE * Math.ceil((forgedOperation.length + 128) / 2) + // 128 is the length of a hex signature
|
|
840
|
-
MINIMAL_FEE_PER_GAS_UNIT * gasLimitTotal +
|
|
841
|
-
100 // add 100 for safety
|
|
842
|
-
;
|
|
843
|
-
nonRevealOperations = wrappedOperation.contents.filter(function (operation) { return operation.kind !== 'reveal'; });
|
|
844
|
-
feePerOperation_1 = Math.ceil(fee / nonRevealOperations.length);
|
|
845
|
-
wrappedOperation.contents.forEach(function (content) {
|
|
846
|
-
if (content.fee && content.kind !== 'reveal') {
|
|
847
|
-
;
|
|
848
|
-
content.fee = feePerOperation_1.toString();
|
|
849
|
-
}
|
|
850
|
-
});
|
|
851
|
-
}
|
|
852
|
-
return [2 /*return*/, wrappedOperation];
|
|
853
|
-
}
|
|
854
|
-
});
|
|
855
|
-
});
|
|
856
|
-
};
|
|
857
|
-
TezosProtocolImpl.prototype.createTransactionOperations = function (previousOperations, details, fee, address, counter, balance) {
|
|
858
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
859
|
-
var amountUsedByPreviousOperations, operations, firstValue, i, recipient, value, _a, total, transferable, receivingBalance, spendOperation;
|
|
860
|
-
return __generator(this, function (_b) {
|
|
861
|
-
switch (_b.label) {
|
|
862
|
-
case 0:
|
|
863
|
-
amountUsedByPreviousOperations = (0, operations_1.getAmountUsedByPreviousOperations)(previousOperations);
|
|
864
|
-
operations = [];
|
|
865
|
-
if (!amountUsedByPreviousOperations.isZero()) {
|
|
866
|
-
firstValue = new bignumber_1.default((0, module_kit_1.newAmount)(details[0].amount).blockchain(this.units).value);
|
|
867
|
-
if (balance.isLessThan(firstValue.plus(fee).plus(amountUsedByPreviousOperations))) {
|
|
868
|
-
// if not, make room for the init fee
|
|
869
|
-
details[0] = __assign(__assign({}, details[0]), { amount: (0, module_kit_1.newAmount)(firstValue.minus(amountUsedByPreviousOperations), 'blockchain') // deduct fee from balance
|
|
870
|
-
});
|
|
871
|
-
}
|
|
872
|
-
}
|
|
873
|
-
i = 0;
|
|
874
|
-
_b.label = 1;
|
|
875
|
-
case 1:
|
|
876
|
-
if (!(i < details.length)) return [3 /*break*/, 4];
|
|
877
|
-
recipient = details[i].to;
|
|
878
|
-
value = new bignumber_1.default((0, module_kit_1.newAmount)(details[i].amount).blockchain(this.units).value);
|
|
879
|
-
return [4 /*yield*/, this.getBalanceOfAddress(recipient)];
|
|
880
|
-
case 2:
|
|
881
|
-
_a = _b.sent(), total = _a.total, transferable = _a.transferable;
|
|
882
|
-
receivingBalance = new bignumber_1.default((0, module_kit_1.newAmount)(transferable !== null && transferable !== void 0 ? transferable : total).blockchain(this.units).value);
|
|
883
|
-
// if our receiver has 0 balance, the account is not activated yet.
|
|
884
|
-
if (receivingBalance.isZero() && recipient.toLowerCase().startsWith('tz')) {
|
|
885
|
-
// We have to supply an additional 0.257 XTZ fee for storage_limit costs, which gets automatically deducted from the sender so we just have to make sure enough balance is around
|
|
886
|
-
if (balance.isLessThan(fee.plus(operations_1.ACTIVATION_BURN))) {
|
|
887
|
-
// If we don't have enough funds to pay the activation + fee, we throw an error
|
|
888
|
-
throw new errors_1.BalanceError(coinlib_core_1.Domain.TEZOS, 'Insufficient balance to pay activation burn!');
|
|
889
|
-
}
|
|
890
|
-
else if (balance.isLessThan(value.plus(fee).plus(operations_1.ACTIVATION_BURN))) {
|
|
891
|
-
// Check whether the sender has enough to cover the amount to send + fee + activation
|
|
892
|
-
// If not, we deduct it from amount sent to make room for the activation burn
|
|
893
|
-
value = value.minus(operations_1.ACTIVATION_BURN); // deduct fee from balance
|
|
894
|
-
}
|
|
895
|
-
}
|
|
896
|
-
if (balance.isEqualTo(value.plus(fee))) {
|
|
897
|
-
// Tezos accounts can never be empty. If user tries to send everything, we must leave 1 mutez behind.
|
|
898
|
-
value = value.minus(1);
|
|
899
|
-
}
|
|
900
|
-
else if (balance.isLessThan(value.plus(fee))) {
|
|
901
|
-
throw new errors_1.BalanceError(coinlib_core_1.Domain.TEZOS, 'not enough balance');
|
|
902
|
-
}
|
|
903
|
-
spendOperation = {
|
|
904
|
-
kind: TezosOperationType_1.TezosOperationType.TRANSACTION,
|
|
905
|
-
fee: fee.toFixed(),
|
|
906
|
-
gas_limit: GAS_LIMIT_PLACEHOLDER,
|
|
907
|
-
storage_limit: STORAGE_LIMIT_PLACEHOLDER,
|
|
908
|
-
amount: value.toFixed(),
|
|
909
|
-
counter: counter.plus(i).toFixed(),
|
|
910
|
-
destination: recipient,
|
|
911
|
-
source: address
|
|
912
|
-
};
|
|
913
|
-
operations.push(spendOperation);
|
|
914
|
-
_b.label = 3;
|
|
915
|
-
case 3:
|
|
916
|
-
i++;
|
|
917
|
-
return [3 /*break*/, 1];
|
|
918
|
-
case 4: return [2 /*return*/, operations];
|
|
919
|
-
}
|
|
920
|
-
});
|
|
921
|
-
});
|
|
922
|
-
};
|
|
923
|
-
return TezosProtocolImpl;
|
|
924
|
-
}());
|
|
925
|
-
exports.TezosProtocolImpl = TezosProtocolImpl;
|
|
926
|
-
// Factory
|
|
927
|
-
function createTezosProtocol(options) {
|
|
928
|
-
if (options === void 0) { options = {}; }
|
|
929
|
-
return new TezosProtocolImpl(options);
|
|
930
|
-
}
|
|
931
|
-
exports.createTezosProtocol = createTezosProtocol;
|
|
932
|
-
exports.TEZOS_MAINNET_PROTOCOL_NETWORK = {
|
|
933
|
-
name: 'Mainnet',
|
|
934
|
-
type: 'mainnet',
|
|
935
|
-
rpcUrl: 'https://tezos-node.prod.gke.papers.tech',
|
|
936
|
-
network: network_1.TezosNetwork.MAINNET,
|
|
937
|
-
blockExplorer: {
|
|
938
|
-
type: 'tzkt',
|
|
939
|
-
url: 'https://tzkt.io'
|
|
940
|
-
},
|
|
941
|
-
indexer: {
|
|
942
|
-
type: 'tzkt',
|
|
943
|
-
apiUrl: 'https://tezos-mainnet-indexer.prod.gke.papers.tech'
|
|
944
|
-
}
|
|
945
|
-
};
|
|
946
|
-
exports.TEZOS_GHOSTNET_PROTOCOL_NETWORK = {
|
|
947
|
-
name: 'Ghostnet',
|
|
948
|
-
type: 'testnet',
|
|
949
|
-
rpcUrl: 'https://tezos-ghostnet-node.prod.gke.papers.tech',
|
|
950
|
-
network: network_1.TezosNetwork.GHOSTNET,
|
|
951
|
-
blockExplorer: {
|
|
952
|
-
type: 'tzkt',
|
|
953
|
-
url: 'https://ghostnet.tzkt.io'
|
|
954
|
-
},
|
|
955
|
-
indexer: {
|
|
956
|
-
type: 'tzkt',
|
|
957
|
-
apiUrl: 'https://tezos-ghostnet-indexer.prod.gke.papers.tech'
|
|
958
|
-
}
|
|
959
|
-
};
|
|
960
|
-
var DEFAULT_TEZOS_PROTOCOL_NETWORK = exports.TEZOS_MAINNET_PROTOCOL_NETWORK;
|
|
961
|
-
function createTezosProtocolOptions(network) {
|
|
962
|
-
if (network === void 0) { network = {}; }
|
|
963
|
-
return {
|
|
964
|
-
network: __assign(__assign(__assign({}, DEFAULT_TEZOS_PROTOCOL_NETWORK), network), { blockExplorer: __assign(__assign({}, DEFAULT_TEZOS_PROTOCOL_NETWORK.blockExplorer), network.blockExplorer), indexer: __assign(__assign({}, DEFAULT_TEZOS_PROTOCOL_NETWORK.indexer), network.indexer) })
|
|
965
|
-
};
|
|
966
|
-
}
|
|
967
|
-
exports.createTezosProtocolOptions = createTezosProtocolOptions;
|
|
968
|
-
//# sourceMappingURL=TezosProtocol.js.map
|