@kynesyslabs/demosdk 2.3.1-8.1 → 2.3.1-8.2
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/build/abstraction/CoinFinder.js +67 -0
- package/build/abstraction/CoinFinder.js.map +1 -0
- package/build/abstraction/EvmCoinFinder.js +280 -0
- package/build/abstraction/EvmCoinFinder.js.map +1 -0
- package/build/abstraction/Identities.d.ts +9 -9
- package/build/abstraction/Identities.js +348 -0
- package/build/abstraction/Identities.js.map +1 -0
- package/build/abstraction/index.d.ts +1 -1
- package/build/abstraction/index.js +16 -1
- package/build/abstraction/index.js.map +1 -0
- package/build/abstraction/providers/AbstractionProviders.js +65 -0
- package/build/abstraction/providers/AbstractionProviders.js.map +1 -0
- package/build/abstraction/providers/CoinAddresses.js +232 -0
- package/build/abstraction/providers/CoinAddresses.js.map +1 -0
- package/build/abstraction/providers/Providers.js +22 -0
- package/build/abstraction/providers/Providers.js.map +1 -0
- package/build/abstraction/providers/evm/ankr.js +36 -0
- package/build/abstraction/providers/evm/ankr.js.map +1 -0
- package/build/abstraction/providers/evm/arbitrum.js +23 -0
- package/build/abstraction/providers/evm/arbitrum.js.map +1 -0
- package/build/abstraction/providers/evm/bsc.js +27 -0
- package/build/abstraction/providers/evm/bsc.js.map +1 -0
- package/build/abstraction/providers/evm/ethereum.js +32 -0
- package/build/abstraction/providers/evm/ethereum.js.map +1 -0
- package/build/abstraction/providers/evm/index.js +15 -0
- package/build/abstraction/providers/evm/index.js.map +1 -0
- package/build/abstraction/providers/evm/optimism.js +27 -0
- package/build/abstraction/providers/evm/optimism.js.map +1 -0
- package/build/abstraction/providers/index.js +10 -0
- package/build/abstraction/providers/index.js.map +1 -0
- package/build/abstraction/providers/non-evm/bitcoin.js +23 -0
- package/build/abstraction/providers/non-evm/bitcoin.js.map +1 -0
- package/build/abstraction/providers/non-evm/index.js +15 -0
- package/build/abstraction/providers/non-evm/index.js.map +1 -0
- package/build/abstraction/providers/non-evm/multiversx.js +23 -0
- package/build/abstraction/providers/non-evm/multiversx.js.map +1 -0
- package/build/abstraction/providers/non-evm/solana.js +24 -0
- package/build/abstraction/providers/non-evm/solana.js.map +1 -0
- package/build/abstraction/providers/non-evm/xrp.js +23 -0
- package/build/abstraction/providers/non-evm/xrp.js.map +1 -0
- package/build/bridge/index.d.ts +2 -2
- package/build/bridge/index.js +27 -1
- package/build/bridge/index.js.map +1 -0
- package/build/bridge/nativeBridge.d.ts +3 -3
- package/build/bridge/nativeBridge.js +108 -0
- package/build/bridge/nativeBridge.js.map +1 -0
- package/build/bridge/nativeBridgeTypes.js +35 -0
- package/build/bridge/nativeBridgeTypes.js.map +1 -0
- package/build/bridge/rubicBridge.d.ts +3 -3
- package/build/bridge/rubicBridge.js +45 -0
- package/build/bridge/rubicBridge.js.map +1 -0
- package/build/demoswork/executor/index.js +21 -0
- package/build/demoswork/executor/index.js.map +1 -0
- package/build/demoswork/executor/stepexecutor.js +53 -0
- package/build/demoswork/executor/stepexecutor.js.map +1 -0
- package/build/demoswork/index.js +27 -1
- package/build/demoswork/index.js.map +1 -0
- package/build/demoswork/operations/baseoperation.d.ts +1 -1
- package/build/demoswork/operations/baseoperation.js +29 -0
- package/build/demoswork/operations/baseoperation.js.map +1 -0
- package/build/demoswork/operations/conditional/condition.d.ts +5 -5
- package/build/demoswork/operations/conditional/condition.js +54 -0
- package/build/demoswork/operations/conditional/condition.js.map +1 -0
- package/build/demoswork/operations/conditional/index.d.ts +4 -4
- package/build/demoswork/operations/conditional/index.js +110 -0
- package/build/demoswork/operations/conditional/index.js.map +1 -0
- package/build/demoswork/operations/index.d.ts +2 -2
- package/build/demoswork/operations/index.js +65 -0
- package/build/demoswork/operations/index.js.map +1 -0
- package/build/demoswork/utils/createTestWorkScript.d.ts +1 -1
- package/build/demoswork/utils/createTestWorkScript.js +64 -0
- package/build/demoswork/utils/createTestWorkScript.js.map +1 -0
- package/build/demoswork/utils/index.js +61 -0
- package/build/demoswork/utils/index.js.map +1 -0
- package/build/demoswork/validator/index.d.ts +1 -1
- package/build/demoswork/validator/index.js +43 -0
- package/build/demoswork/validator/index.js.map +1 -0
- package/build/demoswork/validator/steps.validator.d.ts +1 -1
- package/build/demoswork/validator/steps.validator.js +77 -0
- package/build/demoswork/validator/steps.validator.js.map +1 -0
- package/build/demoswork/work.d.ts +3 -3
- package/build/demoswork/work.js +77 -0
- package/build/demoswork/work.js.map +1 -0
- package/build/demoswork/workstep.d.ts +3 -3
- package/build/demoswork/workstep.js +88 -0
- package/build/demoswork/workstep.js.map +1 -0
- package/build/encryption/Cryptography.js +271 -0
- package/build/encryption/Cryptography.js.map +1 -0
- package/build/encryption/FHE/index.js +28 -0
- package/build/encryption/FHE/index.js.map +1 -0
- package/build/encryption/Hashing.js +30 -0
- package/build/encryption/Hashing.js.map +1 -0
- package/build/encryption/PQC/enigma.js +249 -0
- package/build/encryption/PQC/enigma.js.map +1 -0
- package/build/encryption/PQC/falconts/falcon.js +228 -0
- package/build/encryption/PQC/falconts/falcon.js.map +1 -0
- package/build/encryption/PQC/falconts/index.js +19 -0
- package/build/encryption/PQC/falconts/index.js.map +1 -0
- package/build/encryption/PQC/falconts/mnemonic.js +109 -0
- package/build/encryption/PQC/falconts/mnemonic.js.map +1 -0
- package/build/encryption/PQC/falconts/wordlist.js +216 -0
- package/build/encryption/PQC/falconts/wordlist.js.map +1 -0
- package/build/encryption/PQC/utils.js +16 -0
- package/build/encryption/PQC/utils.js.map +1 -0
- package/build/encryption/index.js +51 -1
- package/build/encryption/index.js.map +1 -0
- package/build/encryption/unifiedCrypto.d.ts +1 -1
- package/build/encryption/unifiedCrypto.js +409 -0
- package/build/encryption/unifiedCrypto.js.map +1 -0
- package/build/encryption/zK/index.js +38 -0
- package/build/encryption/zK/index.js.map +1 -0
- package/build/encryption/zK/interactive/index.js +43 -0
- package/build/encryption/zK/interactive/index.js.map +1 -0
- package/build/encryption/zK/primer.js +69 -0
- package/build/encryption/zK/primer.js.map +1 -0
- package/build/index.d.ts +0 -14
- package/build/index.js +20 -1
- package/build/index.js.map +1 -0
- package/build/instant_messaging/index.js +675 -0
- package/build/instant_messaging/index.js.map +1 -0
- package/build/l2ps/index.js +9 -1
- package/build/l2ps/index.js.map +1 -0
- package/build/l2ps/l2ps.d.ts +1 -1
- package/build/l2ps/l2ps.js +312 -0
- package/build/l2ps/l2ps.js.map +1 -0
- package/build/multichain/core/aptos.d.ts +1 -1
- package/build/multichain/core/aptos.js +554 -0
- package/build/multichain/core/aptos.js.map +1 -0
- package/build/multichain/core/btc.d.ts +2 -2
- package/build/multichain/core/btc.js +409 -0
- package/build/multichain/core/btc.js.map +1 -0
- package/build/multichain/core/evm.js +359 -0
- package/build/multichain/core/evm.js.map +1 -0
- package/build/multichain/core/ibc.js +269 -0
- package/build/multichain/core/ibc.js.map +1 -0
- package/build/multichain/core/index.js +29 -1
- package/build/multichain/core/index.js.map +1 -0
- package/build/multichain/core/multiversx.d.ts +1 -1
- package/build/multichain/core/multiversx.js +173 -0
- package/build/multichain/core/multiversx.js.map +1 -0
- package/build/multichain/core/near.js +214 -0
- package/build/multichain/core/near.js.map +1 -0
- package/build/multichain/core/solana.js +246 -0
- package/build/multichain/core/solana.js.map +1 -0
- package/build/multichain/core/ten.js +142 -0
- package/build/multichain/core/ten.js.map +1 -0
- package/build/multichain/core/ton.js +142 -0
- package/build/multichain/core/ton.js.map +1 -0
- package/build/multichain/core/types/SolanaPhantomProvider.js +5 -0
- package/build/multichain/core/types/SolanaPhantomProvider.js.map +1 -0
- package/build/multichain/core/types/defaultChain.js +83 -0
- package/build/multichain/core/types/defaultChain.js.map +1 -0
- package/build/multichain/core/types/interfaces.js +9 -0
- package/build/multichain/core/types/interfaces.js.map +1 -0
- package/build/multichain/core/utils.js +21 -0
- package/build/multichain/core/utils.js.map +1 -0
- package/build/multichain/core/xrp.d.ts +1 -1
- package/build/multichain/core/xrp.js +191 -0
- package/build/multichain/core/xrp.js.map +1 -0
- package/build/multichain/index.js +40 -0
- package/build/multichain/index.js.map +1 -0
- package/build/multichain/localsdk/aptos.js +192 -0
- package/build/multichain/localsdk/aptos.js.map +1 -0
- package/build/multichain/localsdk/btc.d.ts +1 -1
- package/build/multichain/localsdk/btc.js +89 -0
- package/build/multichain/localsdk/btc.js.map +1 -0
- package/build/multichain/localsdk/evm.d.ts +1 -1
- package/build/multichain/localsdk/evm.js +59 -0
- package/build/multichain/localsdk/evm.js.map +1 -0
- package/build/multichain/localsdk/ibc.d.ts +1 -1
- package/build/multichain/localsdk/ibc.js +26 -0
- package/build/multichain/localsdk/ibc.js.map +1 -0
- package/build/multichain/localsdk/index.js +22 -1
- package/build/multichain/localsdk/index.js.map +1 -0
- package/build/multichain/localsdk/multiversx.d.ts +1 -1
- package/build/multichain/localsdk/multiversx.js +52 -0
- package/build/multichain/localsdk/multiversx.js.map +1 -0
- package/build/multichain/localsdk/near.js +34 -0
- package/build/multichain/localsdk/near.js.map +1 -0
- package/build/multichain/localsdk/solana.js +32 -0
- package/build/multichain/localsdk/solana.js.map +1 -0
- package/build/multichain/localsdk/ten.js +66 -0
- package/build/multichain/localsdk/ten.js.map +1 -0
- package/build/multichain/localsdk/ton.d.ts +1 -1
- package/build/multichain/localsdk/ton.js +34 -0
- package/build/multichain/localsdk/ton.js.map +1 -0
- package/build/multichain/localsdk/xrp.d.ts +1 -1
- package/build/multichain/localsdk/xrp.js +88 -0
- package/build/multichain/localsdk/xrp.js.map +1 -0
- package/build/multichain/websdk/aptos.js +289 -0
- package/build/multichain/websdk/aptos.js.map +1 -0
- package/build/multichain/websdk/btc.d.ts +1 -1
- package/build/multichain/websdk/btc.js +11 -0
- package/build/multichain/websdk/btc.js.map +1 -0
- package/build/multichain/websdk/evm.d.ts +1 -1
- package/build/multichain/websdk/evm.js +11 -0
- package/build/multichain/websdk/evm.js.map +1 -0
- package/build/multichain/websdk/ibc.d.ts +1 -1
- package/build/multichain/websdk/ibc.js +12 -0
- package/build/multichain/websdk/ibc.js.map +1 -0
- package/build/multichain/websdk/index.js +22 -1
- package/build/multichain/websdk/index.js.map +1 -0
- package/build/multichain/websdk/multiversx.d.ts +1 -1
- package/build/multichain/websdk/multiversx.js +69 -0
- package/build/multichain/websdk/multiversx.js.map +1 -0
- package/build/multichain/websdk/near.js +12 -0
- package/build/multichain/websdk/near.js.map +1 -0
- package/build/multichain/websdk/solana.d.ts +1 -1
- package/build/multichain/websdk/solana.js +92 -0
- package/build/multichain/websdk/solana.js.map +1 -0
- package/build/multichain/websdk/ton.js +8 -0
- package/build/multichain/websdk/ton.js.map +1 -0
- package/build/multichain/websdk/xrp.d.ts +1 -1
- package/build/multichain/websdk/xrp.js +11 -0
- package/build/multichain/websdk/xrp.js.map +1 -0
- package/build/types/abstraction/index.js +4 -0
- package/build/types/abstraction/index.js.map +1 -0
- package/build/types/blockchain/Confirmation.js +23 -0
- package/build/types/blockchain/Confirmation.js.map +1 -0
- package/build/types/blockchain/GCREdit.js +5 -0
- package/build/types/blockchain/GCREdit.js.map +1 -0
- package/build/types/blockchain/ISignature.js +3 -0
- package/build/types/blockchain/ISignature.js.map +1 -0
- package/build/types/blockchain/Transaction.d.ts +2 -2
- package/build/types/blockchain/Transaction.js +19 -0
- package/build/types/blockchain/Transaction.js.map +1 -0
- package/build/types/blockchain/TransactionSubtypes/CrosschainTransaction.d.ts +1 -1
- package/build/types/blockchain/TransactionSubtypes/CrosschainTransaction.js +3 -0
- package/build/types/blockchain/TransactionSubtypes/CrosschainTransaction.js.map +1 -0
- package/build/types/blockchain/TransactionSubtypes/DemosworkTransaction.d.ts +1 -1
- package/build/types/blockchain/TransactionSubtypes/DemosworkTransaction.js +3 -0
- package/build/types/blockchain/TransactionSubtypes/DemosworkTransaction.js.map +1 -0
- package/build/types/blockchain/TransactionSubtypes/IdentityTransaction.d.ts +1 -1
- package/build/types/blockchain/TransactionSubtypes/IdentityTransaction.js +3 -0
- package/build/types/blockchain/TransactionSubtypes/IdentityTransaction.js.map +1 -0
- package/build/types/blockchain/TransactionSubtypes/InstantMessagingTransaction.d.ts +1 -1
- package/build/types/blockchain/TransactionSubtypes/InstantMessagingTransaction.js +3 -0
- package/build/types/blockchain/TransactionSubtypes/InstantMessagingTransaction.js.map +1 -0
- package/build/types/blockchain/TransactionSubtypes/L2PSHashTransaction.js +3 -0
- package/build/types/blockchain/TransactionSubtypes/L2PSHashTransaction.js.map +1 -0
- package/build/types/blockchain/TransactionSubtypes/L2PSTransaction.d.ts +1 -1
- package/build/types/blockchain/TransactionSubtypes/L2PSTransaction.js +3 -0
- package/build/types/blockchain/TransactionSubtypes/L2PSTransaction.js.map +1 -0
- package/build/types/blockchain/TransactionSubtypes/NativeBridgeTransaction.d.ts +1 -1
- package/build/types/blockchain/TransactionSubtypes/NativeBridgeTransaction.js +3 -0
- package/build/types/blockchain/TransactionSubtypes/NativeBridgeTransaction.js.map +1 -0
- package/build/types/blockchain/TransactionSubtypes/NativeTransaction.d.ts +1 -1
- package/build/types/blockchain/TransactionSubtypes/NativeTransaction.js +3 -0
- package/build/types/blockchain/TransactionSubtypes/NativeTransaction.js.map +1 -0
- package/build/types/blockchain/TransactionSubtypes/SmartContractTransaction.js +3 -0
- package/build/types/blockchain/TransactionSubtypes/SmartContractTransaction.js.map +1 -0
- package/build/types/blockchain/TransactionSubtypes/StorageTransaction.js +3 -0
- package/build/types/blockchain/TransactionSubtypes/StorageTransaction.js.map +1 -0
- package/build/types/blockchain/TransactionSubtypes/Web2Transaction.d.ts +1 -1
- package/build/types/blockchain/TransactionSubtypes/Web2Transaction.js +3 -0
- package/build/types/blockchain/TransactionSubtypes/Web2Transaction.js.map +1 -0
- package/build/types/blockchain/TransactionSubtypes/index.js +27 -0
- package/build/types/blockchain/TransactionSubtypes/index.js.map +1 -0
- package/build/types/blockchain/TransactionSubtypes/utils.js +42 -0
- package/build/types/blockchain/TransactionSubtypes/utils.js.map +1 -0
- package/build/types/blockchain/TxFee.js +3 -0
- package/build/types/blockchain/TxFee.js.map +1 -0
- package/build/types/blockchain/ValidityData.js +8 -0
- package/build/types/blockchain/ValidityData.js.map +1 -0
- package/build/types/blockchain/WalletTypes.js +3 -0
- package/build/types/blockchain/WalletTypes.js.map +1 -0
- package/build/types/blockchain/address.js +3 -0
- package/build/types/blockchain/address.js.map +1 -0
- package/build/types/blockchain/addressInfo.js +3 -0
- package/build/types/blockchain/addressInfo.js.map +1 -0
- package/build/types/blockchain/blocks.d.ts +2 -2
- package/build/types/blockchain/blocks.js +13 -0
- package/build/types/blockchain/blocks.js.map +1 -0
- package/build/types/blockchain/encryptedTransaction.js +3 -0
- package/build/types/blockchain/encryptedTransaction.js.map +1 -0
- package/build/types/blockchain/genesisTypes.js +4 -0
- package/build/types/blockchain/genesisTypes.js.map +1 -0
- package/build/types/blockchain/identities.js +14 -0
- package/build/types/blockchain/identities.js.map +1 -0
- package/build/types/blockchain/rawTransaction.js +13 -0
- package/build/types/blockchain/rawTransaction.js.map +1 -0
- package/build/types/blockchain/statusNative.js +3 -0
- package/build/types/blockchain/statusNative.js.map +1 -0
- package/build/types/blockchain/statusProperties.js +3 -0
- package/build/types/blockchain/statusProperties.js.map +1 -0
- package/build/types/bridge/bridgeTradePayload.js +3 -0
- package/build/types/bridge/bridgeTradePayload.js.map +1 -0
- package/build/types/bridge/constants.js +91 -0
- package/build/types/bridge/constants.js.map +1 -0
- package/build/types/communication/demosWork.js +3 -0
- package/build/types/communication/demosWork.js.map +1 -0
- package/build/types/communication/rpc.js +11 -0
- package/build/types/communication/rpc.js.map +1 -0
- package/build/types/communication/transmit.js +13 -0
- package/build/types/communication/transmit.js.map +1 -0
- package/build/types/cryptography.js +3 -0
- package/build/types/cryptography.js.map +1 -0
- package/build/types/demoswork/datatypes.js +10 -0
- package/build/types/demoswork/datatypes.js.map +1 -0
- package/build/types/demoswork/index.d.ts +1 -1
- package/build/types/demoswork/index.js +3 -0
- package/build/types/demoswork/index.js.map +1 -0
- package/build/types/demoswork/operations.d.ts +1 -1
- package/build/types/demoswork/operations.js +3 -0
- package/build/types/demoswork/operations.js.map +1 -0
- package/build/types/demoswork/steps.d.ts +2 -2
- package/build/types/demoswork/steps.js +21 -0
- package/build/types/demoswork/steps.js.map +1 -0
- package/build/types/gls/Operation.js +3 -0
- package/build/types/gls/Operation.js.map +1 -0
- package/build/types/gls/StateChange.js +13 -0
- package/build/types/gls/StateChange.js.map +1 -0
- package/build/types/index.js +24 -0
- package/build/types/index.js.map +1 -0
- package/build/types/instantMessaging/index.js +3 -0
- package/build/types/instantMessaging/index.js.map +1 -0
- package/build/types/native/INativePayload.js +4 -0
- package/build/types/native/INativePayload.js.map +1 -0
- package/build/types/native/index.js +18 -0
- package/build/types/native/index.js.map +1 -0
- package/build/types/network/ExecutionResult.js +3 -0
- package/build/types/network/ExecutionResult.js.map +1 -0
- package/build/types/network/SecurityTypes.js +3 -0
- package/build/types/network/SecurityTypes.js.map +1 -0
- package/build/types/peers/Peer.js +13 -0
- package/build/types/peers/Peer.js.map +1 -0
- package/build/types/web2/index.js +9 -0
- package/build/types/web2/index.js.map +1 -0
- package/build/types/web2/telegram.js +6 -0
- package/build/types/web2/telegram.js.map +1 -0
- package/build/types/web2/twitter.js +3 -0
- package/build/types/web2/twitter.js.map +1 -0
- package/build/types/xm/apiTools.js +3 -0
- package/build/types/xm/apiTools.js.map +1 -0
- package/build/types/xm/index.js +3 -0
- package/build/types/xm/index.js.map +1 -0
- package/build/utils/dataManipulation.js +37 -0
- package/build/utils/dataManipulation.js.map +1 -0
- package/build/utils/getRemoteIP.js +19 -0
- package/build/utils/getRemoteIP.js.map +1 -0
- package/build/utils/index.js +55 -1
- package/build/utils/index.js.map +1 -0
- package/build/utils/pprint.js +17 -0
- package/build/utils/pprint.js.map +1 -0
- package/build/utils/uint8Serialize.js +22 -0
- package/build/utils/uint8Serialize.js.map +1 -0
- package/build/wallet/Wallet.d.ts +3 -3
- package/build/wallet/Wallet.js +120 -0
- package/build/wallet/Wallet.js.map +1 -0
- package/build/wallet/index.js +38 -1
- package/build/wallet/index.js.map +1 -0
- package/build/wallet/passkeys/passkeys.js +60 -0
- package/build/wallet/passkeys/passkeys.js.map +1 -0
- package/build/websdk/DemosTransactions.d.ts +2 -2
- package/build/websdk/DemosTransactions.js +298 -0
- package/build/websdk/DemosTransactions.js.map +1 -0
- package/build/websdk/DemosWebAuth.js +187 -0
- package/build/websdk/DemosWebAuth.js.map +1 -0
- package/build/websdk/GCRGeneration.d.ts +2 -2
- package/build/websdk/GCRGeneration.js +237 -0
- package/build/websdk/GCRGeneration.js.map +1 -0
- package/build/websdk/Web2Calls.d.ts +1 -1
- package/build/websdk/Web2Calls.js +107 -0
- package/build/websdk/Web2Calls.js.map +1 -0
- package/build/websdk/XMTransactions.d.ts +1 -1
- package/build/websdk/XMTransactions.js +150 -0
- package/build/websdk/XMTransactions.js.map +1 -0
- package/build/websdk/bridge.d.ts +3 -3
- package/build/websdk/bridge.js +46 -0
- package/build/websdk/bridge.js.map +1 -0
- package/build/websdk/demos.js +11 -0
- package/build/websdk/demos.js.map +1 -0
- package/build/websdk/demosclass.d.ts +5 -5
- package/build/websdk/demosclass.js +734 -0
- package/build/websdk/demosclass.js.map +1 -0
- package/build/websdk/examples/tryWeb2.js +81 -0
- package/build/websdk/examples/tryWeb2.js.map +1 -0
- package/build/websdk/index.js +70 -1
- package/build/websdk/index.js.map +1 -0
- package/build/websdk/rsa.js +86 -0
- package/build/websdk/rsa.js.map +1 -0
- package/build/websdk/types/IBuffer.js +3 -0
- package/build/websdk/types/IBuffer.js.map +1 -0
- package/build/websdk/types/KeyPair.js +3 -0
- package/build/websdk/types/KeyPair.js.map +1 -0
- package/build/websdk/utils/bufferizer.js +18 -0
- package/build/websdk/utils/bufferizer.js.map +1 -0
- package/build/websdk/utils/forge_converter.js +61 -0
- package/build/websdk/utils/forge_converter.js.map +1 -0
- package/build/websdk/utils/required.js +47 -0
- package/build/websdk/utils/required.js.map +1 -0
- package/build/websdk/utils/sha256.js +18 -0
- package/build/websdk/utils/sha256.js.map +1 -0
- package/build/websdk/utils/skeletons.d.ts +1 -1
- package/build/websdk/utils/skeletons.js +70 -0
- package/build/websdk/utils/skeletons.js.map +1 -0
- package/package.json +2 -15
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CoinFinder = void 0;
|
|
4
|
+
const CoinAddresses_1 = require("./providers/CoinAddresses");
|
|
5
|
+
/**
|
|
6
|
+
* Class for finding wrapped tokens on various chains
|
|
7
|
+
*/
|
|
8
|
+
class CoinFinder {
|
|
9
|
+
static validateChain(chain) {
|
|
10
|
+
if (!Object.values(CoinAddresses_1.BaseChain).includes(chain)) {
|
|
11
|
+
throw new Error(`Invalid chain: ${chain}`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Finds the wrapped token address for a given source chain on a target chain
|
|
16
|
+
* @param {BaseChain} sourceChain The chain whose token we want to find (e.g., BITCOIN, SOLANA)
|
|
17
|
+
* @param {BaseChain} targetChain The chain where we want to find the wrapped token
|
|
18
|
+
* @returns {Promise<string | false>} The wrapped token address or false if not found
|
|
19
|
+
*/
|
|
20
|
+
static async findWrappedToken(sourceChain, targetChain) {
|
|
21
|
+
this.validateChain(sourceChain);
|
|
22
|
+
this.validateChain(targetChain);
|
|
23
|
+
return (CoinAddresses_1.tokenAddresses[sourceChain].wrapped?.[targetChain]?.mainnet || false);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Gets the native token address for any supported chain
|
|
27
|
+
* @param {SupportedChain} chain The supported chain to find the native address for (e.g., "ethereum_mainnet")
|
|
28
|
+
* @param {number} targetChainId The chain ID to find the native address for (e.g., 1 for Ethereum mainnet)
|
|
29
|
+
* @returns {string} The native token address for the given chain ID
|
|
30
|
+
* @throws {Error} If chain ID doesn't match the chain or if chain is unsupported
|
|
31
|
+
*/
|
|
32
|
+
static getNativeForSupportedChain(chain, targetChainId = 1) {
|
|
33
|
+
const [chainType, networkType] = chain.split("_");
|
|
34
|
+
// Handle EVM chains
|
|
35
|
+
switch (chainType) {
|
|
36
|
+
case CoinAddresses_1.BaseChain.ETHEREUM:
|
|
37
|
+
case CoinAddresses_1.BaseChain.BSC:
|
|
38
|
+
case CoinAddresses_1.BaseChain.ARBITRUM:
|
|
39
|
+
case CoinAddresses_1.BaseChain.OPTIMISM:
|
|
40
|
+
// Validate chain ID matches the chain
|
|
41
|
+
const chainIdMap = {
|
|
42
|
+
[CoinAddresses_1.BaseChain.ETHEREUM]: CoinAddresses_1.chainIds.eth.mainnet,
|
|
43
|
+
[CoinAddresses_1.BaseChain.BSC]: CoinAddresses_1.chainIds.bsc.mainnet,
|
|
44
|
+
[CoinAddresses_1.BaseChain.ARBITRUM]: CoinAddresses_1.chainIds.arbitrum.mainnet,
|
|
45
|
+
[CoinAddresses_1.BaseChain.OPTIMISM]: CoinAddresses_1.chainIds.optimism.mainnet,
|
|
46
|
+
};
|
|
47
|
+
if (targetChainId !== chainIdMap[chainType]) {
|
|
48
|
+
throw new Error(`Chain ID doesn't match ${chainType}`);
|
|
49
|
+
}
|
|
50
|
+
return CoinAddresses_1.tokenAddresses.ethereum[networkType];
|
|
51
|
+
// Handle non-EVM chains
|
|
52
|
+
case CoinAddresses_1.BaseChain.SOLANA:
|
|
53
|
+
case CoinAddresses_1.BaseChain.MULTIVERSX:
|
|
54
|
+
case CoinAddresses_1.BaseChain.XRP:
|
|
55
|
+
case CoinAddresses_1.BaseChain.BITCOIN:
|
|
56
|
+
case CoinAddresses_1.BaseChain.TON:
|
|
57
|
+
if (targetChainId !== 1) {
|
|
58
|
+
throw new Error("Non-EVM chains only support targetChainId 1");
|
|
59
|
+
}
|
|
60
|
+
return CoinAddresses_1.tokenAddresses[chainType][networkType];
|
|
61
|
+
default:
|
|
62
|
+
throw new Error(`Unsupported chain: ${chain}`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.CoinFinder = CoinFinder;
|
|
67
|
+
//# sourceM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BAAQ,CAAC,GAAG,CAAC,OAAO;oBACrC,CAAC,yBAAS,CAAC,QAAQ,CAAC,EAAE,wBAAQ,CAAC,QAAQ,CAAC,OAAO;oBAC/C,CAAC,yBAAS,CAAC,QAAQ,CAAC,EAAE,wBAAQ,CAAC,QAAQ,CAAC,OAAO;iBAClD,CAAA;gBACD,IAAI,aAAa,KAAK,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;oBAC1C,MAAM,IAAI,KAAK,CAAC,0BAA0B,SAAS,EAAE,CAAC,CAAA;gBAC1D,CAAC;gBACD,OAAO,8BAAc,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAA;YAE/C,wBAAwB;YACxB,KAAK,yBAAS,CAAC,MAAM,CAAC;YACtB,KAAK,yBAAS,CAAC,UAAU,CAAC;YAC1B,KAAK,yBAAS,CAAC,GAAG,CAAC;YACnB,KAAK,yBAAS,CAAC,OAAO,CAAC;YACvB,KAAK,yBAAS,CAAC,GAAG;gBACd,IAAI,aAAa,KAAK,CAAC,EAAE,CAAC;oBACtB,MAAM,IAAI,KAAK,CACX,6CAA6C,CAChD,CAAA;gBACL,CAAC;gBACD,OAAO,8BAAc,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAA;YAEjD;gBACI,MAAM,IAAI,KAAK,CAAC,sBAAsB,KAAK,EAAE,CAAC,CAAA;QACtD,CAAC;IACL,CAAC;CACJ;AA3ED,gCA2EC"}
|
|
@@ -0,0 +1,280 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.EvmCoinFinder = exports.EvmError = void 0;
|
|
40
|
+
const providers_1 = __importDefault(require("./providers"));
|
|
41
|
+
const CoinAddresses_1 = require("./providers/CoinAddresses");
|
|
42
|
+
const ethers = __importStar(require("ethers"));
|
|
43
|
+
/**
|
|
44
|
+
* Error class for EVM coin finder
|
|
45
|
+
* @extends Error
|
|
46
|
+
* @param {string} message - The error message
|
|
47
|
+
* @param {string} code - The error code
|
|
48
|
+
* @param {any} details - The error details
|
|
49
|
+
*/
|
|
50
|
+
class EvmError extends Error {
|
|
51
|
+
constructor(message, code, details) {
|
|
52
|
+
super(message);
|
|
53
|
+
this.code = code;
|
|
54
|
+
this.details = details;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.EvmError = EvmError;
|
|
58
|
+
/**
|
|
59
|
+
* Class for finding wrapped tokens on EVM chains
|
|
60
|
+
* @throws {EvmError} With code 'UNSUPPORTED_CHAIN_ID' if chain ID is not supported
|
|
61
|
+
* @throws {EvmError} With code 'INVALID_ADDRESS' if token address is invalid
|
|
62
|
+
* @throws {EvmError} With code 'CONTRACT_NOT_FOUND' if token contract doesn't exist
|
|
63
|
+
*/
|
|
64
|
+
class EvmCoinFinder {
|
|
65
|
+
static getChainName(chainId) {
|
|
66
|
+
switch (chainId) {
|
|
67
|
+
case CoinAddresses_1.chainIds.eth.mainnet:
|
|
68
|
+
return CoinAddresses_1.BaseChain.ETHEREUM;
|
|
69
|
+
case CoinAddresses_1.chainIds.bsc.mainnet:
|
|
70
|
+
return CoinAddresses_1.BaseChain.BSC;
|
|
71
|
+
case CoinAddresses_1.chainIds.arbitrum.mainnet:
|
|
72
|
+
return CoinAddresses_1.BaseChain.ARBITRUM;
|
|
73
|
+
case CoinAddresses_1.chainIds.optimism.mainnet:
|
|
74
|
+
return CoinAddresses_1.BaseChain.OPTIMISM;
|
|
75
|
+
default:
|
|
76
|
+
throw new Error(`Unsupported chain ID: ${chainId}`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
static isValidAddress(address) {
|
|
80
|
+
return ethers.isAddress(address);
|
|
81
|
+
}
|
|
82
|
+
static getChainNameFromId(chainId) {
|
|
83
|
+
switch (chainId) {
|
|
84
|
+
case CoinAddresses_1.chainIds.eth.mainnet:
|
|
85
|
+
return CoinAddresses_1.BaseChain.ETHEREUM;
|
|
86
|
+
case CoinAddresses_1.chainIds.bsc.mainnet:
|
|
87
|
+
return CoinAddresses_1.BaseChain.BSC;
|
|
88
|
+
case CoinAddresses_1.chainIds.arbitrum.mainnet:
|
|
89
|
+
return CoinAddresses_1.BaseChain.ARBITRUM;
|
|
90
|
+
case CoinAddresses_1.chainIds.optimism.mainnet:
|
|
91
|
+
return CoinAddresses_1.BaseChain.OPTIMISM;
|
|
92
|
+
default:
|
|
93
|
+
return undefined;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
static async getRandomProvider(chainId) {
|
|
97
|
+
// Filter out Flashbots and Payload RPCs
|
|
98
|
+
const rpcUrls = providers_1.default.evm[chainId.toString()].filter(url => !url.includes("flashbots.net") && !url.includes("payload.de"));
|
|
99
|
+
if (!rpcUrls || rpcUrls.length === 0) {
|
|
100
|
+
throw new Error(`No providers found for chain ${chainId}`);
|
|
101
|
+
}
|
|
102
|
+
// Shuffle RPC URLs to try them in random order
|
|
103
|
+
const shuffledUrls = [...rpcUrls].sort(() => Math.random() - 0.5);
|
|
104
|
+
// Try each RPC until one works
|
|
105
|
+
for (const rpcUrl of shuffledUrls) {
|
|
106
|
+
try {
|
|
107
|
+
// Create ethers provider
|
|
108
|
+
const provider = new ethers.JsonRpcProvider(rpcUrl, undefined, {
|
|
109
|
+
staticNetwork: true, // Prevent network detection
|
|
110
|
+
});
|
|
111
|
+
await provider.getNetwork(); // Test the connection
|
|
112
|
+
return provider;
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
console.warn(`Failed to connect to RPC ${rpcUrl}:`, error);
|
|
116
|
+
continue; // Try next RPC
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
throw new Error(`All RPC providers failed for chain ${chainId}`);
|
|
120
|
+
}
|
|
121
|
+
static validateChainId(chainId) {
|
|
122
|
+
if (!Object.values(CoinAddresses_1.chainIds).some(chain => Object.values(chain).includes(chainId))) {
|
|
123
|
+
throw new EvmError(`Unsupported chain ID: ${chainId}`, "UNSUPPORTED_CHAIN_ID");
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Finds native ETH and WETH addresses for given chain IDs
|
|
128
|
+
* @param {SupportedChainId[]} targetChainIds - Array of supported chain IDs
|
|
129
|
+
* @returns {Promise<Record<SupportedChainId, EvmTokenPair>>}
|
|
130
|
+
* @throws {EvmError} With code 'UNSUPPORTED_CHAIN_ID' if any chain ID is not supported
|
|
131
|
+
*/
|
|
132
|
+
static async findNativeEth(targetChainIds) {
|
|
133
|
+
const result = {};
|
|
134
|
+
for (const chainId of targetChainIds) {
|
|
135
|
+
this.validateChainId(chainId);
|
|
136
|
+
let weth;
|
|
137
|
+
switch (chainId) {
|
|
138
|
+
case CoinAddresses_1.chainIds.eth.mainnet:
|
|
139
|
+
weth = CoinAddresses_1.tokenAddresses.ethereum.wrapped.ethereum.mainnet;
|
|
140
|
+
break;
|
|
141
|
+
case CoinAddresses_1.chainIds.bsc.mainnet:
|
|
142
|
+
weth = CoinAddresses_1.tokenAddresses.ethereum.wrapped.bsc.mainnet;
|
|
143
|
+
break;
|
|
144
|
+
case CoinAddresses_1.chainIds.arbitrum.mainnet:
|
|
145
|
+
weth = CoinAddresses_1.tokenAddresses.ethereum.wrapped.arbitrum.mainnet;
|
|
146
|
+
break;
|
|
147
|
+
case CoinAddresses_1.chainIds.optimism.mainnet:
|
|
148
|
+
weth = CoinAddresses_1.tokenAddresses.ethereum.wrapped.optimism.mainnet;
|
|
149
|
+
break;
|
|
150
|
+
}
|
|
151
|
+
if (weth) {
|
|
152
|
+
result[chainId] = {
|
|
153
|
+
native: CoinAddresses_1.tokenAddresses.ethereum.mainnet, // native ETH
|
|
154
|
+
wrapped: weth, // wrapped ETH
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return result;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Finds the wrapped assets for the given chain IDs
|
|
162
|
+
* @param {SupportedChainId[]} targetChainIds The chain IDs to find wrapped assets for
|
|
163
|
+
* @returns {Promise<Record<number, EvmTokenPair>>} An object with the wrapped assets for each chain ID or false if not found
|
|
164
|
+
*/
|
|
165
|
+
static async findWrappedAssets(targetChainIds) {
|
|
166
|
+
const result = {};
|
|
167
|
+
for (const chainId of targetChainIds) {
|
|
168
|
+
this.validateChainId(chainId);
|
|
169
|
+
result[chainId] = {
|
|
170
|
+
native: CoinAddresses_1.tokenAddresses.ethereum.mainnet,
|
|
171
|
+
wrapped: CoinAddresses_1.tokenAddresses.ethereum.wrapped[this.getChainName(chainId)]
|
|
172
|
+
?.mainnet || false,
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
return result;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Finds wrapped token addresses across different chains
|
|
179
|
+
* @param {string} tokenAddress - Token address on source chain
|
|
180
|
+
* @param {SupportedChainId} sourceChainId - Chain ID where token exists
|
|
181
|
+
* @param {SupportedChainId[]} targetChainIds - Chain IDs to find wrapped versions
|
|
182
|
+
* @returns {Promise<Record<SupportedChainId, EvmTokenPair>>} Map of chain IDs to token addresses
|
|
183
|
+
* @throws {EvmError} With various error codes for different failure cases
|
|
184
|
+
*/
|
|
185
|
+
static async findTokenPairs(tokenAddress, sourceChainId, targetChainIds) {
|
|
186
|
+
if (!this.isValidAddress(tokenAddress)) {
|
|
187
|
+
throw new EvmError("Invalid token address", "INVALID_ADDRESS", {
|
|
188
|
+
address: tokenAddress,
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
const result = {};
|
|
192
|
+
// Verify token exists on source chain
|
|
193
|
+
const provider = await this.getRandomProvider(sourceChainId);
|
|
194
|
+
const code = await provider.getCode(tokenAddress);
|
|
195
|
+
if (code === "0x") {
|
|
196
|
+
throw new Error("Token contract not found on source chain");
|
|
197
|
+
}
|
|
198
|
+
// Get chain names for lookup
|
|
199
|
+
const sourceChain = this.getChainNameFromId(sourceChainId);
|
|
200
|
+
if (!sourceChain) {
|
|
201
|
+
throw new Error(`Unsupported chain ID: ${sourceChainId}`);
|
|
202
|
+
}
|
|
203
|
+
for (const targetChainId of targetChainIds) {
|
|
204
|
+
// Same chain = same address
|
|
205
|
+
if (targetChainId === sourceChainId) {
|
|
206
|
+
result[targetChainId] = {
|
|
207
|
+
native: tokenAddress,
|
|
208
|
+
wrapped: false,
|
|
209
|
+
};
|
|
210
|
+
continue;
|
|
211
|
+
}
|
|
212
|
+
const targetChain = this.getChainNameFromId(targetChainId);
|
|
213
|
+
if (!targetChain) {
|
|
214
|
+
result[targetChainId] = {
|
|
215
|
+
native: tokenAddress,
|
|
216
|
+
wrapped: false,
|
|
217
|
+
};
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
220
|
+
// Check USDC mapping
|
|
221
|
+
if (tokenAddress === CoinAddresses_1.tokenAddresses.usdc[sourceChain]?.mainnet) {
|
|
222
|
+
result[targetChainId] = {
|
|
223
|
+
native: tokenAddress,
|
|
224
|
+
wrapped: CoinAddresses_1.tokenAddresses.usdc[targetChain]?.mainnet || false,
|
|
225
|
+
};
|
|
226
|
+
continue;
|
|
227
|
+
}
|
|
228
|
+
// Check USDT mapping
|
|
229
|
+
if (tokenAddress === CoinAddresses_1.tokenAddresses.usdt[sourceChain]?.mainnet) {
|
|
230
|
+
result[targetChainId] = {
|
|
231
|
+
native: tokenAddress,
|
|
232
|
+
wrapped: CoinAddresses_1.tokenAddresses.usdt[targetChain]?.mainnet || false,
|
|
233
|
+
};
|
|
234
|
+
continue;
|
|
235
|
+
}
|
|
236
|
+
result[targetChainId] = {
|
|
237
|
+
native: tokenAddress,
|
|
238
|
+
wrapped: false,
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
return result;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Finds the native address for the given chain ID
|
|
245
|
+
* @param {string} chain The chain to find the native address for
|
|
246
|
+
* @param {number} targetChainId The chain ID to find the native address for
|
|
247
|
+
* @returns {string} The native address for the given chain ID
|
|
248
|
+
*/
|
|
249
|
+
static getNativeForSupportedChain(chain, targetChainId) {
|
|
250
|
+
// Validate chain matches targetChainId
|
|
251
|
+
switch (chain) {
|
|
252
|
+
case CoinAddresses_1.BaseChain.ETHEREUM:
|
|
253
|
+
if (targetChainId !== CoinAddresses_1.chainIds.eth.mainnet) {
|
|
254
|
+
throw new Error("Chain ID doesn't match ethereum");
|
|
255
|
+
}
|
|
256
|
+
return CoinAddresses_1.tokenAddresses.ethereum.mainnet;
|
|
257
|
+
case CoinAddresses_1.BaseChain.BSC:
|
|
258
|
+
if (targetChainId !== CoinAddresses_1.chainIds.bsc.mainnet) {
|
|
259
|
+
throw new Error("Chain ID doesn't match bsc");
|
|
260
|
+
}
|
|
261
|
+
break;
|
|
262
|
+
case CoinAddresses_1.BaseChain.ARBITRUM:
|
|
263
|
+
if (targetChainId !== CoinAddresses_1.chainIds.arbitrum.mainnet) {
|
|
264
|
+
throw new Error("Chain ID doesn't match arbitrum");
|
|
265
|
+
}
|
|
266
|
+
break;
|
|
267
|
+
case CoinAddresses_1.BaseChain.OPTIMISM:
|
|
268
|
+
if (targetChainId !== CoinAddresses_1.chainIds.optimism.mainnet) {
|
|
269
|
+
throw new Error("Chain ID doesn't match optimism");
|
|
270
|
+
}
|
|
271
|
+
break;
|
|
272
|
+
default:
|
|
273
|
+
throw new Error(`Unsupported chain: ${chain}`);
|
|
274
|
+
}
|
|
275
|
+
// Return native address (0x0)
|
|
276
|
+
return CoinAddresses_1.tokenAddresses.ethereum.mainnet;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
exports.EvmCoinFinder = EvmCoinFinder;
|
|
280
|
+
//# sourceMappingURL=EvmCoinFinder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EvmCoinFinder.js","sourceRoot":"","sources":["../../../src/abstraction/EvmCoinFinder.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4DAAmC;AACnC,6DAA+E;AAC/E,+CAAgC;AAahC;;;;;;GAMG;AACH,MAAa,QAAS,SAAQ,KAAK;IAC/B,YACI,OAAe,EACC,IAAY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"
|
|
3
|
-
import { PQCAlgorithm } from "
|
|
4
|
-
import { RPCResponseWithValidityData } from "
|
|
1
|
+
import { XMCoreTargetIdentityPayload, Web2CoreTargetIdentityPayload, GithubProof, TwitterProof, InferFromSignaturePayload } from "../types/abstraction";
|
|
2
|
+
import { Demos } from "../websdk/demosclass";
|
|
3
|
+
import { PQCAlgorithm } from "../types/cryptography";
|
|
4
|
+
import { RPCResponseWithValidityData } from "../types";
|
|
5
5
|
export declare class Identities {
|
|
6
6
|
formats: {
|
|
7
7
|
web2: {
|
|
@@ -95,7 +95,7 @@ export declare class Identities {
|
|
|
95
95
|
* @param address The address to get identities for.
|
|
96
96
|
* @returns The identities associated with the address.
|
|
97
97
|
*/
|
|
98
|
-
getIdentities(demos: Demos, call?: string, address?: string): Promise<import("
|
|
98
|
+
getIdentities(demos: Demos, call?: string, address?: string): Promise<import("../types").RPCResponse>;
|
|
99
99
|
/**
|
|
100
100
|
* Get the crosschain identities associated with an address.
|
|
101
101
|
*
|
|
@@ -103,7 +103,7 @@ export declare class Identities {
|
|
|
103
103
|
* @param address The address to get identities for.
|
|
104
104
|
* @returns The identities associated with the address.
|
|
105
105
|
*/
|
|
106
|
-
getXmIdentities(demos: Demos, address?: string): Promise<import("
|
|
106
|
+
getXmIdentities(demos: Demos, address?: string): Promise<import("../types").RPCResponse>;
|
|
107
107
|
/**
|
|
108
108
|
* Get the web2 identities associated with an address.
|
|
109
109
|
*
|
|
@@ -111,7 +111,7 @@ export declare class Identities {
|
|
|
111
111
|
* @param address The address to get identities for.
|
|
112
112
|
* @returns The identities associated with the address.
|
|
113
113
|
*/
|
|
114
|
-
getWeb2Identities(demos: Demos, address?: string): Promise<import("
|
|
114
|
+
getWeb2Identities(demos: Demos, address?: string): Promise<import("../types").RPCResponse>;
|
|
115
115
|
/**
|
|
116
116
|
* Get the points associated with an identity
|
|
117
117
|
*
|
|
@@ -127,7 +127,7 @@ export declare class Identities {
|
|
|
127
127
|
* @param referralCode The referral code to validate.
|
|
128
128
|
* @returns The validation result containing validity status, referrer public key, and message.
|
|
129
129
|
*/
|
|
130
|
-
validateReferralCode(demos: Demos, referralCode: string): Promise<import("
|
|
130
|
+
validateReferralCode(demos: Demos, referralCode: string): Promise<import("../types").RPCResponse>;
|
|
131
131
|
/**
|
|
132
132
|
* Get referral information for an address.
|
|
133
133
|
*
|
|
@@ -135,5 +135,5 @@ export declare class Identities {
|
|
|
135
135
|
* @param address The address to get referral info for. Defaults to the connected wallet's address.
|
|
136
136
|
* @returns The referral information associated with the address.
|
|
137
137
|
*/
|
|
138
|
-
getReferralInfo(demos: Demos, address?: string): Promise<import("
|
|
138
|
+
getReferralInfo(demos: Demos, address?: string): Promise<import("../types").RPCResponse>;
|
|
139
139
|
}
|