@kynesyslabs/demosdk 2.9.0 → 2.10.0
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 +19 -23
- package/build/abstraction/CoinFinder.js.map +1 -1
- package/build/abstraction/EvmCoinFinder.js +48 -89
- package/build/abstraction/EvmCoinFinder.js.map +1 -1
- package/build/abstraction/Identities.d.ts +28 -1
- package/build/abstraction/Identities.js +58 -24
- package/build/abstraction/Identities.js.map +1 -1
- package/build/abstraction/index.js +4 -9
- package/build/abstraction/index.js.map +1 -1
- package/build/abstraction/providers/AbstractionProviders.js +1 -3
- package/build/abstraction/providers/AbstractionProviders.js.map +1 -1
- package/build/abstraction/providers/CoinAddresses.js +4 -7
- package/build/abstraction/providers/CoinAddresses.js.map +1 -1
- package/build/abstraction/providers/Providers.js +13 -18
- package/build/abstraction/providers/Providers.js.map +1 -1
- package/build/abstraction/providers/evm/ankr.js +8 -14
- package/build/abstraction/providers/evm/ankr.js.map +1 -1
- package/build/abstraction/providers/evm/arbitrum.js +4 -10
- package/build/abstraction/providers/evm/arbitrum.js.map +1 -1
- package/build/abstraction/providers/evm/bsc.js +4 -10
- package/build/abstraction/providers/evm/bsc.js.map +1 -1
- package/build/abstraction/providers/evm/ethereum.js +5 -11
- package/build/abstraction/providers/evm/ethereum.js.map +1 -1
- package/build/abstraction/providers/evm/index.js +4 -14
- package/build/abstraction/providers/evm/index.js.map +1 -1
- package/build/abstraction/providers/evm/optimism.js +4 -10
- package/build/abstraction/providers/evm/optimism.js.map +1 -1
- package/build/abstraction/providers/index.js +2 -7
- package/build/abstraction/providers/index.js.map +1 -1
- package/build/abstraction/providers/non-evm/bitcoin.js +4 -10
- package/build/abstraction/providers/non-evm/bitcoin.js.map +1 -1
- package/build/abstraction/providers/non-evm/index.js +4 -14
- package/build/abstraction/providers/non-evm/index.js.map +1 -1
- package/build/abstraction/providers/non-evm/multiversx.js +4 -10
- package/build/abstraction/providers/non-evm/multiversx.js.map +1 -1
- package/build/abstraction/providers/non-evm/solana.js +7 -13
- package/build/abstraction/providers/non-evm/solana.js.map +1 -1
- package/build/abstraction/providers/non-evm/xrp.js +4 -10
- package/build/abstraction/providers/non-evm/xrp.js.map +1 -1
- package/build/abstraction/types/UDResolution.js +1 -2
- package/build/abstraction/types/UDResolution.js.map +1 -1
- package/build/bridge/index.js +12 -33
- package/build/bridge/index.js.map +1 -1
- package/build/bridge/nativeBridge.js +16 -19
- package/build/bridge/nativeBridge.js.map +1 -1
- package/build/bridge/nativeBridgeTypes.js +6 -9
- package/build/bridge/nativeBridgeTypes.js.map +1 -1
- package/build/bridge/rubicBridge.js +1 -4
- package/build/bridge/rubicBridge.js.map +1 -1
- package/build/contracts/ContractDeployer.js +6 -43
- package/build/contracts/ContractDeployer.js.map +1 -1
- package/build/contracts/ContractFactory.js +8 -13
- package/build/contracts/ContractFactory.js.map +1 -1
- package/build/contracts/ContractInstance.js +3 -7
- package/build/contracts/ContractInstance.js.map +1 -1
- package/build/contracts/ContractInteractor.js +4 -41
- package/build/contracts/ContractInteractor.js.map +1 -1
- package/build/contracts/index.js +4 -12
- package/build/contracts/index.js.map +1 -1
- package/build/contracts/templates/TemplateRegistry.js +3 -7
- package/build/contracts/templates/TemplateRegistry.js.map +1 -1
- package/build/contracts/templates/TemplateValidator.js +1 -5
- package/build/contracts/templates/TemplateValidator.js.map +1 -1
- package/build/contracts/types/ContractABI.js +1 -2
- package/build/contracts/types/ContractABI.js.map +1 -1
- package/build/contracts/types/TypedContract.js +1 -2
- package/build/contracts/types/TypedContract.js.map +1 -1
- package/build/d402/client/D402Client.js +4 -41
- package/build/d402/client/D402Client.js.map +1 -1
- package/build/d402/client/index.js +1 -5
- package/build/d402/client/index.js.map +1 -1
- package/build/d402/client/types.js +1 -2
- package/build/d402/client/types.js.map +1 -1
- package/build/d402/index.js +2 -20
- package/build/d402/index.js.map +1 -1
- package/build/d402/server/D402Server.js +1 -5
- package/build/d402/server/D402Server.js.map +1 -1
- package/build/d402/server/index.js +2 -7
- package/build/d402/server/index.js.map +1 -1
- package/build/d402/server/middleware.js +3 -6
- package/build/d402/server/middleware.js.map +1 -1
- package/build/d402/server/types.js +1 -2
- package/build/d402/server/types.js.map +1 -1
- package/build/demoswork/executor/index.js +1 -4
- package/build/demoswork/executor/index.js.map +1 -1
- package/build/demoswork/executor/stepexecutor.js +2 -6
- package/build/demoswork/executor/stepexecutor.js.map +1 -1
- package/build/demoswork/index.js +8 -25
- package/build/demoswork/index.js.map +1 -1
- package/build/demoswork/operations/baseoperation.js +2 -6
- package/build/demoswork/operations/baseoperation.js.map +1 -1
- package/build/demoswork/operations/conditional/condition.js +7 -11
- package/build/demoswork/operations/conditional/condition.js.map +1 -1
- package/build/demoswork/operations/conditional/index.js +9 -13
- package/build/demoswork/operations/conditional/index.js.map +1 -1
- package/build/demoswork/operations/index.js +5 -9
- package/build/demoswork/operations/index.js.map +1 -1
- package/build/demoswork/utils/createTestWorkScript.js +22 -28
- package/build/demoswork/utils/createTestWorkScript.js.map +1 -1
- package/build/demoswork/utils/index.js +3 -8
- package/build/demoswork/utils/index.js.map +1 -1
- package/build/demoswork/validator/index.js +3 -6
- package/build/demoswork/validator/index.js.map +1 -1
- package/build/demoswork/validator/steps.validator.js +3 -6
- package/build/demoswork/validator/steps.validator.js.map +1 -1
- package/build/demoswork/work.js +6 -11
- package/build/demoswork/work.js.map +1 -1
- package/build/demoswork/workstep.js +16 -26
- package/build/demoswork/workstep.js.map +1 -1
- package/build/encryption/Cryptography.js +36 -71
- package/build/encryption/Cryptography.js.map +1 -1
- package/build/encryption/FHE/index.js +3 -9
- package/build/encryption/FHE/index.js.map +1 -1
- package/build/encryption/Hashing.js +8 -15
- package/build/encryption/Hashing.js.map +1 -1
- package/build/encryption/PQC/enigma.js +22 -59
- package/build/encryption/PQC/enigma.js.map +1 -1
- package/build/encryption/PQC/falconts/falcon.js +3 -6
- package/build/encryption/PQC/falconts/falcon.js.map +1 -1
- package/build/encryption/PQC/falconts/index.js +3 -15
- package/build/encryption/PQC/falconts/index.js.map +1 -1
- package/build/encryption/PQC/falconts/mnemonic.js +9 -15
- package/build/encryption/PQC/falconts/mnemonic.js.map +1 -1
- package/build/encryption/PQC/falconts/wordlist.js +1 -4
- package/build/encryption/PQC/falconts/wordlist.js.map +1 -1
- package/build/encryption/PQC/utils.js +2 -7
- package/build/encryption/PQC/utils.js.map +1 -1
- package/build/encryption/index.js +7 -50
- package/build/encryption/index.js.map +1 -1
- package/build/encryption/unifiedCrypto.js +23 -63
- package/build/encryption/unifiedCrypto.js.map +1 -1
- package/build/encryption/zK/identity/CommitmentService.js +5 -10
- package/build/encryption/zK/identity/CommitmentService.js.map +1 -1
- package/build/encryption/zK/identity/ProofGenerator.js +3 -40
- package/build/encryption/zK/identity/ProofGenerator.js.map +1 -1
- package/build/encryption/zK/identity/ZKIdentity.js +3 -40
- package/build/encryption/zK/identity/ZKIdentity.js.map +1 -1
- package/build/encryption/zK/identity/index.js +3 -40
- package/build/encryption/zK/identity/index.js.map +1 -1
- package/build/encryption/zK/index.js +2 -38
- package/build/encryption/zK/index.js.map +1 -1
- package/build/encryption/zK/interactive/index.js +4 -12
- package/build/encryption/zK/interactive/index.js.map +1 -1
- package/build/encryption/zK/primer.js +7 -13
- package/build/encryption/zK/primer.js.map +1 -1
- package/build/escrow/EscrowQueries.js +1 -5
- package/build/escrow/EscrowQueries.js.map +1 -1
- package/build/escrow/EscrowTransaction.js +8 -45
- package/build/escrow/EscrowTransaction.js.map +1 -1
- package/build/escrow/index.js +2 -7
- package/build/escrow/index.js.map +1 -1
- package/build/index.js +18 -54
- package/build/index.js.map +1 -1
- package/build/instant_messaging/index.js +13 -17
- package/build/instant_messaging/index.js.map +1 -1
- package/build/ipfs/IPFSOperations.js +5 -9
- package/build/ipfs/IPFSOperations.js.map +1 -1
- package/build/ipfs/index.js +1 -6
- package/build/ipfs/index.js.map +1 -1
- package/build/keyserver/KeyServerClient.js +10 -14
- package/build/keyserver/KeyServerClient.js.map +1 -1
- package/build/keyserver/errors.js +1 -5
- package/build/keyserver/errors.js.map +1 -1
- package/build/keyserver/index.js +3 -10
- package/build/keyserver/index.js.map +1 -1
- package/build/keyserver/types.js +1 -2
- package/build/keyserver/types.js.map +1 -1
- package/build/keyserver/verification.js +4 -8
- package/build/keyserver/verification.js.map +1 -1
- package/build/l2ps/index.js +2 -8
- package/build/l2ps/index.js.map +1 -1
- package/build/l2ps/l2ps.js +6 -41
- package/build/l2ps/l2ps.js.map +1 -1
- package/build/multichain/core/aptos.js +40 -77
- package/build/multichain/core/aptos.js.map +1 -1
- package/build/multichain/core/btc.js +22 -62
- package/build/multichain/core/btc.js.map +1 -1
- package/build/multichain/core/evm.js +24 -61
- package/build/multichain/core/evm.js.map +1 -1
- package/build/multichain/core/ibc.js +34 -71
- package/build/multichain/core/ibc.js.map +1 -1
- package/build/multichain/core/index.js +12 -28
- package/build/multichain/core/index.js.map +1 -1
- package/build/multichain/core/multiversx.js +34 -41
- package/build/multichain/core/multiversx.js.map +1 -1
- package/build/multichain/core/near.js +44 -84
- package/build/multichain/core/near.js.map +1 -1
- package/build/multichain/core/solana.js +51 -91
- package/build/multichain/core/solana.js.map +1 -1
- package/build/multichain/core/ten.js +11 -48
- package/build/multichain/core/ten.js.map +1 -1
- package/build/multichain/core/ton.d.ts +1 -1
- package/build/multichain/core/ton.js +30 -37
- package/build/multichain/core/ton.js.map +1 -1
- package/build/multichain/core/tron.js +34 -41
- package/build/multichain/core/tron.js.map +1 -1
- package/build/multichain/core/types/SolanaPhantomProvider.js +1 -2
- package/build/multichain/core/types/SolanaPhantomProvider.js.map +1 -1
- package/build/multichain/core/types/defaultChain.js +1 -5
- package/build/multichain/core/types/defaultChain.js.map +1 -1
- package/build/multichain/core/types/interfaces.js +2 -5
- package/build/multichain/core/types/interfaces.js.map +1 -1
- package/build/multichain/core/utils.js +1 -4
- package/build/multichain/core/utils.js.map +1 -1
- package/build/multichain/core/xrp.js +17 -22
- package/build/multichain/core/xrp.js.map +1 -1
- package/build/multichain/index.js +3 -39
- package/build/multichain/index.js.map +1 -1
- package/build/multichain/localsdk/aptos.js +11 -15
- package/build/multichain/localsdk/aptos.js.map +1 -1
- package/build/multichain/localsdk/btc.js +10 -50
- package/build/multichain/localsdk/btc.js.map +1 -1
- package/build/multichain/localsdk/evm.js +6 -10
- package/build/multichain/localsdk/evm.js.map +1 -1
- package/build/multichain/localsdk/ibc.js +5 -9
- package/build/multichain/localsdk/ibc.js.map +1 -1
- package/build/multichain/localsdk/index.js +10 -23
- package/build/multichain/localsdk/index.js.map +1 -1
- package/build/multichain/localsdk/multiversx.js +12 -16
- package/build/multichain/localsdk/multiversx.js.map +1 -1
- package/build/multichain/localsdk/near.js +9 -13
- package/build/multichain/localsdk/near.js.map +1 -1
- package/build/multichain/localsdk/solana.js +5 -9
- package/build/multichain/localsdk/solana.js.map +1 -1
- package/build/multichain/localsdk/ten.js +8 -45
- package/build/multichain/localsdk/ten.js.map +1 -1
- package/build/multichain/localsdk/ton.js +9 -13
- package/build/multichain/localsdk/ton.js.map +1 -1
- package/build/multichain/localsdk/tron.js +2 -6
- package/build/multichain/localsdk/tron.js.map +1 -1
- package/build/multichain/localsdk/xrp.js +6 -43
- package/build/multichain/localsdk/xrp.js.map +1 -1
- package/build/multichain/websdk/aptos.js +1 -5
- package/build/multichain/websdk/aptos.js.map +1 -1
- package/build/multichain/websdk/btc.js +2 -6
- package/build/multichain/websdk/btc.js.map +1 -1
- package/build/multichain/websdk/evm.js +2 -6
- package/build/multichain/websdk/evm.js.map +1 -1
- package/build/multichain/websdk/ibc.js +2 -6
- package/build/multichain/websdk/ibc.js.map +1 -1
- package/build/multichain/websdk/index.js +9 -21
- package/build/multichain/websdk/index.js.map +1 -1
- package/build/multichain/websdk/multiversx.js +9 -13
- package/build/multichain/websdk/multiversx.js.map +1 -1
- package/build/multichain/websdk/near.js +2 -6
- package/build/multichain/websdk/near.js.map +1 -1
- package/build/multichain/websdk/solana.js +10 -18
- package/build/multichain/websdk/solana.js.map +1 -1
- package/build/multichain/websdk/ton.js +2 -6
- package/build/multichain/websdk/ton.js.map +1 -1
- package/build/multichain/websdk/xrp.js +2 -6
- package/build/multichain/websdk/xrp.js.map +1 -1
- package/build/storage/StorageProgram.js +11 -18
- package/build/storage/StorageProgram.js.map +1 -1
- package/build/storage/index.js +2 -10
- package/build/storage/index.js.map +1 -1
- package/build/tlsnotary/TLSNotary.js +11 -52
- package/build/tlsnotary/TLSNotary.js.map +1 -1
- package/build/tlsnotary/TLSNotaryService.js +21 -25
- package/build/tlsnotary/TLSNotaryService.js.map +1 -1
- package/build/tlsnotary/auto-init.js +11 -17
- package/build/tlsnotary/auto-init.js.map +1 -1
- package/build/tlsnotary/helpers.js +1 -4
- package/build/tlsnotary/helpers.js.map +1 -1
- package/build/tlsnotary/index.js +8 -25
- package/build/tlsnotary/index.js.map +1 -1
- package/build/tlsnotary/service.js +2 -7
- package/build/tlsnotary/service.js.map +1 -1
- package/build/tlsnotary/types.js +1 -2
- package/build/tlsnotary/types.js.map +1 -1
- package/build/tlsnotary/webpack.js +10 -52
- package/build/tlsnotary/webpack.js.map +1 -1
- package/build/tlsnotary/worker.js +5 -40
- package/build/tlsnotary/worker.js.map +1 -1
- package/build/types/abstraction/index.d.ts +64 -1
- package/build/types/abstraction/index.js +1 -2
- package/build/types/abstraction/index.js.map +1 -1
- package/build/types/blockchain/Confirmation.js +1 -4
- package/build/types/blockchain/Confirmation.js.map +1 -1
- package/build/types/blockchain/CustomCharges.js +2 -6
- package/build/types/blockchain/CustomCharges.js.map +1 -1
- package/build/types/blockchain/GCREdit.d.ts +1 -1
- package/build/types/blockchain/GCREdit.js +1 -2
- package/build/types/blockchain/GCREdit.js.map +1 -1
- package/build/types/blockchain/ISignature.js +1 -2
- package/build/types/blockchain/Transaction.js +1 -17
- package/build/types/blockchain/Transaction.js.map +1 -1
- package/build/types/blockchain/TransactionSubtypes/ContractCallTransaction.js +1 -2
- package/build/types/blockchain/TransactionSubtypes/ContractDeployTransaction.js +1 -2
- package/build/types/blockchain/TransactionSubtypes/CrosschainTransaction.js +1 -2
- package/build/types/blockchain/TransactionSubtypes/D402PaymentTransaction.js +1 -2
- package/build/types/blockchain/TransactionSubtypes/DemosworkTransaction.js +1 -2
- package/build/types/blockchain/TransactionSubtypes/EscrowTransaction.js +1 -2
- package/build/types/blockchain/TransactionSubtypes/IPFSTransaction.js +5 -12
- package/build/types/blockchain/TransactionSubtypes/IPFSTransaction.js.map +1 -1
- package/build/types/blockchain/TransactionSubtypes/IdentityTransaction.js +1 -2
- package/build/types/blockchain/TransactionSubtypes/InstantMessagingTransaction.js +1 -2
- package/build/types/blockchain/TransactionSubtypes/L2PSHashTransaction.js +1 -2
- package/build/types/blockchain/TransactionSubtypes/L2PSTransaction.js +1 -2
- package/build/types/blockchain/TransactionSubtypes/NativeBridgeTransaction.js +1 -2
- package/build/types/blockchain/TransactionSubtypes/NativeTransaction.js +1 -2
- package/build/types/blockchain/TransactionSubtypes/StorageProgramTransaction.js +4 -10
- package/build/types/blockchain/TransactionSubtypes/StorageProgramTransaction.js.map +1 -1
- package/build/types/blockchain/TransactionSubtypes/StorageTransaction.js +1 -2
- package/build/types/blockchain/TransactionSubtypes/Web2Transaction.js +1 -2
- package/build/types/blockchain/TransactionSubtypes/index.js +16 -32
- package/build/types/blockchain/TransactionSubtypes/index.js.map +1 -1
- package/build/types/blockchain/TransactionSubtypes/utils.js +2 -6
- package/build/types/blockchain/TransactionSubtypes/utils.js.map +1 -1
- package/build/types/blockchain/TxFee.js +1 -2
- package/build/types/blockchain/ValidityData.js +1 -5
- package/build/types/blockchain/ValidityData.js.map +1 -1
- package/build/types/blockchain/WalletTypes.js +1 -2
- package/build/types/blockchain/address.js +1 -2
- package/build/types/blockchain/addressInfo.js +1 -2
- package/build/types/blockchain/blocks.js +1 -2
- package/build/types/blockchain/blocks.js.map +1 -1
- package/build/types/blockchain/encryptedTransaction.js +1 -2
- package/build/types/blockchain/genesisTypes.js +1 -2
- package/build/types/blockchain/genesisTypes.js.map +1 -1
- package/build/types/blockchain/identities.js +1 -2
- package/build/types/blockchain/identities.js.map +1 -1
- package/build/types/blockchain/rawTransaction.js +1 -2
- package/build/types/blockchain/rawTransaction.js.map +1 -1
- package/build/types/blockchain/statusNative.js +1 -2
- package/build/types/blockchain/statusProperties.js +1 -2
- package/build/types/bridge/bridgeTradePayload.js +1 -2
- package/build/types/bridge/constants.js +3 -6
- package/build/types/bridge/constants.js.map +1 -1
- package/build/types/communication/demosWork.js +1 -2
- package/build/types/communication/rpc.js +1 -4
- package/build/types/communication/rpc.js.map +1 -1
- package/build/types/communication/transmit.js +1 -2
- package/build/types/communication/transmit.js.map +1 -1
- package/build/types/cryptography.js +1 -2
- package/build/types/demoswork/datatypes.js +2 -5
- package/build/types/demoswork/datatypes.js.map +1 -1
- package/build/types/demoswork/index.js +1 -2
- package/build/types/demoswork/operations.js +1 -2
- package/build/types/demoswork/steps.js +4 -7
- package/build/types/demoswork/steps.js.map +1 -1
- package/build/types/gls/Operation.js +1 -2
- package/build/types/gls/StateChange.js +1 -2
- package/build/types/gls/StateChange.js.map +1 -1
- package/build/types/gls/account.js +1 -2
- package/build/types/index.js +10 -30
- package/build/types/index.js.map +1 -1
- package/build/types/instantMessaging/index.js +1 -2
- package/build/types/native/INativePayload.js +1 -2
- package/build/types/native/INativePayload.js.map +1 -1
- package/build/types/native/index.js +1 -17
- package/build/types/native/index.js.map +1 -1
- package/build/types/network/ExecutionResult.js +1 -2
- package/build/types/network/SecurityTypes.js +1 -2
- package/build/types/peers/Peer.js +1 -2
- package/build/types/peers/Peer.js.map +1 -1
- package/build/types/web2/discord.js +1 -2
- package/build/types/web2/index.js +2 -5
- package/build/types/web2/index.js.map +1 -1
- package/build/types/web2/telegram.js +1 -2
- package/build/types/web2/telegram.js.map +1 -1
- package/build/types/web2/twitter.js +1 -2
- package/build/types/xm/apiTools.js +1 -2
- package/build/types/xm/index.js +1 -2
- package/build/utils/dataManipulation.js +5 -12
- package/build/utils/dataManipulation.js.map +1 -1
- package/build/utils/getRemoteIP.js +3 -9
- package/build/utils/getRemoteIP.js.map +1 -1
- package/build/utils/index.js +4 -44
- package/build/utils/index.js.map +1 -1
- package/build/utils/pprint.js +3 -9
- package/build/utils/pprint.js.map +1 -1
- package/build/utils/uint8Serialize.js +2 -6
- package/build/utils/uint8Serialize.js.map +1 -1
- package/build/wallet/Wallet.js +11 -46
- package/build/wallet/Wallet.js.map +1 -1
- package/build/wallet/index.js +1 -37
- package/build/wallet/index.js.map +1 -1
- package/build/wallet/passkeys/passkeys.js +9 -16
- package/build/wallet/passkeys/passkeys.js.map +1 -1
- package/build/websdk/DemosContracts.d.ts +1 -1
- package/build/websdk/DemosContracts.js +9 -13
- package/build/websdk/DemosContracts.js.map +1 -1
- package/build/websdk/DemosTransactions.js +33 -69
- package/build/websdk/DemosTransactions.js.map +1 -1
- package/build/websdk/DemosWebAuth.js +17 -24
- package/build/websdk/DemosWebAuth.js.map +1 -1
- package/build/websdk/GCRGeneration.js +31 -19
- package/build/websdk/GCRGeneration.js.map +1 -1
- package/build/websdk/Web2Calls.js +14 -18
- package/build/websdk/Web2Calls.js.map +1 -1
- package/build/websdk/XMTransactions.js +8 -13
- package/build/websdk/XMTransactions.js.map +1 -1
- package/build/websdk/bridge.js +1 -5
- package/build/websdk/bridge.js.map +1 -1
- package/build/websdk/demos.js +2 -5
- package/build/websdk/demos.js.map +1 -1
- package/build/websdk/demosclass.js +55 -95
- package/build/websdk/demosclass.js.map +1 -1
- package/build/websdk/examples/tryWeb2.js +4 -6
- package/build/websdk/examples/tryWeb2.js.map +1 -1
- package/build/websdk/index.js +14 -69
- package/build/websdk/index.js.map +1 -1
- package/build/websdk/rsa.js +17 -24
- package/build/websdk/rsa.js.map +1 -1
- package/build/websdk/types/IBuffer.js +1 -2
- package/build/websdk/types/KeyPair.js +1 -2
- package/build/websdk/utils/bufferizer.js +1 -4
- package/build/websdk/utils/bufferizer.js.map +1 -1
- package/build/websdk/utils/canonicalJson.js +3 -8
- package/build/websdk/utils/canonicalJson.js.map +1 -1
- package/build/websdk/utils/forge_converter.js +4 -7
- package/build/websdk/utils/forge_converter.js.map +1 -1
- package/build/websdk/utils/required.js +2 -6
- package/build/websdk/utils/required.js.map +1 -1
- package/build/websdk/utils/sha256.js +1 -4
- package/build/websdk/utils/sha256.js.map +1 -1
- package/build/websdk/utils/skeletons.js +3 -8
- package/build/websdk/utils/skeletons.js.map +1 -1
- package/package.json +2 -1
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CoinFinder = void 0;
|
|
4
|
-
const CoinAddresses_1 = require("./providers/CoinAddresses");
|
|
1
|
+
import { BaseChain, tokenAddresses, chainIds, } from "./providers/CoinAddresses.js";
|
|
5
2
|
/**
|
|
6
3
|
* Class for finding wrapped tokens on various chains
|
|
7
4
|
*/
|
|
8
|
-
class CoinFinder {
|
|
5
|
+
export class CoinFinder {
|
|
9
6
|
static validateChain(chain) {
|
|
10
|
-
if (!Object.values(
|
|
7
|
+
if (!Object.values(BaseChain).includes(chain)) {
|
|
11
8
|
throw new Error(`Invalid chain: ${chain}`);
|
|
12
9
|
}
|
|
13
10
|
}
|
|
@@ -20,7 +17,7 @@ class CoinFinder {
|
|
|
20
17
|
static async findWrappedToken(sourceChain, targetChain) {
|
|
21
18
|
this.validateChain(sourceChain);
|
|
22
19
|
this.validateChain(targetChain);
|
|
23
|
-
return (
|
|
20
|
+
return (tokenAddresses[sourceChain].wrapped?.[targetChain]?.mainnet || false);
|
|
24
21
|
}
|
|
25
22
|
/**
|
|
26
23
|
* Gets the native token address for any supported chain
|
|
@@ -33,35 +30,34 @@ class CoinFinder {
|
|
|
33
30
|
const [chainType, networkType] = chain.split("_");
|
|
34
31
|
// Handle EVM chains
|
|
35
32
|
switch (chainType) {
|
|
36
|
-
case
|
|
37
|
-
case
|
|
38
|
-
case
|
|
39
|
-
case
|
|
33
|
+
case BaseChain.ETHEREUM:
|
|
34
|
+
case BaseChain.BSC:
|
|
35
|
+
case BaseChain.ARBITRUM:
|
|
36
|
+
case BaseChain.OPTIMISM:
|
|
40
37
|
// Validate chain ID matches the chain
|
|
41
38
|
const chainIdMap = {
|
|
42
|
-
[
|
|
43
|
-
[
|
|
44
|
-
[
|
|
45
|
-
[
|
|
39
|
+
[BaseChain.ETHEREUM]: chainIds.eth.mainnet,
|
|
40
|
+
[BaseChain.BSC]: chainIds.bsc.mainnet,
|
|
41
|
+
[BaseChain.ARBITRUM]: chainIds.arbitrum.mainnet,
|
|
42
|
+
[BaseChain.OPTIMISM]: chainIds.optimism.mainnet,
|
|
46
43
|
};
|
|
47
44
|
if (targetChainId !== chainIdMap[chainType]) {
|
|
48
45
|
throw new Error(`Chain ID doesn't match ${chainType}`);
|
|
49
46
|
}
|
|
50
|
-
return
|
|
47
|
+
return tokenAddresses.ethereum[networkType];
|
|
51
48
|
// Handle non-EVM chains
|
|
52
|
-
case
|
|
53
|
-
case
|
|
54
|
-
case
|
|
55
|
-
case
|
|
56
|
-
case
|
|
49
|
+
case BaseChain.SOLANA:
|
|
50
|
+
case BaseChain.MULTIVERSX:
|
|
51
|
+
case BaseChain.XRP:
|
|
52
|
+
case BaseChain.BITCOIN:
|
|
53
|
+
case BaseChain.TON:
|
|
57
54
|
if (targetChainId !== 1) {
|
|
58
55
|
throw new Error("Non-EVM chains only support targetChainId 1");
|
|
59
56
|
}
|
|
60
|
-
return
|
|
57
|
+
return tokenAddresses[chainType][networkType];
|
|
61
58
|
default:
|
|
62
59
|
throw new Error(`Unsupported chain: ${chain}`);
|
|
63
60
|
}
|
|
64
61
|
}
|
|
65
62
|
}
|
|
66
|
-
exports.CoinFinder = CoinFinder;
|
|
67
63
|
//# sourceMappingURL=CoinFinder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinFinder.js","sourceRoot":"","sources":["../../../src/abstraction/CoinFinder.ts"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AAC,GAAG,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO;oBACrC,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC,OAAO;oBAC/C,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,QAAQ,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,cAAc,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAA;YAE/C,wBAAwB;YACxB,KAAK,SAAS,CAAC,MAAM,CAAC;YACtB,KAAK,SAAS,CAAC,UAAU,CAAC;YAC1B,KAAK,SAAS,CAAC,GAAG,CAAC;YACnB,KAAK,SAAS,CAAC,OAAO,CAAC;YACvB,KAAK,SAAS,CAAC,GAAG;gBACd,IAAI,aAAa,KAAK,CAAC,EAAE,CAAC;oBACtB,MAAM,IAAI,KAAK,CACX,6CAA6C,CAChD,CAAA;gBACL,CAAC;gBACD,OAAO,cAAc,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAA;YAEjD;gBACI,MAAM,IAAI,KAAK,CAAC,sBAAsB,KAAK,EAAE,CAAC,CAAA;QACtD,CAAC;IACL,CAAC;CACJ"}
|
|
@@ -1,45 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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"));
|
|
1
|
+
import Providers from "./providers/index.js";
|
|
2
|
+
import { tokenAddresses, chainIds, BaseChain } from "./providers/CoinAddresses.js";
|
|
3
|
+
import * as ethers from "ethers";
|
|
43
4
|
/**
|
|
44
5
|
* Error class for EVM coin finder
|
|
45
6
|
* @extends Error
|
|
@@ -47,31 +8,30 @@ const ethers = __importStar(require("ethers"));
|
|
|
47
8
|
* @param {string} code - The error code
|
|
48
9
|
* @param {any} details - The error details
|
|
49
10
|
*/
|
|
50
|
-
class EvmError extends Error {
|
|
11
|
+
export class EvmError extends Error {
|
|
51
12
|
constructor(message, code, details) {
|
|
52
13
|
super(message);
|
|
53
14
|
this.code = code;
|
|
54
15
|
this.details = details;
|
|
55
16
|
}
|
|
56
17
|
}
|
|
57
|
-
exports.EvmError = EvmError;
|
|
58
18
|
/**
|
|
59
19
|
* Class for finding wrapped tokens on EVM chains
|
|
60
20
|
* @throws {EvmError} With code 'UNSUPPORTED_CHAIN_ID' if chain ID is not supported
|
|
61
21
|
* @throws {EvmError} With code 'INVALID_ADDRESS' if token address is invalid
|
|
62
22
|
* @throws {EvmError} With code 'CONTRACT_NOT_FOUND' if token contract doesn't exist
|
|
63
23
|
*/
|
|
64
|
-
class EvmCoinFinder {
|
|
24
|
+
export class EvmCoinFinder {
|
|
65
25
|
static getChainName(chainId) {
|
|
66
26
|
switch (chainId) {
|
|
67
|
-
case
|
|
68
|
-
return
|
|
69
|
-
case
|
|
70
|
-
return
|
|
71
|
-
case
|
|
72
|
-
return
|
|
73
|
-
case
|
|
74
|
-
return
|
|
27
|
+
case chainIds.eth.mainnet:
|
|
28
|
+
return BaseChain.ETHEREUM;
|
|
29
|
+
case chainIds.bsc.mainnet:
|
|
30
|
+
return BaseChain.BSC;
|
|
31
|
+
case chainIds.arbitrum.mainnet:
|
|
32
|
+
return BaseChain.ARBITRUM;
|
|
33
|
+
case chainIds.optimism.mainnet:
|
|
34
|
+
return BaseChain.OPTIMISM;
|
|
75
35
|
default:
|
|
76
36
|
throw new Error(`Unsupported chain ID: ${chainId}`);
|
|
77
37
|
}
|
|
@@ -81,21 +41,21 @@ class EvmCoinFinder {
|
|
|
81
41
|
}
|
|
82
42
|
static getChainNameFromId(chainId) {
|
|
83
43
|
switch (chainId) {
|
|
84
|
-
case
|
|
85
|
-
return
|
|
86
|
-
case
|
|
87
|
-
return
|
|
88
|
-
case
|
|
89
|
-
return
|
|
90
|
-
case
|
|
91
|
-
return
|
|
44
|
+
case chainIds.eth.mainnet:
|
|
45
|
+
return BaseChain.ETHEREUM;
|
|
46
|
+
case chainIds.bsc.mainnet:
|
|
47
|
+
return BaseChain.BSC;
|
|
48
|
+
case chainIds.arbitrum.mainnet:
|
|
49
|
+
return BaseChain.ARBITRUM;
|
|
50
|
+
case chainIds.optimism.mainnet:
|
|
51
|
+
return BaseChain.OPTIMISM;
|
|
92
52
|
default:
|
|
93
53
|
return undefined;
|
|
94
54
|
}
|
|
95
55
|
}
|
|
96
56
|
static async getRandomProvider(chainId) {
|
|
97
57
|
// Filter out Flashbots and Payload RPCs
|
|
98
|
-
const rpcUrls =
|
|
58
|
+
const rpcUrls = Providers.evm[chainId.toString()].filter(url => !url.includes("flashbots.net") && !url.includes("payload.de"));
|
|
99
59
|
if (!rpcUrls || rpcUrls.length === 0) {
|
|
100
60
|
throw new Error(`No providers found for chain ${chainId}`);
|
|
101
61
|
}
|
|
@@ -119,7 +79,7 @@ class EvmCoinFinder {
|
|
|
119
79
|
throw new Error(`All RPC providers failed for chain ${chainId}`);
|
|
120
80
|
}
|
|
121
81
|
static validateChainId(chainId) {
|
|
122
|
-
if (!Object.values(
|
|
82
|
+
if (!Object.values(chainIds).some(chain => Object.values(chain).includes(chainId))) {
|
|
123
83
|
throw new EvmError(`Unsupported chain ID: ${chainId}`, "UNSUPPORTED_CHAIN_ID");
|
|
124
84
|
}
|
|
125
85
|
}
|
|
@@ -135,22 +95,22 @@ class EvmCoinFinder {
|
|
|
135
95
|
this.validateChainId(chainId);
|
|
136
96
|
let weth;
|
|
137
97
|
switch (chainId) {
|
|
138
|
-
case
|
|
139
|
-
weth =
|
|
98
|
+
case chainIds.eth.mainnet:
|
|
99
|
+
weth = tokenAddresses.ethereum.wrapped.ethereum.mainnet;
|
|
140
100
|
break;
|
|
141
|
-
case
|
|
142
|
-
weth =
|
|
101
|
+
case chainIds.bsc.mainnet:
|
|
102
|
+
weth = tokenAddresses.ethereum.wrapped.bsc.mainnet;
|
|
143
103
|
break;
|
|
144
|
-
case
|
|
145
|
-
weth =
|
|
104
|
+
case chainIds.arbitrum.mainnet:
|
|
105
|
+
weth = tokenAddresses.ethereum.wrapped.arbitrum.mainnet;
|
|
146
106
|
break;
|
|
147
|
-
case
|
|
148
|
-
weth =
|
|
107
|
+
case chainIds.optimism.mainnet:
|
|
108
|
+
weth = tokenAddresses.ethereum.wrapped.optimism.mainnet;
|
|
149
109
|
break;
|
|
150
110
|
}
|
|
151
111
|
if (weth) {
|
|
152
112
|
result[chainId] = {
|
|
153
|
-
native:
|
|
113
|
+
native: tokenAddresses.ethereum.mainnet, // native ETH
|
|
154
114
|
wrapped: weth, // wrapped ETH
|
|
155
115
|
};
|
|
156
116
|
}
|
|
@@ -167,8 +127,8 @@ class EvmCoinFinder {
|
|
|
167
127
|
for (const chainId of targetChainIds) {
|
|
168
128
|
this.validateChainId(chainId);
|
|
169
129
|
result[chainId] = {
|
|
170
|
-
native:
|
|
171
|
-
wrapped:
|
|
130
|
+
native: tokenAddresses.ethereum.mainnet,
|
|
131
|
+
wrapped: tokenAddresses.ethereum.wrapped[this.getChainName(chainId)]
|
|
172
132
|
?.mainnet || false,
|
|
173
133
|
};
|
|
174
134
|
}
|
|
@@ -218,18 +178,18 @@ class EvmCoinFinder {
|
|
|
218
178
|
continue;
|
|
219
179
|
}
|
|
220
180
|
// Check USDC mapping
|
|
221
|
-
if (tokenAddress ===
|
|
181
|
+
if (tokenAddress === tokenAddresses.usdc[sourceChain]?.mainnet) {
|
|
222
182
|
result[targetChainId] = {
|
|
223
183
|
native: tokenAddress,
|
|
224
|
-
wrapped:
|
|
184
|
+
wrapped: tokenAddresses.usdc[targetChain]?.mainnet || false,
|
|
225
185
|
};
|
|
226
186
|
continue;
|
|
227
187
|
}
|
|
228
188
|
// Check USDT mapping
|
|
229
|
-
if (tokenAddress ===
|
|
189
|
+
if (tokenAddress === tokenAddresses.usdt[sourceChain]?.mainnet) {
|
|
230
190
|
result[targetChainId] = {
|
|
231
191
|
native: tokenAddress,
|
|
232
|
-
wrapped:
|
|
192
|
+
wrapped: tokenAddresses.usdt[targetChain]?.mainnet || false,
|
|
233
193
|
};
|
|
234
194
|
continue;
|
|
235
195
|
}
|
|
@@ -249,23 +209,23 @@ class EvmCoinFinder {
|
|
|
249
209
|
static getNativeForSupportedChain(chain, targetChainId) {
|
|
250
210
|
// Validate chain matches targetChainId
|
|
251
211
|
switch (chain) {
|
|
252
|
-
case
|
|
253
|
-
if (targetChainId !==
|
|
212
|
+
case BaseChain.ETHEREUM:
|
|
213
|
+
if (targetChainId !== chainIds.eth.mainnet) {
|
|
254
214
|
throw new Error("Chain ID doesn't match ethereum");
|
|
255
215
|
}
|
|
256
|
-
return
|
|
257
|
-
case
|
|
258
|
-
if (targetChainId !==
|
|
216
|
+
return tokenAddresses.ethereum.mainnet;
|
|
217
|
+
case BaseChain.BSC:
|
|
218
|
+
if (targetChainId !== chainIds.bsc.mainnet) {
|
|
259
219
|
throw new Error("Chain ID doesn't match bsc");
|
|
260
220
|
}
|
|
261
221
|
break;
|
|
262
|
-
case
|
|
263
|
-
if (targetChainId !==
|
|
222
|
+
case BaseChain.ARBITRUM:
|
|
223
|
+
if (targetChainId !== chainIds.arbitrum.mainnet) {
|
|
264
224
|
throw new Error("Chain ID doesn't match arbitrum");
|
|
265
225
|
}
|
|
266
226
|
break;
|
|
267
|
-
case
|
|
268
|
-
if (targetChainId !==
|
|
227
|
+
case BaseChain.OPTIMISM:
|
|
228
|
+
if (targetChainId !== chainIds.optimism.mainnet) {
|
|
269
229
|
throw new Error("Chain ID doesn't match optimism");
|
|
270
230
|
}
|
|
271
231
|
break;
|
|
@@ -273,8 +233,7 @@ class EvmCoinFinder {
|
|
|
273
233
|
throw new Error(`Unsupported chain: ${chain}`);
|
|
274
234
|
}
|
|
275
235
|
// Return native address (0x0)
|
|
276
|
-
return
|
|
236
|
+
return tokenAddresses.ethereum.mainnet;
|
|
277
237
|
}
|
|
278
238
|
}
|
|
279
|
-
exports.EvmCoinFinder = EvmCoinFinder;
|
|
280
239
|
//# sourceMappingURL=EvmCoinFinder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EvmCoinFinder.js","sourceRoot":"","sources":["../../../src/abstraction/EvmCoinFinder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EvmCoinFinder.js","sourceRoot":"","sources":["../../../src/abstraction/EvmCoinFinder.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAC/E,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAahC;;;;;;GAMG;AACH,MAAM,OAAO,QAAS,SAAQ,KAAK;IAC/B,YACI,OAAe,EACC,IAAY,EACZ,OAAa;QAE7B,KAAK,CAAC,OAAO,CAAC,CAAA;QAHE,SAAI,GAAJ,IAAI,CAAQ;QACZ,YAAO,GAAP,OAAO,CAAM;IAGjC,CAAC;CACJ;AAED;;;;;GAKG;AACH,MAAM,OAAO,aAAa;IACd,MAAM,CAAC,YAAY,CAAC,OAAyB;QACjD,QAAQ,OAAO,EAAE,CAAC;YACd,KAAK,QAAQ,CAAC,GAAG,CAAC,OAAO;gBACrB,OAAO,SAAS,CAAC,QAAQ,CAAA;YAC7B,KAAK,QAAQ,CAAC,GAAG,CAAC,OAAO;gBACrB,OAAO,SAAS,CAAC,GAAG,CAAA;YACxB,KAAK,QAAQ,CAAC,QAAQ,CAAC,OAAO;gBAC1B,OAAO,SAAS,CAAC,QAAQ,CAAA;YAC7B,KAAK,QAAQ,CAAC,QAAQ,CAAC,OAAO;gBAC1B,OAAO,SAAS,CAAC,QAAQ,CAAA;YAC7B;gBACI,MAAM,IAAI,KAAK,CAAC,yBAAyB,OAAO,EAAE,CAAC,CAAA;QAC3D,CAAC;IACL,CAAC;IAEO,MAAM,CAAC,cAAc,CAAC,OAAe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AAC,QAAQ;gBACnB,IAAI,aAAa,KAAK,QAAQ,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;oBAC9C,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAA;gBACtD,CAAC;gBACD,MAAK;YACT;gBACI,MAAM,IAAI,KAAK,CAAC,sBAAsB,KAAK,EAAE,CAAC,CAAA;QACtD,CAAC;QAED,8BAA8B;QAC9B,OAAO,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAA;IAC1C,CAAC;CACJ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { XMCoreTargetIdentityPayload, Web2CoreTargetIdentityPayload, GithubProof, TwitterProof, InferFromSignaturePayload, DiscordProof, TelegramSignedAttestation, FindDemosIdByWeb2IdentityQuery, FindDemosIdByWeb3IdentityQuery, NomisWalletIdentity } from "../types/abstraction";
|
|
1
|
+
import { XMCoreTargetIdentityPayload, Web2CoreTargetIdentityPayload, GithubProof, TwitterProof, InferFromSignaturePayload, DiscordProof, TelegramSignedAttestation, FindDemosIdByWeb2IdentityQuery, FindDemosIdByWeb3IdentityQuery, NomisWalletIdentity, TLSNotaryPresentation, TLSNIdentityContext } from "../types/abstraction";
|
|
2
2
|
import { UnifiedDomainResolution } from "./types/UDResolution";
|
|
3
3
|
import { Demos } from "../websdk/demosclass";
|
|
4
4
|
import { PQCAlgorithm } from "../types/cryptography";
|
|
@@ -80,6 +80,33 @@ export declare class Identities {
|
|
|
80
80
|
* @returns The response from the RPC call.
|
|
81
81
|
*/
|
|
82
82
|
addGithubIdentity(demos: Demos, payload: GithubProof, referralCode?: string): Promise<RPCResponseWithValidityData>;
|
|
83
|
+
/**
|
|
84
|
+
* Add a Web2 identity via TLSNotary attestation.
|
|
85
|
+
*
|
|
86
|
+
* This generic method uses a cryptographic proof from TLSNotary to verify
|
|
87
|
+
* identity ownership. The context determines which platform's API was attested:
|
|
88
|
+
* - "github": api.github.com/user
|
|
89
|
+
* - "discord": discord.com/api/users/@me
|
|
90
|
+
* - "telegram": backend's /api/telegram/user
|
|
91
|
+
*
|
|
92
|
+
* @param demos A Demos instance to communicate with the RPC.
|
|
93
|
+
* @param context The platform context ("github", "discord", or "telegram").
|
|
94
|
+
* @param proof The TLSNotary presentation (from attestResult.presentation).
|
|
95
|
+
* @param username Username from the proven response.
|
|
96
|
+
* @param userId User ID from the proven response.
|
|
97
|
+
* @param referralCode Optional referral code.
|
|
98
|
+
* @returns The response from the RPC call.
|
|
99
|
+
*/
|
|
100
|
+
addWeb2IdentityViaTLSN(demos: Demos, context: TLSNIdentityContext, proof: TLSNotaryPresentation, username: string, userId: string | number, referralCode?: string): Promise<RPCResponseWithValidityData>;
|
|
101
|
+
/**
|
|
102
|
+
* Remove a Web2 identity that was added via TLSNotary.
|
|
103
|
+
*
|
|
104
|
+
* @param demos A Demos instance to communicate with the RPC.
|
|
105
|
+
* @param context The platform context ("github", "discord", or "telegram").
|
|
106
|
+
* @param username The username to remove.
|
|
107
|
+
* @returns The response from the RPC call.
|
|
108
|
+
*/
|
|
109
|
+
removeWeb2IdentityViaTLSN(demos: Demos, context: TLSNIdentityContext, username: string): Promise<RPCResponseWithValidityData>;
|
|
83
110
|
/**
|
|
84
111
|
* Add a twitter identity to the GCR.
|
|
85
112
|
*
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// TODO Implement the identities abstraction
|
|
3
2
|
// This should be able to query and set the GCR identities for a Demos address
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
exports.Identities = void 0;
|
|
9
|
-
const axios_1 = __importDefault(require("axios"));
|
|
10
|
-
const encryption_1 = require("../encryption");
|
|
11
|
-
const websdk_1 = require("../websdk");
|
|
12
|
-
class Identities {
|
|
3
|
+
import axios from "axios";
|
|
4
|
+
import { uint8ArrayToHex, UnifiedCrypto } from "../encryption/index.js";
|
|
5
|
+
import { _required as required, DemosTransactions } from "../websdk/index.js";
|
|
6
|
+
export class Identities {
|
|
13
7
|
constructor() {
|
|
14
8
|
this.formats = {
|
|
15
9
|
web2: {
|
|
@@ -35,7 +29,7 @@ class Identities {
|
|
|
35
29
|
async createWeb2ProofPayload(demos) {
|
|
36
30
|
const message = "dw2p";
|
|
37
31
|
const signature = await demos.crypto.sign(demos.algorithm, new TextEncoder().encode(message));
|
|
38
|
-
return `demos:${message}:${demos.algorithm}:${
|
|
32
|
+
return `demos:${message}:${demos.algorithm}:${uint8ArrayToHex(signature.signature)}`;
|
|
39
33
|
}
|
|
40
34
|
/**
|
|
41
35
|
* Infer an identity from either a crosschain payload or a web2 proof.
|
|
@@ -58,9 +52,9 @@ class Identities {
|
|
|
58
52
|
}
|
|
59
53
|
}
|
|
60
54
|
}
|
|
61
|
-
const tx =
|
|
55
|
+
const tx = DemosTransactions.empty();
|
|
62
56
|
const ed25519 = await demos.crypto.getIdentity("ed25519");
|
|
63
|
-
const address =
|
|
57
|
+
const address = uint8ArrayToHex(ed25519.publicKey);
|
|
64
58
|
tx.content = {
|
|
65
59
|
...tx.content,
|
|
66
60
|
type: "identity",
|
|
@@ -88,9 +82,9 @@ class Identities {
|
|
|
88
82
|
* @returns The response from the RPC call.
|
|
89
83
|
*/
|
|
90
84
|
async removeIdentity(demos, context, payload) {
|
|
91
|
-
const tx =
|
|
85
|
+
const tx = DemosTransactions.empty();
|
|
92
86
|
const ed25519 = await demos.crypto.getIdentity("ed25519");
|
|
93
|
-
const address =
|
|
87
|
+
const address = uint8ArrayToHex(ed25519.publicKey);
|
|
94
88
|
tx.content = {
|
|
95
89
|
...tx.content,
|
|
96
90
|
type: "identity",
|
|
@@ -163,7 +157,7 @@ class Identities {
|
|
|
163
157
|
*/
|
|
164
158
|
async addGithubIdentity(demos, payload, referralCode) {
|
|
165
159
|
const username = payload.split("/")[3];
|
|
166
|
-
const ghUser = await
|
|
160
|
+
const ghUser = await axios.get(`https://api.github.com/users/${username}`);
|
|
167
161
|
if (!ghUser.data.login) {
|
|
168
162
|
throw new Error("Failed to get github user");
|
|
169
163
|
}
|
|
@@ -176,6 +170,47 @@ class Identities {
|
|
|
176
170
|
};
|
|
177
171
|
return await this.inferIdentity(demos, "web2", githubPayload);
|
|
178
172
|
}
|
|
173
|
+
/**
|
|
174
|
+
* Add a Web2 identity via TLSNotary attestation.
|
|
175
|
+
*
|
|
176
|
+
* This generic method uses a cryptographic proof from TLSNotary to verify
|
|
177
|
+
* identity ownership. The context determines which platform's API was attested:
|
|
178
|
+
* - "github": api.github.com/user
|
|
179
|
+
* - "discord": discord.com/api/users/@me
|
|
180
|
+
* - "telegram": backend's /api/telegram/user
|
|
181
|
+
*
|
|
182
|
+
* @param demos A Demos instance to communicate with the RPC.
|
|
183
|
+
* @param context The platform context ("github", "discord", or "telegram").
|
|
184
|
+
* @param proof The TLSNotary presentation (from attestResult.presentation).
|
|
185
|
+
* @param username Username from the proven response.
|
|
186
|
+
* @param userId User ID from the proven response.
|
|
187
|
+
* @param referralCode Optional referral code.
|
|
188
|
+
* @returns The response from the RPC call.
|
|
189
|
+
*/
|
|
190
|
+
async addWeb2IdentityViaTLSN(demos, context, proof, username, userId, referralCode) {
|
|
191
|
+
const payload = {
|
|
192
|
+
context: context,
|
|
193
|
+
proof: proof,
|
|
194
|
+
username: username,
|
|
195
|
+
userId: String(userId),
|
|
196
|
+
referralCode: referralCode,
|
|
197
|
+
};
|
|
198
|
+
return await this.inferIdentity(demos, "tlsn", payload);
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Remove a Web2 identity that was added via TLSNotary.
|
|
202
|
+
*
|
|
203
|
+
* @param demos A Demos instance to communicate with the RPC.
|
|
204
|
+
* @param context The platform context ("github", "discord", or "telegram").
|
|
205
|
+
* @param username The username to remove.
|
|
206
|
+
* @returns The response from the RPC call.
|
|
207
|
+
*/
|
|
208
|
+
async removeWeb2IdentityViaTLSN(demos, context, username) {
|
|
209
|
+
return await this.removeIdentity(demos, "tlsn", {
|
|
210
|
+
context: context,
|
|
211
|
+
username: username,
|
|
212
|
+
});
|
|
213
|
+
}
|
|
179
214
|
/**
|
|
180
215
|
* Add a twitter identity to the GCR.
|
|
181
216
|
*
|
|
@@ -250,7 +285,7 @@ class Identities {
|
|
|
250
285
|
// Create the address types to bind
|
|
251
286
|
if (algorithms === "all") {
|
|
252
287
|
await demos.crypto.generateAllIdentities();
|
|
253
|
-
addressTypes =
|
|
288
|
+
addressTypes = UnifiedCrypto.supportedPQCAlgorithms;
|
|
254
289
|
}
|
|
255
290
|
else {
|
|
256
291
|
for (const algorithm of algorithms) {
|
|
@@ -263,12 +298,12 @@ class Identities {
|
|
|
263
298
|
for (const addressType of addressTypes) {
|
|
264
299
|
// INFO: Create an ed25519 signature for each address type
|
|
265
300
|
const keypair = await demos.crypto.getIdentity(addressType);
|
|
266
|
-
const address =
|
|
301
|
+
const address = uint8ArrayToHex(keypair.publicKey);
|
|
267
302
|
const signature = await demos.crypto.sign("ed25519", new TextEncoder().encode(address));
|
|
268
303
|
payloads.push({
|
|
269
304
|
algorithm: addressType,
|
|
270
305
|
address: address,
|
|
271
|
-
signature:
|
|
306
|
+
signature: uint8ArrayToHex(signature.signature),
|
|
272
307
|
});
|
|
273
308
|
}
|
|
274
309
|
return await this.inferIdentity(demos, "pqc", payloads);
|
|
@@ -278,7 +313,7 @@ class Identities {
|
|
|
278
313
|
// Create the address types to remove
|
|
279
314
|
if (algorithms === "all") {
|
|
280
315
|
await demos.crypto.generateAllIdentities();
|
|
281
|
-
addressTypes =
|
|
316
|
+
addressTypes = UnifiedCrypto.supportedPQCAlgorithms;
|
|
282
317
|
}
|
|
283
318
|
else {
|
|
284
319
|
for (const algorithm of algorithms) {
|
|
@@ -292,7 +327,7 @@ class Identities {
|
|
|
292
327
|
const address = await demos.crypto.getIdentity(addressType);
|
|
293
328
|
payloads.push({
|
|
294
329
|
algorithm: addressType,
|
|
295
|
-
address:
|
|
330
|
+
address: uint8ArrayToHex(address.publicKey),
|
|
296
331
|
});
|
|
297
332
|
}
|
|
298
333
|
return await this.removeIdentity(demos, "pqc", payloads);
|
|
@@ -307,7 +342,7 @@ class Identities {
|
|
|
307
342
|
async getIdentities(demos, call = "getIdentities", address) {
|
|
308
343
|
if (!address) {
|
|
309
344
|
const ed25519 = await demos.crypto.getIdentity("ed25519");
|
|
310
|
-
address =
|
|
345
|
+
address = uint8ArrayToHex(ed25519.publicKey);
|
|
311
346
|
}
|
|
312
347
|
const request = {
|
|
313
348
|
method: "gcr_routine",
|
|
@@ -348,7 +383,7 @@ class Identities {
|
|
|
348
383
|
* @returns The points data for the identity
|
|
349
384
|
*/
|
|
350
385
|
async getUserPoints(demos, address) {
|
|
351
|
-
(
|
|
386
|
+
required(address || demos.walletConnected, "No address provided and no wallet connected");
|
|
352
387
|
if (!address) {
|
|
353
388
|
address = await demos.getEd25519Address();
|
|
354
389
|
}
|
|
@@ -905,5 +940,4 @@ class Identities {
|
|
|
905
940
|
return await this.removeIdentity(demos, "nomis", payload);
|
|
906
941
|
}
|
|
907
942
|
}
|
|
908
|
-
exports.Identities = Identities;
|
|
909
943
|
//# sourceMappingURL=Identities.js.map
|