@magic-ext/zilliqa 6.0.0 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -1,2 +1,2 @@
1
- var l=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var L=o=>l(o,"__esModule",{value:!0});var b=(o,i)=>{for(var n in i)l(o,n,{get:i[n],enumerable:!0})},d=(o,i,n,t)=>{if(i&&typeof i=="object"||typeof i=="function")for(let e of y(i))!P.call(o,e)&&(n||e!=="default")&&l(o,e,{get:()=>i[e],enumerable:!(t=f(i,e))||t.enumerable});return o};var h=(o=>(i,n)=>o&&o.get(i)||(n=d(L({}),i,1),o&&o.set(i,n),n))(typeof WeakMap!="undefined"?new WeakMap:0);var q={};b(q,{ZilliqaExtension:()=>u});var r=require("@magic-sdk/commons"),u=class extends r.Extension.Internal{constructor(i){super();this.zilliqaConfig=i;this.name="zilliqa";this.sendTransaction=(i,n)=>(i.amount&&(i.amount=typeof i.amount=="string"?i.amount:i.amount.toString()),i.gasPrice&&(i.gasPrice=typeof i.gasPrice=="string"?i.gasPrice:i.gasPrice.toString()),i.gasLimit&&(i.gasLimit=typeof i.gasLimit=="string"?i.gasLimit:i.gasLimit.toNumber()),this.request({id:42,method:"zil_sendTransaction",jsonrpc:"2.0",params:{params:i,toDs:n}}));this.deployContract=(i,n,t,e,g,c)=>(t.amount&&(t.amount=typeof t.amount=="string"?t.amount:t.amount.toString()),t.gasPrice&&(t.gasPrice=typeof t.gasPrice=="string"?t.gasPrice:t.gasPrice.toString()),t.gasLimit&&(t.gasLimit=typeof t.gasLimit=="string"?t.gasLimit:t.gasLimit.toNumber()),this.request({id:42,jsonrpc:"2.0",method:"zil_deployContract",params:{init:i,code:n,params:t,attempts:e,interval:g,toDs:c}}));this.callContract=(i,n,t,e=33,g=1e3,c=!1,s)=>(t.amount&&(t.amount=typeof t.amount=="string"?t.amount:t.amount.toString()),t.gasPrice&&(t.gasPrice=typeof t.gasPrice=="string"?t.gasPrice:t.gasPrice.toString()),t.gasLimit&&(t.gasLimit=typeof t.gasLimit=="string"?t.gasLimit:t.gasLimit.toNumber()),this.request({id:42,jsonrpc:"2.0",method:"zil_callContract",params:{transition:i,args:n,params:t,attempts:e,interval:g,toDs:c,contractAddress:s}}));this.getWallet=()=>this.request({id:42,jsonrpc:"2.0",method:"zil_getWallet",params:[]});this.config={rpcUrl:i.rpcUrl,chainType:"ZILLIQA"}}};module.exports=h(q);
1
+ "use strict";var u=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var L=Object.prototype.hasOwnProperty;var b=(o,n)=>{for(var t in n)u(o,t,{get:n[t],enumerable:!0})},d=(o,n,t,e)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of P(n))!L.call(o,i)&&i!==t&&u(o,i,{get:()=>n[i],enumerable:!(e=y(n,i))||e.enumerable});return o};var h=o=>d(u({},"__esModule",{value:!0}),o);var C={};b(C,{ZilliqaExtension:()=>l});module.exports=h(C);var s=require("@magic-sdk/commons"),l=class extends s.Extension.Internal{constructor(t){super();this.zilliqaConfig=t;this.name="zilliqa";this.sendTransaction=(t,e)=>(t.amount&&(t.amount=typeof t.amount=="string"?t.amount:t.amount.toString()),t.gasPrice&&(t.gasPrice=typeof t.gasPrice=="string"?t.gasPrice:t.gasPrice.toString()),t.gasLimit&&(t.gasLimit=typeof t.gasLimit=="string"?t.gasLimit:t.gasLimit.toNumber()),this.request({id:42,method:"zil_sendTransaction",jsonrpc:"2.0",params:{params:t,toDs:e}}));this.deployContract=(t,e,i,g,c,r)=>(i.amount&&(i.amount=typeof i.amount=="string"?i.amount:i.amount.toString()),i.gasPrice&&(i.gasPrice=typeof i.gasPrice=="string"?i.gasPrice:i.gasPrice.toString()),i.gasLimit&&(i.gasLimit=typeof i.gasLimit=="string"?i.gasLimit:i.gasLimit.toNumber()),this.request({id:42,jsonrpc:"2.0",method:"zil_deployContract",params:{init:t,code:e,params:i,attempts:g,interval:c,toDs:r}}));this.callContract=(t,e,i,g=33,c=1e3,r=!1,f)=>(i.amount&&(i.amount=typeof i.amount=="string"?i.amount:i.amount.toString()),i.gasPrice&&(i.gasPrice=typeof i.gasPrice=="string"?i.gasPrice:i.gasPrice.toString()),i.gasLimit&&(i.gasLimit=typeof i.gasLimit=="string"?i.gasLimit:i.gasLimit.toNumber()),this.request({id:42,jsonrpc:"2.0",method:"zil_callContract",params:{transition:t,args:e,params:i,attempts:g,interval:c,toDs:r,contractAddress:f}}));this.getWallet=()=>this.request({id:42,jsonrpc:"2.0",method:"zil_getWallet",params:[]});this.config={rpcUrl:t.rpcUrl,chainType:"ZILLIQA"}}};
2
2
  //# sourceMappingURL=index.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
4
  "sourcesContent": ["/* eslint-disable no-param-reassign */\nimport { Extension } from '@magic-sdk/commons';\nimport { ZilliqaConfig, ConfigType } from './type';\n\nexport class ZilliqaExtension extends Extension.Internal<'zilliqa', ZilliqaConfig> {\n name = 'zilliqa' as const;\n\n config: ConfigType;\n\n constructor(public zilliqaConfig: ZilliqaConfig) {\n super();\n\n this.config = {\n rpcUrl: zilliqaConfig.rpcUrl,\n chainType: 'ZILLIQA',\n };\n }\n\n public sendTransaction = (params: any, toDs: boolean): Promise<any> => {\n if (params.amount) params.amount = typeof params.amount === 'string' ? params.amount : params.amount.toString();\n if (params.gasPrice)\n params.gasPrice = typeof params.gasPrice === 'string' ? params.gasPrice : params.gasPrice.toString();\n if (params.gasLimit)\n params.gasLimit = typeof params.gasLimit === 'string' ? params.gasLimit : params.gasLimit.toNumber();\n\n return this.request({\n id: 42,\n method: 'zil_sendTransaction',\n jsonrpc: '2.0',\n params: {\n params,\n toDs,\n },\n });\n };\n\n public deployContract = (\n init: any,\n code: string,\n params: any,\n attempts: number,\n interval: number,\n toDs: boolean,\n ): Promise<any> => {\n if (params.amount) params.amount = typeof params.amount === 'string' ? params.amount : params.amount.toString();\n if (params.gasPrice)\n params.gasPrice = typeof params.gasPrice === 'string' ? params.gasPrice : params.gasPrice.toString();\n if (params.gasLimit)\n params.gasLimit = typeof params.gasLimit === 'string' ? params.gasLimit : params.gasLimit.toNumber();\n\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'zil_deployContract',\n params: {\n init,\n code,\n params,\n attempts,\n interval,\n toDs,\n },\n });\n };\n\n public callContract = (\n transition: string,\n args: any[],\n params: any,\n attempts = 33,\n interval = 1000,\n toDs = false,\n contractAddress: string,\n ) => {\n if (params.amount) params.amount = typeof params.amount === 'string' ? params.amount : params.amount.toString();\n if (params.gasPrice)\n params.gasPrice = typeof params.gasPrice === 'string' ? params.gasPrice : params.gasPrice.toString();\n if (params.gasLimit)\n params.gasLimit = typeof params.gasLimit === 'string' ? params.gasLimit : params.gasLimit.toNumber();\n\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'zil_callContract',\n params: {\n transition,\n args,\n params,\n attempts,\n interval,\n toDs,\n contractAddress,\n },\n });\n };\n\n public getWallet = (): Promise<object> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'zil_getWallet',\n params: [],\n });\n };\n}\n"],
5
- "mappings": "8gBAAA,uCACA,MAA0B,8BAGnB,eAA+B,aAAU,QAAmC,CAKjF,YAAmB,EAA8B,CAC/C,QADiB,qBAJnB,UAAO,UAaA,qBAAkB,CAAC,EAAa,IACjC,GAAO,QAAQ,GAAO,OAAS,MAAO,GAAO,QAAW,SAAW,EAAO,OAAS,EAAO,OAAO,YACjG,EAAO,UACT,GAAO,SAAW,MAAO,GAAO,UAAa,SAAW,EAAO,SAAW,EAAO,SAAS,YACxF,EAAO,UACT,GAAO,SAAW,MAAO,GAAO,UAAa,SAAW,EAAO,SAAW,EAAO,SAAS,YAErF,KAAK,QAAQ,CAClB,GAAI,GACJ,OAAQ,sBACR,QAAS,MACT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A,KAAAC,EACA,OAAAP,EACA,SAAAI,EACA,SAAAC,EACA,KAAAJ,EACA,gBAAAO,CACF,CACF,CAAC,GAGH,KAAO,UAAY,IACV,KAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,gBACR,OAAQ,CAAC,CACX,CAAC,EA1FD,KAAK,OAAS,CACZ,OAAQT,EAAc,OACtB,UAAW,SACb,CACF,CAwFF",
6
+ "names": ["src_exports", "__export", "ZilliqaExtension", "__toCommonJS", "import_commons", "zilliqaConfig", "params", "toDs", "init", "code", "attempts", "interval", "transition", "args", "contractAddress"]
7
7
  }
package/dist/es/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{Extension as l}from"@magic-sdk/commons";var r=class extends l.Internal{constructor(t){super();this.zilliqaConfig=t;this.name="zilliqa";this.sendTransaction=(t,n)=>(t.amount&&(t.amount=typeof t.amount=="string"?t.amount:t.amount.toString()),t.gasPrice&&(t.gasPrice=typeof t.gasPrice=="string"?t.gasPrice:t.gasPrice.toString()),t.gasLimit&&(t.gasLimit=typeof t.gasLimit=="string"?t.gasLimit:t.gasLimit.toNumber()),this.request({id:42,method:"zil_sendTransaction",jsonrpc:"2.0",params:{params:t,toDs:n}}));this.deployContract=(t,n,i,o,e,g)=>(i.amount&&(i.amount=typeof i.amount=="string"?i.amount:i.amount.toString()),i.gasPrice&&(i.gasPrice=typeof i.gasPrice=="string"?i.gasPrice:i.gasPrice.toString()),i.gasLimit&&(i.gasLimit=typeof i.gasLimit=="string"?i.gasLimit:i.gasLimit.toNumber()),this.request({id:42,jsonrpc:"2.0",method:"zil_deployContract",params:{init:t,code:n,params:i,attempts:o,interval:e,toDs:g}}));this.callContract=(t,n,i,o=33,e=1e3,g=!1,c)=>(i.amount&&(i.amount=typeof i.amount=="string"?i.amount:i.amount.toString()),i.gasPrice&&(i.gasPrice=typeof i.gasPrice=="string"?i.gasPrice:i.gasPrice.toString()),i.gasLimit&&(i.gasLimit=typeof i.gasLimit=="string"?i.gasLimit:i.gasLimit.toNumber()),this.request({id:42,jsonrpc:"2.0",method:"zil_callContract",params:{transition:t,args:n,params:i,attempts:o,interval:e,toDs:g,contractAddress:c}}));this.getWallet=()=>this.request({id:42,jsonrpc:"2.0",method:"zil_getWallet",params:[]});this.config={rpcUrl:t.rpcUrl,chainType:"ZILLIQA"}}};export{r as ZilliqaExtension};
1
+ import{Extension as u}from"@magic-sdk/commons";var c=class extends u.Internal{constructor(t){super();this.zilliqaConfig=t;this.name="zilliqa";this.sendTransaction=(t,n)=>(t.amount&&(t.amount=typeof t.amount=="string"?t.amount:t.amount.toString()),t.gasPrice&&(t.gasPrice=typeof t.gasPrice=="string"?t.gasPrice:t.gasPrice.toString()),t.gasLimit&&(t.gasLimit=typeof t.gasLimit=="string"?t.gasLimit:t.gasLimit.toNumber()),this.request({id:42,method:"zil_sendTransaction",jsonrpc:"2.0",params:{params:t,toDs:n}}));this.deployContract=(t,n,i,o,e,g)=>(i.amount&&(i.amount=typeof i.amount=="string"?i.amount:i.amount.toString()),i.gasPrice&&(i.gasPrice=typeof i.gasPrice=="string"?i.gasPrice:i.gasPrice.toString()),i.gasLimit&&(i.gasLimit=typeof i.gasLimit=="string"?i.gasLimit:i.gasLimit.toNumber()),this.request({id:42,jsonrpc:"2.0",method:"zil_deployContract",params:{init:t,code:n,params:i,attempts:o,interval:e,toDs:g}}));this.callContract=(t,n,i,o=33,e=1e3,g=!1,r)=>(i.amount&&(i.amount=typeof i.amount=="string"?i.amount:i.amount.toString()),i.gasPrice&&(i.gasPrice=typeof i.gasPrice=="string"?i.gasPrice:i.gasPrice.toString()),i.gasLimit&&(i.gasLimit=typeof i.gasLimit=="string"?i.gasLimit:i.gasLimit.toNumber()),this.request({id:42,jsonrpc:"2.0",method:"zil_callContract",params:{transition:t,args:n,params:i,attempts:o,interval:e,toDs:g,contractAddress:r}}));this.getWallet=()=>this.request({id:42,jsonrpc:"2.0",method:"zil_getWallet",params:[]});this.config={rpcUrl:t.rpcUrl,chainType:"ZILLIQA"}}};export{c as ZilliqaExtension};
2
2
  //# sourceMappingURL=index.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
4
  "sourcesContent": ["/* eslint-disable no-param-reassign */\nimport { Extension } from '@magic-sdk/commons';\nimport { ZilliqaConfig, ConfigType } from './type';\n\nexport class ZilliqaExtension extends Extension.Internal<'zilliqa', ZilliqaConfig> {\n name = 'zilliqa' as const;\n\n config: ConfigType;\n\n constructor(public zilliqaConfig: ZilliqaConfig) {\n super();\n\n this.config = {\n rpcUrl: zilliqaConfig.rpcUrl,\n chainType: 'ZILLIQA',\n };\n }\n\n public sendTransaction = (params: any, toDs: boolean): Promise<any> => {\n if (params.amount) params.amount = typeof params.amount === 'string' ? params.amount : params.amount.toString();\n if (params.gasPrice)\n params.gasPrice = typeof params.gasPrice === 'string' ? params.gasPrice : params.gasPrice.toString();\n if (params.gasLimit)\n params.gasLimit = typeof params.gasLimit === 'string' ? params.gasLimit : params.gasLimit.toNumber();\n\n return this.request({\n id: 42,\n method: 'zil_sendTransaction',\n jsonrpc: '2.0',\n params: {\n params,\n toDs,\n },\n });\n };\n\n public deployContract = (\n init: any,\n code: string,\n params: any,\n attempts: number,\n interval: number,\n toDs: boolean,\n ): Promise<any> => {\n if (params.amount) params.amount = typeof params.amount === 'string' ? params.amount : params.amount.toString();\n if (params.gasPrice)\n params.gasPrice = typeof params.gasPrice === 'string' ? params.gasPrice : params.gasPrice.toString();\n if (params.gasLimit)\n params.gasLimit = typeof params.gasLimit === 'string' ? params.gasLimit : params.gasLimit.toNumber();\n\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'zil_deployContract',\n params: {\n init,\n code,\n params,\n attempts,\n interval,\n toDs,\n },\n });\n };\n\n public callContract = (\n transition: string,\n args: any[],\n params: any,\n attempts = 33,\n interval = 1000,\n toDs = false,\n contractAddress: string,\n ) => {\n if (params.amount) params.amount = typeof params.amount === 'string' ? params.amount : params.amount.toString();\n if (params.gasPrice)\n params.gasPrice = typeof params.gasPrice === 'string' ? params.gasPrice : params.gasPrice.toString();\n if (params.gasLimit)\n params.gasLimit = typeof params.gasLimit === 'string' ? params.gasLimit : params.gasLimit.toNumber();\n\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'zil_callContract',\n params: {\n transition,\n args,\n params,\n attempts,\n interval,\n toDs,\n contractAddress,\n },\n });\n };\n\n public getWallet = (): Promise<object> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'zil_getWallet',\n params: [],\n });\n };\n}\n"],
5
- "mappings": "AACA,+CAGO,mBAA+B,GAAU,QAAmC,CAKjF,YAAmB,EAA8B,CAC/C,QADiB,qBAJnB,UAAO,UAaA,qBAAkB,CAAC,EAAa,IACjC,GAAO,QAAQ,GAAO,OAAS,MAAO,GAAO,QAAW,SAAW,EAAO,OAAS,EAAO,OAAO,YACjG,EAAO,UACT,GAAO,SAAW,MAAO,GAAO,UAAa,SAAW,EAAO,SAAW,EAAO,SAAS,YACxF,EAAO,UACT,GAAO,SAAW,MAAO,GAAO,UAAa,SAAW,EAAO,SAAW,EAAO,SAAS,YAErF,KAAK,QAAQ,CAClB,GAAI,GACJ,OAAQ,sBACR,QAAS,MACT,OAAQ,CACN,SACA,WAKC,oBAAiB,CACtB,EACA,EACA,EACA,EACA,EACA,IAEI,GAAO,QAAQ,GAAO,OAAS,MAAO,GAAO,QAAW,SAAW,EAAO,OAAS,EAAO,OAAO,YACjG,EAAO,UACT,GAAO,SAAW,MAAO,GAAO,UAAa,SAAW,EAAO,SAAW,EAAO,SAAS,YACxF,EAAO,UACT,GAAO,SAAW,MAAO,GAAO,UAAa,SAAW,EAAO,SAAW,EAAO,SAAS,YAErF,KAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,qBACR,OAAQ,CACN,OACA,OACA,SACA,WACA,WACA,WAKC,kBAAe,CACpB,EACA,EACA,EACA,EAAW,GACX,EAAW,IACX,EAAO,GACP,IAEI,GAA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,SAAWA,EAAO,SAAS,SAAS,GACjGA,EAAO,WACTA,EAAO,SAAW,OAAOA,EAAO,UAAa,SAAWA,EAAO,SAAWA,EAAO,SAAS,SAAS,GAE9F,KAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,qBACR,OAAQ,CACN,KAAAE,EACA,KAAAC,EACA,OAAAH,EACA,SAAAI,EACA,SAAAC,EACA,KAAAJ,CACF,CACF,CAAC,GAGH,KAAO,aAAe,CACpBK,EACAC,EACAP,EACAI,EAAW,GACXC,EAAW,IACXJ,EAAO,GACPO,KAEIR,EAAO,SAAQA,EAAO,OAAS,OAAOA,EAAO,QAAW,SAAWA,EAAO,OAASA,EAAO,OAAO,SAAS,GAC1GA,EAAO,WACTA,EAAO,SAAW,OAAOA,EAAO,UAAa,SAAWA,EAAO,SAAWA,EAAO,SAAS,SAAS,GACjGA,EAAO,WACTA,EAAO,SAAW,OAAOA,EAAO,UAAa,SAAWA,EAAO,SAAWA,EAAO,SAAS,SAAS,GAE9F,KAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,mBACR,OAAQ,CACN,WAAAM,EACA,KAAAC,EACA,OAAAP,EACA,SAAAI,EACA,SAAAC,EACA,KAAAJ,EACA,gBAAAO,CACF,CACF,CAAC,GAGH,KAAO,UAAY,IACV,KAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,gBACR,OAAQ,CAAC,CACX,CAAC,EA1FD,KAAK,OAAS,CACZ,OAAQT,EAAc,OACtB,UAAW,SACb,CACF,CAwFF",
6
+ "names": ["Extension", "ZilliqaExtension", "zilliqaConfig", "params", "toDs", "init", "code", "attempts", "interval", "transition", "args", "contractAddress"]
7
7
  }
package/dist/es/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import{Extension as l}from"@magic-sdk/commons";var r=class extends l.Internal{constructor(t){super();this.zilliqaConfig=t;this.name="zilliqa";this.sendTransaction=(t,n)=>(t.amount&&(t.amount=typeof t.amount=="string"?t.amount:t.amount.toString()),t.gasPrice&&(t.gasPrice=typeof t.gasPrice=="string"?t.gasPrice:t.gasPrice.toString()),t.gasLimit&&(t.gasLimit=typeof t.gasLimit=="string"?t.gasLimit:t.gasLimit.toNumber()),this.request({id:42,method:"zil_sendTransaction",jsonrpc:"2.0",params:{params:t,toDs:n}}));this.deployContract=(t,n,i,o,e,g)=>(i.amount&&(i.amount=typeof i.amount=="string"?i.amount:i.amount.toString()),i.gasPrice&&(i.gasPrice=typeof i.gasPrice=="string"?i.gasPrice:i.gasPrice.toString()),i.gasLimit&&(i.gasLimit=typeof i.gasLimit=="string"?i.gasLimit:i.gasLimit.toNumber()),this.request({id:42,jsonrpc:"2.0",method:"zil_deployContract",params:{init:t,code:n,params:i,attempts:o,interval:e,toDs:g}}));this.callContract=(t,n,i,o=33,e=1e3,g=!1,c)=>(i.amount&&(i.amount=typeof i.amount=="string"?i.amount:i.amount.toString()),i.gasPrice&&(i.gasPrice=typeof i.gasPrice=="string"?i.gasPrice:i.gasPrice.toString()),i.gasLimit&&(i.gasLimit=typeof i.gasLimit=="string"?i.gasLimit:i.gasLimit.toNumber()),this.request({id:42,jsonrpc:"2.0",method:"zil_callContract",params:{transition:t,args:n,params:i,attempts:o,interval:e,toDs:g,contractAddress:c}}));this.getWallet=()=>this.request({id:42,jsonrpc:"2.0",method:"zil_getWallet",params:[]});this.config={rpcUrl:t.rpcUrl,chainType:"ZILLIQA"}}};export{r as ZilliqaExtension};
1
+ import{Extension as u}from"@magic-sdk/commons";var c=class extends u.Internal{constructor(t){super();this.zilliqaConfig=t;this.name="zilliqa";this.sendTransaction=(t,n)=>(t.amount&&(t.amount=typeof t.amount=="string"?t.amount:t.amount.toString()),t.gasPrice&&(t.gasPrice=typeof t.gasPrice=="string"?t.gasPrice:t.gasPrice.toString()),t.gasLimit&&(t.gasLimit=typeof t.gasLimit=="string"?t.gasLimit:t.gasLimit.toNumber()),this.request({id:42,method:"zil_sendTransaction",jsonrpc:"2.0",params:{params:t,toDs:n}}));this.deployContract=(t,n,i,o,e,g)=>(i.amount&&(i.amount=typeof i.amount=="string"?i.amount:i.amount.toString()),i.gasPrice&&(i.gasPrice=typeof i.gasPrice=="string"?i.gasPrice:i.gasPrice.toString()),i.gasLimit&&(i.gasLimit=typeof i.gasLimit=="string"?i.gasLimit:i.gasLimit.toNumber()),this.request({id:42,jsonrpc:"2.0",method:"zil_deployContract",params:{init:t,code:n,params:i,attempts:o,interval:e,toDs:g}}));this.callContract=(t,n,i,o=33,e=1e3,g=!1,r)=>(i.amount&&(i.amount=typeof i.amount=="string"?i.amount:i.amount.toString()),i.gasPrice&&(i.gasPrice=typeof i.gasPrice=="string"?i.gasPrice:i.gasPrice.toString()),i.gasLimit&&(i.gasLimit=typeof i.gasLimit=="string"?i.gasLimit:i.gasLimit.toNumber()),this.request({id:42,jsonrpc:"2.0",method:"zil_callContract",params:{transition:t,args:n,params:i,attempts:o,interval:e,toDs:g,contractAddress:r}}));this.getWallet=()=>this.request({id:42,jsonrpc:"2.0",method:"zil_getWallet",params:[]});this.config={rpcUrl:t.rpcUrl,chainType:"ZILLIQA"}}};export{c as ZilliqaExtension};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
4
  "sourcesContent": ["/* eslint-disable no-param-reassign */\nimport { Extension } from '@magic-sdk/commons';\nimport { ZilliqaConfig, ConfigType } from './type';\n\nexport class ZilliqaExtension extends Extension.Internal<'zilliqa', ZilliqaConfig> {\n name = 'zilliqa' as const;\n\n config: ConfigType;\n\n constructor(public zilliqaConfig: ZilliqaConfig) {\n super();\n\n this.config = {\n rpcUrl: zilliqaConfig.rpcUrl,\n chainType: 'ZILLIQA',\n };\n }\n\n public sendTransaction = (params: any, toDs: boolean): Promise<any> => {\n if (params.amount) params.amount = typeof params.amount === 'string' ? params.amount : params.amount.toString();\n if (params.gasPrice)\n params.gasPrice = typeof params.gasPrice === 'string' ? params.gasPrice : params.gasPrice.toString();\n if (params.gasLimit)\n params.gasLimit = typeof params.gasLimit === 'string' ? params.gasLimit : params.gasLimit.toNumber();\n\n return this.request({\n id: 42,\n method: 'zil_sendTransaction',\n jsonrpc: '2.0',\n params: {\n params,\n toDs,\n },\n });\n };\n\n public deployContract = (\n init: any,\n code: string,\n params: any,\n attempts: number,\n interval: number,\n toDs: boolean,\n ): Promise<any> => {\n if (params.amount) params.amount = typeof params.amount === 'string' ? params.amount : params.amount.toString();\n if (params.gasPrice)\n params.gasPrice = typeof params.gasPrice === 'string' ? params.gasPrice : params.gasPrice.toString();\n if (params.gasLimit)\n params.gasLimit = typeof params.gasLimit === 'string' ? params.gasLimit : params.gasLimit.toNumber();\n\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'zil_deployContract',\n params: {\n init,\n code,\n params,\n attempts,\n interval,\n toDs,\n },\n });\n };\n\n public callContract = (\n transition: string,\n args: any[],\n params: any,\n attempts = 33,\n interval = 1000,\n toDs = false,\n contractAddress: string,\n ) => {\n if (params.amount) params.amount = typeof params.amount === 'string' ? params.amount : params.amount.toString();\n if (params.gasPrice)\n params.gasPrice = typeof params.gasPrice === 'string' ? params.gasPrice : params.gasPrice.toString();\n if (params.gasLimit)\n params.gasLimit = typeof params.gasLimit === 'string' ? params.gasLimit : params.gasLimit.toNumber();\n\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'zil_callContract',\n params: {\n transition,\n args,\n params,\n attempts,\n interval,\n toDs,\n contractAddress,\n },\n });\n };\n\n public getWallet = (): Promise<object> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'zil_getWallet',\n params: [],\n });\n };\n}\n"],
5
- "mappings": "AACA,+CAGO,mBAA+B,GAAU,QAAmC,CAKjF,YAAmB,EAA8B,CAC/C,QADiB,qBAJnB,UAAO,UAaA,qBAAkB,CAAC,EAAa,IACjC,GAAO,QAAQ,GAAO,OAAS,MAAO,GAAO,QAAW,SAAW,EAAO,OAAS,EAAO,O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AO,WACTA,EAAO,SAAW,OAAOA,EAAO,UAAa,SAAWA,EAAO,SAAWA,EAAO,SAAS,SAAS,GAE9F,KAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,mBACR,OAAQ,CACN,WAAAM,EACA,KAAAC,EACA,OAAAP,EACA,SAAAI,EACA,SAAAC,EACA,KAAAJ,EACA,gBAAAO,CACF,CACF,CAAC,GAGH,KAAO,UAAY,IACV,KAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,gBACR,OAAQ,CAAC,CACX,CAAC,EA1FD,KAAK,OAAS,CACZ,OAAQT,EAAc,OACtB,UAAW,SACb,CACF,CAwFF",
6
+ "names": ["Extension", "ZilliqaExtension", "zilliqaConfig", "params", "toDs", "init", "code", "attempts", "interval", "transition", "args", "contractAddress"]
7
7
  }
package/dist/extension.js CHANGED
@@ -1,2 +1,2 @@
1
- var MagicZilliqaExtension=(()=>{var d=Object.create;var g=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var u=n=>g(n,"__esModule",{value:!0});var m=(n,i)=>()=>(i||n((i={exports:{}}).exports,i),i.exports),x=(n,i)=>{for(var o in i)g(n,o,{get:i[o],enumerable:!0})},s=(n,i,o,t)=>{if(i&&typeof i=="object"||typeof i=="function")for(let e of h(i))!C.call(n,e)&&(o||e!=="default")&&g(n,e,{get:()=>i[e],enumerable:!(t=b(i,e))||t.enumerable});return n},z=(n,i)=>s(u(g(n!=null?d(q(n)):{},"default",!i&&n&&n.__esModule?{get:()=>n.default,enumerable:!0}:{value:n,enumerable:!0})),n),S=(n=>(i,o)=>n&&n.get(i)||(o=s(u({}),i,1),n&&n.set(i,o),o))(typeof WeakMap!="undefined"?new WeakMap:0);var y=m((_,f)=>{f.exports=Magic});var T={};x(T,{default:()=>j});var P=z(y()),r=class extends P.Extension.Internal{constructor(i){super();this.zilliqaConfig=i;this.name="zilliqa";this.sendTransaction=(i,o)=>(i.amount&&(i.amount=typeof i.amount=="string"?i.amount:i.amount.toString()),i.gasPrice&&(i.gasPrice=typeof i.gasPrice=="string"?i.gasPrice:i.gasPrice.toString()),i.gasLimit&&(i.gasLimit=typeof i.gasLimit=="string"?i.gasLimit:i.gasLimit.toNumber()),this.request({id:42,method:"zil_sendTransaction",jsonrpc:"2.0",params:{params:i,toDs:o}}));this.deployContract=(i,o,t,e,c,l)=>(t.amount&&(t.amount=typeof t.amount=="string"?t.amount:t.amount.toString()),t.gasPrice&&(t.gasPrice=typeof t.gasPrice=="string"?t.gasPrice:t.gasPrice.toString()),t.gasLimit&&(t.gasLimit=typeof t.gasLimit=="string"?t.gasLimit:t.gasLimit.toNumber()),this.request({id:42,jsonrpc:"2.0",method:"zil_deployContract",params:{init:i,code:o,params:t,attempts:e,interval:c,toDs:l}}));this.callContract=(i,o,t,e=33,c=1e3,l=!1,L)=>(t.amount&&(t.amount=typeof t.amount=="string"?t.amount:t.amount.toString()),t.gasPrice&&(t.gasPrice=typeof t.gasPrice=="string"?t.gasPrice:t.gasPrice.toString()),t.gasLimit&&(t.gasLimit=typeof t.gasLimit=="string"?t.gasLimit:t.gasLimit.toNumber()),this.request({id:42,jsonrpc:"2.0",method:"zil_callContract",params:{transition:i,args:o,params:t,attempts:e,interval:c,toDs:l,contractAddress:L}}));this.getWallet=()=>this.request({id:42,jsonrpc:"2.0",method:"zil_getWallet",params:[]});this.config={rpcUrl:i.rpcUrl,chainType:"ZILLIQA"}}};var j=r;return S(T);})();
1
+ "use strict";var MagicZilliqaExtension=(()=>{var d=Object.create;var g=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var m=(n,o)=>()=>(o||n((o={exports:{}}).exports,o),o.exports),z=(n,o)=>{for(var t in o)g(n,t,{get:o[t],enumerable:!0})},s=(n,o,t,e)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of h(o))!C.call(n,i)&&i!==t&&g(n,i,{get:()=>o[i],enumerable:!(e=b(o,i))||e.enumerable});return n};var S=(n,o,t)=>(t=n!=null?d(q(n)):{},s(o||!n||!n.__esModule?g(t,"default",{value:n,enumerable:!0}):t,n)),j=n=>s(g({},"__esModule",{value:!0}),n);var y=m((_,f)=>{f.exports=Magic});var T={};z(T,{default:()=>x});var P=S(y()),c=class extends P.Extension.Internal{constructor(t){super();this.zilliqaConfig=t;this.name="zilliqa";this.sendTransaction=(t,e)=>(t.amount&&(t.amount=typeof t.amount=="string"?t.amount:t.amount.toString()),t.gasPrice&&(t.gasPrice=typeof t.gasPrice=="string"?t.gasPrice:t.gasPrice.toString()),t.gasLimit&&(t.gasLimit=typeof t.gasLimit=="string"?t.gasLimit:t.gasLimit.toNumber()),this.request({id:42,method:"zil_sendTransaction",jsonrpc:"2.0",params:{params:t,toDs:e}}));this.deployContract=(t,e,i,r,l,u)=>(i.amount&&(i.amount=typeof i.amount=="string"?i.amount:i.amount.toString()),i.gasPrice&&(i.gasPrice=typeof i.gasPrice=="string"?i.gasPrice:i.gasPrice.toString()),i.gasLimit&&(i.gasLimit=typeof i.gasLimit=="string"?i.gasLimit:i.gasLimit.toNumber()),this.request({id:42,jsonrpc:"2.0",method:"zil_deployContract",params:{init:t,code:e,params:i,attempts:r,interval:l,toDs:u}}));this.callContract=(t,e,i,r=33,l=1e3,u=!1,L)=>(i.amount&&(i.amount=typeof i.amount=="string"?i.amount:i.amount.toString()),i.gasPrice&&(i.gasPrice=typeof i.gasPrice=="string"?i.gasPrice:i.gasPrice.toString()),i.gasLimit&&(i.gasLimit=typeof i.gasLimit=="string"?i.gasLimit:i.gasLimit.toNumber()),this.request({id:42,jsonrpc:"2.0",method:"zil_callContract",params:{transition:t,args:e,params:i,attempts:r,interval:l,toDs:u,contractAddress:L}}));this.getWallet=()=>this.request({id:42,jsonrpc:"2.0",method:"zil_getWallet",params:[]});this.config={rpcUrl:t.rpcUrl,chainType:"ZILLIQA"}}};var x=c;return j(T);})();
2
2
  if (MagicZilliqaExtension && MagicZilliqaExtension.default != null) { MagicZilliqaExtension = Object.assign(MagicZilliqaExtension.default, MagicZilliqaExtension); delete MagicZilliqaExtension.default; }
@@ -1,2 +1,2 @@
1
- var r=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var L=o=>r(o,"__esModule",{value:!0});var b=(o,i)=>{for(var n in i)r(o,n,{get:i[n],enumerable:!0})},d=(o,i,n,t)=>{if(i&&typeof i=="object"||typeof i=="function")for(let e of y(i))!P.call(o,e)&&(n||e!=="default")&&r(o,e,{get:()=>i[e],enumerable:!(t=f(i,e))||t.enumerable});return o};var h=(o=>(i,n)=>o&&o.get(i)||(n=d(L({}),i,1),o&&o.set(i,n),n))(typeof WeakMap!="undefined"?new WeakMap:0);var q={};b(q,{ZilliqaExtension:()=>u});var l=require("@magic-sdk/commons"),u=class extends l.Extension.Internal{constructor(i){super();this.zilliqaConfig=i;this.name="zilliqa";this.sendTransaction=(i,n)=>(i.amount&&(i.amount=typeof i.amount=="string"?i.amount:i.amount.toString()),i.gasPrice&&(i.gasPrice=typeof i.gasPrice=="string"?i.gasPrice:i.gasPrice.toString()),i.gasLimit&&(i.gasLimit=typeof i.gasLimit=="string"?i.gasLimit:i.gasLimit.toNumber()),this.request({id:42,method:"zil_sendTransaction",jsonrpc:"2.0",params:{params:i,toDs:n}}));this.deployContract=(i,n,t,e,g,c)=>(t.amount&&(t.amount=typeof t.amount=="string"?t.amount:t.amount.toString()),t.gasPrice&&(t.gasPrice=typeof t.gasPrice=="string"?t.gasPrice:t.gasPrice.toString()),t.gasLimit&&(t.gasLimit=typeof t.gasLimit=="string"?t.gasLimit:t.gasLimit.toNumber()),this.request({id:42,jsonrpc:"2.0",method:"zil_deployContract",params:{init:i,code:n,params:t,attempts:e,interval:g,toDs:c}}));this.callContract=(i,n,t,e=33,g=1e3,c=!1,s)=>(t.amount&&(t.amount=typeof t.amount=="string"?t.amount:t.amount.toString()),t.gasPrice&&(t.gasPrice=typeof t.gasPrice=="string"?t.gasPrice:t.gasPrice.toString()),t.gasLimit&&(t.gasLimit=typeof t.gasLimit=="string"?t.gasLimit:t.gasLimit.toNumber()),this.request({id:42,jsonrpc:"2.0",method:"zil_callContract",params:{transition:i,args:n,params:t,attempts:e,interval:g,toDs:c,contractAddress:s}}));this.getWallet=()=>this.request({id:42,jsonrpc:"2.0",method:"zil_getWallet",params:[]});this.config={rpcUrl:i.rpcUrl,chainType:"ZILLIQA"}}};module.exports=h(q);
1
+ "use strict";var u=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var L=Object.prototype.hasOwnProperty;var b=(o,n)=>{for(var t in n)u(o,t,{get:n[t],enumerable:!0})},d=(o,n,t,e)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of P(n))!L.call(o,i)&&i!==t&&u(o,i,{get:()=>n[i],enumerable:!(e=y(n,i))||e.enumerable});return o};var h=o=>d(u({},"__esModule",{value:!0}),o);var C={};b(C,{ZilliqaExtension:()=>l});module.exports=h(C);var f=require("@magic-sdk/commons"),l=class extends f.Extension.Internal{constructor(t){super();this.zilliqaConfig=t;this.name="zilliqa";this.sendTransaction=(t,e)=>(t.amount&&(t.amount=typeof t.amount=="string"?t.amount:t.amount.toString()),t.gasPrice&&(t.gasPrice=typeof t.gasPrice=="string"?t.gasPrice:t.gasPrice.toString()),t.gasLimit&&(t.gasLimit=typeof t.gasLimit=="string"?t.gasLimit:t.gasLimit.toNumber()),this.request({id:42,method:"zil_sendTransaction",jsonrpc:"2.0",params:{params:t,toDs:e}}));this.deployContract=(t,e,i,g,c,r)=>(i.amount&&(i.amount=typeof i.amount=="string"?i.amount:i.amount.toString()),i.gasPrice&&(i.gasPrice=typeof i.gasPrice=="string"?i.gasPrice:i.gasPrice.toString()),i.gasLimit&&(i.gasLimit=typeof i.gasLimit=="string"?i.gasLimit:i.gasLimit.toNumber()),this.request({id:42,jsonrpc:"2.0",method:"zil_deployContract",params:{init:t,code:e,params:i,attempts:g,interval:c,toDs:r}}));this.callContract=(t,e,i,g=33,c=1e3,r=!1,s)=>(i.amount&&(i.amount=typeof i.amount=="string"?i.amount:i.amount.toString()),i.gasPrice&&(i.gasPrice=typeof i.gasPrice=="string"?i.gasPrice:i.gasPrice.toString()),i.gasLimit&&(i.gasLimit=typeof i.gasLimit=="string"?i.gasLimit:i.gasLimit.toNumber()),this.request({id:42,jsonrpc:"2.0",method:"zil_callContract",params:{transition:t,args:e,params:i,attempts:g,interval:c,toDs:r,contractAddress:s}}));this.getWallet=()=>this.request({id:42,jsonrpc:"2.0",method:"zil_getWallet",params:[]});this.config={rpcUrl:t.rpcUrl,chainType:"ZILLIQA"}}};
2
2
  //# sourceMappingURL=index.native.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.native.ts", "../../src/index.ts"],
4
4
  "sourcesContent": ["export * from './index';\n", "/* eslint-disable no-param-reassign */\nimport { Extension } from '@magic-sdk/commons';\nimport { ZilliqaConfig, ConfigType } from './type';\n\nexport class ZilliqaExtension extends Extension.Internal<'zilliqa', ZilliqaConfig> {\n name = 'zilliqa' as const;\n\n config: ConfigType;\n\n constructor(public zilliqaConfig: ZilliqaConfig) {\n super();\n\n this.config = {\n rpcUrl: zilliqaConfig.rpcUrl,\n chainType: 'ZILLIQA',\n };\n }\n\n public sendTransaction = (params: any, toDs: boolean): Promise<any> => {\n if (params.amount) params.amount = typeof params.amount === 'string' ? params.amount : params.amount.toString();\n if (params.gasPrice)\n params.gasPrice = typeof params.gasPrice === 'string' ? params.gasPrice : params.gasPrice.toString();\n if (params.gasLimit)\n params.gasLimit = typeof params.gasLimit === 'string' ? params.gasLimit : params.gasLimit.toNumber();\n\n return this.request({\n id: 42,\n method: 'zil_sendTransaction',\n jsonrpc: '2.0',\n params: {\n params,\n toDs,\n },\n });\n };\n\n public deployContract = (\n init: any,\n code: string,\n params: any,\n attempts: number,\n interval: number,\n toDs: boolean,\n ): Promise<any> => {\n if (params.amount) params.amount = typeof params.amount === 'string' ? params.amount : params.amount.toString();\n if (params.gasPrice)\n params.gasPrice = typeof params.gasPrice === 'string' ? params.gasPrice : params.gasPrice.toString();\n if (params.gasLimit)\n params.gasLimit = typeof params.gasLimit === 'string' ? params.gasLimit : params.gasLimit.toNumber();\n\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'zil_deployContract',\n params: {\n init,\n code,\n params,\n attempts,\n interval,\n toDs,\n },\n });\n };\n\n public callContract = (\n transition: string,\n args: any[],\n params: any,\n attempts = 33,\n interval = 1000,\n toDs = false,\n contractAddress: string,\n ) => {\n if (params.amount) params.amount = typeof params.amount === 'string' ? params.amount : params.amount.toString();\n if (params.gasPrice)\n params.gasPrice = typeof params.gasPrice === 'string' ? params.gasPrice : params.gasPrice.toString();\n if (params.gasLimit)\n params.gasLimit = typeof params.gasLimit === 'string' ? params.gasLimit : params.gasLimit.toNumber();\n\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'zil_callContract',\n params: {\n transition,\n args,\n params,\n attempts,\n interval,\n toDs,\n contractAddress,\n },\n });\n };\n\n public getWallet = (): Promise<object> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'zil_getWallet',\n params: [],\n });\n };\n}\n"],
5
- "mappings": "8gBAAA,uCCCA,MAA0B,8BAGnB,eAA+B,aAAU,QAAmC,CAKjF,YAAmB,EAA8B,CAC/C,QADiB,qBAJnB,UAAO,UAaA,qBAAkB,CAAC,EAAa,IACjC,GAAO,QAAQ,GAAO,OAAS,MAAO,GAAO,QAAW,SAAW,EAAO,OAAS,EAAO,OAAO,YACjG,EAAO,UACT,GAAO,SAAW,MAAO,GAAO,UAAa,SAAW,EAAO,SAAW,EAAO,SAAS,YACxF,EAAO,UACT,GAAO,SAAW,MAAO,GAAO,UAAa,SAAW,EAAO,SAAW,EAAO,SAAS,YAErF,KAAK,QAAQ,CAClB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T,OAAQ,mBACR,OAAQ,CACN,WAAAM,EACA,KAAAC,EACA,OAAAP,EACA,SAAAI,EACA,SAAAC,EACA,KAAAJ,EACA,gBAAAO,CACF,CACF,CAAC,GAGH,KAAO,UAAY,IACV,KAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,gBACR,OAAQ,CAAC,CACX,CAAC,EA1FD,KAAK,OAAS,CACZ,OAAQT,EAAc,OACtB,UAAW,SACb,CACF,CAwFF",
6
+ "names": ["index_native_exports", "__export", "ZilliqaExtension", "__toCommonJS", "import_commons", "ZilliqaExtension", "zilliqaConfig", "params", "toDs", "init", "code", "attempts", "interval", "transition", "args", "contractAddress"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magic-ext/zilliqa",
3
- "version": "6.0.0",
3
+ "version": "8.0.0",
4
4
  "description": "magic zilliqa extension",
5
5
  "author": "Magic <team@magic.link> (https://magic.link/)",
6
6
  "license": "MIT",
@@ -28,7 +28,7 @@
28
28
  ]
29
29
  },
30
30
  "devDependencies": {
31
- "@magic-sdk/commons": "^7.0.0"
31
+ "@magic-sdk/commons": "^9.0.0"
32
32
  },
33
- "gitHead": "96a8edeb9e9dbb39ff47b5c9c41348b1965da560"
33
+ "gitHead": "4f0dd0871531afe5db7b966ec2ab502943cf8679"
34
34
  }