o3-dapi-ont
Version:
Ontology Plugin for o3-dapi
1 lines • 13.9 kB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.o3dapiOnt=e():t.o3dapiOnt=e()}("undefined"!=typeof self?self:this,function(){return function(t){var e={};function n(a){if(e[a])return e[a].exports;var o=e[a]={i:a,l:!1,exports:{}};return t[a].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,a){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:a})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(a,o,function(e){return t[e]}.bind(null,o));return a},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=17)}([function(t,e,n){"use strict";n.d(e,"b",function(){return c}),n.d(e,"a",function(){return i});var a=n(9),o=n(1);let r=t=>Promise.reject(new Error("o3-dapi-ont plugin not instanciated."));function c(t){return r(Object.assign({},t,{blockchain:o.a,version:o.e}))}function i(t,e){r=t,e({blockchain:o.a,callback:a.b})}},function(t,e,n){"use strict";n.d(e,"a",function(){return a}),n.d(e,"e",function(){return o}),n.d(e,"d",function(){return r}),n.d(e,"b",function(){return c}),n.d(e,"c",function(){return i});const a="ONT",o="v1";var r,c,i,u;!function(t){t.MainNet="MainNet",t.TestNet="TestNet"}(r||(r={})),function(t){t.getAccount="getAccount",t.getPublicKey="getPublicKey",t.send="send",t.getIdentity="getIdentity",t.getDDO="getDDO",t.addAttributes="addAttributes",t.removeAttribute="removeAttribute",t.signMessageHash="signMessageHash",t.verifyMessageHash="verifyMessageHash",t.signMessage="signMessage",t.verifyMessage="verifyMessage",t.getNodeCount="getNodeCount",t.getBlockHeight="getBlockHeight",t.getMerkleProof="getMerkleProof",t.getStorage="getStorage",t.getAllowance="getAllowance",t.getBlock="getBlock",t.getTransaction="getTransaction",t.getNetworks="getNetworks",t.getBalance="getBalance",t.getUnboundOng="getUnboundOng",t.getContract="getContract",t.getSmartCodeEvent="getSmartCodeEvent",t.getBlockHeightByTxHash="getBlockHeightByTxHash",t.getBlockHash="getBlockHash",t.getBlockTxsByHeight="getBlockTxsByHeight",t.getGasPrice="getGasPrice",t.getGrantOng="getGrantOng",t.getMempoolTxCount="getMempoolTxCount",t.getMempoolTxState="getMempoolTxState",t.getVersion="getVersion",t.getProvider="getProvider",t.invoke="invoke",t.invokeRead="invokeRead",t.deploy="deploy",t.disconnect="disconnect"}(c||(c={})),function(t){t.READY="READY",t.ACCOUNT_CHANGED="ACCOUNT_CHANGED",t.CONNECTED="CONNECTED",t.DISCONNECTED="DISCONNECTED",t.NETWORK_CHANGED="NETWORK_CHANGED"}(i||(i={})),function(t){t[t.BookKeeper=2]="BookKeeper",t[t.Claim=3]="Claim",t[t.Deploy=208]="Deploy",t[t.Invoke=209]="Invoke",t[t.Enrollment=4]="Enrollment",t[t.Vote=5]="Vote"}(u||(u={}))},function(t,e,n){"use strict";n.d(e,"a",function(){return o});var a=n(1);const o=(t,e,n,o,r=!0)=>c=>{const i=c&&c.network,u=!r||i===a.d.MainNet||i===a.d.TestNet,d=t.clientPlugin&&t.clientPlugin[e]&&t.clientPlugin[e][n];return(u&&d?d:o)(c)}},function(t,e,n){"use strict";var a,o=n(0);function r(t){return Object(o.b)({command:a.getAllowance,data:t})}function c(t){return Object(o.b)({command:a.getBalanceOf,data:t})}function i(t){return Object(o.b)({command:a.getTotalSupply,data:t})}function u(t){return Object(o.b)({command:a.getSymbol,data:t})}function d(t){return Object(o.b)({command:a.getDecimals,data:t})}function s(t){return Object(o.b)({command:a.getName,data:t})}function g(t){return Object(o.b)({command:a.getTokenDetails,data:t})}function f(t){return Object(o.b)({command:a.init,data:t})}function b(t){return Object(o.b)({command:a.transfer,data:t})}function l(t){return Object(o.b)({command:a.transferMulti,data:t})}function m(t){return Object(o.b)({command:a.approve,data:t})}function O(t){return Object(o.b)({command:a.transferFrom,data:t})}!function(t){t.getAllowance="OEP4.getAllowance",t.getBalanceOf="OEP4.getBalanceOf",t.getTotalSupply="OEP4.getTotalSupply",t.getSymbol="OEP4.getSymbol",t.getDecimals="OEP4.getDecimals",t.getName="OEP4.getName",t.getTokenDetails="OEP4.getTokenDetails",t.init="OEP4.init",t.transfer="OEP4.transfer",t.transferMulti="OEP4.transferMulti",t.approve="OEP4.approve",t.transferFrom="OEP4.transferFrom"}(a||(a={})),n.d(e,"b",function(){return r}),n.d(e,"c",function(){return c}),n.d(e,"h",function(){return i}),n.d(e,"f",function(){return u}),n.d(e,"d",function(){return d}),n.d(e,"e",function(){return s}),n.d(e,"g",function(){return g}),n.d(e,"i",function(){return f}),n.d(e,"j",function(){return b}),n.d(e,"l",function(){return l}),n.d(e,"a",function(){return m}),n.d(e,"k",function(){return O})},function(t,e,n){"use strict";var a;!function(t){t.getStakeRoundInfo="getStakeRoundInfo",t.getNodeList="getNodeList",t.getTotalStake="getTotalStake",t.getNodeStakeInfo="getNodeStakeInfo",t.getStakedClaimableOng="getStakedClaimableOng",t.getStakedClaimableOngRewards="getStakedClaimableOngRewards",t.addStake="addStake",t.requestStakeWithdraw="requestStakeWithdraw",t.withdrawStake="withdrawStake",t.claimStakedOng="claimStakedOng",t.claimStakedOngRewards="claimStakedOngRewards"}(a||(a={}));var o=n(0);function r(t){return Object(o.b)({command:a.getStakeRoundInfo,data:t})}function c(t){return Object(o.b)({command:a.getNodeList,data:t})}function i(t){return Object(o.b)({command:a.getTotalStake,data:t})}function u(t){return Object(o.b)({command:a.getNodeStakeInfo,data:t})}function d(t){return Object(o.b)({command:a.getStakedClaimableOng,data:t})}function s(t){return Object(o.b)({command:a.getStakedClaimableOngRewards,data:t})}function g(t){return Object(o.b)({command:a.addStake,data:t})}function f(t){return Object(o.b)({command:a.requestStakeWithdraw,data:t})}function b(t){return Object(o.b)({command:a.withdrawStake,data:t})}function l(t){return Object(o.b)({command:a.claimStakedOng,data:t})}function m(t){return Object(o.b)({command:a.claimStakedOngRewards,data:t})}n.d(e,"f",function(){return r}),n.d(e,"d",function(){return c}),n.d(e,"i",function(){return i}),n.d(e,"e",function(){return u}),n.d(e,"g",function(){return d}),n.d(e,"h",function(){return s}),n.d(e,"a",function(){return g}),n.d(e,"j",function(){return f}),n.d(e,"k",function(){return b}),n.d(e,"b",function(){return l}),n.d(e,"c",function(){return m})},function(t,e,n){"use strict";var a=n(0),o=n(1);function r(t){return Object(a.b)({command:o.b.getMempoolTxCount,data:t})}function c(t){return Object(a.b)({command:o.b.getMempoolTxState,data:t})}function i(t){return Object(a.b)({command:o.b.getSmartCodeEvent,data:t})}function u(t){return Object(a.b)({command:o.b.getGasPrice,data:t})}function d(t){return Object(a.b)({command:o.b.getBlockTxsByHeight,data:t})}function s(t){return Object(a.b)({command:o.b.getTransaction,data:t})}function g(t){return Object(a.b)({command:o.b.getBlockHeightByTxHash,data:t})}n.d(e,"d",function(){return r}),n.d(e,"e",function(){return c}),n.d(e,"f",function(){return i}),n.d(e,"c",function(){return u}),n.d(e,"b",function(){return d}),n.d(e,"g",function(){return s}),n.d(e,"a",function(){return g})},function(t,e,n){"use strict";var a=n(0),o=n(1);function r(t){return Object(a.b)({command:o.b.getNodeCount,data:t})}function c(t){return Object(a.b)({command:o.b.getBlockHeight,data:t})}function i(t){return Object(a.b)({command:o.b.getMerkleProof,data:t})}function u(t){return Object(a.b)({command:o.b.getBlock,data:t})}function d(t){return Object(a.b)({command:o.b.getBlockHash,data:t})}function s(t){return Object(a.b)({command:o.b.getVersion,data:t})}n.d(e,"e",function(){return r}),n.d(e,"c",function(){return c}),n.d(e,"d",function(){return i}),n.d(e,"a",function(){return u}),n.d(e,"b",function(){return d}),n.d(e,"f",function(){return s})},function(t,e,n){"use strict";var a=n(0),o=n(1);function r(t){return Object(a.b)({command:o.b.getAllowance,data:t})}function c(t){return Object(a.b)({command:o.b.getBalance,data:t})}function i(t){return Object(a.b)({command:o.b.getGrantOng,data:t})}function u(t){return Object(a.b)({command:o.b.getUnboundOng,data:t})}function d(t){return Object(a.b)({command:o.b.send,data:t})}n.d(e,"a",function(){return r}),n.d(e,"b",function(){return c}),n.d(e,"c",function(){return i}),n.d(e,"d",function(){return u}),n.d(e,"e",function(){return d})},function(t,e,n){"use strict";var a=n(0),o=n(1);function r(t){return Object(a.b)({command:o.b.getContract,data:t})}function c(t){return Object(a.b)({command:o.b.getStorage,data:t})}function i(t){return Object(a.b)({command:o.b.invoke,data:t})}function u(t){return Object(a.b)({command:o.b.invokeRead,data:t})}function d(t){return Object(a.b)({command:o.b.deploy,data:t})}n.d(e,"b",function(){return r}),n.d(e,"c",function(){return c}),n.d(e,"d",function(){return i}),n.d(e,"e",function(){return u}),n.d(e,"a",function(){return d})},function(t,e,n){"use strict";(function(t){n.d(e,"a",function(){return c}),n.d(e,"c",function(){return i}),n.d(e,"b",function(){return u});var a=n(1);const o="undefined"!=typeof window?window:t,r={};function c(t,e){const n=r[t]||[];n.push(e),r[t]=n;const c=o._o3dapi.isReady;if(t===a.c.READY&&c){const t=r[a.c.READY];t&&t.forEach(t=>t(c))}}function i(t){r[t]=[]}function u(t,e){const n=r[t];n&&n.forEach(t=>t(e))}}).call(this,n(12))},function(t,e,n){"use strict";var a=n(0),o=n(1);function r(t){return Object(a.b)({command:o.b.signMessage,data:t})}function c(t){return Object(a.b)({command:o.b.verifyMessage,data:t})}n.d(e,"a",function(){return r}),n.d(e,"b",function(){return c})},function(t,e,n){"use strict";var a=n(0),o=n(1);function r(){return Object(a.b)({command:o.b.getAccount})}function c(){return Object(a.b)({command:o.b.getPublicKey})}n.d(e,"a",function(){return r}),n.d(e,"b",function(){return c})},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var a=n(0),o=n(1);function r(){return Object(a.b)({command:o.b.getProvider})}},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var a=n(0),o=n(1);function r(){return Object(a.b)({command:o.b.getNetworks})}},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var a=n(0),o=n(1);function r(){return Object(a.b)({command:o.b.disconnect})}},function(t,e,n){"use strict";var a;n.d(e,"a",function(){return a}),function(t){t.BOOLEAN="Boolean",t.INTEGER="Integer",t.BYTEARRAY="ByteArray",t.STRUCT="Struct",t.MAP="Map",t.STRING="String",t.ADDRESS="Address"}(a||(a={}))},function(t,e,n){t.exports=n(18)},function(t,e,n){"use strict";n.r(e),function(t){var a=n(7),o=n(10),r=n(8),c=n(5),i=n(6),u=n(4),d=n(3),s=n(13),g=n(11),f=n(14),b=n(15),l=n(16),m=n(9),O=n(2),k=n(1),h=n(0);const j="undefined"!=typeof window?window:t;class p{constructor(t,e){this.isAvailable=Boolean(j._o3dapi.isAvailable),this.getProvider=s.a,this.getNetworks=f.a,this.getAccount=g.a,this.getPublicKey=g.b,this.disconnect=b.a,this.message={verifyMessage:Object(O.a)(this,"message","getBalance",o.b),signMessage:o.a},this.network={getNodeCount:Object(O.a)(this,"network","getNodeCount",i.e),getBlockHeight:Object(O.a)(this,"network","getBlockHeight",i.c),getMerkleProof:Object(O.a)(this,"network","getMerkleProof",i.d),getBlock:Object(O.a)(this,"network","getBlock",i.a),getBlockHash:Object(O.a)(this,"network","getBlockHash",i.b),getVersion:Object(O.a)(this,"network","getVersion",i.f)},this.tx={getBlockHeightByTxHash:Object(O.a)(this,"tx","getBlockHeightByTxHash",c.a),getMempoolTxCount:Object(O.a)(this,"tx","getMempoolTxCount",c.d),getMempoolTxState:Object(O.a)(this,"tx","getMempoolTxState",c.e),getSmartCodeEvent:Object(O.a)(this,"tx","getSmartCodeEvent",c.f),getGasPrice:Object(O.a)(this,"tx","getGasPrice",c.c),getBlockTxsByHeight:Object(O.a)(this,"tx","getBlockTxsByHeight",c.b),getTransaction:Object(O.a)(this,"tx","getTransaction",c.g)},this.assets={getAllowance:Object(O.a)(this,"assets","getAllowance",a.a),getBalance:Object(O.a)(this,"assets","getBalance",a.b),getGrantOng:Object(O.a)(this,"assets","getGrantOng",a.c),getUnboundOng:Object(O.a)(this,"assets","getUnboundOng",a.d),send:a.e},this.sc={getContract:Object(O.a)(this,"sc","getContract",r.b),getStorage:Object(O.a)(this,"sc","getStorage",r.c),invokeRead:Object(O.a)(this,"sc","invokeRead",r.e),invoke:r.d,deploy:r.a},this.stake={getStakeRoundInfo:Object(O.a)(this,"stake","getStakeRoundInfo",u.f),getNodeList:Object(O.a)(this,"stake","getNodeList",u.d),getTotalStake:Object(O.a)(this,"stake","getTotalStake",u.i),getNodeStakeInfo:Object(O.a)(this,"stake","getNodeStakeInfo",u.e),getStakedClaimableOng:Object(O.a)(this,"stake","getStakedClaimableOng",u.g),getStakedClaimableOngRewards:Object(O.a)(this,"stake","getStakedClaimableOngRewards",u.h),addStake:u.a,requestStakeWithdraw:u.j,withdrawStake:u.k,claimStakedOng:u.b,claimStakedOngRewards:u.c},this.oep4={getAllowance:Object(O.a)(this,"oep4","getAllowance",d.b),getBalanceOf:Object(O.a)(this,"oep4","getBalanceOf",d.c),getTotalSupply:Object(O.a)(this,"oep4","getTotalSupply",d.h),getSymbol:Object(O.a)(this,"oep4","getSymbol",d.f),getDecimals:Object(O.a)(this,"oep4","getDecimals",d.d),getName:Object(O.a)(this,"oep4","getName",d.e),getTokenDetails:Object(O.a)(this,"oep4","getTokenDetails",d.g),init:d.i,transfer:d.j,transferMulti:d.l,approve:d.a,transferFrom:d.k},this.addEventListener=m.a,this.removeEventListener=m.c,this.Constants={EventName:k.c,ParameterType:l.a},Object(h.a)(t,e)}setClientPlugin(t){this.clientPlugin=t}}p.blockchain=k.a,e.default=p}.call(this,n(12))}]).default});