@eluvio/elv-client-js 3.1.96 → 3.1.97
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/ElvClient-min.js +11 -15
- package/dist/ElvClient-node-min.js +13 -17
- package/dist/ElvFrameClient-min.js +9 -13
- package/dist/ElvPermissionsClient-min.js +9 -13
- package/dist/src/AuthorizationClient.js +1980 -2238
- package/dist/src/ContentObjectVerification.js +173 -164
- package/dist/src/Crypto.js +324 -376
- package/dist/src/ElvClient.js +1019 -1182
- package/dist/src/ElvWallet.js +95 -119
- package/dist/src/EthClient.js +896 -1040
- package/dist/src/FrameClient.js +300 -331
- package/dist/src/HttpClient.js +147 -153
- package/dist/src/Id.js +3 -1
- package/dist/src/PermissionsClient.js +1168 -1294
- package/dist/src/RemoteSigner.js +211 -263
- package/dist/src/UserProfileClient.js +1023 -1164
- package/dist/src/Utils.js +197 -209
- package/dist/src/client/ABRPublishing.js +858 -895
- package/dist/src/client/AccessGroups.js +959 -1102
- package/dist/src/client/ContentAccess.js +3434 -3727
- package/dist/src/client/ContentManagement.js +2068 -2252
- package/dist/src/client/Contracts.js +563 -647
- package/dist/src/client/Files.js +1757 -1886
- package/dist/src/client/NFT.js +112 -126
- package/dist/src/client/NTP.js +422 -478
- package/package-lock.json +22001 -0
- package/package.json +1 -1
- package/src/Utils.js +22 -0
package/package.json
CHANGED
package/src/Utils.js
CHANGED
|
@@ -4,6 +4,7 @@ const bs58 = require("bs58");
|
|
|
4
4
|
const BigNumber = require("bignumber.js").default;
|
|
5
5
|
const VarInt = require("varint");
|
|
6
6
|
const URI = require("urijs");
|
|
7
|
+
const Pako = require("pako");
|
|
7
8
|
|
|
8
9
|
const {
|
|
9
10
|
keccak256,
|
|
@@ -150,6 +151,27 @@ const Utils = {
|
|
|
150
151
|
};
|
|
151
152
|
},
|
|
152
153
|
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Decode the specified signed token into its component parts
|
|
157
|
+
*
|
|
158
|
+
* @param {string} token - The token to decode
|
|
159
|
+
*
|
|
160
|
+
* @return {Object} - Components of the signed token
|
|
161
|
+
*/
|
|
162
|
+
DecodeSignedToken: (token) => {
|
|
163
|
+
const decodedToken = Utils.FromB58(token.slice(6));
|
|
164
|
+
const signature = `0x${decodedToken.slice(0, 65).toString("hex")}`;
|
|
165
|
+
|
|
166
|
+
let payload = JSON.parse(Buffer.from(Pako.inflateRaw(decodedToken.slice(65))).toString("utf-8"));
|
|
167
|
+
payload.adr = Utils.FormatAddress(`0x${Buffer.from(payload.adr, "base64").toString("hex")}`);
|
|
168
|
+
|
|
169
|
+
return {
|
|
170
|
+
payload,
|
|
171
|
+
signature
|
|
172
|
+
};
|
|
173
|
+
},
|
|
174
|
+
|
|
153
175
|
/**
|
|
154
176
|
* Decode the specified write token into its component parts
|
|
155
177
|
*
|