项目思路:
Iv: 随机16位Uint8Array的数组,再转成16进制字符串。
this._transport.send('{"data":"3c993da0f00f3fd751ba6947ff31305c4d15f193e7bb31ac06846dd29790b6af177447f8c5bfd0632d5352041376f26b97318b5459f860f51037d240d5481fc217359537aff61a39eea05ff430d93568511c605712f3975a29529dbcaee815472babaad5a28039855105e039282b4c33757abbf5ed0346f4813c7825481b045c6a62846e30d5425770da8bc5bf3f58324f5895f70a4253d1884db25a3aeb1f1096c6f6b984f810558f53d52d45e0e57e98382df0897528ae6fc987f16d6ebc2c8f22af9cd5268c6fb7248580fb8c7efbb2e7dafcc6b076e62cb74818849cbf143ff86ce2ae711c58abde74cff913f9ddc8daa062abc7a7bf04c2def67a8c12a9e2355eb274f89273576d0ed2cd0ab88a1f805d8940957abcf7440bccc124c97c642701991c2486f61959267558f1fd8202714b92cd560ca9f97e9770f135ecc0a97bfedaa8e6d79186f9470ada27ae14c745693e829b306194a5199694816cedc47399346746087839e918abf1acd7b9","hmac":"eb2c2878987c04c1cd86ba818ebc05e8e717825a96d1f82debe087c1704ca079","iv":"2addb8e84ce047b4b5c4b5e4267f62f1"}', '111111', false)
Websocket send
"{\"topic\":\"111111\",\"type\":\"pub\",\"payload\":\"{\\\"data\\\":\\\"948a32e1d283138aaa0f0943034f403550c1972f32bff65d5b46397cd668627063457a7add137a6a20b44446556f0a28c9b33a4ead983343e2873cf6f5aa3685fe75ef6771ac5852538f77083665f988eb481ad1a8a734a701a9cf2df0955b527f59c31e86183386dddab89f67ab6d214f584bafe5104d3a818ea0a459a0007e2379f39a1d4e51dee80f92e20eac8891ccb821bf6da10f4c83d060d3d8267bd22ad4be77e1a9c6c9f67cb23eae294d5213048f36bcd2ab58e6d72aac2ccf37d9c3d3680486ecb5be60b34556064352c9f11c28042c5f9a5b2ed0612f9cace1d97a8d56851cca90c4b63da418fa4d86c8625e1137d7fee7a1a9d16d4615f11d8dd4e410e9aeb1fb4c3b20b3f077a36b5dd799f148f6382f4f43f48798e5d2db11ec784e55c1b6eddcfb4408c01844bc1860c9df6c44bb5bc94520320995dbbbb28bc63e31ad1e10fc08c8fb86504f6224a7c1305122ea1ef346cba35fb1aeab34ed7b3602ed871d8e8df077525d8fbe5d\\\",\\\"hmac\\\":\\\"566e762888c6e88b316cb5f99f7371ddc193f3544cd1892adff08a89d7ca7d80\\\",\\\"iv\\\":\\\"7204ef8d52d2dca3679bcdec71f51205\\\"}\",\"silent\":false}"
https://u.bridge.walletconnect.org/?env=browser&host=www.7seasnft.com&protocol=wc&version=1
JavaScript加密部分
App……..27fd.js
868 erc20Approve: function() {
106757 f.prototype._encodeMethodABI = function() {
var e = this._method.signature
, t = this.arguments || []
, n = !1
, r = this._parent.options.jsonInterface.filter((function(t) {
return "constructor" === e && t.type === e || (t.signature === e || t.signature === e.replace("0x", "") || t.name === e) && "function" === t.type
}
)).map((function(e) {
var r = Array.isArray(e.inputs) ? e.inputs.length : 0;
if (r !== t.length)
throw new Error("The number of arguments is not matching the methods required number. You need to pass " + r + " arguments.");
return "function" === e.type && (n = e.signature),
Array.isArray(e.inputs) ? e.inputs : []
}
)).map((function(e) {
return l.encodeParameters(e, t).replace("0x", "")
}
))[0] || "";
if ("constructor" === e) {
if (!this._deployData)
throw new Error("The contract has no contract data option set. This is necessary to append the constructor parameters.");
return this._deployData.startsWith("0x") || (this._deployData = "0x" + this._deployData),
this._deployData + r
}
var a = n ? n + r : r;
if (!a)
throw new Error("Couldn't find a matching contract method named \"" + this._method.name + '".');
return a
}
processTransaction: async(e,t)=>{
try {
const n = await this.getWalletConnector()
, r = await n.sendTransaction(e);
t(null, r)
} catch (n) {
t(n)
}
}
async sendTransaction(e) {
if (!this._connected)
throw new Error(c);
const t = Object(a["z"])(e)
, n = this._formatRequest({
method: "eth_sendTransaction",
params: [t]
})
, r = await this._sendCallRequest(n);
return r
}
-----------------------------------------------------------------------------------------------------------------------------
23449 "2eaf": function(e, t, n) {
24038 async _sendRequest(e, t) {
const n = this._formatRequest(e)
, r = await this._encrypt(n)
, i = "undefined" !== typeof (null === t || void 0 === t ? void 0 : t.topic) ? t.topic : this.peerId
, o = JSON.stringify(r)
, c = "undefined" !== typeof (null === t || void 0 === t ? void 0 : t.forcePushNotification) ? !t.forcePushNotification : Object(a["v"])(n);
this._transport.send(o, i, c)
24273 async _encrypt(e) {
const t = this._key;
if (this._cryptoLib && t) {
const n = await this._cryptoLib.encrypt(e, t);
return n
}
return null
24364 async function z(e, t, n) {
const r = R["f"](Object(a["b"])(t))
, i = n || await I(128)
, o = R["f"](Object(a["b"])(i))
, c = R["c"](o, !1)
, s = JSON.stringify(e)
, d = R["z"](s)
, l = await P["aesCbcEncrypt"](o, r, d)
, f = R["c"](l, !1)
, u = R["j"](l, o)
, b = await P["hmacSha256Sign"](r, u)
, h = R["c"](b, !1);
此项目是针对 www.7seasnft.com 这个站进行编写,获取最新合适竞标,跟踪此标不断的进行加价出价,核心通信竞标采用了加密数据的websocket提交竞标金额。