@eluvio/elv-client-js 3.2.21 → 3.2.22
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/package-lock.json +42401 -0
- package/package.json +1 -1
- package/src/ElvClient.js +17 -9
- package/src/walletClient/Utils.js +1 -0
package/package.json
CHANGED
package/src/ElvClient.js
CHANGED
|
@@ -708,6 +708,22 @@ class ElvClient {
|
|
|
708
708
|
json 79b {"adr":"VVf4DQU357tDnZGYQeDrntRJ5rs=","spc":"ispc3ANoVSzNA3P6t7abLR69ho5YPPZU"}
|
|
709
709
|
*/
|
|
710
710
|
|
|
711
|
+
async PersonalSign({
|
|
712
|
+
message,
|
|
713
|
+
addEthereumPrefix,
|
|
714
|
+
Sign
|
|
715
|
+
}) {
|
|
716
|
+
if(!Sign) {
|
|
717
|
+
Sign = async message => this.authClient.Sign(message);
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
if(addEthereumPrefix) {
|
|
721
|
+
message = Ethers.utils.keccak256(Buffer.from(`\x19Ethereum Signed Message:\n${message.length}${message}`, "utf-8"));
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
return await Sign(message);
|
|
725
|
+
}
|
|
726
|
+
|
|
711
727
|
/**
|
|
712
728
|
* Create a signed authorization token that can be used to authorize against the fabric
|
|
713
729
|
*
|
|
@@ -737,17 +753,9 @@ class ElvClient {
|
|
|
737
753
|
exp: Date.now() + duration,
|
|
738
754
|
};
|
|
739
755
|
|
|
740
|
-
if(!Sign) {
|
|
741
|
-
Sign = async message => this.authClient.Sign(message);
|
|
742
|
-
}
|
|
743
|
-
|
|
744
756
|
let message = `Eluvio Content Fabric Access Token 1.0\n${JSON.stringify(token)}`;
|
|
745
757
|
|
|
746
|
-
|
|
747
|
-
message = Ethers.utils.keccak256(Buffer.from(`\x19Ethereum Signed Message:\n${message.length}${message}`, "utf-8"));
|
|
748
|
-
}
|
|
749
|
-
|
|
750
|
-
const signature = await Sign(message);
|
|
758
|
+
const signature = await this.PersonalSign({message, addEthereumPrefix, Sign});
|
|
751
759
|
|
|
752
760
|
const compressedToken = Pako.deflateRaw(Buffer.from(JSON.stringify(token), "utf-8"));
|
|
753
761
|
return `acspjc${this.utils.B58(
|
|
@@ -56,6 +56,7 @@ const FormatNFTDetails = function(entry) {
|
|
|
56
56
|
ContractId: `ictr${Utils.AddressToHash(info.contract_addr)}`,
|
|
57
57
|
ContractName: info.contract_name,
|
|
58
58
|
Cap: info.cap,
|
|
59
|
+
Offers: info.offers || [],
|
|
59
60
|
TokenIdStr: info.token_id_str,
|
|
60
61
|
TokenUri: info.token_uri,
|
|
61
62
|
TokenOrdinal: info.ordinal,
|