@eluvio/elv-client-js 4.0.82 → 4.0.84
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 -11
- package/dist/ElvClient-node-min.js +10 -10
- package/dist/ElvFrameClient-min.js +1 -1
- package/dist/ElvWalletClient-min.js +11 -11
- package/dist/ElvWalletClient-node-min.js +10 -10
- package/dist/src/FrameClient.js +1 -1
- package/dist/src/abr_profiles/abr_profile_live_to_vod.js +7 -0
- package/dist/src/client/LiveConf.js +118 -31
- package/dist/src/client/LiveStream.js +1053 -528
- package/package.json +1 -1
- package/src/FrameClient.js +3 -0
- package/src/abr_profiles/abr_profile_live_to_vod.js +9 -0
- package/src/client/LiveConf.js +113 -28
- package/src/client/LiveStream.js +555 -153
- package/testScripts/DecodeSignedMessage.js +45 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const { ElvClient } = require("../src/ElvClient");
|
|
2
|
+
|
|
3
|
+
const yargs = require("yargs");
|
|
4
|
+
const argv = yargs
|
|
5
|
+
.option("msg", {
|
|
6
|
+
description: "message to be decoded",
|
|
7
|
+
type: "string"
|
|
8
|
+
})
|
|
9
|
+
.option("config-url", {
|
|
10
|
+
type: "string",
|
|
11
|
+
description: "URL pointing to the Fabric configuration. i.e. https://main.net955210.contentfabric.io/config"
|
|
12
|
+
})
|
|
13
|
+
.demandOption(
|
|
14
|
+
["msg"],
|
|
15
|
+
"\nUsage: PRIVATE_KEY=<private-key> node DecodeSignedMessage.js --msg <message>\n"
|
|
16
|
+
)
|
|
17
|
+
.strict().argv;
|
|
18
|
+
const ClientConfiguration = (!argv["config-url"]) ? (require("../TestConfiguration.json")) : {"config-url": argv["config-url"]};
|
|
19
|
+
|
|
20
|
+
const DecodeSignedMessage = async ({msg}) => {
|
|
21
|
+
try {
|
|
22
|
+
const client = await ElvClient.FromConfigurationUrl({
|
|
23
|
+
configUrl: ClientConfiguration["config-url"],
|
|
24
|
+
});
|
|
25
|
+
const wallet = client.GenerateWallet();
|
|
26
|
+
const signer = wallet.AddAccount({
|
|
27
|
+
privateKey: process.env.PRIVATE_KEY
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
client.SetSigner({signer});
|
|
31
|
+
|
|
32
|
+
const decodedMessage = await client.DecodeSignedMessageJSON({
|
|
33
|
+
signedMessage: msg,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
console.log(JSON.stringify(decodedMessage));
|
|
37
|
+
} catch(error) {
|
|
38
|
+
console.error(error);
|
|
39
|
+
console.error(JSON.stringify(error, null, 2));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
process.exit(0);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
DecodeSignedMessage({msg: argv.msg});
|