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

@vostokplatform/voting-contract-api

Package Overview
Dependencies
Maintainers
10
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vostokplatform/voting-contract-api - npm Package Compare versions

Comparing version 0.1.0-RC28 to 0.1.0-RC29

dist/interfaces/IParticipantParams.d.ts

3

dist/index.d.ts

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

import { ICreateContractParams, IUpdateServerListParams, IVoteParams, IVotingContractAPICtr, IDkgRoundParams, IUpdateAdminListParams, IAddMainKey, IResultsParams, IDkgCommitParams, IDkgScalarParams, IDkgShadowsParams, IDkgComplaintParams, IDecryptionParams, IModifiedWavesApiResponse } from "./interfaces";
import { ICreateContractParams, IUpdateServerListParams, IVoteParams, IVotingContractAPICtr, IDkgRoundParams, IUpdateAdminListParams, IAddMainKey, IResultsParams, IDkgCommitParams, IDkgScalarParams, IDkgShadowsParams, IDkgComplaintParams, IDecryptionParams, IModifiedWavesApiResponse, IParticipantParams } from "./interfaces";
export declare class VotingContract {

@@ -27,2 +27,3 @@ private readonly weApi;

decryption: (params: IDecryptionParams) => Promise<IModifiedWavesApiResponse>;
addParticipants: (params: IParticipantParams) => Promise<IModifiedWavesApiResponse>;
}

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

!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("@vostokplatform/waves-api"),require("moment"));else if("function"==typeof define&&define.amd)define(["@vostokplatform/waves-api","moment"],e);else{var r="object"==typeof exports?e(require("@vostokplatform/waves-api"),require("moment")):e(t["@vostokplatform/waves-api"],t.moment);for(var a in r)("object"==typeof exports?exports:t)[a]=r[a]}}(this,(function(t,e){return function(t){var e={};function r(a){if(e[a])return e[a].exports;var n=e[a]={i:a,l:!1,exports:{}};return t[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,a){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:a})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(a,n,function(e){return t[e]}.bind(null,n));return a},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=2)}([function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.string="string",t.integer="integer",t.boolean="boolean"}(e.ParamType||(e.ParamType={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});class a extends Error{constructor(t){super(`Error. Cannot map contract params. Unknown type for key: ${t}.`),this.name="MapContractParamsError"}}e.MapContractParamsError=a},function(t,e,r){"use strict";var a=this&&this.__awaiter||function(t,e,r,a){return new(r||(r=Promise))((function(n,s){function i(t){try{c(a.next(t))}catch(t){s(t)}}function o(t){try{c(a.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,o)}c((a=a.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3),s=r(0),i=r(4),o={statusResponseTimeout:2e4};e.VotingContract=class{constructor(t){this.checkStatusTimerId=null,this.statusResponseTimerId=null,this.checkStatus=t=>a(this,void 0,void 0,(function*(){const e=yield this.fetchInstance(`${this.apiUrl}/contracts/status/${t}`,{method:"GET"}),r=yield e.json();return 200===e.status?Object.assign(Object.assign({},e),{success:!0,data:r}):Object.assign(Object.assign({},e),{success:!1,data:r})})),this.waitStatusResponse=t=>(...e)=>a(this,void 0,void 0,(function*(){const r=yield t(...e);return new Promise(t=>{let e=!1,n=[];this.statusResponseTimerId=setTimeout(()=>{null!==this.checkStatusTimerId&&clearTimeout(this.checkStatusTimerId),e=!0,t({success:!1,data:r,status:n[n.length-1]}),n=[]},this.STATUS_RESPONSE_TIMEOUT);const s=()=>a(this,void 0,void 0,(function*(){const a=yield this.checkStatus(r.id);n.push(a.data),a.success&&a.data.some(t=>"Success"===t.status)&&(n=[],e=!0,null!==this.statusResponseTimerId&&clearTimeout(this.statusResponseTimerId),t({success:!0,data:r,status:a.data})),e||(this.checkStatusTimerId=setTimeout(s,1e3))}));s()})})),this.createOperationParam=t=>({type:s.ParamType.string,key:"operation",value:t}),this.callDockerContract=(t,e,r)=>{const{txParams:{contractId:a,fee:n},contractParams:s}=e,i={senderPublicKey:this.keyPair.publicKey,authorPublicKey:this.keyPair.publicKey,contractId:a,timestamp:Date.now(),params:[t,...Object.entries(s).map(r)],fee:n};return this.weApi.API.Node.transactions.broadcastFromClientAddress("dockerCall",i,this.keyPair)},this.initiateVoting=t=>a(this,void 0,void 0,(function*(){const{txParams:{fee:e,contractName:r,image:a,imageHash:n},contractParams:s}=t,o={senderPublicKey:this.keyPair.publicKey,timestamp:Date.now(),image:a,imageHash:n,contractName:r,params:Object.entries(s).map(i.mapCreateContractParams),fee:e};return this.weApi.API.Node.transactions.broadcastFromClientAddress("dockerCreateV2",o,this.keyPair)})),this.vote=t=>this.callDockerContract(this.createOperationParam("vote"),t,i.mapVoteParams),this.updateServerList=t=>this.callDockerContract(this.createOperationParam("updateServerList"),t,i.mapUpdateServerListParams),this.dkgRound=t=>this.callDockerContract(this.createOperationParam("dkgRound"),t,i.mapDkgRoundParams),this.updateAdminList=t=>this.callDockerContract(this.createOperationParam("updateAdminList"),t,i.mapUpdateAdminListParams),this.addMainKey=t=>this.callDockerContract(this.createOperationParam("addMainKey"),t,i.mapAddMainKeyParams),this.results=t=>this.callDockerContract(this.createOperationParam("results"),t,i.mapResultsParams),this.dkgCommit=t=>this.callDockerContract(this.createOperationParam("dkgCommit"),t,i.mapDkgCommitParams),this.dkgScalar=t=>this.callDockerContract(this.createOperationParam("dkgScalar"),t,i.mapDkgScalarParams),this.dkgShadows=t=>this.callDockerContract(this.createOperationParam("dkgShadows"),t,i.mapDkgShadowsParams),this.dkgComplaint=t=>this.callDockerContract(this.createOperationParam("dkgComplaint"),t,i.mapDkgComplaintParams),this.decryption=t=>this.callDockerContract(this.createOperationParam("decryption"),t,i.mapDecryptionParams);const{weApiConfig:e,fetchInstance:r,keyPair:c,statusResponseTimeout:u}=Object.assign(Object.assign({},o),t);this.STATUS_RESPONSE_TIMEOUT=u,this.fetchInstance=r,this.apiUrl=e.nodeAddress.replace(/\/$/,""),this.keyPair=c,this.weApi=n.create({initialConfiguration:e,fetchInstance:r}),this.initiateVoting=this.waitStatusResponse(this.initiateVoting),this.callDockerContract=this.waitStatusResponse(this.callDockerContract)}}},function(e,r){e.exports=t},function(t,e,r){"use strict";function a(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),a(r(5)),a(r(9)),a(r(10)),a(r(11)),a(r(12)),a(r(13)),a(r(14)),a(r(15)),a(r(16)),a(r(17)),a(r(18)),a(r(19))},function(t,e,r){"use strict";var a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const n=a(r(6)),s=r(0),i=r(7),o=r(8),c=r(1);e.mapCreateContractParams=t=>{const[e,r]=t;if("string"==typeof r)return{type:s.ParamType.string,key:e,value:r};if(i.isDateInstance(r))return{type:s.ParamType.string,key:e,value:n.default.utc(r).format(o.DateFormat)};if(Array.isArray(r))return"docs"===e?{type:s.ParamType.string,key:e,value:JSON.stringify(r.map(t=>(t.dateUpload=n.default.utc(t.dateUpload).format(o.DateFormat),t)))}:{type:s.ParamType.string,key:e,value:JSON.stringify(r)};if("number"==typeof r)return{type:s.ParamType.integer,key:e,value:r};throw new c.MapContractParamsError(e)}},function(t,r){t.exports=e},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isDateInstance=function(t){return t instanceof Date&&!isNaN(t.valueOf())}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DateFormat="DD-MM-YYYY HH:mm:ss"},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const a=r(0),n=r(1);e.mapUpdateServerListParams=t=>{const[e,r]=t;if("string"==typeof r)return{type:a.ParamType.string,key:e,value:r};if(Array.isArray(r))return{type:a.ParamType.string,key:e,value:JSON.stringify(r)};if("number"==typeof r)return{type:a.ParamType.integer,key:e,value:r};throw new n.MapContractParamsError(e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const a=r(0),n=r(1);e.mapVoteParams=function(t){const[e,r]=t;if("string"==typeof r)return{type:a.ParamType.string,key:e,value:r};throw new n.MapContractParamsError(e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const a=r(0),n=r(1);e.mapDkgRoundParams=function(t){const[e,r]=t;if("number"==typeof r)return{type:a.ParamType.integer,key:e,value:r};throw new n.MapContractParamsError(e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const a=r(0),n=r(1);e.mapUpdateAdminListParams=function(t){const[e,r]=t;if(Array.isArray(r))return{type:a.ParamType.string,key:e,value:JSON.stringify(r)};throw new n.MapContractParamsError(e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const a=r(0),n=r(1);e.mapAddMainKeyParams=function(t){const[e,r]=t;if("string"==typeof r)return{type:a.ParamType.string,key:e,value:r};if("number"==typeof r)return{type:a.ParamType.integer,key:e,value:r};throw new n.MapContractParamsError(e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const a=r(0),n=r(1);e.mapResultsParams=function(t){const[e,r]=t;if("string"==typeof r)return{type:a.ParamType.string,key:e,value:r};throw new n.MapContractParamsError(e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const a=r(0),n=r(1);e.mapDkgCommitParams=function(t){const[e,r]=t;if("number"==typeof r)return{type:a.ParamType.integer,key:e,value:r};if("object"==typeof r)return{type:a.ParamType.string,key:e,value:JSON.stringify(r)};throw new n.MapContractParamsError(e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const a=r(0),n=r(1);e.mapDkgScalarParams=function(t){const[e,r]=t;if("number"==typeof r)return{type:a.ParamType.integer,key:e,value:r};if("string"==typeof r)return{type:a.ParamType.string,key:e,value:r};throw new n.MapContractParamsError(e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const a=r(0),n=r(1);e.mapDkgShadowsParams=function(t){const[e,r]=t;if("object"==typeof r)return{type:a.ParamType.string,key:e,value:JSON.stringify(r)};if("number"==typeof r)return{type:a.ParamType.integer,key:e,value:r};throw new n.MapContractParamsError(e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const a=r(0),n=r(1);e.mapDkgComplaintParams=function(t){const[e,r]=t;if("number"==typeof r)return{type:a.ParamType.integer,key:e,value:r};if("string"==typeof r)return{type:a.ParamType.string,key:e,value:r};throw new n.MapContractParamsError(e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const a=r(0),n=r(1);e.mapDecryptionParams=function(t){const[e,r]=t;if("string"==typeof r)return{type:a.ParamType.string,key:e,value:r};throw new n.MapContractParamsError(e)}}])}));
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("@vostokplatform/waves-api"),require("moment"));else if("function"==typeof define&&define.amd)define(["@vostokplatform/waves-api","moment"],e);else{var r="object"==typeof exports?e(require("@vostokplatform/waves-api"),require("moment")):e(t["@vostokplatform/waves-api"],t.moment);for(var a in r)("object"==typeof exports?exports:t)[a]=r[a]}}(this,(function(t,e){return function(t){var e={};function r(a){if(e[a])return e[a].exports;var n=e[a]={i:a,l:!1,exports:{}};return t[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,a){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:a})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(a,n,function(e){return t[e]}.bind(null,n));return a},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=2)}([function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.string="string",t.integer="integer",t.boolean="boolean"}(e.ParamType||(e.ParamType={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});class a extends Error{constructor(t){super(`Error. Cannot map contract params. Unknown type for key: ${t}.`),this.name="MapContractParamsError"}}e.MapContractParamsError=a},function(t,e,r){"use strict";var a=this&&this.__awaiter||function(t,e,r,a){return new(r||(r=Promise))((function(n,s){function i(t){try{c(a.next(t))}catch(t){s(t)}}function o(t){try{c(a.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,o)}c((a=a.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3),s=r(0),i=r(4),o={statusResponseTimeout:2e4};e.VotingContract=class{constructor(t){this.checkStatusTimerId=null,this.statusResponseTimerId=null,this.checkStatus=t=>a(this,void 0,void 0,(function*(){const e=yield this.fetchInstance(`${this.apiUrl}/contracts/status/${t}`,{method:"GET"}),r=yield e.json();return 200===e.status?Object.assign(Object.assign({},e),{success:!0,data:r}):Object.assign(Object.assign({},e),{success:!1,data:r})})),this.waitStatusResponse=t=>(...e)=>a(this,void 0,void 0,(function*(){const r=yield t(...e);return new Promise(t=>{let e=!1,n=[];this.statusResponseTimerId=setTimeout(()=>{null!==this.checkStatusTimerId&&clearTimeout(this.checkStatusTimerId),e=!0,t({success:!1,data:r,status:n[n.length-1]}),n=[]},this.STATUS_RESPONSE_TIMEOUT);const s=()=>a(this,void 0,void 0,(function*(){const a=yield this.checkStatus(r.id);n.push(a.data),a.success&&a.data.some(t=>"Success"===t.status)&&(n=[],e=!0,null!==this.statusResponseTimerId&&clearTimeout(this.statusResponseTimerId),t({success:!0,data:r,status:a.data})),e||(this.checkStatusTimerId=setTimeout(s,1e3))}));s()})})),this.createOperationParam=t=>({type:s.ParamType.string,key:"operation",value:t}),this.callDockerContract=(t,e,r)=>{const{txParams:{contractId:a,fee:n},contractParams:s}=e,i={senderPublicKey:this.keyPair.publicKey,authorPublicKey:this.keyPair.publicKey,contractId:a,timestamp:Date.now(),params:[t,...Object.entries(s).map(r)],fee:n};return this.weApi.API.Node.transactions.broadcastFromClientAddress("dockerCall",i,this.keyPair)},this.initiateVoting=t=>a(this,void 0,void 0,(function*(){const{txParams:{fee:e,contractName:r,image:a,imageHash:n},contractParams:s}=t,o={senderPublicKey:this.keyPair.publicKey,timestamp:Date.now(),image:a,imageHash:n,contractName:r,params:Object.entries(s).map(i.mapCreateContractParams),fee:e};return this.weApi.API.Node.transactions.broadcastFromClientAddress("dockerCreateV2",o,this.keyPair)})),this.vote=t=>this.callDockerContract(this.createOperationParam("vote"),t,i.mapVoteParams),this.updateServerList=t=>this.callDockerContract(this.createOperationParam("updateServerList"),t,i.mapUpdateServerListParams),this.dkgRound=t=>this.callDockerContract(this.createOperationParam("dkgRound"),t,i.mapDkgRoundParams),this.updateAdminList=t=>this.callDockerContract(this.createOperationParam("updateAdminList"),t,i.mapUpdateAdminListParams),this.addMainKey=t=>this.callDockerContract(this.createOperationParam("addMainKey"),t,i.mapAddMainKeyParams),this.results=t=>this.callDockerContract(this.createOperationParam("results"),t,i.mapResultsParams),this.dkgCommit=t=>this.callDockerContract(this.createOperationParam("dkgCommit"),t,i.mapDkgCommitParams),this.dkgScalar=t=>this.callDockerContract(this.createOperationParam("dkgScalar"),t,i.mapDkgScalarParams),this.dkgShadows=t=>this.callDockerContract(this.createOperationParam("dkgShadows"),t,i.mapDkgShadowsParams),this.dkgComplaint=t=>this.callDockerContract(this.createOperationParam("dkgComplaint"),t,i.mapDkgComplaintParams),this.decryption=t=>this.callDockerContract(this.createOperationParam("decryption"),t,i.mapDecryptionParams),this.addParticipants=t=>this.callDockerContract(this.createOperationParam("addParticipants"),t,i.mapAddParticipantsParams);const{weApiConfig:e,fetchInstance:r,keyPair:c,statusResponseTimeout:u}=Object.assign(Object.assign({},o),t);this.STATUS_RESPONSE_TIMEOUT=u,this.fetchInstance=r,this.apiUrl=e.nodeAddress.replace(/\/$/,""),this.keyPair=c,this.weApi=n.create({initialConfiguration:e,fetchInstance:r}),this.initiateVoting=this.waitStatusResponse(this.initiateVoting),this.callDockerContract=this.waitStatusResponse(this.callDockerContract)}}},function(e,r){e.exports=t},function(t,e,r){"use strict";function a(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),a(r(5)),a(r(9)),a(r(10)),a(r(11)),a(r(12)),a(r(13)),a(r(14)),a(r(15)),a(r(16)),a(r(17)),a(r(18)),a(r(19)),a(r(20))},function(t,e,r){"use strict";var a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const n=a(r(6)),s=r(0),i=r(7),o=r(8),c=r(1);e.mapCreateContractParams=t=>{const[e,r]=t;if("string"==typeof r)return{type:s.ParamType.string,key:e,value:r};if(i.isDateInstance(r))return{type:s.ParamType.string,key:e,value:n.default.utc(r).format(o.DateFormat)};if(Array.isArray(r))return"docs"===e?{type:s.ParamType.string,key:e,value:JSON.stringify(r.map(t=>(t.dateUpload=n.default.utc(t.dateUpload).format(o.DateFormat),t)))}:{type:s.ParamType.string,key:e,value:JSON.stringify(r)};if("number"==typeof r)return{type:s.ParamType.integer,key:e,value:r};throw new c.MapContractParamsError(e)}},function(t,r){t.exports=e},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isDateInstance=function(t){return t instanceof Date&&!isNaN(t.valueOf())}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DateFormat="DD-MM-YYYY HH:mm:ss"},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const a=r(0),n=r(1);e.mapUpdateServerListParams=t=>{const[e,r]=t;if("string"==typeof r)return{type:a.ParamType.string,key:e,value:r};if(Array.isArray(r))return{type:a.ParamType.string,key:e,value:JSON.stringify(r)};if("number"==typeof r)return{type:a.ParamType.integer,key:e,value:r};throw new n.MapContractParamsError(e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const a=r(0),n=r(1);e.mapVoteParams=function(t){const[e,r]=t;if("string"==typeof r)return{type:a.ParamType.string,key:e,value:r};throw new n.MapContractParamsError(e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const a=r(0),n=r(1);e.mapDkgRoundParams=function(t){const[e,r]=t;if("number"==typeof r)return{type:a.ParamType.integer,key:e,value:r};throw new n.MapContractParamsError(e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const a=r(0),n=r(1);e.mapUpdateAdminListParams=function(t){const[e,r]=t;if(Array.isArray(r))return{type:a.ParamType.string,key:e,value:JSON.stringify(r)};throw new n.MapContractParamsError(e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const a=r(0),n=r(1);e.mapAddMainKeyParams=function(t){const[e,r]=t;if("string"==typeof r)return{type:a.ParamType.string,key:e,value:r};if("number"==typeof r)return{type:a.ParamType.integer,key:e,value:r};throw new n.MapContractParamsError(e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const a=r(0),n=r(1);e.mapResultsParams=function(t){const[e,r]=t;if("string"==typeof r)return{type:a.ParamType.string,key:e,value:r};throw new n.MapContractParamsError(e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const a=r(0),n=r(1);e.mapDkgCommitParams=function(t){const[e,r]=t;if("number"==typeof r)return{type:a.ParamType.integer,key:e,value:r};if("object"==typeof r)return{type:a.ParamType.string,key:e,value:JSON.stringify(r)};throw new n.MapContractParamsError(e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const a=r(0),n=r(1);e.mapDkgScalarParams=function(t){const[e,r]=t;if("number"==typeof r)return{type:a.ParamType.integer,key:e,value:r};if("string"==typeof r)return{type:a.ParamType.string,key:e,value:r};throw new n.MapContractParamsError(e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const a=r(0),n=r(1);e.mapDkgShadowsParams=function(t){const[e,r]=t;if("object"==typeof r)return{type:a.ParamType.string,key:e,value:JSON.stringify(r)};if("number"==typeof r)return{type:a.ParamType.integer,key:e,value:r};throw new n.MapContractParamsError(e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const a=r(0),n=r(1);e.mapDkgComplaintParams=function(t){const[e,r]=t;if("number"==typeof r)return{type:a.ParamType.integer,key:e,value:r};if("string"==typeof r)return{type:a.ParamType.string,key:e,value:r};throw new n.MapContractParamsError(e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const a=r(0),n=r(1);e.mapDecryptionParams=function(t){const[e,r]=t;if("string"==typeof r)return{type:a.ParamType.string,key:e,value:r};throw new n.MapContractParamsError(e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const a=r(0),n=r(1);e.mapAddParticipantsParams=t=>{const[e,r]=t;if(Array.isArray(r))return{type:a.ParamType.string,key:e,value:JSON.stringify(r)};throw new n.MapContractParamsError(e)}}])}));
//# sourceMappingURL=index.js.map

@@ -33,1 +33,4 @@ import { IWavesConfig } from "@vostokplatform/waves-api/interfaces";

export * from "./IStatusResponse";
export * from "./IParticipantParams";
export * from "./IWavesApiResponse";
export * from "./IDockerCallTxPrams";

@@ -13,1 +13,2 @@ export * from "./mapCreateContractParams";

export * from "./mapDecryptionParams";
export * from "./mapAddParticipantsParams";
{
"name": "@vostokplatform/voting-contract-api",
"version": "0.1.0-RC28",
"version": "0.1.0-RC29",
"description": "",

@@ -31,5 +31,5 @@ "main": "dist/index.js",

"peerDependencies": {
"@vostokplatform/waves-api": "1.3.0-RC7",
"@vostokplatform/waves-api": "1.3.0-RC8",
"moment": "2.24.0"
}
}

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