phantasma-sdk-ts 0.1.71
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/.eslintignore +13 -0
- package/.eslintrc.cjs +15 -0
- package/.github/workflows/npm-publish.yml +47 -0
- package/.prettierignore +13 -0
- package/.prettierrc +8 -0
- package/LICENSE +201 -0
- package/README.md +842 -0
- package/babel.config.js +6 -0
- package/core/index.d.ts +10 -0
- package/core/index.d.ts.map +1 -0
- package/core/index.js +25 -0
- package/core/interfaces/IContract.d.ts +27 -0
- package/core/interfaces/IContract.d.ts.map +1 -0
- package/core/interfaces/IContract.js +25 -0
- package/core/interfaces/IKeyPair.d.ts +7 -0
- package/core/interfaces/IKeyPair.d.ts.map +1 -0
- package/core/interfaces/IKeyPair.js +2 -0
- package/core/interfaces/ISerializable.d.ts +6 -0
- package/core/interfaces/ISerializable.d.ts.map +1 -0
- package/core/interfaces/ISerializable.js +9 -0
- package/core/interfaces/IStack.d.ts +7 -0
- package/core/interfaces/IStack.d.ts.map +1 -0
- package/core/interfaces/IStack.js +2 -0
- package/core/interfaces/IToken.d.ts +29 -0
- package/core/interfaces/IToken.d.ts.map +1 -0
- package/core/interfaces/IToken.js +22 -0
- package/core/interfaces/Signature.d.ts +21 -0
- package/core/interfaces/Signature.d.ts.map +1 -0
- package/core/interfaces/Signature.js +31 -0
- package/core/interfaces/index.d.ts +7 -0
- package/core/interfaces/index.d.ts.map +1 -0
- package/core/interfaces/index.js +22 -0
- package/core/ledger/Address-Transcode.d.ts +20 -0
- package/core/ledger/Address-Transcode.d.ts.map +1 -0
- package/core/ledger/Address-Transcode.js +70 -0
- package/core/ledger/Ledger-Commands.d.ts +76 -0
- package/core/ledger/Ledger-Commands.d.ts.map +1 -0
- package/core/ledger/Ledger-Commands.js +530 -0
- package/core/ledger/Ledger-Utils.d.ts +74 -0
- package/core/ledger/Ledger-Utils.d.ts.map +1 -0
- package/core/ledger/Ledger-Utils.js +609 -0
- package/core/ledger/LedgerConfig.d.ts +17 -0
- package/core/ledger/LedgerConfig.d.ts.map +1 -0
- package/core/ledger/LedgerConfig.js +2 -0
- package/core/ledger/Mnemonic.d.ts +35 -0
- package/core/ledger/Mnemonic.d.ts.map +1 -0
- package/core/ledger/Mnemonic.js +65 -0
- package/core/ledger/Transaction-Sign.d.ts +10 -0
- package/core/ledger/Transaction-Sign.d.ts.map +1 -0
- package/core/ledger/Transaction-Sign.js +149 -0
- package/core/ledger/Transaction-Transcode.d.ts +24 -0
- package/core/ledger/Transaction-Transcode.d.ts.map +1 -0
- package/core/ledger/Transaction-Transcode.js +47 -0
- package/core/ledger/index.d.ts +9 -0
- package/core/ledger/index.d.ts.map +1 -0
- package/core/ledger/index.js +24 -0
- package/core/ledger/interfaces/ApplicationNameResponse.d.ts +6 -0
- package/core/ledger/interfaces/ApplicationNameResponse.d.ts.map +1 -0
- package/core/ledger/interfaces/ApplicationNameResponse.js +2 -0
- package/core/ledger/interfaces/Device.d.ts +7 -0
- package/core/ledger/interfaces/Device.d.ts.map +1 -0
- package/core/ledger/interfaces/Device.js +2 -0
- package/core/ledger/interfaces/DeviceResponse.d.ts +7 -0
- package/core/ledger/interfaces/DeviceResponse.d.ts.map +1 -0
- package/core/ledger/interfaces/DeviceResponse.js +2 -0
- package/core/ledger/interfaces/Ledger.d.ts +2 -0
- package/core/ledger/interfaces/Ledger.d.ts.map +1 -0
- package/core/ledger/interfaces/Ledger.js +2 -0
- package/core/ledger/interfaces/LedgerBalanceFromLedgerResponse.d.ts +12 -0
- package/core/ledger/interfaces/LedgerBalanceFromLedgerResponse.d.ts.map +1 -0
- package/core/ledger/interfaces/LedgerBalanceFromLedgerResponse.js +2 -0
- package/core/ledger/interfaces/LedgerConfig.d.ts +17 -0
- package/core/ledger/interfaces/LedgerConfig.d.ts.map +1 -0
- package/core/ledger/interfaces/LedgerConfig.js +2 -0
- package/core/ledger/interfaces/LedgerDeviceInfoResponse.d.ts +7 -0
- package/core/ledger/interfaces/LedgerDeviceInfoResponse.d.ts.map +1 -0
- package/core/ledger/interfaces/LedgerDeviceInfoResponse.js +2 -0
- package/core/ledger/interfaces/LedgerSendTransactionResponse.d.ts +5 -0
- package/core/ledger/interfaces/LedgerSendTransactionResponse.d.ts.map +1 -0
- package/core/ledger/interfaces/LedgerSendTransactionResponse.js +2 -0
- package/core/ledger/interfaces/LedgerSigner.d.ts +6 -0
- package/core/ledger/interfaces/LedgerSigner.d.ts.map +1 -0
- package/core/ledger/interfaces/LedgerSigner.js +2 -0
- package/core/ledger/interfaces/LedgerSignerData.d.ts +8 -0
- package/core/ledger/interfaces/LedgerSignerData.d.ts.map +1 -0
- package/core/ledger/interfaces/LedgerSignerData.js +2 -0
- package/core/ledger/interfaces/PublicKeyResponse.d.ts +6 -0
- package/core/ledger/interfaces/PublicKeyResponse.d.ts.map +1 -0
- package/core/ledger/interfaces/PublicKeyResponse.js +2 -0
- package/core/ledger/interfaces/SignResponse.d.ts +6 -0
- package/core/ledger/interfaces/SignResponse.d.ts.map +1 -0
- package/core/ledger/interfaces/SignResponse.js +2 -0
- package/core/ledger/interfaces/VersionResponse.d.ts +6 -0
- package/core/ledger/interfaces/VersionResponse.d.ts.map +1 -0
- package/core/ledger/interfaces/VersionResponse.js +2 -0
- package/core/ledger/interfaces/index.d.ts +14 -0
- package/core/ledger/interfaces/index.d.ts.map +1 -0
- package/core/ledger/interfaces/index.js +29 -0
- package/core/ledger/ledger-comm.d.ts +85 -0
- package/core/ledger/ledger-comm.d.ts.map +1 -0
- package/core/ledger/ledger-comm.js +613 -0
- package/core/link/easyConnect.d.ts +23 -0
- package/core/link/easyConnect.d.ts.map +1 -0
- package/core/link/easyConnect.js +237 -0
- package/core/link/easyScript.d.ts +13 -0
- package/core/link/easyScript.d.ts.map +1 -0
- package/core/link/easyScript.js +52 -0
- package/core/link/index.d.ts +2 -0
- package/core/link/index.d.ts.map +1 -0
- package/core/link/index.js +17 -0
- package/core/link/interfaces/IAccount.d.ts +13 -0
- package/core/link/interfaces/IAccount.d.ts.map +1 -0
- package/core/link/interfaces/IAccount.js +2 -0
- package/core/link/interfaces/IFile.d.ts +7 -0
- package/core/link/interfaces/IFile.d.ts.map +1 -0
- package/core/link/interfaces/IFile.js +2 -0
- package/core/link/interfaces/ProofOfWork.d.ts +9 -0
- package/core/link/interfaces/ProofOfWork.d.ts.map +1 -0
- package/core/link/interfaces/ProofOfWork.js +12 -0
- package/core/link/interfaces/index.d.ts +4 -0
- package/core/link/interfaces/index.d.ts.map +1 -0
- package/core/link/interfaces/index.js +19 -0
- package/core/link/phantasmaLink.d.ts +41 -0
- package/core/link/phantasmaLink.d.ts.map +1 -0
- package/core/link/phantasmaLink.js +479 -0
- package/core/rpc/index.d.ts +3 -0
- package/core/rpc/index.d.ts.map +1 -0
- package/core/rpc/index.js +18 -0
- package/core/rpc/interfaces/ABIContract.d.ts +6 -0
- package/core/rpc/interfaces/ABIContract.d.ts.map +1 -0
- package/core/rpc/interfaces/ABIContract.js +2 -0
- package/core/rpc/interfaces/ABIEvent.d.ts +7 -0
- package/core/rpc/interfaces/ABIEvent.d.ts.map +1 -0
- package/core/rpc/interfaces/ABIEvent.js +2 -0
- package/core/rpc/interfaces/ABIMethod.d.ts +7 -0
- package/core/rpc/interfaces/ABIMethod.d.ts.map +1 -0
- package/core/rpc/interfaces/ABIMethod.js +2 -0
- package/core/rpc/interfaces/ABIParameter.d.ts +5 -0
- package/core/rpc/interfaces/ABIParameter.d.ts.map +1 -0
- package/core/rpc/interfaces/ABIParameter.js +2 -0
- package/core/rpc/interfaces/Account.d.ts +16 -0
- package/core/rpc/interfaces/Account.d.ts.map +1 -0
- package/core/rpc/interfaces/Account.js +2 -0
- package/core/rpc/interfaces/AccountTransactions.d.ts +6 -0
- package/core/rpc/interfaces/AccountTransactions.d.ts.map +1 -0
- package/core/rpc/interfaces/AccountTransactions.js +2 -0
- package/core/rpc/interfaces/Archive.d.ts +11 -0
- package/core/rpc/interfaces/Archive.d.ts.map +1 -0
- package/core/rpc/interfaces/Archive.js +2 -0
- package/core/rpc/interfaces/Auction.d.ts +13 -0
- package/core/rpc/interfaces/Auction.d.ts.map +1 -0
- package/core/rpc/interfaces/Auction.js +2 -0
- package/core/rpc/interfaces/Balance.d.ts +8 -0
- package/core/rpc/interfaces/Balance.d.ts.map +1 -0
- package/core/rpc/interfaces/Balance.js +2 -0
- package/core/rpc/interfaces/Block.d.ts +17 -0
- package/core/rpc/interfaces/Block.d.ts.map +1 -0
- package/core/rpc/interfaces/Block.js +2 -0
- package/core/rpc/interfaces/Chain.d.ts +10 -0
- package/core/rpc/interfaces/Chain.d.ts.map +1 -0
- package/core/rpc/interfaces/Chain.js +2 -0
- package/core/rpc/interfaces/Channel.d.ts +13 -0
- package/core/rpc/interfaces/Channel.d.ts.map +1 -0
- package/core/rpc/interfaces/Channel.js +2 -0
- package/core/rpc/interfaces/Contract.d.ts +11 -0
- package/core/rpc/interfaces/Contract.d.ts.map +1 -0
- package/core/rpc/interfaces/Contract.js +2 -0
- package/core/rpc/interfaces/Dapp.d.ts +6 -0
- package/core/rpc/interfaces/Dapp.d.ts.map +1 -0
- package/core/rpc/interfaces/Dapp.js +2 -0
- package/core/rpc/interfaces/Event.d.ts +7 -0
- package/core/rpc/interfaces/Event.d.ts.map +1 -0
- package/core/rpc/interfaces/Event.js +2 -0
- package/core/rpc/interfaces/Governance.d.ts +5 -0
- package/core/rpc/interfaces/Governance.d.ts.map +1 -0
- package/core/rpc/interfaces/Governance.js +2 -0
- package/core/rpc/interfaces/Interop.d.ts +5 -0
- package/core/rpc/interfaces/Interop.d.ts.map +1 -0
- package/core/rpc/interfaces/Interop.js +2 -0
- package/core/rpc/interfaces/KeyValue.d.ts +5 -0
- package/core/rpc/interfaces/KeyValue.d.ts.map +1 -0
- package/core/rpc/interfaces/KeyValue.js +2 -0
- package/core/rpc/interfaces/Leaderboard.d.ts +6 -0
- package/core/rpc/interfaces/Leaderboard.d.ts.map +1 -0
- package/core/rpc/interfaces/Leaderboard.js +2 -0
- package/core/rpc/interfaces/LeaderboardRow.d.ts +5 -0
- package/core/rpc/interfaces/LeaderboardRow.d.ts.map +1 -0
- package/core/rpc/interfaces/LeaderboardRow.js +2 -0
- package/core/rpc/interfaces/NFT.d.ts +14 -0
- package/core/rpc/interfaces/NFT.d.ts.map +1 -0
- package/core/rpc/interfaces/NFT.js +2 -0
- package/core/rpc/interfaces/Nexus.d.ts +14 -0
- package/core/rpc/interfaces/Nexus.d.ts.map +1 -0
- package/core/rpc/interfaces/Nexus.js +2 -0
- package/core/rpc/interfaces/Oracle.d.ts +5 -0
- package/core/rpc/interfaces/Oracle.d.ts.map +1 -0
- package/core/rpc/interfaces/Oracle.js +2 -0
- package/core/rpc/interfaces/Organization.d.ts +6 -0
- package/core/rpc/interfaces/Organization.d.ts.map +1 -0
- package/core/rpc/interfaces/Organization.js +2 -0
- package/core/rpc/interfaces/Paginated.d.ts +8 -0
- package/core/rpc/interfaces/Paginated.d.ts.map +1 -0
- package/core/rpc/interfaces/Paginated.js +2 -0
- package/core/rpc/interfaces/Peer.d.ts +8 -0
- package/core/rpc/interfaces/Peer.d.ts.map +1 -0
- package/core/rpc/interfaces/Peer.js +2 -0
- package/core/rpc/interfaces/Platform.d.ts +9 -0
- package/core/rpc/interfaces/Platform.d.ts.map +1 -0
- package/core/rpc/interfaces/Platform.js +2 -0
- package/core/rpc/interfaces/Receipt.d.ts +10 -0
- package/core/rpc/interfaces/Receipt.d.ts.map +1 -0
- package/core/rpc/interfaces/Receipt.js +2 -0
- package/core/rpc/interfaces/Script.d.ts +9 -0
- package/core/rpc/interfaces/Script.d.ts.map +1 -0
- package/core/rpc/interfaces/Script.js +2 -0
- package/core/rpc/interfaces/SendRawTx.d.ts +5 -0
- package/core/rpc/interfaces/SendRawTx.d.ts.map +1 -0
- package/core/rpc/interfaces/SendRawTx.js +2 -0
- package/core/rpc/interfaces/SignatureResult.d.ts +5 -0
- package/core/rpc/interfaces/SignatureResult.d.ts.map +1 -0
- package/core/rpc/interfaces/SignatureResult.js +2 -0
- package/core/rpc/interfaces/Stake.d.ts +6 -0
- package/core/rpc/interfaces/Stake.d.ts.map +1 -0
- package/core/rpc/interfaces/Stake.js +2 -0
- package/core/rpc/interfaces/Storage.d.ts +8 -0
- package/core/rpc/interfaces/Storage.d.ts.map +1 -0
- package/core/rpc/interfaces/Storage.js +2 -0
- package/core/rpc/interfaces/Swap.d.ts +13 -0
- package/core/rpc/interfaces/Swap.d.ts.map +1 -0
- package/core/rpc/interfaces/Swap.js +2 -0
- package/core/rpc/interfaces/Token.d.ts +19 -0
- package/core/rpc/interfaces/Token.d.ts.map +1 -0
- package/core/rpc/interfaces/Token.js +2 -0
- package/core/rpc/interfaces/TokenData.d.ts +13 -0
- package/core/rpc/interfaces/TokenData.d.ts.map +1 -0
- package/core/rpc/interfaces/TokenData.js +2 -0
- package/core/rpc/interfaces/TokenExternal.d.ts +5 -0
- package/core/rpc/interfaces/TokenExternal.d.ts.map +1 -0
- package/core/rpc/interfaces/TokenExternal.js +2 -0
- package/core/rpc/interfaces/TokenPrice.d.ts +8 -0
- package/core/rpc/interfaces/TokenPrice.d.ts.map +1 -0
- package/core/rpc/interfaces/TokenPrice.js +2 -0
- package/core/rpc/interfaces/TokenSeries.d.ts +12 -0
- package/core/rpc/interfaces/TokenSeries.d.ts.map +1 -0
- package/core/rpc/interfaces/TokenSeries.js +2 -0
- package/core/rpc/interfaces/TransactionData.d.ts +23 -0
- package/core/rpc/interfaces/TransactionData.d.ts.map +1 -0
- package/core/rpc/interfaces/TransactionData.js +2 -0
- package/core/rpc/interfaces/Validator.d.ts +5 -0
- package/core/rpc/interfaces/Validator.d.ts.map +1 -0
- package/core/rpc/interfaces/Validator.js +2 -0
- package/core/rpc/interfaces/index.d.ts +42 -0
- package/core/rpc/interfaces/index.d.ts.map +1 -0
- package/core/rpc/interfaces/index.js +57 -0
- package/core/rpc/phantasma.d.ts +89 -0
- package/core/rpc/phantasma.d.ts.map +1 -0
- package/core/rpc/phantasma.js +900 -0
- package/core/tx/SignatureKind.js +9 -0
- package/core/tx/Transaction.d.ts +28 -0
- package/core/tx/Transaction.d.ts.map +1 -0
- package/core/tx/Transaction.js +209 -0
- package/core/tx/index.d.ts +3 -0
- package/core/tx/index.d.ts.map +1 -0
- package/core/tx/index.js +18 -0
- package/core/tx/utils.d.ts +10 -0
- package/core/tx/utils.d.ts.map +1 -0
- package/core/tx/utils.js +147 -0
- package/core/types/Address.d.ts +41 -0
- package/core/types/Address.d.ts.map +1 -0
- package/core/types/Address.js +276 -0
- package/core/types/Consensus.d.ts +61 -0
- package/core/types/Consensus.d.ts.map +1 -0
- package/core/types/Consensus.js +151 -0
- package/core/types/Contract.d.ts +60 -0
- package/core/types/Contract.d.ts.map +1 -0
- package/core/types/Contract.js +342 -0
- package/core/types/DomainSettings.d.ts +87 -0
- package/core/types/DomainSettings.d.ts.map +1 -0
- package/core/types/DomainSettings.js +107 -0
- package/core/types/Ed25519Signature.d.ts +16 -0
- package/core/types/Ed25519Signature.d.ts.map +1 -0
- package/core/types/Ed25519Signature.js +78 -0
- package/core/types/Entropy.d.ts +5 -0
- package/core/types/Entropy.d.ts.map +1 -0
- package/core/types/Entropy.js +24 -0
- package/core/types/Extensions/Base16.d.ts +7 -0
- package/core/types/Extensions/Base16.d.ts.map +1 -0
- package/core/types/Extensions/Base16.js +36 -0
- package/core/types/Extensions/BinaryReader.d.ts +17 -0
- package/core/types/Extensions/BinaryReader.d.ts.map +1 -0
- package/core/types/Extensions/BinaryReader.js +192 -0
- package/core/types/Extensions/BinaryWriter.d.ts +25 -0
- package/core/types/Extensions/BinaryWriter.d.ts.map +1 -0
- package/core/types/Extensions/BinaryWriter.js +191 -0
- package/core/types/Extensions/Describer.d.ts +5 -0
- package/core/types/Extensions/Describer.d.ts.map +1 -0
- package/core/types/Extensions/Describer.js +25 -0
- package/core/types/Extensions/PBinaryReader.d.ts +42 -0
- package/core/types/Extensions/PBinaryReader.d.ts.map +1 -0
- package/core/types/Extensions/PBinaryReader.js +269 -0
- package/core/types/Extensions/PBinaryWriter.d.ts +49 -0
- package/core/types/Extensions/PBinaryWriter.d.ts.map +1 -0
- package/core/types/Extensions/PBinaryWriter.js +250 -0
- package/core/types/Extensions/TableColumns.d.ts +5 -0
- package/core/types/Extensions/TableColumns.d.ts.map +1 -0
- package/core/types/Extensions/TableColumns.js +22 -0
- package/core/types/Extensions/index.d.ts +5 -0
- package/core/types/Extensions/index.d.ts.map +1 -0
- package/core/types/Extensions/index.js +20 -0
- package/core/types/PhantasmaKeys.d.ts +19 -0
- package/core/types/PhantasmaKeys.d.ts.map +1 -0
- package/core/types/PhantasmaKeys.js +92 -0
- package/core/types/Serialization.d.ts +22 -0
- package/core/types/Serialization.d.ts.map +1 -0
- package/core/types/Serialization.js +195 -0
- package/core/types/Stack.d.ts +16 -0
- package/core/types/Stack.d.ts.map +1 -0
- package/core/types/Stack.js +42 -0
- package/core/types/Timestamp.d.ts +26 -0
- package/core/types/Timestamp.d.ts.map +1 -0
- package/core/types/Timestamp.js +74 -0
- package/core/types/index.d.ts +12 -0
- package/core/types/index.d.ts.map +1 -0
- package/core/types/index.js +27 -0
- package/core/utils/index.d.ts +25 -0
- package/core/utils/index.d.ts.map +1 -0
- package/core/utils/index.js +236 -0
- package/core/vm/Contracts.d.ts +17 -0
- package/core/vm/Contracts.d.ts.map +1 -0
- package/core/vm/Contracts.js +20 -0
- package/core/vm/Decoder.d.ts +19 -0
- package/core/vm/Decoder.d.ts.map +1 -0
- package/core/vm/Decoder.js +175 -0
- package/core/vm/EventData.d.ts +97 -0
- package/core/vm/EventData.d.ts.map +1 -0
- package/core/vm/EventData.js +134 -0
- package/core/vm/Opcode.d.ts +57 -0
- package/core/vm/Opcode.d.ts.map +1 -0
- package/core/vm/Opcode.js +69 -0
- package/core/vm/ScriptBuilder.d.ts +65 -0
- package/core/vm/ScriptBuilder.d.ts.map +1 -0
- package/core/vm/ScriptBuilder.js +592 -0
- package/core/vm/VMObject.d.ts +55 -0
- package/core/vm/VMObject.d.ts.map +1 -0
- package/core/vm/VMObject.js +1101 -0
- package/core/vm/VMType.d.ts +12 -0
- package/core/vm/VMType.d.ts.map +1 -0
- package/core/vm/VMType.js +15 -0
- package/core/vm/index.d.ts +8 -0
- package/core/vm/index.d.ts.map +1 -0
- package/core/vm/index.js +23 -0
- package/html/TestWebPage.html +187 -0
- package/html/phantasma.js +60504 -0
- package/index.d.ts +5 -0
- package/index.d.ts.map +1 -0
- package/index.js +36 -0
- package/jest.config.js +5 -0
- package/package.json +67 -0
- package/src/core/index.ts +9 -0
- package/src/core/interfaces/IContract.ts +28 -0
- package/src/core/interfaces/IKeyPair.ts +14 -0
- package/src/core/interfaces/ISerializable.ts +6 -0
- package/src/core/interfaces/IStack.ts +6 -0
- package/src/core/interfaces/IToken.ts +31 -0
- package/src/core/interfaces/Signature.ts +32 -0
- package/src/core/interfaces/index.ts +6 -0
- package/src/core/ledger/Address-Transcode.ts +44 -0
- package/src/core/ledger/Ledger-Commands.ts +463 -0
- package/src/core/ledger/Ledger-Utils.ts +549 -0
- package/src/core/ledger/Mnemonic.ts +79 -0
- package/src/core/ledger/Transaction-Sign.ts +126 -0
- package/src/core/ledger/Transaction-Transcode.ts +56 -0
- package/src/core/ledger/index.ts +8 -0
- package/src/core/ledger/interfaces/ApplicationNameResponse.ts +5 -0
- package/src/core/ledger/interfaces/Device.ts +6 -0
- package/src/core/ledger/interfaces/DeviceResponse.ts +6 -0
- package/src/core/ledger/interfaces/Ledger.ts +10 -0
- package/src/core/ledger/interfaces/LedgerBalanceFromLedgerResponse.ts +9 -0
- package/src/core/ledger/interfaces/LedgerConfig.ts +17 -0
- package/src/core/ledger/interfaces/LedgerDeviceInfoResponse.ts +7 -0
- package/src/core/ledger/interfaces/LedgerSendTransactionResponse.ts +4 -0
- package/src/core/ledger/interfaces/LedgerSigner.ts +6 -0
- package/src/core/ledger/interfaces/LedgerSignerData.ts +8 -0
- package/src/core/ledger/interfaces/PublicKeyResponse.ts +5 -0
- package/src/core/ledger/interfaces/SignResponse.ts +5 -0
- package/src/core/ledger/interfaces/VersionResponse.ts +5 -0
- package/src/core/ledger/interfaces/index.ts +13 -0
- package/src/core/link/easyConnect.ts +214 -0
- package/src/core/link/easyScript.ts +67 -0
- package/src/core/link/index.ts +1 -0
- package/src/core/link/interfaces/IAccount.ts +13 -0
- package/src/core/link/interfaces/IFile.ts +6 -0
- package/src/core/link/interfaces/ProofOfWork.ts +8 -0
- package/src/core/link/interfaces/index.ts +3 -0
- package/src/core/link/phantasmaLink.ts +561 -0
- package/src/core/rpc/index.ts +2 -0
- package/src/core/rpc/interfaces/ABIContract.ts +6 -0
- package/src/core/rpc/interfaces/ABIEvent.ts +6 -0
- package/src/core/rpc/interfaces/ABIMethod.ts +7 -0
- package/src/core/rpc/interfaces/ABIParameter.ts +4 -0
- package/src/core/rpc/interfaces/Account.ts +16 -0
- package/src/core/rpc/interfaces/AccountTransactions.ts +6 -0
- package/src/core/rpc/interfaces/Archive.ts +10 -0
- package/src/core/rpc/interfaces/Auction.ts +12 -0
- package/src/core/rpc/interfaces/Balance.ts +7 -0
- package/src/core/rpc/interfaces/Block.ts +17 -0
- package/src/core/rpc/interfaces/Chain.ts +9 -0
- package/src/core/rpc/interfaces/Channel.ts +12 -0
- package/src/core/rpc/interfaces/Contract.ts +11 -0
- package/src/core/rpc/interfaces/Dapp.ts +5 -0
- package/src/core/rpc/interfaces/Event.ts +6 -0
- package/src/core/rpc/interfaces/Governance.ts +4 -0
- package/src/core/rpc/interfaces/Interop.ts +4 -0
- package/src/core/rpc/interfaces/KeyValue.ts +4 -0
- package/src/core/rpc/interfaces/Leaderboard.ts +6 -0
- package/src/core/rpc/interfaces/LeaderboardRow.ts +4 -0
- package/src/core/rpc/interfaces/NFT.ts +14 -0
- package/src/core/rpc/interfaces/Nexus.ts +14 -0
- package/src/core/rpc/interfaces/Oracle.ts +4 -0
- package/src/core/rpc/interfaces/Organization.ts +5 -0
- package/src/core/rpc/interfaces/Paginated.ts +7 -0
- package/src/core/rpc/interfaces/Peer.ts +7 -0
- package/src/core/rpc/interfaces/Platform.ts +9 -0
- package/src/core/rpc/interfaces/Receipt.ts +9 -0
- package/src/core/rpc/interfaces/Script.ts +9 -0
- package/src/core/rpc/interfaces/SendRawTx.ts +4 -0
- package/src/core/rpc/interfaces/SignatureResult.ts +4 -0
- package/src/core/rpc/interfaces/Stake.ts +5 -0
- package/src/core/rpc/interfaces/Storage.ts +8 -0
- package/src/core/rpc/interfaces/Swap.ts +12 -0
- package/src/core/rpc/interfaces/Token.ts +19 -0
- package/src/core/rpc/interfaces/TokenData.ts +12 -0
- package/src/core/rpc/interfaces/TokenExternal.ts +4 -0
- package/src/core/rpc/interfaces/TokenPrice.ts +7 -0
- package/src/core/rpc/interfaces/TokenSeries.ts +12 -0
- package/src/core/rpc/interfaces/TransactionData.ts +23 -0
- package/src/core/rpc/interfaces/Validator.ts +4 -0
- package/src/core/rpc/interfaces/index.ts +41 -0
- package/src/core/rpc/phantasma.ts +466 -0
- package/src/core/tx/Transaction.ts +258 -0
- package/src/core/tx/index.ts +2 -0
- package/src/core/tx/utils.ts +106 -0
- package/src/core/types/Address.ts +290 -0
- package/src/core/types/Consensus.ts +181 -0
- package/src/core/types/Contract.ts +324 -0
- package/src/core/types/DomainSettings.ts +128 -0
- package/src/core/types/Ed25519Signature.ts +78 -0
- package/src/core/types/Entropy.ts +16 -0
- package/src/core/types/Extensions/Base16.ts +36 -0
- package/src/core/types/Extensions/Describer.ts +17 -0
- package/src/core/types/Extensions/PBinaryReader.ts +247 -0
- package/src/core/types/Extensions/PBinaryWriter.ts +278 -0
- package/src/core/types/Extensions/index.ts +4 -0
- package/src/core/types/PhantasmaKeys.ts +119 -0
- package/src/core/types/Serialization.ts +211 -0
- package/src/core/types/Stack.ts +46 -0
- package/src/core/types/Timestamp.ts +93 -0
- package/src/core/types/index.ts +11 -0
- package/src/core/utils/index.ts +206 -0
- package/src/core/vm/Contracts.ts +17 -0
- package/src/core/vm/Decoder.ts +162 -0
- package/src/core/vm/Disassembler.ts +1 -0
- package/src/core/vm/EventData.ts +135 -0
- package/src/core/vm/Opcode.ts +74 -0
- package/src/core/vm/ScriptBuilder.ts +588 -0
- package/src/core/vm/VMObject.ts +1162 -0
- package/src/core/vm/VMType.ts +11 -0
- package/src/core/vm/index.ts +7 -0
- package/src/core/vm/utils/DisasmMethodCall.ts +22 -0
- package/src/core/vm/utils/DisasmUtils.ts +89 -0
- package/src/core/vm/utils/index.ts +2 -0
- package/src/index.ts +7 -0
- package/tests/VMObject.test.ts +146 -0
- package/tests/ledger/Address-Transacode.test.ts +26 -0
- package/tests/tx/Transaction.test.ts +274 -0
- package/tests/types/Address.test.ts +26 -0
- package/tests/types/Consensus.test.ts +67 -0
- package/tsconfig.json +29 -0
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.EasyConnect = void 0;
|
|
40
|
+
var phantasmaLink_1 = require("./phantasmaLink");
|
|
41
|
+
var ProofOfWork_1 = require("./interfaces/ProofOfWork");
|
|
42
|
+
var easyScript_1 = require("./easyScript");
|
|
43
|
+
var EasyConnect = /** @class */ (function () {
|
|
44
|
+
function EasyConnect(_options) {
|
|
45
|
+
if (_options === void 0) { _options = null; }
|
|
46
|
+
this.platform = 'phantasma';
|
|
47
|
+
this.providerHint = 'poltergeist';
|
|
48
|
+
this.script = new easyScript_1.EasyScript();
|
|
49
|
+
this.link = new phantasmaLink_1.PhantasmaLink('easyConnect', false);
|
|
50
|
+
this.connected = false;
|
|
51
|
+
this.requiredVersion = 2;
|
|
52
|
+
//Make This Auto In Future
|
|
53
|
+
this.nexus = easyScript_1.Nexus.Mainnet;
|
|
54
|
+
if (_options == null) {
|
|
55
|
+
this.setConfig('auto');
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
try {
|
|
59
|
+
this.requiredVersion = Number(_options[0]);
|
|
60
|
+
this.platform = _options[1];
|
|
61
|
+
this.providerHint = _options[2];
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
console.log(error);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
this.script = new easyScript_1.EasyScript();
|
|
68
|
+
}
|
|
69
|
+
EasyConnect.prototype.setConfig = function (_provider) {
|
|
70
|
+
this.requiredVersion = 2;
|
|
71
|
+
this.platform = 'phantasma';
|
|
72
|
+
switch (_provider) {
|
|
73
|
+
case 'auto':
|
|
74
|
+
// @ts-ignore
|
|
75
|
+
if (!!window.PhantasmaLinkSocket == true) {
|
|
76
|
+
this.setConfig('ecto');
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
this.providerHint = '';
|
|
80
|
+
}
|
|
81
|
+
break;
|
|
82
|
+
case 'ecto':
|
|
83
|
+
this.providerHint = 'ecto';
|
|
84
|
+
break;
|
|
85
|
+
case 'poltergeist':
|
|
86
|
+
this.providerHint = 'poltergeist';
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
EasyConnect.prototype.connect = function (onSuccess, onFail) {
|
|
91
|
+
if (onSuccess === void 0) { onSuccess = function (data) { }; }
|
|
92
|
+
if (onFail === void 0) { onFail = function (data) {
|
|
93
|
+
console.log('%cError: ' + data, 'color:red');
|
|
94
|
+
}; }
|
|
95
|
+
var that = this;
|
|
96
|
+
this.link.login(function (data) {
|
|
97
|
+
//Console Logging for Debugging Purposes
|
|
98
|
+
if (data) {
|
|
99
|
+
that.connected = true;
|
|
100
|
+
onSuccess(data);
|
|
101
|
+
console.log('%c[EasyConnect Connected]', 'color:green');
|
|
102
|
+
console.log("Wallet Address '" + that.link.account.address + "' connected via " + that.link.wallet);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
onFail();
|
|
106
|
+
console.log('EasyConnect could not connect to wallet');
|
|
107
|
+
}
|
|
108
|
+
}, onFail, this.requiredVersion, this.platform, this.providerHint);
|
|
109
|
+
};
|
|
110
|
+
EasyConnect.prototype.disconnect = function (_message) {
|
|
111
|
+
if (_message === void 0) { _message = 'Graceful Disconect'; }
|
|
112
|
+
this.link.disconnect(_message);
|
|
113
|
+
this.connected = false;
|
|
114
|
+
};
|
|
115
|
+
EasyConnect.prototype.query = function (_type, _arguments, _callback) {
|
|
116
|
+
if (_type === void 0) { _type = null; }
|
|
117
|
+
if (_arguments === void 0) { _arguments = null; }
|
|
118
|
+
if (_callback === void 0) { _callback = function (data) {
|
|
119
|
+
console.log(data);
|
|
120
|
+
}; }
|
|
121
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
122
|
+
var account, name_1, balances, walletAddress, avatar;
|
|
123
|
+
return __generator(this, function (_a) {
|
|
124
|
+
if (this.connected == true) {
|
|
125
|
+
switch (_type) {
|
|
126
|
+
case 'account':
|
|
127
|
+
account = this.link.account;
|
|
128
|
+
_callback(account);
|
|
129
|
+
return [2 /*return*/, account];
|
|
130
|
+
break;
|
|
131
|
+
case 'name':
|
|
132
|
+
name_1 = this.link.account.name;
|
|
133
|
+
_callback(name_1);
|
|
134
|
+
return [2 /*return*/, name_1];
|
|
135
|
+
break;
|
|
136
|
+
case 'balances':
|
|
137
|
+
balances = this.link.account.balances;
|
|
138
|
+
_callback(balances);
|
|
139
|
+
return [2 /*return*/, balances];
|
|
140
|
+
break;
|
|
141
|
+
case 'walletAddress':
|
|
142
|
+
walletAddress = this.link.account.address;
|
|
143
|
+
_callback(walletAddress);
|
|
144
|
+
return [2 /*return*/, walletAddress];
|
|
145
|
+
break;
|
|
146
|
+
case 'avatar':
|
|
147
|
+
avatar = this.link.account.avatar;
|
|
148
|
+
_callback(avatar);
|
|
149
|
+
return [2 /*return*/, avatar];
|
|
150
|
+
break;
|
|
151
|
+
case 'tokenBalance':
|
|
152
|
+
//let token = _arguments[0];
|
|
153
|
+
//return this.link.accounts[]
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
console.log('%cWallet is not connected', 'color:red');
|
|
159
|
+
}
|
|
160
|
+
return [2 /*return*/];
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
};
|
|
164
|
+
EasyConnect.prototype.action = function (_type, _arguments, onSuccess, onFail) {
|
|
165
|
+
if (_type === void 0) { _type = null; }
|
|
166
|
+
if (_arguments === void 0) { _arguments = null; }
|
|
167
|
+
if (onSuccess === void 0) { onSuccess = function (data) { }; }
|
|
168
|
+
if (onFail === void 0) { onFail = function (data) {
|
|
169
|
+
console.log('%cError: ' + data, 'color:red');
|
|
170
|
+
}; }
|
|
171
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
172
|
+
var _a, sendFTScript, sendNFTScript;
|
|
173
|
+
return __generator(this, function (_b) {
|
|
174
|
+
switch (_b.label) {
|
|
175
|
+
case 0:
|
|
176
|
+
if (!(this.connected == true)) return [3 /*break*/, 6];
|
|
177
|
+
_a = _type;
|
|
178
|
+
switch (_a) {
|
|
179
|
+
case 'sendFT': return [3 /*break*/, 1];
|
|
180
|
+
case 'sendNFT': return [3 /*break*/, 3];
|
|
181
|
+
}
|
|
182
|
+
return [3 /*break*/, 5];
|
|
183
|
+
case 1: return [4 /*yield*/, this.script.buildScript('interop', [
|
|
184
|
+
'Runtime.SendTokens',
|
|
185
|
+
[_arguments[0], _arguments[1], _arguments[2], _arguments[3]],
|
|
186
|
+
])];
|
|
187
|
+
case 2:
|
|
188
|
+
sendFTScript = _b.sent();
|
|
189
|
+
this.signTransaction(sendFTScript, null, onSuccess, onFail);
|
|
190
|
+
return [3 /*break*/, 5];
|
|
191
|
+
case 3: return [4 /*yield*/, this.script.buildScript('interop', [
|
|
192
|
+
'Runtime.SendTokens',
|
|
193
|
+
[_arguments[0], _arguments[1], _arguments[2], _arguments[3]],
|
|
194
|
+
])];
|
|
195
|
+
case 4:
|
|
196
|
+
sendNFTScript = _b.sent();
|
|
197
|
+
this.signTransaction(sendNFTScript, null, onSuccess, onFail);
|
|
198
|
+
return [3 /*break*/, 5];
|
|
199
|
+
case 5: return [3 /*break*/, 7];
|
|
200
|
+
case 6:
|
|
201
|
+
console.log('%cWallet is not connected', 'color:red');
|
|
202
|
+
_b.label = 7;
|
|
203
|
+
case 7: return [2 /*return*/];
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
});
|
|
207
|
+
};
|
|
208
|
+
EasyConnect.prototype.signTransaction = function (script, payload, onSuccess, onFail) {
|
|
209
|
+
if (payload === void 0) { payload = null; }
|
|
210
|
+
if (onSuccess === void 0) { onSuccess = function (data) { }; }
|
|
211
|
+
if (onFail === void 0) { onFail = function (data) {
|
|
212
|
+
console.log('%cError: ' + data, 'color:red');
|
|
213
|
+
}; }
|
|
214
|
+
this.link.signTx(script, payload, onSuccess, onFail);
|
|
215
|
+
};
|
|
216
|
+
EasyConnect.prototype.signData = function (data, onSuccess, onFail) {
|
|
217
|
+
if (onSuccess === void 0) { onSuccess = function (data) { }; }
|
|
218
|
+
if (onFail === void 0) { onFail = function (data) {
|
|
219
|
+
console.log('%cError: ' + data, 'color:red');
|
|
220
|
+
}; }
|
|
221
|
+
this.link.signData(data, onSuccess, onFail);
|
|
222
|
+
};
|
|
223
|
+
EasyConnect.prototype.invokeScript = function (script, _callback) {
|
|
224
|
+
this.link.invokeScript(script, _callback);
|
|
225
|
+
};
|
|
226
|
+
EasyConnect.prototype.deployContract = function (script, payload, proofOfWork, onSuccess, onFail) {
|
|
227
|
+
if (payload === void 0) { payload = null; }
|
|
228
|
+
if (proofOfWork === void 0) { proofOfWork = ProofOfWork_1.ProofOfWork.Minimal; }
|
|
229
|
+
if (onSuccess === void 0) { onSuccess = function (data) { }; }
|
|
230
|
+
if (onFail === void 0) { onFail = function (data) {
|
|
231
|
+
console.log('%cError: ' + data, 'color:red');
|
|
232
|
+
}; }
|
|
233
|
+
this.link.signTx(script, payload, onSuccess, onFail, proofOfWork);
|
|
234
|
+
};
|
|
235
|
+
return EasyConnect;
|
|
236
|
+
}());
|
|
237
|
+
exports.EasyConnect = EasyConnect;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ScriptBuilder } from "../vm";
|
|
2
|
+
export declare enum Nexus {
|
|
3
|
+
Mainnet = "mainnet",
|
|
4
|
+
Simnet = "simnet",
|
|
5
|
+
Testnet = "testnet"
|
|
6
|
+
}
|
|
7
|
+
export declare class EasyScript {
|
|
8
|
+
nexus: Nexus;
|
|
9
|
+
sb: ScriptBuilder;
|
|
10
|
+
constructor(nexus?: Nexus);
|
|
11
|
+
buildScript(_type: string, _options?: Array<any>): string;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=easyScript.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easyScript.d.ts","sourceRoot":"","sources":["../../src/core/link/easyScript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,oBAAY,KAAK;IACf,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,OAAO,YAAY;CACpB;AAED,qBAAa,UAAU;IACrB,KAAK,EAAE,KAAK,CAAC;IACb,EAAE,EAAE,aAAa,CAAC;gBAEN,KAAK,GAAE,KAAqB;IAKxC,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,GAAE,KAAK,CAAC,GAAG,CAAU;CAiDzD"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EasyScript = exports.Nexus = void 0;
|
|
4
|
+
var vm_1 = require("../vm");
|
|
5
|
+
var Nexus;
|
|
6
|
+
(function (Nexus) {
|
|
7
|
+
Nexus["Mainnet"] = "mainnet";
|
|
8
|
+
Nexus["Simnet"] = "simnet";
|
|
9
|
+
Nexus["Testnet"] = "testnet";
|
|
10
|
+
})(Nexus = exports.Nexus || (exports.Nexus = {}));
|
|
11
|
+
var EasyScript = /** @class */ (function () {
|
|
12
|
+
function EasyScript(nexus) {
|
|
13
|
+
if (nexus === void 0) { nexus = Nexus.Mainnet; }
|
|
14
|
+
this.sb = new vm_1.ScriptBuilder();
|
|
15
|
+
this.nexus = nexus;
|
|
16
|
+
}
|
|
17
|
+
EasyScript.prototype.buildScript = function (_type, _options) {
|
|
18
|
+
if (_options === void 0) { _options = [null]; }
|
|
19
|
+
this.sb = new vm_1.ScriptBuilder();
|
|
20
|
+
switch (_type) {
|
|
21
|
+
case "interact":
|
|
22
|
+
var contractNameInteract = _options[0];
|
|
23
|
+
var methodNameInteract = _options[1];
|
|
24
|
+
var inputArgumentsInteract = _options[2];
|
|
25
|
+
return this.sb
|
|
26
|
+
.CallContract("gas", "AllowGas", [])
|
|
27
|
+
.CallContract(contractNameInteract, methodNameInteract, inputArgumentsInteract) //The Meat of the Script
|
|
28
|
+
.CallContract("gas", "SpendGas", [])
|
|
29
|
+
.EndScript();
|
|
30
|
+
break;
|
|
31
|
+
case "invoke":
|
|
32
|
+
var contractNameInvoke = _options[0];
|
|
33
|
+
var methodNameInvoke = _options[1];
|
|
34
|
+
var inputArgumentsInvoke = _options[2];
|
|
35
|
+
return this.sb
|
|
36
|
+
.CallContract(contractNameInvoke, methodNameInvoke, inputArgumentsInvoke) //The Meat of the Script
|
|
37
|
+
.EndScript();
|
|
38
|
+
break;
|
|
39
|
+
case "interop":
|
|
40
|
+
var interopNameInterop = _options[0];
|
|
41
|
+
var inputArgumentsInterop = _options[1];
|
|
42
|
+
return this.sb
|
|
43
|
+
.CallContract("gas", "AllowGas", [])
|
|
44
|
+
.CallInterop(interopNameInterop, inputArgumentsInterop)
|
|
45
|
+
.CallContract("gas", "SpendGas", [])
|
|
46
|
+
.EndScript();
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
return EasyScript;
|
|
51
|
+
}());
|
|
52
|
+
exports.EasyScript = EasyScript;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/link/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./interfaces"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Balance } from '../../rpc/interfaces/Balance';
|
|
2
|
+
import { IFile } from './IFile';
|
|
3
|
+
export interface IAccount {
|
|
4
|
+
alias: string;
|
|
5
|
+
name: string;
|
|
6
|
+
address: string;
|
|
7
|
+
avatar: string;
|
|
8
|
+
platform: string;
|
|
9
|
+
external: string;
|
|
10
|
+
balances: Balance[];
|
|
11
|
+
files: IFile[];
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=IAccount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAccount.d.ts","sourceRoot":"","sources":["../../../src/core/link/interfaces/IAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,KAAK,EAAE,KAAK,EAAE,CAAC;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IFile.d.ts","sourceRoot":"","sources":["../../../src/core/link/interfaces/IFile.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProofOfWork.d.ts","sourceRoot":"","sources":["../../../src/core/link/interfaces/ProofOfWork.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW;IACrB,IAAI,IAAI;IACR,OAAO,IAAI;IACX,QAAQ,KAAK;IACb,IAAI,KAAK;IACT,KAAK,KAAK;IACV,OAAO,KAAK;CACb"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProofOfWork = void 0;
|
|
4
|
+
var ProofOfWork;
|
|
5
|
+
(function (ProofOfWork) {
|
|
6
|
+
ProofOfWork[ProofOfWork["None"] = 0] = "None";
|
|
7
|
+
ProofOfWork[ProofOfWork["Minimal"] = 5] = "Minimal";
|
|
8
|
+
ProofOfWork[ProofOfWork["Moderate"] = 15] = "Moderate";
|
|
9
|
+
ProofOfWork[ProofOfWork["Hard"] = 19] = "Hard";
|
|
10
|
+
ProofOfWork[ProofOfWork["Heavy"] = 24] = "Heavy";
|
|
11
|
+
ProofOfWork[ProofOfWork["Extreme"] = 30] = "Extreme";
|
|
12
|
+
})(ProofOfWork = exports.ProofOfWork || (exports.ProofOfWork = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/link/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./IFile"), exports);
|
|
18
|
+
__exportStar(require("./IAccount"), exports);
|
|
19
|
+
__exportStar(require("./ProofOfWork"), exports);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ProofOfWork } from './interfaces/ProofOfWork';
|
|
2
|
+
import { IAccount } from './interfaces/IAccount';
|
|
3
|
+
export declare class PhantasmaLink {
|
|
4
|
+
host: string;
|
|
5
|
+
dapp: any;
|
|
6
|
+
onLogin: (succ: any) => void;
|
|
7
|
+
providerHint: any;
|
|
8
|
+
onError: (message: any) => void;
|
|
9
|
+
socket: any;
|
|
10
|
+
requestCallback: any;
|
|
11
|
+
token: any;
|
|
12
|
+
requestID: number;
|
|
13
|
+
account: IAccount;
|
|
14
|
+
wallet: any;
|
|
15
|
+
messageLogging: boolean;
|
|
16
|
+
version: number;
|
|
17
|
+
nexus: string;
|
|
18
|
+
chain: string;
|
|
19
|
+
platform: string;
|
|
20
|
+
constructor(dappID: any, logging?: boolean);
|
|
21
|
+
onMessage: (msg: string) => void;
|
|
22
|
+
login(onLoginCallback: (success: boolean) => void, onErrorCallback: (message: string) => void, version?: number, platform?: string, providerHint?: string): void;
|
|
23
|
+
invokeScript(script: string, callback: (message: string) => void): void;
|
|
24
|
+
signTx(script: any, payload: string | null, callback: (arg0: string) => void, onErrorCallback: () => void, pow?: ProofOfWork, signature?: string): void;
|
|
25
|
+
signTxSignature(tx: string, callback: (result: string) => void, onErrorCallback: () => void, signature?: string): void;
|
|
26
|
+
multiSig(subject: string, callback: (result: string) => void, onErrorCallback: () => void, signature?: string): void;
|
|
27
|
+
getPeer(callback: (result: string) => void, onErrorCallback: () => void): void;
|
|
28
|
+
fetchWallet(callback: (result: any) => void, onErrorCallback: (message: any) => void): void;
|
|
29
|
+
getNexus(callback: (message: any) => void, onErrorCallback: (message: any) => void): void;
|
|
30
|
+
getWalletVersion(callback: (message: any) => void, onErrorCallback: (message: any) => void): void;
|
|
31
|
+
signData(data: string, callback: (success: string) => void, onErrorCallback: (message: string) => void, signature?: string): void;
|
|
32
|
+
createSocket(isResume?: boolean): void;
|
|
33
|
+
toggleMessageLogging(): void;
|
|
34
|
+
resume(token: any): void;
|
|
35
|
+
retry(): void;
|
|
36
|
+
set dappID(dapp: any);
|
|
37
|
+
get dappID(): any;
|
|
38
|
+
sendLinkRequest(request: string, callback: (T: any) => void): void;
|
|
39
|
+
disconnect(triggered: string | boolean | undefined): void;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=phantasmaLink.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phantasmaLink.d.ts","sourceRoot":"","sources":["../../src/core/link/phantasmaLink.ts"],"names":[],"mappings":"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"}
|