solid-ui 2.4.28-6451e8ad → 2.4.28-6a319caf
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/dist/solid-ui.js +3 -72
- package/dist/solid-ui.js.map +1 -1
- package/dist/solid-ui.min.js +1 -1
- package/dist/solid-ui.min.js.map +1 -1
- package/lib/chat/signature.d.ts +0 -2
- package/lib/chat/signature.d.ts.map +1 -1
- package/lib/chat/signature.js +1 -70
- package/lib/chat/signature.js.map +1 -1
- package/lib/versionInfo.js +2 -2
- package/lib/versionInfo.js.map +1 -1
- package/package.json +3 -1
package/dist/solid-ui.js
CHANGED
|
@@ -5953,96 +5953,27 @@ exports.verifySignature = verifySignature;
|
|
|
5953
5953
|
var _secp256k = __webpack_require__(/*! @noble/curves/secp256k1 */ "./node_modules/@noble/curves/secp256k1.js");
|
|
5954
5954
|
var _utils = __webpack_require__(/*! @noble/hashes/utils */ "./node_modules/@noble/hashes/utils.js");
|
|
5955
5955
|
var _sha = __webpack_require__(/*! @noble/hashes/sha256 */ "./node_modules/@noble/hashes/sha256.js");
|
|
5956
|
-
// import {utf8Encoder} from './utils'
|
|
5957
|
-
// import { getPublicKey } from './keys'
|
|
5958
|
-
|
|
5959
5956
|
var utf8Decoder = new TextDecoder('utf-8');
|
|
5960
5957
|
exports.utf8Decoder = utf8Decoder;
|
|
5961
5958
|
var utf8Encoder = new TextEncoder();
|
|
5962
5959
|
exports.utf8Encoder = utf8Encoder;
|
|
5963
5960
|
var SEC = 'https://w3id.org/security#'; // Proof, VerificationMethod
|
|
5964
|
-
// export const CERT = 'http://www.w3.org/ns/auth/cert#' // PrivateKey, PublicKey, key
|
|
5965
|
-
|
|
5966
|
-
/* eslint-disable no-unused-vars */
|
|
5967
|
-
/* export enum Kind {
|
|
5968
|
-
Metadata = 0,
|
|
5969
|
-
Text = 1,
|
|
5970
|
-
RecommendRelay = 2,
|
|
5971
|
-
Contacts = 3,
|
|
5972
|
-
EncryptedDirectMessage = 4,
|
|
5973
|
-
EventDeletion = 5,
|
|
5974
|
-
Reaction = 7,
|
|
5975
|
-
BadgeAward = 8,
|
|
5976
|
-
ChannelCreation = 40,
|
|
5977
|
-
ChannelMetadata = 41,
|
|
5978
|
-
ChannelMessage = 42,
|
|
5979
|
-
ChannelHideMessage = 43,
|
|
5980
|
-
ChannelMuteUser = 44,
|
|
5981
|
-
Report = 1984,
|
|
5982
|
-
ZapRequest = 9734,
|
|
5983
|
-
Zap = 9735,
|
|
5984
|
-
RelayList = 10002,
|
|
5985
|
-
ClientAuth = 22242,
|
|
5986
|
-
BadgeDefinition = 30008,
|
|
5987
|
-
ProfileBadge = 30009,
|
|
5988
|
-
Article = 30023
|
|
5989
|
-
} */
|
|
5990
5961
|
exports.SEC = SEC;
|
|
5991
5962
|
function getBlankMsg() {
|
|
5992
5963
|
return {
|
|
5993
5964
|
id: '',
|
|
5994
5965
|
created: '',
|
|
5995
|
-
dateDeleted: '',
|
|
5996
|
-
// TODO to remove if not used
|
|
5997
5966
|
content: '',
|
|
5998
|
-
maker: ''
|
|
5999
|
-
sig: '' // TODO to remove if not used
|
|
5967
|
+
maker: ''
|
|
6000
5968
|
};
|
|
6001
5969
|
}
|
|
6002
|
-
|
|
6003
|
-
/* export function finishMsg (t: MsgTemplate, privateKey: string): Message {
|
|
6004
|
-
// to update to chat message triples
|
|
6005
|
-
const message = t as Message
|
|
6006
|
-
// message.pubkey = getPublicKey(privateKey)
|
|
6007
|
-
message.id = getMsgHash(message)
|
|
6008
|
-
message.sig = signMsg(message, privateKey)
|
|
6009
|
-
return message
|
|
6010
|
-
} */
|
|
6011
|
-
|
|
6012
5970
|
function serializeMsg(msg) {
|
|
6013
|
-
// to update to chat messages triples
|
|
6014
|
-
/* if (!validateMsg(msg))
|
|
6015
|
-
throw new Error("can't serialize message with wrong or missing properties") */
|
|
6016
|
-
|
|
6017
5971
|
return JSON.stringify(msg);
|
|
6018
5972
|
}
|
|
6019
5973
|
function getMsgHash(message) {
|
|
6020
5974
|
var msgHash = (0, _sha.sha256)(utf8Encoder.encode(serializeMsg(message)));
|
|
6021
5975
|
return (0, _utils.bytesToHex)(msgHash);
|
|
6022
5976
|
}
|
|
6023
|
-
|
|
6024
|
-
// const isRecord = (obj: unknown): obj is Record<string, unknown> => obj instanceof Object
|
|
6025
|
-
|
|
6026
|
-
/* export function validateMsg<T> (message: T): message is T & UnsignedMsg {
|
|
6027
|
-
if (!isRecord(message)) return false
|
|
6028
|
-
if (typeof message.kind !== 'number') return false
|
|
6029
|
-
if (typeof message.content !== 'string') return false
|
|
6030
|
-
if (typeof message.created_at !== 'number') return false
|
|
6031
|
-
if (typeof message.pubkey !== 'string') return false
|
|
6032
|
-
if (!message.pubkey.match(/^[a-f0-9]{64}$/)) return false
|
|
6033
|
-
|
|
6034
|
-
if (!Array.isArray(message.tags)) return false
|
|
6035
|
-
for (let i = 0; i < message.tags.length; i++) {
|
|
6036
|
-
let tag = message.tags[i]
|
|
6037
|
-
if (!Array.isArray(tag)) return false
|
|
6038
|
-
for (let j = 0; j < tag.length; j++) {
|
|
6039
|
-
if (typeof tag[j] === 'object') return false
|
|
6040
|
-
}
|
|
6041
|
-
}
|
|
6042
|
-
|
|
6043
|
-
return true
|
|
6044
|
-
} */
|
|
6045
|
-
|
|
6046
5977
|
function verifySignature(sig, message, pubKey) {
|
|
6047
5978
|
return _secp256k.schnorr.verify(sig, getMsgHash(message), pubKey);
|
|
6048
5979
|
}
|
|
@@ -14393,8 +14324,8 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
14393
14324
|
}));
|
|
14394
14325
|
exports.versionInfo = void 0;
|
|
14395
14326
|
var versionInfo = {
|
|
14396
|
-
buildTime: '2023-06-
|
|
14397
|
-
commit: '
|
|
14327
|
+
buildTime: '2023-06-03T23:48:25Z',
|
|
14328
|
+
commit: '6a319caf69ef4ecc171a5adcb375dea108d002c2',
|
|
14398
14329
|
npmInfo: {
|
|
14399
14330
|
'solid-ui': '2.4.28',
|
|
14400
14331
|
npm: '8.19.4',
|