added claim_address and change_address to publish'
This commit is contained in:
parent
daa7555752
commit
5569e53e2d
3 changed files with 6 additions and 8 deletions
|
@ -68,7 +68,7 @@ function findAllClaims(name, resolve, reject){
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
||||||
publishClaim: function(publishParams){
|
publishClaim: function(publishParams){
|
||||||
console.log(publishParams);
|
console.log("publish params:>", publishParams);
|
||||||
var deferred = new Promise(function(resolve, reject){
|
var deferred = new Promise(function(resolve, reject){
|
||||||
axios.post('http://localhost:5279/lbryapi', {
|
axios.post('http://localhost:5279/lbryapi', {
|
||||||
"method": "publish",
|
"method": "publish",
|
||||||
|
@ -89,9 +89,7 @@ module.exports = {
|
||||||
},
|
},
|
||||||
|
|
||||||
getClaimBasedOnNameOnly: function(claimName){
|
getClaimBasedOnNameOnly: function(claimName){
|
||||||
// 1. create a promise
|
|
||||||
var deferred = new Promise(function (resolve, reject){
|
var deferred = new Promise(function (resolve, reject){
|
||||||
// 2. code to resolve or reject the promise
|
|
||||||
// make a call to the daemon to get the claims list
|
// make a call to the daemon to get the claims list
|
||||||
axios.post('http://localhost:5279/lbryapi', {
|
axios.post('http://localhost:5279/lbryapi', {
|
||||||
"method": "claim_list",
|
"method": "claim_list",
|
||||||
|
@ -129,9 +127,7 @@ module.exports = {
|
||||||
reject(error);
|
reject(error);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
// 3. return the promise
|
|
||||||
return deferred;
|
return deferred;
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
getClaimBasedOnUri: function(uri){
|
getClaimBasedOnUri: function(uri){
|
||||||
|
|
|
@ -15,7 +15,7 @@ function createPublishParams(name, filepath, license, nsfw) {
|
||||||
var publishParams = {
|
var publishParams = {
|
||||||
"name": name,
|
"name": name,
|
||||||
"file_path": filepath,
|
"file_path": filepath,
|
||||||
"bid": 0.1,
|
"bid": 0.01,
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"description": name + " published via spee.ch",
|
"description": name + " published via spee.ch",
|
||||||
"title": name,
|
"title": name,
|
||||||
|
@ -23,7 +23,9 @@ function createPublishParams(name, filepath, license, nsfw) {
|
||||||
"language": "en",
|
"language": "en",
|
||||||
"license": license,
|
"license": license,
|
||||||
"nsfw": (nsfw.toLowerCase() === "true")
|
"nsfw": (nsfw.toLowerCase() === "true")
|
||||||
}
|
},
|
||||||
|
"claim_address": "", // fill in wallet address
|
||||||
|
"change_address": "" // fill in wallet address; requires daemon 0.12.2rc1 or above
|
||||||
};
|
};
|
||||||
return publishParams;
|
return publishParams;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ module.exports = function(app) {
|
||||||
console.log("saved " + event.file.name);
|
console.log("saved " + event.file.name);
|
||||||
if (event.file.success){
|
if (event.file.success){
|
||||||
socket.emit("publish-status", "file upload successfully completed");
|
socket.emit("publish-status", "file upload successfully completed");
|
||||||
socketHelpers.publish(event.file.meta.name, event.file.pathName, event.file.meta.license,event.file.meta.nsfw, socket)
|
socketHelpers.publish(event.file.meta.name, event.file.pathName, event.file.meta.license, event.file.meta.nsfw, socket)
|
||||||
} else {
|
} else {
|
||||||
socket.emit("publish-failure", "file uploaded, but with errors")
|
socket.emit("publish-failure", "file uploaded, but with errors")
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue