lbryweb support
This commit is contained in:
parent
76d8bbef96
commit
406e1970b9
7 changed files with 1031 additions and 9855 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
|||
/node_modules
|
||||
yarn-error.log
|
||||
yarn-error.log
|
||||
package-lock.json
|
26
dist/bundle.js
vendored
26
dist/bundle.js
vendored
|
@ -2467,6 +2467,10 @@ Lbry.account_encrypt = function () {
|
|||
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
return daemonCallWithResult('account_encrypt', params);
|
||||
};
|
||||
Lbry.account_list = function () {
|
||||
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
return daemonCallWithResult('account_list', params);
|
||||
};
|
||||
Lbry.address_is_mine = function () {
|
||||
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
return daemonCallWithResult('address_is_mine', params);
|
||||
|
@ -2592,6 +2596,28 @@ Lbry.resolve = function () {
|
|||
});
|
||||
};
|
||||
|
||||
Lbry.publish = function () {
|
||||
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
return new Promise(function (resolve, reject) {
|
||||
if (Lbry.overrides.publish) {
|
||||
Lbry.overrides.publish(params).then(resolve, reject);
|
||||
} else {
|
||||
apiCall('publish', params, resolve, reject);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// Allow overriding Lbry methods
|
||||
Lbry.overrides = {};
|
||||
Lbry.setOverride = function (methodName, newMethod) {
|
||||
Lbry.overrides[methodName] = newMethod;
|
||||
};
|
||||
|
||||
// Allow overriding daemon connection string (e.g. to `/api/proxy` for lbryweb)
|
||||
Lbry.setDaemonConnectionString = function (value) {
|
||||
Lbry.daemonConnectionString = value;
|
||||
};
|
||||
|
||||
var lbryProxy = new Proxy(Lbry, {
|
||||
get: function get(target, name) {
|
||||
if (name in target) {
|
||||
|
|
9849
package-lock.json
generated
9849
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -2,9 +2,7 @@
|
|||
"name": "lbry-redux",
|
||||
"version": "0.0.1",
|
||||
"description": "Common shared components for desktop and mobile.",
|
||||
"keywords": [
|
||||
"lbry"
|
||||
],
|
||||
"keywords": ["lbry"],
|
||||
"license": "MIT",
|
||||
"homepage": "https://lbry.io/",
|
||||
"bugs": {
|
||||
|
|
21
src/lbry.js
21
src/lbry.js
|
@ -79,6 +79,7 @@ Lbry.claim_list_by_channel = (params = {}) => daemonCallWithResult('claim_list_b
|
|||
Lbry.account_balance = (params = {}) => daemonCallWithResult('account_balance', params);
|
||||
Lbry.account_decrypt = () => daemonCallWithResult('account_decrypt', {});
|
||||
Lbry.account_encrypt = (params = {}) => daemonCallWithResult('account_encrypt', params);
|
||||
Lbry.account_list = (params = {}) => daemonCallWithResult('account_list', params);
|
||||
Lbry.address_is_mine = (params = {}) => daemonCallWithResult('address_is_mine', params);
|
||||
Lbry.wallet_lock = () => daemonCallWithResult('wallet_lock', {});
|
||||
Lbry.address_unused = (params = {}) => daemonCallWithResult('address_unused', params);
|
||||
|
@ -197,6 +198,26 @@ Lbry.resolve = (params = {}) =>
|
|||
);
|
||||
});
|
||||
|
||||
Lbry.publish = (params = {}) =>
|
||||
new Promise((resolve, reject) => {
|
||||
if (Lbry.overrides.publish) {
|
||||
Lbry.overrides.publish(params).then(resolve, reject);
|
||||
} else {
|
||||
apiCall('publish', params, resolve, reject);
|
||||
}
|
||||
});
|
||||
|
||||
// Allow overriding Lbry methods
|
||||
Lbry.overrides = {};
|
||||
Lbry.setOverride = (methodName, newMethod) => {
|
||||
Lbry.overrides[methodName] = newMethod;
|
||||
};
|
||||
|
||||
// Allow overriding daemon connection string (e.g. to `/api/proxy` for lbryweb)
|
||||
Lbry.setDaemonConnectionString = value => {
|
||||
Lbry.daemonConnectionString = value;
|
||||
};
|
||||
|
||||
const lbryProxy = new Proxy(Lbry, {
|
||||
get(target, name) {
|
||||
if (name in target) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* eslint-disable import/no-commonjs */
|
||||
const path = require('path');
|
||||
const FlowWebpackPlugin = require('flow-webpack-plugin')
|
||||
const FlowWebpackPlugin = require('flow-webpack-plugin');
|
||||
|
||||
module.exports = {
|
||||
mode: 'none',
|
||||
|
@ -9,7 +9,7 @@ module.exports = {
|
|||
filename: 'bundle.js',
|
||||
path: path.resolve(__dirname, 'dist'),
|
||||
libraryTarget: 'umd',
|
||||
globalObject: `(typeof self !== 'undefined' ? self : this)`
|
||||
globalObject: `(typeof self !== 'undefined' ? self : this)`,
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
|
|
Loading…
Reference in a new issue