@airgap/tezos 0.13.7-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +7 -0
- package/actions/GetKtAccountsAction.d.ts +8 -0
- package/actions/GetKtAccountsAction.js +85 -0
- package/actions/GetKtAccountsAction.js.map +1 -0
- package/airgap-coinlib-tezos.min.js +103587 -0
- package/constants.d.ts +18 -0
- package/constants.js +28 -0
- package/constants.js.map +1 -0
- package/index.d.ts +46 -0
- package/index.js +103 -0
- package/index.js.map +1 -0
- package/package.json +70 -0
- package/protocol/TezosAddress.d.ts +11 -0
- package/protocol/TezosAddress.js +102 -0
- package/protocol/TezosAddress.js.map +1 -0
- package/protocol/TezosCryptoClient.d.ts +15 -0
- package/protocol/TezosCryptoClient.js +152 -0
- package/protocol/TezosCryptoClient.js.map +1 -0
- package/protocol/TezosProtocol.d.ts +349 -0
- package/protocol/TezosProtocol.js +1853 -0
- package/protocol/TezosProtocol.js.map +1 -0
- package/protocol/TezosProtocolOptions.d.ts +29 -0
- package/protocol/TezosProtocolOptions.js +114 -0
- package/protocol/TezosProtocolOptions.js.map +1 -0
- package/protocol/TezosUtils.d.ts +40 -0
- package/protocol/TezosUtils.js +296 -0
- package/protocol/TezosUtils.js.map +1 -0
- package/protocol/contract/TezosContract.d.ts +52 -0
- package/protocol/contract/TezosContract.js +509 -0
- package/protocol/contract/TezosContract.js.map +1 -0
- package/protocol/contract/TezosContractCall.d.ts +10 -0
- package/protocol/contract/TezosContractCall.js +23 -0
- package/protocol/contract/TezosContractCall.js.map +1 -0
- package/protocol/contract/TezosContractEntrypoint.d.ts +8 -0
- package/protocol/contract/TezosContractEntrypoint.js +27 -0
- package/protocol/contract/TezosContractEntrypoint.js.map +1 -0
- package/protocol/contract/TezosContractStorage.d.ts +7 -0
- package/protocol/contract/TezosContractStorage.js +16 -0
- package/protocol/contract/TezosContractStorage.js.map +1 -0
- package/protocol/contract/remote-data/TezosContractRemoteDataFactory.d.ts +11 -0
- package/protocol/contract/remote-data/TezosContractRemoteDataFactory.js +34 -0
- package/protocol/contract/remote-data/TezosContractRemoteDataFactory.js.map +1 -0
- package/protocol/contract/remote-data/TezosStorageRemoteData.d.ts +12 -0
- package/protocol/contract/remote-data/TezosStorageRemoteData.js +151 -0
- package/protocol/contract/remote-data/TezosStorageRemoteData.js.map +1 -0
- package/protocol/domains/TezosDomains.d.ts +20 -0
- package/protocol/domains/TezosDomains.js +306 -0
- package/protocol/domains/TezosDomains.js.map +1 -0
- package/protocol/fa/TezosBTC.d.ts +12 -0
- package/protocol/fa/TezosBTC.js +107 -0
- package/protocol/fa/TezosBTC.js.map +1 -0
- package/protocol/fa/TezosBTCtez.d.ts +10 -0
- package/protocol/fa/TezosBTCtez.js +54 -0
- package/protocol/fa/TezosBTCtez.js.map +1 -0
- package/protocol/fa/TezosCTez.d.ts +10 -0
- package/protocol/fa/TezosCTez.js +51 -0
- package/protocol/fa/TezosCTez.js.map +1 -0
- package/protocol/fa/TezosDOGA.d.ts +10 -0
- package/protocol/fa/TezosDOGA.js +51 -0
- package/protocol/fa/TezosDOGA.js.map +1 -0
- package/protocol/fa/TezosETHtz.d.ts +9 -0
- package/protocol/fa/TezosETHtz.js +72 -0
- package/protocol/fa/TezosETHtz.js.map +1 -0
- package/protocol/fa/TezosFA1Protocol.d.ts +27 -0
- package/protocol/fa/TezosFA1Protocol.js +310 -0
- package/protocol/fa/TezosFA1Protocol.js.map +1 -0
- package/protocol/fa/TezosFA1p2Protocol.d.ts +8 -0
- package/protocol/fa/TezosFA1p2Protocol.js +117 -0
- package/protocol/fa/TezosFA1p2Protocol.js.map +1 -0
- package/protocol/fa/TezosFA2Protocol.d.ts +58 -0
- package/protocol/fa/TezosFA2Protocol.js +449 -0
- package/protocol/fa/TezosFA2Protocol.js.map +1 -0
- package/protocol/fa/TezosFAProtocol.d.ts +65 -0
- package/protocol/fa/TezosFAProtocol.js +510 -0
- package/protocol/fa/TezosFAProtocol.js.map +1 -0
- package/protocol/fa/TezosFAProtocolOptions.d.ts +54 -0
- package/protocol/fa/TezosFAProtocolOptions.js +228 -0
- package/protocol/fa/TezosFAProtocolOptions.js.map +1 -0
- package/protocol/fa/TezosKolibriUSD.d.ts +10 -0
- package/protocol/fa/TezosKolibriUSD.js +74 -0
- package/protocol/fa/TezosKolibriUSD.js.map +1 -0
- package/protocol/fa/TezosPlanty.d.ts +10 -0
- package/protocol/fa/TezosPlanty.js +51 -0
- package/protocol/fa/TezosPlanty.js.map +1 -0
- package/protocol/fa/TezosQUIPU.d.ts +10 -0
- package/protocol/fa/TezosQUIPU.js +54 -0
- package/protocol/fa/TezosQUIPU.js.map +1 -0
- package/protocol/fa/TezosSIRS.d.ts +10 -0
- package/protocol/fa/TezosSIRS.js +51 -0
- package/protocol/fa/TezosSIRS.js.map +1 -0
- package/protocol/fa/TezosStaker.d.ts +10 -0
- package/protocol/fa/TezosStaker.js +74 -0
- package/protocol/fa/TezosStaker.js.map +1 -0
- package/protocol/fa/TezosUBTC.d.ts +10 -0
- package/protocol/fa/TezosUBTC.js +54 -0
- package/protocol/fa/TezosUBTC.js.map +1 -0
- package/protocol/fa/TezosUDEFI.d.ts +10 -0
- package/protocol/fa/TezosUDEFI.js +54 -0
- package/protocol/fa/TezosUDEFI.js.map +1 -0
- package/protocol/fa/TezosUSD.d.ts +10 -0
- package/protocol/fa/TezosUSD.js +74 -0
- package/protocol/fa/TezosUSD.js.map +1 -0
- package/protocol/fa/TezosUSDT.d.ts +10 -0
- package/protocol/fa/TezosUSDT.js +54 -0
- package/protocol/fa/TezosUSDT.js.map +1 -0
- package/protocol/fa/TezosUUSD.d.ts +6 -0
- package/protocol/fa/TezosUUSD.js +31 -0
- package/protocol/fa/TezosUUSD.js.map +1 -0
- package/protocol/fa/TezosWRAP.d.ts +10 -0
- package/protocol/fa/TezosWRAP.js +54 -0
- package/protocol/fa/TezosWRAP.js.map +1 -0
- package/protocol/fa/TezosWrapped.d.ts +10 -0
- package/protocol/fa/TezosWrapped.js +74 -0
- package/protocol/fa/TezosWrapped.js.map +1 -0
- package/protocol/fa/TezosYOU.d.ts +6 -0
- package/protocol/fa/TezosYOU.js +31 -0
- package/protocol/fa/TezosYOU.js.map +1 -0
- package/protocol/indexerClient/TezosIndexerClient.d.ts +25 -0
- package/protocol/indexerClient/TezosIndexerClient.js +251 -0
- package/protocol/indexerClient/TezosIndexerClient.js.map +1 -0
- package/protocol/indexerClient/TezosProtocolIndexerClient.d.ts +26 -0
- package/protocol/indexerClient/TezosProtocolIndexerClient.js +3 -0
- package/protocol/indexerClient/TezosProtocolIndexerClient.js.map +1 -0
- package/protocol/kt/TezosKtAddress.d.ts +5 -0
- package/protocol/kt/TezosKtAddress.js +72 -0
- package/protocol/kt/TezosKtAddress.js.map +1 -0
- package/protocol/kt/TezosKtProtocol.d.ts +30 -0
- package/protocol/kt/TezosKtProtocol.js +317 -0
- package/protocol/kt/TezosKtProtocol.js.map +1 -0
- package/protocol/sapling/TezosSaplingAddress.d.ts +12 -0
- package/protocol/sapling/TezosSaplingAddress.js +134 -0
- package/protocol/sapling/TezosSaplingAddress.js.map +1 -0
- package/protocol/sapling/TezosSaplingCryptoClient.d.ts +34 -0
- package/protocol/sapling/TezosSaplingCryptoClient.js +241 -0
- package/protocol/sapling/TezosSaplingCryptoClient.js.map +1 -0
- package/protocol/sapling/TezosSaplingProtocol.d.ts +130 -0
- package/protocol/sapling/TezosSaplingProtocol.js +1101 -0
- package/protocol/sapling/TezosSaplingProtocol.js.map +1 -0
- package/protocol/sapling/TezosSaplingProtocolOptions.d.ts +43 -0
- package/protocol/sapling/TezosSaplingProtocolOptions.js +78 -0
- package/protocol/sapling/TezosSaplingProtocolOptions.js.map +1 -0
- package/protocol/sapling/TezosShieldedTezProtocol.d.ts +9 -0
- package/protocol/sapling/TezosShieldedTezProtocol.js +109 -0
- package/protocol/sapling/TezosShieldedTezProtocol.js.map +1 -0
- package/protocol/sapling/node/TezosSaplingNodeClient.d.ts +8 -0
- package/protocol/sapling/node/TezosSaplingNodeClient.js +78 -0
- package/protocol/sapling/node/TezosSaplingNodeClient.js.map +1 -0
- package/protocol/sapling/utils/TezosSaplingBookkeeper.d.ts +34 -0
- package/protocol/sapling/utils/TezosSaplingBookkeeper.js +586 -0
- package/protocol/sapling/utils/TezosSaplingBookkeeper.js.map +1 -0
- package/protocol/sapling/utils/TezosSaplingEncoder.d.ts +22 -0
- package/protocol/sapling/utils/TezosSaplingEncoder.js +158 -0
- package/protocol/sapling/utils/TezosSaplingEncoder.js.map +1 -0
- package/protocol/sapling/utils/TezosSaplingForger.d.ts +26 -0
- package/protocol/sapling/utils/TezosSaplingForger.js +278 -0
- package/protocol/sapling/utils/TezosSaplingForger.js.map +1 -0
- package/protocol/sapling/utils/TezosSaplingState.d.ts +17 -0
- package/protocol/sapling/utils/TezosSaplingState.js +260 -0
- package/protocol/sapling/utils/TezosSaplingState.js.map +1 -0
- package/protocol/types/TezosAddressCursor.d.ts +3 -0
- package/protocol/types/TezosAddressCursor.js +3 -0
- package/protocol/types/TezosAddressCursor.js.map +1 -0
- package/protocol/types/TezosAddressResult.d.ts +4 -0
- package/protocol/types/TezosAddressResult.js +3 -0
- package/protocol/types/TezosAddressResult.js.map +1 -0
- package/protocol/types/TezosBlockHeader.d.ts +13 -0
- package/protocol/types/TezosBlockHeader.js +3 -0
- package/protocol/types/TezosBlockHeader.js.map +1 -0
- package/protocol/types/TezosBlockMetadata.d.ts +7 -0
- package/protocol/types/TezosBlockMetadata.js +3 -0
- package/protocol/types/TezosBlockMetadata.js.map +1 -0
- package/protocol/types/TezosContractCode.d.ts +5 -0
- package/protocol/types/TezosContractCode.js +3 -0
- package/protocol/types/TezosContractCode.js.map +1 -0
- package/protocol/types/TezosOperationType.d.ts +13 -0
- package/protocol/types/TezosOperationType.js +18 -0
- package/protocol/types/TezosOperationType.js.map +1 -0
- package/protocol/types/TezosTransactionCursor.d.ts +3 -0
- package/protocol/types/TezosTransactionCursor.js +3 -0
- package/protocol/types/TezosTransactionCursor.js.map +1 -0
- package/protocol/types/TezosTransactionResult.d.ts +6 -0
- package/protocol/types/TezosTransactionResult.js +3 -0
- package/protocol/types/TezosTransactionResult.js.map +1 -0
- package/protocol/types/TezosWrappedOperation.d.ts +5 -0
- package/protocol/types/TezosWrappedOperation.js +3 -0
- package/protocol/types/TezosWrappedOperation.js.map +1 -0
- package/protocol/types/contract/BigMap.d.ts +7 -0
- package/protocol/types/contract/BigMap.js +3 -0
- package/protocol/types/contract/BigMap.js.map +1 -0
- package/protocol/types/contract/BigMapEnrtyFilter.d.ts +5 -0
- package/protocol/types/contract/BigMapEnrtyFilter.js +3 -0
- package/protocol/types/contract/BigMapEnrtyFilter.js.map +1 -0
- package/protocol/types/contract/BigMapEntry.d.ts +7 -0
- package/protocol/types/contract/BigMapEntry.js +3 -0
- package/protocol/types/contract/BigMapEntry.js.map +1 -0
- package/protocol/types/contract/BigMapRequest.d.ts +8 -0
- package/protocol/types/contract/BigMapRequest.js +3 -0
- package/protocol/types/contract/BigMapRequest.js.map +1 -0
- package/protocol/types/contract/TezosContractMetadata.d.ts +61 -0
- package/protocol/types/contract/TezosContractMetadata.js +3 -0
- package/protocol/types/contract/TezosContractMetadata.js.map +1 -0
- package/protocol/types/domains/TezosDomainsRecord.d.ts +8 -0
- package/protocol/types/domains/TezosDomainsRecord.js +3 -0
- package/protocol/types/domains/TezosDomainsRecord.js.map +1 -0
- package/protocol/types/domains/TezosDomainsReverseRecord.d.ts +5 -0
- package/protocol/types/domains/TezosDomainsReverseRecord.js +3 -0
- package/protocol/types/domains/TezosDomainsReverseRecord.js.map +1 -0
- package/protocol/types/fa/TezosFA2BalanceOfRequest.d.ts +4 -0
- package/protocol/types/fa/TezosFA2BalanceOfRequest.js +3 -0
- package/protocol/types/fa/TezosFA2BalanceOfRequest.js.map +1 -0
- package/protocol/types/fa/TezosFA2BalanceOfResponse.d.ts +5 -0
- package/protocol/types/fa/TezosFA2BalanceOfResponse.js +3 -0
- package/protocol/types/fa/TezosFA2BalanceOfResponse.js.map +1 -0
- package/protocol/types/fa/TezosFA2TransferRequest.d.ts +8 -0
- package/protocol/types/fa/TezosFA2TransferRequest.js +3 -0
- package/protocol/types/fa/TezosFA2TransferRequest.js.map +1 -0
- package/protocol/types/fa/TezosFA2UpdateOperatorRequest.d.ts +6 -0
- package/protocol/types/fa/TezosFA2UpdateOperatorRequest.js +3 -0
- package/protocol/types/fa/TezosFA2UpdateOperatorRequest.js.map +1 -0
- package/protocol/types/fa/TezosFATokenMetadata.d.ts +6 -0
- package/protocol/types/fa/TezosFATokenMetadata.js +3 -0
- package/protocol/types/fa/TezosFATokenMetadata.js.map +1 -0
- package/protocol/types/kt/TezosKtAddressCursor.d.ts +4 -0
- package/protocol/types/kt/TezosKtAddressCursor.js +3 -0
- package/protocol/types/kt/TezosKtAddressCursor.js.map +1 -0
- package/protocol/types/kt/TezosKtAddressResult.d.ts +5 -0
- package/protocol/types/kt/TezosKtAddressResult.js +3 -0
- package/protocol/types/kt/TezosKtAddressResult.js.map +1 -0
- package/protocol/types/micheline/MichelineNode.d.ts +15 -0
- package/protocol/types/micheline/MichelineNode.js +5 -0
- package/protocol/types/micheline/MichelineNode.js.map +1 -0
- package/protocol/types/micheline/MichelineNodeUtils.d.ts +6 -0
- package/protocol/types/micheline/MichelineNodeUtils.js +40 -0
- package/protocol/types/micheline/MichelineNodeUtils.js.map +1 -0
- package/protocol/types/michelson/MichelsonType.d.ts +11 -0
- package/protocol/types/michelson/MichelsonType.js +22 -0
- package/protocol/types/michelson/MichelsonType.js.map +1 -0
- package/protocol/types/michelson/MichelsonTypeMeta.d.ts +33 -0
- package/protocol/types/michelson/MichelsonTypeMeta.js +132 -0
- package/protocol/types/michelson/MichelsonTypeMeta.js.map +1 -0
- package/protocol/types/michelson/MichelsonTypeUtils.d.ts +19 -0
- package/protocol/types/michelson/MichelsonTypeUtils.js +249 -0
- package/protocol/types/michelson/MichelsonTypeUtils.js.map +1 -0
- package/protocol/types/michelson/generics/MichelsonList.d.ts +11 -0
- package/protocol/types/michelson/generics/MichelsonList.js +68 -0
- package/protocol/types/michelson/generics/MichelsonList.js.map +1 -0
- package/protocol/types/michelson/generics/MichelsonMap.d.ts +14 -0
- package/protocol/types/michelson/generics/MichelsonMap.js +118 -0
- package/protocol/types/michelson/generics/MichelsonMap.js.map +1 -0
- package/protocol/types/michelson/generics/MichelsonOption.d.ts +25 -0
- package/protocol/types/michelson/generics/MichelsonOption.js +119 -0
- package/protocol/types/michelson/generics/MichelsonOption.js.map +1 -0
- package/protocol/types/michelson/generics/MichelsonOr.d.ts +25 -0
- package/protocol/types/michelson/generics/MichelsonOr.js +132 -0
- package/protocol/types/michelson/generics/MichelsonOr.js.map +1 -0
- package/protocol/types/michelson/generics/MichelsonPair.d.ts +17 -0
- package/protocol/types/michelson/generics/MichelsonPair.js +135 -0
- package/protocol/types/michelson/generics/MichelsonPair.js.map +1 -0
- package/protocol/types/michelson/grammar/MichelsonGrammarData.d.ts +2 -0
- package/protocol/types/michelson/grammar/MichelsonGrammarData.js +4 -0
- package/protocol/types/michelson/grammar/MichelsonGrammarData.js.map +1 -0
- package/protocol/types/michelson/grammar/MichelsonGrammarInstruction.d.ts +1 -0
- package/protocol/types/michelson/grammar/MichelsonGrammarInstruction.js +4 -0
- package/protocol/types/michelson/grammar/MichelsonGrammarInstruction.js.map +1 -0
- package/protocol/types/michelson/grammar/MichelsonGrammarType.d.ts +1 -0
- package/protocol/types/michelson/grammar/MichelsonGrammarType.js +4 -0
- package/protocol/types/michelson/grammar/MichelsonGrammarType.js.map +1 -0
- package/protocol/types/michelson/primitives/MichelsonAddress.d.ts +15 -0
- package/protocol/types/michelson/primitives/MichelsonAddress.js +72 -0
- package/protocol/types/michelson/primitives/MichelsonAddress.js.map +1 -0
- package/protocol/types/michelson/primitives/MichelsonBool.d.ts +12 -0
- package/protocol/types/michelson/primitives/MichelsonBool.js +57 -0
- package/protocol/types/michelson/primitives/MichelsonBool.js.map +1 -0
- package/protocol/types/michelson/primitives/MichelsonBytes.d.ts +14 -0
- package/protocol/types/michelson/primitives/MichelsonBytes.js +75 -0
- package/protocol/types/michelson/primitives/MichelsonBytes.js.map +1 -0
- package/protocol/types/michelson/primitives/MichelsonInt.d.ts +14 -0
- package/protocol/types/michelson/primitives/MichelsonInt.js +72 -0
- package/protocol/types/michelson/primitives/MichelsonInt.js.map +1 -0
- package/protocol/types/michelson/primitives/MichelsonString.d.ts +14 -0
- package/protocol/types/michelson/primitives/MichelsonString.js +74 -0
- package/protocol/types/michelson/primitives/MichelsonString.js.map +1 -0
- package/protocol/types/michelson/primitives/MichelsonUnit.d.ts +9 -0
- package/protocol/types/michelson/primitives/MichelsonUnit.js +53 -0
- package/protocol/types/michelson/primitives/MichelsonUnit.js.map +1 -0
- package/protocol/types/operations/ActivateAccount.d.ts +7 -0
- package/protocol/types/operations/ActivateAccount.js +3 -0
- package/protocol/types/operations/ActivateAccount.js.map +1 -0
- package/protocol/types/operations/Ballot.d.ts +9 -0
- package/protocol/types/operations/Ballot.js +3 -0
- package/protocol/types/operations/Ballot.js.map +1 -0
- package/protocol/types/operations/Delegation.d.ts +11 -0
- package/protocol/types/operations/Delegation.js +3 -0
- package/protocol/types/operations/Delegation.js.map +1 -0
- package/protocol/types/operations/DoubleBakingEvidence.d.ts +8 -0
- package/protocol/types/operations/DoubleBakingEvidence.js +3 -0
- package/protocol/types/operations/DoubleBakingEvidence.js.map +1 -0
- package/protocol/types/operations/DoubleEndorsementEvidence.d.ts +16 -0
- package/protocol/types/operations/DoubleEndorsementEvidence.js +3 -0
- package/protocol/types/operations/DoubleEndorsementEvidence.js.map +1 -0
- package/protocol/types/operations/Endorsement.d.ts +6 -0
- package/protocol/types/operations/Endorsement.js +3 -0
- package/protocol/types/operations/Endorsement.js.map +1 -0
- package/protocol/types/operations/Origination.d.ts +13 -0
- package/protocol/types/operations/Origination.js +3 -0
- package/protocol/types/operations/Origination.js.map +1 -0
- package/protocol/types/operations/Proposal.d.ts +7 -0
- package/protocol/types/operations/Proposal.js +3 -0
- package/protocol/types/operations/Proposal.js.map +1 -0
- package/protocol/types/operations/Reveal.d.ts +11 -0
- package/protocol/types/operations/Reveal.js +3 -0
- package/protocol/types/operations/Reveal.js.map +1 -0
- package/protocol/types/operations/SeedNonceRevelation.d.ts +7 -0
- package/protocol/types/operations/SeedNonceRevelation.js +3 -0
- package/protocol/types/operations/SeedNonceRevelation.js.map +1 -0
- package/protocol/types/operations/TezosOperation.d.ts +4 -0
- package/protocol/types/operations/TezosOperation.js +3 -0
- package/protocol/types/operations/TezosOperation.js.map +1 -0
- package/protocol/types/operations/Transaction.d.ts +23 -0
- package/protocol/types/operations/Transaction.js +3 -0
- package/protocol/types/operations/Transaction.js.map +1 -0
- package/protocol/types/sapling/TezosSaplingAddressCursor.d.ts +4 -0
- package/protocol/types/sapling/TezosSaplingAddressCursor.js +3 -0
- package/protocol/types/sapling/TezosSaplingAddressCursor.js.map +1 -0
- package/protocol/types/sapling/TezosSaplingAddressResult.d.ts +4 -0
- package/protocol/types/sapling/TezosSaplingAddressResult.js +3 -0
- package/protocol/types/sapling/TezosSaplingAddressResult.js.map +1 -0
- package/protocol/types/sapling/TezosSaplingCiphertext.d.ts +8 -0
- package/protocol/types/sapling/TezosSaplingCiphertext.js +3 -0
- package/protocol/types/sapling/TezosSaplingCiphertext.js.map +1 -0
- package/protocol/types/sapling/TezosSaplingInput.d.ts +6 -0
- package/protocol/types/sapling/TezosSaplingInput.js +3 -0
- package/protocol/types/sapling/TezosSaplingInput.js.map +1 -0
- package/protocol/types/sapling/TezosSaplingOutput.d.ts +6 -0
- package/protocol/types/sapling/TezosSaplingOutput.js +3 -0
- package/protocol/types/sapling/TezosSaplingOutput.js.map +1 -0
- package/protocol/types/sapling/TezosSaplingStateDiff.d.ts +6 -0
- package/protocol/types/sapling/TezosSaplingStateDiff.js +3 -0
- package/protocol/types/sapling/TezosSaplingStateDiff.js.map +1 -0
- package/protocol/types/sapling/TezosSaplingStateTree.d.ts +7 -0
- package/protocol/types/sapling/TezosSaplingStateTree.js +3 -0
- package/protocol/types/sapling/TezosSaplingStateTree.js.map +1 -0
- package/protocol/types/sapling/TezosSaplingTransaction.d.ts +23 -0
- package/protocol/types/sapling/TezosSaplingTransaction.js +3 -0
- package/protocol/types/sapling/TezosSaplingTransaction.js.map +1 -0
- package/protocol/types/sapling/TezosSaplingTransactionCursor.d.ts +3 -0
- package/protocol/types/sapling/TezosSaplingTransactionCursor.js +3 -0
- package/protocol/types/sapling/TezosSaplingTransactionCursor.js.map +1 -0
- package/protocol/types/sapling/TezosSaplingTransactionResult.d.ts +6 -0
- package/protocol/types/sapling/TezosSaplingTransactionResult.js +3 -0
- package/protocol/types/sapling/TezosSaplingTransactionResult.js.map +1 -0
- package/protocol/types/utils.d.ts +8 -0
- package/protocol/types/utils.js +41 -0
- package/protocol/types/utils.js.map +1 -0
- package/readme.md +121 -0
- package/types/signed-transaction-tezos-sapling.d.ts +3 -0
- package/types/signed-transaction-tezos-sapling.js +3 -0
- package/types/signed-transaction-tezos-sapling.js.map +1 -0
- package/types/signed-transaction-tezos.d.ts +5 -0
- package/types/signed-transaction-tezos.js +3 -0
- package/types/signed-transaction-tezos.js.map +1 -0
- package/types/transaction-tezos.d.ts +14 -0
- package/types/transaction-tezos.js +3 -0
- package/types/transaction-tezos.js.map +1 -0
- package/types/unsigned-transaction-tezos-sapling.d.ts +38 -0
- package/types/unsigned-transaction-tezos-sapling.js +3 -0
- package/types/unsigned-transaction-tezos-sapling.js.map +1 -0
- package/types/unsigned-transaction-tezos.d.ts +8 -0
- package/types/unsigned-transaction-tezos.js +3 -0
- package/types/unsigned-transaction-tezos.js.map +1 -0
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
extendStatics(d, b);
|
|
11
|
+
function __() { this.constructor = d; }
|
|
12
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
var __assign = (this && this.__assign) || function () {
|
|
16
|
+
__assign = Object.assign || function(t) {
|
|
17
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
18
|
+
s = arguments[i];
|
|
19
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
20
|
+
t[p] = s[p];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
return __assign.apply(this, arguments);
|
|
25
|
+
};
|
|
26
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
27
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
28
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
29
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
30
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
31
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
32
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
36
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
37
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
38
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
39
|
+
function step(op) {
|
|
40
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
41
|
+
while (_) try {
|
|
42
|
+
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;
|
|
43
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
44
|
+
switch (op[0]) {
|
|
45
|
+
case 0: case 1: t = op; break;
|
|
46
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
47
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
48
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
49
|
+
default:
|
|
50
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
51
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
52
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
53
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
54
|
+
if (t[2]) _.ops.pop();
|
|
55
|
+
_.trys.pop(); continue;
|
|
56
|
+
}
|
|
57
|
+
op = body.call(thisArg, _);
|
|
58
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
59
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
63
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
64
|
+
};
|
|
65
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
66
|
+
exports.TezosFA1Protocol = void 0;
|
|
67
|
+
var bignumber_1 = __importDefault(require("@airgap/coinlib-core/dependencies/src/bignumber.js-9.0.0/bignumber"));
|
|
68
|
+
var errors_1 = require("@airgap/coinlib-core/errors");
|
|
69
|
+
var coinlib_error_1 = require("@airgap/coinlib-core/errors/coinlib-error");
|
|
70
|
+
var hex_1 = require("@airgap/coinlib-core/utils/hex");
|
|
71
|
+
var TezosProtocol_1 = require("../TezosProtocol");
|
|
72
|
+
var TezosUtils_1 = require("../TezosUtils");
|
|
73
|
+
var MichelsonPair_1 = require("../types/michelson/generics/MichelsonPair");
|
|
74
|
+
var MichelsonAddress_1 = require("../types/michelson/primitives/MichelsonAddress");
|
|
75
|
+
var MichelsonInt_1 = require("../types/michelson/primitives/MichelsonInt");
|
|
76
|
+
var MichelsonString_1 = require("../types/michelson/primitives/MichelsonString");
|
|
77
|
+
var TezosOperationType_1 = require("../types/TezosOperationType");
|
|
78
|
+
var utils_1 = require("../types/utils");
|
|
79
|
+
var TezosFAProtocol_1 = require("./TezosFAProtocol");
|
|
80
|
+
var TezosFA1ContractEntrypoint;
|
|
81
|
+
(function (TezosFA1ContractEntrypoint) {
|
|
82
|
+
TezosFA1ContractEntrypoint["BALANCE"] = "getBalance";
|
|
83
|
+
TezosFA1ContractEntrypoint["TRANSFER"] = "transfer";
|
|
84
|
+
TezosFA1ContractEntrypoint["TOTAL_SUPPLY"] = "getTotalSupply";
|
|
85
|
+
})(TezosFA1ContractEntrypoint || (TezosFA1ContractEntrypoint = {}));
|
|
86
|
+
var TezosFA1Protocol = /** @class */ (function (_super) {
|
|
87
|
+
__extends(TezosFA1Protocol, _super);
|
|
88
|
+
function TezosFA1Protocol(options) {
|
|
89
|
+
var _a;
|
|
90
|
+
var _this = _super.call(this, options) || this;
|
|
91
|
+
_this.defaultCallbackContractMap = (_a = {},
|
|
92
|
+
_a[TezosProtocol_1.TezosNetwork.MAINNET] = 'KT19ptNzn4MVAN45KUUNpyL5AdLVhujk815u',
|
|
93
|
+
_a[TezosProtocol_1.TezosNetwork.GHOSTNET] = 'KT1DuHhkizpAqJJxScGzVAXTT4uh3oh4mCeE',
|
|
94
|
+
_a);
|
|
95
|
+
return _this;
|
|
96
|
+
}
|
|
97
|
+
TezosFA1Protocol.prototype.getBalanceOfAddresses = function (addresses) {
|
|
98
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
99
|
+
var promises, _i, addresses_1, address, results;
|
|
100
|
+
return __generator(this, function (_a) {
|
|
101
|
+
switch (_a.label) {
|
|
102
|
+
case 0:
|
|
103
|
+
promises = [];
|
|
104
|
+
for (_i = 0, addresses_1 = addresses; _i < addresses_1.length; _i++) {
|
|
105
|
+
address = addresses_1[_i];
|
|
106
|
+
promises.push(this.getBalance(address, this.defaultSourceAddress));
|
|
107
|
+
}
|
|
108
|
+
return [4 /*yield*/, Promise.all(promises)];
|
|
109
|
+
case 1:
|
|
110
|
+
results = _a.sent();
|
|
111
|
+
return [2 /*return*/, results.reduce(function (current, next) { return current.plus(new bignumber_1.default(next)); }, new bignumber_1.default(0)).toFixed()];
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
TezosFA1Protocol.prototype.estimateFeeDefaultsFromPublicKey = function (publicKey, recipients, values, data) {
|
|
117
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
118
|
+
var transferCalls, operations;
|
|
119
|
+
var _this = this;
|
|
120
|
+
return __generator(this, function (_a) {
|
|
121
|
+
switch (_a.label) {
|
|
122
|
+
case 0:
|
|
123
|
+
// return this.feeDefaults
|
|
124
|
+
if (recipients.length !== values.length) {
|
|
125
|
+
throw new errors_1.ConditionViolationError(coinlib_error_1.Domain.TEZOSFA, 'length of recipients and values does not match!');
|
|
126
|
+
}
|
|
127
|
+
return [4 /*yield*/, this.createTransferCalls(publicKey, recipients, values, this.feeDefaults.medium, data)];
|
|
128
|
+
case 1:
|
|
129
|
+
transferCalls = _a.sent();
|
|
130
|
+
operations = transferCalls.map(function (transferCall) {
|
|
131
|
+
return {
|
|
132
|
+
kind: TezosOperationType_1.TezosOperationType.TRANSACTION,
|
|
133
|
+
amount: '0',
|
|
134
|
+
destination: _this.contractAddress,
|
|
135
|
+
parameters: transferCall.toJSON(),
|
|
136
|
+
fee: '0'
|
|
137
|
+
};
|
|
138
|
+
});
|
|
139
|
+
return [2 /*return*/, this.estimateFeeDefaultsForOperations(publicKey, operations)];
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
TezosFA1Protocol.prototype.prepareTransactionFromPublicKey = function (publicKey, recipients, values, fee, data) {
|
|
145
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
146
|
+
var transferCalls;
|
|
147
|
+
return __generator(this, function (_a) {
|
|
148
|
+
switch (_a.label) {
|
|
149
|
+
case 0: return [4 /*yield*/, this.createTransferCalls(publicKey, recipients, values, fee, data)];
|
|
150
|
+
case 1:
|
|
151
|
+
transferCalls = _a.sent();
|
|
152
|
+
return [2 /*return*/, this.prepareContractCall(transferCalls, fee, publicKey)];
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
TezosFA1Protocol.prototype.transactionDetailsFromParameters = function (parameters) {
|
|
158
|
+
var defaultDetails = {
|
|
159
|
+
extra: {
|
|
160
|
+
type: parameters.entrypoint
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
if (parameters.entrypoint !== TezosFA1ContractEntrypoint.TRANSFER) {
|
|
164
|
+
console.warn('Only calls to the transfer entrypoint can be converted to IAirGapTransaction');
|
|
165
|
+
return [defaultDetails];
|
|
166
|
+
}
|
|
167
|
+
try {
|
|
168
|
+
var callArguments = MichelsonPair_1.MichelsonPair.from(parameters.value, undefined, function (fromJSON) { return MichelsonAddress_1.MichelsonAddress.from(fromJSON, 'from'); }, function (pairJSON) {
|
|
169
|
+
return MichelsonPair_1.MichelsonPair.from(pairJSON, undefined, function (toJSON) { return MichelsonAddress_1.MichelsonAddress.from(toJSON, 'to'); }, function (valueJSON) { return MichelsonInt_1.MichelsonInt.from(valueJSON, 'value'); });
|
|
170
|
+
}).asRawValue();
|
|
171
|
+
if (!this.isTransferRequest(callArguments)) {
|
|
172
|
+
return [defaultDetails];
|
|
173
|
+
}
|
|
174
|
+
return [
|
|
175
|
+
__assign(__assign({}, defaultDetails), { amount: callArguments.value.toFixed(), from: [hex_1.isHex(callArguments.from) ? TezosUtils_1.TezosUtils.parseAddress(callArguments.from) : callArguments.from], to: [hex_1.isHex(callArguments.to) ? TezosUtils_1.TezosUtils.parseAddress(callArguments.to) : callArguments.to] })
|
|
176
|
+
];
|
|
177
|
+
}
|
|
178
|
+
catch (_a) {
|
|
179
|
+
return [defaultDetails];
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
TezosFA1Protocol.prototype.getBalance = function (address, source, callbackContract) {
|
|
183
|
+
if (callbackContract === void 0) { callbackContract = this.callbackContract(); }
|
|
184
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
185
|
+
var getBalanceCall;
|
|
186
|
+
return __generator(this, function (_a) {
|
|
187
|
+
switch (_a.label) {
|
|
188
|
+
case 0: return [4 /*yield*/, this.contract.createContractCall(TezosFA1ContractEntrypoint.BALANCE, [
|
|
189
|
+
new MichelsonAddress_1.MichelsonAddress(new MichelsonString_1.MichelsonString(address)),
|
|
190
|
+
new MichelsonAddress_1.MichelsonAddress(new MichelsonString_1.MichelsonString(callbackContract))
|
|
191
|
+
])];
|
|
192
|
+
case 1:
|
|
193
|
+
getBalanceCall = _a.sent();
|
|
194
|
+
return [2 /*return*/, this.getContractCallIntResult(getBalanceCall, this.requireSource(source, address, 'kt'))];
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
};
|
|
199
|
+
TezosFA1Protocol.prototype.getTotalSupply = function (source, callbackContract) {
|
|
200
|
+
if (callbackContract === void 0) { callbackContract = this.callbackContract(); }
|
|
201
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
202
|
+
var getTotalSupplyCall;
|
|
203
|
+
return __generator(this, function (_a) {
|
|
204
|
+
switch (_a.label) {
|
|
205
|
+
case 0: return [4 /*yield*/, this.contract.createContractCall(TezosFA1ContractEntrypoint.TOTAL_SUPPLY, [[], callbackContract])];
|
|
206
|
+
case 1:
|
|
207
|
+
getTotalSupplyCall = _a.sent();
|
|
208
|
+
return [2 /*return*/, this.getContractCallIntResult(getTotalSupplyCall, this.requireSource(source))];
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
};
|
|
213
|
+
TezosFA1Protocol.prototype.transfer = function (fromAddress, toAddress, amount, fee, publicKey) {
|
|
214
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
215
|
+
var transferCall;
|
|
216
|
+
return __generator(this, function (_a) {
|
|
217
|
+
switch (_a.label) {
|
|
218
|
+
case 0: return [4 /*yield*/, this.contract.createContractCall(TezosFA1ContractEntrypoint.TRANSFER, {
|
|
219
|
+
from: fromAddress,
|
|
220
|
+
to: toAddress,
|
|
221
|
+
value: new bignumber_1.default(amount).toNumber()
|
|
222
|
+
})];
|
|
223
|
+
case 1:
|
|
224
|
+
transferCall = _a.sent();
|
|
225
|
+
return [2 /*return*/, this.prepareContractCall([transferCall], fee, publicKey)];
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
});
|
|
229
|
+
};
|
|
230
|
+
TezosFA1Protocol.prototype.fetchTokenHolders = function () {
|
|
231
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
232
|
+
return __generator(this, function (_a) {
|
|
233
|
+
// there is no standard way to fetch token holders for now, every subclass needs to implement its own logic
|
|
234
|
+
return [2 /*return*/, []];
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
};
|
|
238
|
+
TezosFA1Protocol.prototype.getContractCallIntResult = function (transferCall, source) {
|
|
239
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
240
|
+
var operationResult, _a;
|
|
241
|
+
return __generator(this, function (_b) {
|
|
242
|
+
switch (_b.label) {
|
|
243
|
+
case 0:
|
|
244
|
+
_b.trys.push([0, 2, , 3]);
|
|
245
|
+
return [4 /*yield*/, this.runContractCall(transferCall, source)];
|
|
246
|
+
case 1:
|
|
247
|
+
operationResult = _b.sent();
|
|
248
|
+
if (utils_1.isMichelinePrimitive('int', operationResult)) {
|
|
249
|
+
return [2 /*return*/, operationResult.int];
|
|
250
|
+
}
|
|
251
|
+
return [3 /*break*/, 3];
|
|
252
|
+
case 2:
|
|
253
|
+
_a = _b.sent();
|
|
254
|
+
return [3 /*break*/, 3];
|
|
255
|
+
case 3: return [2 /*return*/, '0'];
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
});
|
|
259
|
+
};
|
|
260
|
+
TezosFA1Protocol.prototype.createTransferCalls = function (publicKey, recipients, values, fee, data) {
|
|
261
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
262
|
+
var addressIndex, addresses, fromAddress, transferCalls, i, transferCall;
|
|
263
|
+
return __generator(this, function (_a) {
|
|
264
|
+
switch (_a.label) {
|
|
265
|
+
case 0:
|
|
266
|
+
if (recipients.length !== values.length) {
|
|
267
|
+
throw new errors_1.ConditionViolationError(coinlib_error_1.Domain.TEZOSFA, 'length of recipients and values does not match!');
|
|
268
|
+
}
|
|
269
|
+
addressIndex = data && data.addressIndex !== undefined ? data.addressIndex : 0;
|
|
270
|
+
return [4 /*yield*/, this.getAddressesFromPublicKey(publicKey)];
|
|
271
|
+
case 1:
|
|
272
|
+
addresses = (_a.sent()).map(function (address) { return address.address; });
|
|
273
|
+
if (!addresses[addressIndex]) {
|
|
274
|
+
throw new errors_1.NotFoundError(coinlib_error_1.Domain.TEZOSFA, "no kt-address with index " + addressIndex + " exists");
|
|
275
|
+
}
|
|
276
|
+
fromAddress = addresses[addressIndex];
|
|
277
|
+
transferCalls = [];
|
|
278
|
+
i = 0;
|
|
279
|
+
_a.label = 2;
|
|
280
|
+
case 2:
|
|
281
|
+
if (!(i < recipients.length)) return [3 /*break*/, 5];
|
|
282
|
+
return [4 /*yield*/, this.contract.createContractCall(TezosFA1ContractEntrypoint.TRANSFER, {
|
|
283
|
+
from: fromAddress,
|
|
284
|
+
to: recipients[i],
|
|
285
|
+
value: new bignumber_1.default(values[i]).toNumber()
|
|
286
|
+
})];
|
|
287
|
+
case 3:
|
|
288
|
+
transferCall = _a.sent();
|
|
289
|
+
transferCalls.push(transferCall);
|
|
290
|
+
_a.label = 4;
|
|
291
|
+
case 4:
|
|
292
|
+
i++;
|
|
293
|
+
return [3 /*break*/, 2];
|
|
294
|
+
case 5: return [2 /*return*/, transferCalls];
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
});
|
|
298
|
+
};
|
|
299
|
+
TezosFA1Protocol.prototype.callbackContract = function () {
|
|
300
|
+
var _a;
|
|
301
|
+
return (_a = this.defaultCallbackContractMap[this.options.network.extras.network]) !== null && _a !== void 0 ? _a : '';
|
|
302
|
+
};
|
|
303
|
+
TezosFA1Protocol.prototype.isTransferRequest = function (obj) {
|
|
304
|
+
var anyObj = obj;
|
|
305
|
+
return (anyObj instanceof Object && typeof anyObj.from === 'string' && typeof anyObj.to === 'string' && bignumber_1.default.isBigNumber(anyObj.value));
|
|
306
|
+
};
|
|
307
|
+
return TezosFA1Protocol;
|
|
308
|
+
}(TezosFAProtocol_1.TezosFAProtocol));
|
|
309
|
+
exports.TezosFA1Protocol = TezosFA1Protocol;
|
|
310
|
+
//# sourceMappingURL=TezosFA1Protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TezosFA1Protocol.js","sourceRoot":"","sources":["../../../src/protocol/fa/TezosFA1Protocol.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,iHAA0F;AAC1F,sDAAoF;AACpF,2EAAkE;AAClE,sDAAsD;AAItD,kDAA+C;AAC/C,4CAA0C;AAC1C,2EAAyE;AACzE,mFAAiF;AACjF,2EAAyE;AACzE,iFAA+E;AAI/E,kEAAgE;AAChE,wCAAqD;AAErD,qDA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K,EAAE,IAAI,mBAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;6BAC3C,CAAC,EAAA;;wBAJI,YAAY,GAAG,SAInB;wBACF,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;;;wBANa,CAAC,EAAE,CAAA;;4BASlD,sBAAO,aAAa,EAAA;;;;KACrB;IAES,2CAAgB,GAA1B;;QACE,aAAO,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,mCAAI,EAAE,CAAA;IACnF,CAAC;IAEO,4CAAiB,GAAzB,UAA0B,GAAY;QACpC,IAAM,MAAM,GAAQ,GAAU,CAAA;QAE9B,OAAO,CACL,MAAM,YAAY,MAAM,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,MAAM,CAAC,EAAE,KAAK,QAAQ,IAAI,mBAAS,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CACpI,CAAA;IACH,CAAC;IACH,uBAAC;AAAD,CAAC,AAlMD,CAAsC,iCAAe,GAkMpD;AAlMY,4CAAgB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RawTezosTransaction } from '../../types/transaction-tezos';
|
|
2
|
+
import { TezosFATokenMetadata } from '../types/fa/TezosFATokenMetadata';
|
|
3
|
+
import { TezosFA1Protocol } from './TezosFA1Protocol';
|
|
4
|
+
export declare class TezosFA1p2Protocol extends TezosFA1Protocol {
|
|
5
|
+
getTokenMetadata(): Promise<TezosFATokenMetadata | undefined>;
|
|
6
|
+
getAllowance(ownerAddress: string, spenderAddress: string, callbackContract?: string, source?: string): Promise<string>;
|
|
7
|
+
approve(spenderAddress: string, amount: string, fee: string, publicKey: string): Promise<RawTezosTransaction>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
extendStatics(d, b);
|
|
11
|
+
function __() { this.constructor = d; }
|
|
12
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
16
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
17
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
18
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
19
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
20
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
21
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
25
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
26
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
27
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
28
|
+
function step(op) {
|
|
29
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
30
|
+
while (_) try {
|
|
31
|
+
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;
|
|
32
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
33
|
+
switch (op[0]) {
|
|
34
|
+
case 0: case 1: t = op; break;
|
|
35
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
36
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
37
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
38
|
+
default:
|
|
39
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
40
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
41
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
42
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
43
|
+
if (t[2]) _.ops.pop();
|
|
44
|
+
_.trys.pop(); continue;
|
|
45
|
+
}
|
|
46
|
+
op = body.call(thisArg, _);
|
|
47
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
48
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
52
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
53
|
+
};
|
|
54
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
|
+
exports.TezosFA1p2Protocol = void 0;
|
|
56
|
+
var bignumber_1 = __importDefault(require("@airgap/coinlib-core/dependencies/src/bignumber.js-9.0.0/bignumber"));
|
|
57
|
+
var TezosFA1Protocol_1 = require("./TezosFA1Protocol");
|
|
58
|
+
var TezosFA1p2ContractEntrypoint;
|
|
59
|
+
(function (TezosFA1p2ContractEntrypoint) {
|
|
60
|
+
TezosFA1p2ContractEntrypoint["BALANCE"] = "getBalance";
|
|
61
|
+
TezosFA1p2ContractEntrypoint["ALLOWANCE"] = "getAllowance";
|
|
62
|
+
TezosFA1p2ContractEntrypoint["APPROVE"] = "approve";
|
|
63
|
+
TezosFA1p2ContractEntrypoint["TRANSFER"] = "transfer";
|
|
64
|
+
TezosFA1p2ContractEntrypoint["TOTAL_SUPPLY"] = "getTotalSupply";
|
|
65
|
+
})(TezosFA1p2ContractEntrypoint || (TezosFA1p2ContractEntrypoint = {}));
|
|
66
|
+
var TezosFA1p2Protocol = /** @class */ (function (_super) {
|
|
67
|
+
__extends(TezosFA1p2Protocol, _super);
|
|
68
|
+
function TezosFA1p2Protocol() {
|
|
69
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
70
|
+
}
|
|
71
|
+
TezosFA1p2Protocol.prototype.getTokenMetadata = function () {
|
|
72
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
73
|
+
return __generator(this, function (_a) {
|
|
74
|
+
return [2 /*return*/, this.getTokenMetadataForTokenID(0)];
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
TezosFA1p2Protocol.prototype.getAllowance = function (ownerAddress, spenderAddress, callbackContract, source) {
|
|
79
|
+
if (callbackContract === void 0) { callbackContract = this.callbackContract(); }
|
|
80
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
81
|
+
var getAllowanceCall;
|
|
82
|
+
return __generator(this, function (_a) {
|
|
83
|
+
switch (_a.label) {
|
|
84
|
+
case 0: return [4 /*yield*/, this.contract.createContractCall(TezosFA1p2ContractEntrypoint.ALLOWANCE, [
|
|
85
|
+
{
|
|
86
|
+
owner: ownerAddress,
|
|
87
|
+
spender: spenderAddress
|
|
88
|
+
},
|
|
89
|
+
callbackContract
|
|
90
|
+
])];
|
|
91
|
+
case 1:
|
|
92
|
+
getAllowanceCall = _a.sent();
|
|
93
|
+
return [2 /*return*/, this.getContractCallIntResult(getAllowanceCall, this.requireSource(source, spenderAddress, 'kt'))];
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
TezosFA1p2Protocol.prototype.approve = function (spenderAddress, amount, fee, publicKey) {
|
|
99
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
100
|
+
var approveCall;
|
|
101
|
+
return __generator(this, function (_a) {
|
|
102
|
+
switch (_a.label) {
|
|
103
|
+
case 0: return [4 /*yield*/, this.contract.createContractCall(TezosFA1p2ContractEntrypoint.APPROVE, {
|
|
104
|
+
spender: spenderAddress,
|
|
105
|
+
value: new bignumber_1.default(amount).toNumber()
|
|
106
|
+
})];
|
|
107
|
+
case 1:
|
|
108
|
+
approveCall = _a.sent();
|
|
109
|
+
return [2 /*return*/, this.prepareContractCall([approveCall], fee, publicKey)];
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
return TezosFA1p2Protocol;
|
|
115
|
+
}(TezosFA1Protocol_1.TezosFA1Protocol));
|
|
116
|
+
exports.TezosFA1p2Protocol = TezosFA1p2Protocol;
|
|
117
|
+
//# sourceMappingURL=TezosFA1p2Protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TezosFA1p2Protocol.js","sourceRoot":"","sources":["../../../src/protocol/fa/TezosFA1p2Protocol.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iHAA0F;AAK1F,uDAAqD;AAErD,IAAK,4BAMJ;AAND,WAAK,4BAA4B;IAC/B,sDAAsB,CAAA;IACtB,0DAA0B,CAAA;IAC1B,mDAAmB,CAAA;IACnB,qDAAqB,CAAA;IACrB,+DAA+B,CAAA;AACjC,CAAC,EANI,4BAA4B,KAA5B,4BAA4B,QAMhC;AAED;IAAwC,sCAAgB;IAAxD;;IA8BA,CAAC;IA7Bc,6CAAgB,GAA7B;;;gBACE,sBAAO,IAAI,CAAC,0BAA0B,CAAC,CAAC,CAAC,EAAA;;;KAC1C;IAEY,yCAAY,GAAzB,UACE,YAAoB,EACpB,cAAsB,EACtB,gBAAkD,EAClD,MAAe;QADf,iCAAA,EAAA,mBAA2B,IAAI,CAAC,gBAAgB,EAAE;;;;;4BAGzB,qBAAM,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,4BAA4B,CAAC,SAAS,EAAE;4BACtG;gCACE,KAAK,EAAE,YAAY;gCACnB,OAAO,EAAE,cAAc;6BACxB;4BACD,gBAAgB;yBACjB,CAAC,EAAA;;wBANI,gBAAgB,GAAG,SAMvB;wBAEF,sBAAO,IAAI,CAAC,wBAAwB,CAAC,gBAAgB,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC,EAAA;;;;KACzG;IAEY,oCAAO,GAApB,UAAqB,cAAsB,EAAE,MAAc,EAAE,GAAW,EAAE,SAAiB;;;;;4BACrE,qBAAM,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,4BAA4B,CAAC,OAAO,EAAE;4BAC/F,OAAO,EAAE,cAAc;4BACvB,KAAK,EAAE,IAAI,mBAAS,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;yBACxC,CAAC,EAAA;;wBAHI,WAAW,GAAG,SAGlB;wBAEF,sBAAO,IAAI,CAAC,mBAAmB,CAAC,CAAC,WAAW,CAAC,EAAE,GAAG,EAAE,SAAS,CAAC,EAAA;;;;KAC/D;IACH,yBAAC;AAAD,CAAC,AA9BD,CAAwC,mCAAgB,GA8BvD;AA9BY,gDAAkB"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { FeeDefaults } from '@airgap/coinlib-core';
|
|
2
|
+
import { IAirGapTransaction } from '@airgap/coinlib-core/interfaces/IAirGapTransaction';
|
|
3
|
+
import { RawTezosTransaction } from '../../types/transaction-tezos';
|
|
4
|
+
import { TezosFA2BalanceOfRequest } from '../types/fa/TezosFA2BalanceOfRequest';
|
|
5
|
+
import { TezosFA2BalanceOfResponse } from '../types/fa/TezosFA2BalanceOfResponse';
|
|
6
|
+
import { TezosFA2TransferRequest } from '../types/fa/TezosFA2TransferRequest';
|
|
7
|
+
import { TezosFA2UpdateOperatorRequest } from '../types/fa/TezosFA2UpdateOperatorRequest';
|
|
8
|
+
import { TezosFATokenMetadata } from '../types/fa/TezosFATokenMetadata';
|
|
9
|
+
import { TezosTransactionParameters } from '../types/operations/Transaction';
|
|
10
|
+
import { TezosFAProtocol } from './TezosFAProtocol';
|
|
11
|
+
import { TezosFA2ProtocolOptions } from './TezosFAProtocolOptions';
|
|
12
|
+
declare enum TezosFA2ContractEntrypoint {
|
|
13
|
+
BALANCE = "balance_of",
|
|
14
|
+
TRANSFER = "transfer",
|
|
15
|
+
UPDATE_OPERATORS = "update_operators"
|
|
16
|
+
}
|
|
17
|
+
export declare class TezosFA2Protocol extends TezosFAProtocol {
|
|
18
|
+
readonly options: TezosFA2ProtocolOptions;
|
|
19
|
+
readonly tokenID?: number;
|
|
20
|
+
private readonly defaultCallbackContract;
|
|
21
|
+
constructor(options: TezosFA2ProtocolOptions);
|
|
22
|
+
getOptions(): Promise<TezosFA2ProtocolOptions>;
|
|
23
|
+
getBalanceOfPublicKey(publicKey: string, data?: {
|
|
24
|
+
addressIndex?: number;
|
|
25
|
+
assetID?: string;
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
}): Promise<string>;
|
|
28
|
+
getAvailableBalanceOfAddresses(addresses: string[], data?: {
|
|
29
|
+
assetID?: string;
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
}): Promise<string>;
|
|
32
|
+
getBalanceOfAddresses(addresses: string[], data?: {
|
|
33
|
+
assetID?: string;
|
|
34
|
+
[key: string]: any;
|
|
35
|
+
}): Promise<string>;
|
|
36
|
+
estimateFeeDefaultsFromPublicKey(publicKey: string, recipients: string[], values: string[], data?: {
|
|
37
|
+
addressIndex?: number;
|
|
38
|
+
tokenID?: number;
|
|
39
|
+
}): Promise<FeeDefaults>;
|
|
40
|
+
prepareTransactionFromPublicKey(publicKey: string, recipients: string[], values: string[], fee: string, data?: {
|
|
41
|
+
addressIndex?: number;
|
|
42
|
+
assetID?: number;
|
|
43
|
+
}): Promise<RawTezosTransaction>;
|
|
44
|
+
transactionDetailsFromParameters(parameters: TezosTransactionParameters): Partial<IAirGapTransaction>[];
|
|
45
|
+
balanceOf(balanceRequests: TezosFA2BalanceOfRequest[], source?: string, callbackContract?: string): Promise<TezosFA2BalanceOfResponse[]>;
|
|
46
|
+
transfer(transferRequests: TezosFA2TransferRequest[], fee: string, publicKey: string): Promise<RawTezosTransaction>;
|
|
47
|
+
updateOperators(updateRequests: TezosFA2UpdateOperatorRequest[], fee: string, publicKey: string): Promise<RawTezosTransaction>;
|
|
48
|
+
getTokenMetadata(tokenID?: number): Promise<TezosFATokenMetadata | undefined>;
|
|
49
|
+
fetchTokenHolders(tokenID?: number): Promise<{
|
|
50
|
+
address: string;
|
|
51
|
+
amount: string;
|
|
52
|
+
}[]>;
|
|
53
|
+
getTotalSupply(tokenID?: number): Promise<string>;
|
|
54
|
+
private createTransferCall;
|
|
55
|
+
protected callbackContract(entrypoint: TezosFA2ContractEntrypoint): string;
|
|
56
|
+
private isTransferRequest;
|
|
57
|
+
}
|
|
58
|
+
export {};
|