Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

medisot-hyperledger-client

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

medisot-hyperledger-client - npm Package Compare versions

Comparing version 2.4.0 to 2.4.1

1

lib/index.d.ts

@@ -8,2 +8,3 @@ declare module 'medisot-hyperledger-client' {

invoke(func: string, args: string, user: string, transientMap: any): any;
InvokeHandler(func: string, args: any, user: any, transientMap: any, query: boolean): Promise<any>;
}

@@ -10,0 +11,0 @@ namespace HyperledgerClient {}

2

lib/index.js

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.HyperledgerClient=t():e.HyperledgerClient=t()}(global,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TYPES={Connection:Symbol.for("Connection")}},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(2)),r(n(0))},function(e,t,n){"use strict";(function(e){var r=this&&this.__decorate||function(e,t,n,r){var o,s=arguments.length,i=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,r);else for(var c=e.length-1;c>=0;c--)(o=e[c])&&(i=(s<3?o(i):s>3?o(t,n,i):o(t,n))||i);return s>3&&i&&Object.defineProperty(t,n,i),i},o=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,s){function i(e){try{a(r.next(e))}catch(e){s(e)}}function c(e){try{a(r.throw(e))}catch(e){s(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,c)}a((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,s,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function c(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0});var c=n(3),a=n(4),l=n(0),u=n(5),f="Transaction failed.",p=u.resolve(e),d=function(){function t(t){this.ccp=t,this.makeAbsolutePath=function(t){for(var n=Object.keys(t.orderers),r=Object.keys(t.peers),o=0;o<n.length;o++){var s=t.orderers[n[o]].tlsCACerts.path;t.orderers[n[o]].tlsCACerts.path=u.resolve(e,s)}for(o=0;o<r.length;o++){s=t.peers[r[o]].tlsCACerts.path;t.peers[r[o]].tlsCACerts.path=u.resolve(e,s)}return t},t=this.makeAbsolutePath(t)}return t.prototype.invoke=function(e,t,n,r){return s(this,void 0,void 0,(function(){var o,s,c,l,d,h,y,b;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,6,,7]),o=u.join(p,"wallet"),s=new a.FileSystemWallet(o),console.log("Wallet path: "+o),[4,s.exists(n)];case 1:return i.sent()?[4,(c=new a.Gateway).connect(this.ccp,{wallet:s,identity:n,discovery:{enabled:!1}})]:(console.log("An identity for the user "+n+" does not exist in the wallet"),[2,{success:!1,result:f,msg:"User does not exist in wallet"}]);case 2:return i.sent(),[4,c.getNetwork("medisotchannel")];case 3:return l=i.sent(),d=l.getContract("medisot"),h=d.createTransaction(e),void 0!==r&&h.setTransient(r),[4,h.submit(t)];case 4:return y=(y=i.sent()).toString(),console.log("Transaction has been submitted"),console.log(y.toString()),[4,c.disconnect()];case 5:return i.sent(),[2,{success:!0,result:"Transaction has been submitted.",msg:y}];case 6:return b=i.sent(),console.error("Failed to submit transaction: "+b),[2,{success:!1,result:f,msg:b.toString()}];case 7:return[2]}}))}))},t.prototype.query=function(e,t,n){return s(this,void 0,void 0,(function(){var r,o,s,c,l,d,h;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,8,,9]),r=u.join(p,"wallet"),o=new a.FileSystemWallet(r),console.log("Wallet path: "+r),[4,o.exists(n)];case 1:return i.sent()?[4,(s=new a.Gateway).connect(this.ccp,{wallet:o,identity:n,discovery:{enabled:!1}})]:(console.log("An identity for the user "+n+" does not exist in the wallet"),[2,{success:!1,result:f,msg:"User "+n+" does not exist in wallet."}]);case 2:return i.sent(),[4,s.getNetwork("medisotchannel")];case 3:return c=i.sent(),l=c.getContract("medisot"),null!=t?[3,5]:[4,l.evaluateTransaction(e)];case 4:return d=i.sent(),[3,7];case 5:return[4,l.evaluateTransaction(e,t)];case 6:d=i.sent(),i.label=7;case 7:return console.log("Transaction has been evaluated, result is: "+d.toString()),[2,{success:!0,result:"Transaction has been submitted.",msg:d.toString()}];case 8:return h=i.sent(),console.error("Failed to evaluate transaction: "+h),[2,{success:!1,result:f,msg:h.toString()}];case 9:return[2]}}))}))},t=r([c.injectable(),o(0,c.inject(l.TYPES.Connection))],t)}();t.HyperledgerClient=d}).call(this,"/")},function(e,t){e.exports=require("inversify")},function(e,t){e.exports=require("fabric-network")},function(e,t){e.exports=require("path")}])}));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.HyperledgerClient=t():e.HyperledgerClient=t()}(global,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(e,t){e.exports=require("fabric-network")},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function u(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,u)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,s,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function u(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(t,"__esModule",{value:!0});var u=n(7),c=n(8),a=function(e){function t(t,n){return e.call(this,t,n)||this}return o(t,e),t.sendTransactionProposalBySignedProposal=function(e,t,n){return s(this,void 0,void 0,(function(){var r;return i(this,(function(o){switch(o.label){case 0:if("sendTransactionProposal(static)",(!e||e.length<1)&&(r="Missing peer objects in Transaction proposal"),r)throw new Error(r);return[4,c.client_utils.sendPeersProposal(e,t.signed,n)];case 1:return[2,[o.sent(),t.source]]}}))}))},t.prototype.queryByChaincodeBySignedProposal=function(e,n,r){return s(this,void 0,void 0,(function(){var o,s,u;return i(this,(function(i){switch(i.label){case 0:return[4,t.sendTransactionProposalBySignedProposal(e,n,r)];case 1:if(o=i.sent(),!(s=o[0])||!Array.isArray(s))throw new Error("Payload results are missing from the chaincode query");return u=[],s.forEach((function(e){e instanceof Error?u.push(e):e.response&&e.response.payload?200===e.response.status?u.push(e.response.payload):e.response.message?u.push(new Error(e.response.message)):u.push(new Error(e)):u.push(new Error(e))})),[2,u]}}))}))},t}(u.Channel);t.default=a},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function u(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,u)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,s,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function u(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),i=s.InMemoryWallet,u=(s.Wallet,n(9)),c=function(){function e(){this.inMemWallet=new i}return e.prototype.import=function(e,t){return r(this,void 0,void 0,(function(){var n;return o(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,u.Upload(e,JSON.stringify(t))];case 1:return r.sent(),[3,3];case 2:throw n=r.sent(),new Error(n);case 3:return[2]}}))}))},e.prototype.export=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(n){switch(n.label){case 0:return console.log("Inside export...."),this.inMemWallet.exists(e)?[3,3]:[4,u.Get(e)];case 1:return t=n.sent(),[4,this.inMemWallet.import(e,JSON.parse(t))];case 2:n.sent(),n.label=3;case 3:return[4,this.inMemWallet.export(e)];case 4:return[2,n.sent()]}}))}))},e.prototype.exists=function(e){return r(this,void 0,void 0,(function(){var t,n,r;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,5,,6]),[4,this.inMemWallet.exists(e)];case 1:return o.sent()?[3,4]:[4,u.Get(e)];case 2:return t=o.sent(),n=t.Body.toString(),[4,this.inMemWallet.import(e,JSON.parse(n))];case 3:o.sent(),o.label=4;case 4:return[2,!0];case 5:if((r=o.sent()).message.includes("does not exist."))return[2,!1];throw new Error(r);case 6:return[2]}}))}))},e.prototype.setUserContext=function(e,t){return r(this,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return[4,this.inMemWallet.setUserContext(e,t)];case 1:return[2,n.sent()]}}))}))},e}();t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TYPES={Connection:Symbol.for("Connection")}},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(5)),r(n(1)),r(n(2)),r(n(3))},function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var o,s=arguments.length,i=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(i=(s<3?o(i):s>3?o(t,n,i):o(t,n))||i);return s>3&&i&&Object.defineProperty(t,n,i),i},o=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function u(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,u)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,s,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function u(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(t,"__esModule",{value:!0});var u=n(6),c=n(0),a=n(1),l=n(2),f=n(3),p=function(){function e(e){this.ccp=e,this.walletClient=new l.default}return e.prototype.preload=function(e){return s(this,void 0,void 0,(function(){var t,n,r,o,s,u;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),[4,this.walletClient.exists(e)];case 1:if(!i.sent())throw new Error("User: "+e+" does not exist in wallet");return t=this.walletClient,[4,(n=new c.Gateway).connect(this.ccp,{wallet:t,identity:e,discovery:{enabled:!1},eventHandlerOptions:{commitTimeout:100,strategy:c.DefaultEventHandlerStrategies.MSPID_SCOPE_ANYFORTX}})];case 2:return i.sent(),[4,n.getNetwork("medisotchannel")];case 3:return r=i.sent(),o=r.getContract("medisot"),s=n.getClient(),[2,{success:!0,result:{gateway:n,network:r,client:s,contract:o},msg:"Successfully opened gateway for "+e+"."}];case 4:return u=i.sent(),[2,{success:!1,result:{gateway:n,network:r,client:s,contract:o},msg:u.toString()}];case 5:return[2]}}))}))},e.prototype._getTransactionObject=function(e,t,n){var r=n.contract.createTransaction(e);return void 0!==t&&r.setTransient(t),r},e.prototype.invoke=function(e,t,n,r){return s(this,void 0,void 0,(function(){return i(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this._getTransactionObject(e,n,r).submit(t)];case 1:return[2,{success:!0,result:"Transaction has been submitted.",msg:o.sent().toString()}];case 2:return[2,{success:!1,result:"Transaction failed.",msg:o.sent().toString()}];case 3:return[2]}}))}))},e.prototype.query=function(e,t,n,r){return s(this,void 0,void 0,(function(){var o,s;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,5,,6]),o=this._getTransactionObject(e,n,r),void 0!==t?[3,2]:[4,o.evaluate("")];case 1:return s=i.sent(),[3,4];case 2:return[4,o.evaluate(t)];case 3:s=i.sent(),i.label=4;case 4:return[2,{success:!0,result:"Query Successful.",msg:s=s.toString()}];case 5:return[2,{success:!1,result:"Query failed.",msg:i.sent().toString()}];case 6:return[2]}}))}))},e.prototype.GetSignedProposal=function(e,t,n,r,o,u){return s(this,void 0,void 0,(function(){var s,c,l,f,p,h,d;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.preload(n)];case 1:if(!(s=i.sent()).success)throw new Error(s.msg);return c=s.result,l=this._getTransactionObject(e,r,c),f=[t],(p=l._buildRequest(f)).chaincodeId=o,h=new a.default("medisotchannel",c.client),d=a.default._buildSignedProposal(p,u,h._clientContext),[2,{success:!0,result:"Proposal generation successful.",msg:JSON.stringify(d)}];case 2:return[2,{success:!1,result:"Proposal generation failed.",msg:i.sent().toString()}];case 3:return[2]}}))}))},e.prototype.queryBySignedProposal=function(e,t){return s(this,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),5e3,[4,new a.default("medisotchannel",t.client).queryByChaincodeBySignedProposal(t.network.getChannel().getPeers(),e,5e3)];case 1:if((n=r.sent())[0].status&&200!=n[0].status)throw new Error(n[0].toString());return[2,{success:!0,result:"Transaction has been submitted.",msg:n[0].toString()}];case 2:return[2,{success:!1,result:"Transaction failed.",msg:r.sent().toString()}];case 3:return[2]}}))}))},e.prototype.correctBuffer=function(e){return s(this,void 0,void 0,(function(){return i(this,(function(t){return Object.keys(e).forEach((function(t){var n=e[t];n.type&&"Buffer"===n.type?e[t]=Buffer.from(n):Object.keys(n).length>0&&(e[t]=this.CorrectBuffer(n))})),[2,e]}))}))},e.prototype.InvokeHandler=function(e,t,n,r,o){return s(this,void 0,void 0,(function(){var s,u;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,9,,10]),[4,this.preload(n)];case 1:if(!(s=i.sent()).success)throw new Error(s.msg);return u=s.result,o?[4,this.query(e,t,r,u)]:[3,3];case 2:return[2,i.sent()];case 3:switch(e){case"SIGNED_PROPOSAL":return[3,4]}return[3,6];case 4:return[4,this.queryBySignedProposal(this.correctBuffer(JSON.parse(t)),u)];case 5:return[2,i.sent()];case 6:return[4,this.invoke(e,t,r,u)];case 7:return[2,i.sent()];case 8:return[3,10];case 9:return[2,{success:!1,result:"Transaction failed.",msg:i.sent().toString()}];case 10:return[2]}}))}))},e=r([u.injectable(),o(0,u.inject(f.TYPES.Connection))],e)}();t.HyperledgerClient=p},function(e,t){e.exports=require("inversify")},function(e,t){e.exports=require("fabric-client")},function(e,t){e.exports=require("fabric-client/lib/utils")},function(e,t,n){const r=n(10);let o=new r.S3({accessKeyId:"AKIARIQSQ4B6IOL55DJU",secretAccessKey:"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",Bucket:"users.medisot"});e.exports={Upload:function(e,t){return new Promise((n,r)=>{var s={Bucket:"users.medisot",Key:e,Body:t};o.upload(s,(function(e,t){e&&r(e),n(t)}))})},Get:function(e){return new Promise((t,n)=>{var r={Bucket:"users.medisot",Key:e};o.getObject(r,(function(e,r){e?n(e):t(r)}))})}}},function(e,t){e.exports=require("aws-sdk")}])}));
//# sourceMappingURL=index.js.map
{
"name": "medisot-hyperledger-client",
"version": "2.4.0",
"version": "2.4.1",
"description": "Hyperledger client for medisot",

@@ -17,9 +17,9 @@ "main": "lib/index.js",

"awesome-typescript-loader": "^5.2.1",
"typescript": "^3.3.3333",
"barrelsby": "^2.2.0",
"copy-webpack-plugin": "^5.1.1",
"source-map-loader": "^0.2.4",
"typescript": "^3.3.3333",
"webpack": "^4.41.5",
"webpack-cli": "^3.3.10",
"webpack-node-externals": "^1.7.2",
"source-map-loader": "^0.2.4"
"webpack-node-externals": "^1.7.2"
},

@@ -29,2 +29,3 @@ "author": "Aditya",

"dependencies": {
"fabric-client": "1.4.4",
"fabric-network": "^1.4.4",

@@ -31,0 +32,0 @@ "inversify": "^5.0.1",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc