@did-kr-cg/whisper-connect
Version:
Whisper Connect is an easy and simple decentralized (without kind of a google cloud services) p2p connect solution. Desktop browser login via mobile app. or create transaction for smart contracts and send a signature and message via whisper too. and it ca
125 lines (122 loc) • 3.12 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.TOPIC = exports.ABI = void 0;
// import { AbiCoder } from 'web3-eth-abi';
var Web3EthAbi = require('web3-eth-abi');
/*
pragma solidity >=0.4.22 <0.7.0;
contract WC {
// _type = sha256(type), _hash = sha256(byte2hex(msgpock({nonce, timestamp, parms}))
function register(bytes32 _type, bytes32 _hash) public {
// dummy function
}
function authenticate(bytes32 _type, bytes32 _hash) public {
// dummy function
}
function credencial(bytes32 _type, bytes32 _hash) public {
// dummy function
}
function presentation(bytes32 _type, bytes32 _hash) public {
// dummy function
}
// function contract(address _contractAddress, byte32 _hash)
// function transfer(address _token, address _to, byte32 _hash)
}
*/
var abi = [
{
inputs: [
{
internalType: 'bytes32',
name: '_type',
type: 'bytes32'
},
{
internalType: 'bytes32',
name: '_hash',
type: 'bytes32'
}
],
name: 'authenticate',
outputs: [],
stateMutability: 'nonpayable',
type: 'function'
},
{
inputs: [
{
internalType: 'bytes32',
name: '_type',
type: 'bytes32'
},
{
internalType: 'bytes32',
name: '_hash',
type: 'bytes32'
}
],
name: 'credencial',
outputs: [],
stateMutability: 'nonpayable',
type: 'function'
},
{
inputs: [
{
internalType: 'bytes32',
name: '_type',
type: 'bytes32'
},
{
internalType: 'bytes32',
name: '_hash',
type: 'bytes32'
}
],
name: 'presentation',
outputs: [],
stateMutability: 'nonpayable',
type: 'function'
},
{
inputs: [
{
internalType: 'bytes32',
name: '_type',
type: 'bytes32'
},
{
internalType: 'bytes32',
name: '_hash',
type: 'bytes32'
}
],
name: 'register',
outputs: [],
stateMutability: 'nonpayable',
type: 'function'
}
];
var ABI = {};
exports.ABI = ABI;
var TOPIC = {};
exports.TOPIC = TOPIC;
/*
const ABI: Abi = {};
const TOPIC: Topic = {};
const abiCoder = new AbiCoder();
for(let i = 0; i < abi.length; i++) {
ABI[abi[i].name!.toUpperCase()] = abi[i];
TOPIC[abiCoder.encodeFunctionSignature(abi[i])] = {
name: abi[i].name!.toUpperCase(),
abi: abi[i],
};
}
*/
for (var i = 0; i < abi.length; i++) {
ABI[abi[i].name.toUpperCase()] = abi[i];
TOPIC[Web3EthAbi.encodeFunctionSignature(abi[i])] = {
name: abi[i].name.toUpperCase(),
abi: abi[i],
};
}