@magic-ext/zilliqa 7.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.
@@ -0,0 +1,2 @@
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
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts"],
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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GACA,IAAAI,EAA0B,8BAGbF,EAAN,cAA+B,YAAU,QAAmC,CAKjF,YAAmBG,EAA8B,CAC/C,MAAM,EADW,mBAAAA,EAJnB,UAAO,UAaP,KAAO,gBAAkB,CAACC,EAAaC,KACjCD,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,OAAQ,sBACR,QAAS,MACT,OAAQ,CACN,OAAAA,EACA,KAAAC,CACF,CACF,CAAC,GAGH,KAAO,eAAiB,CACtBC,EACAC,EACAH,EACAI,EACAC,EACAJ,KAEID,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,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": ["src_exports", "__export", "ZilliqaExtension", "__toCommonJS", "import_commons", "zilliqaConfig", "params", "toDs", "init", "code", "attempts", "interval", "transition", "args", "contractAddress"]
7
+ }
@@ -0,0 +1,2 @@
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
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts"],
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,OAAS,aAAAA,MAAiB,qBAGnB,IAAMC,EAAN,cAA+BD,EAAU,QAAmC,CAKjF,YAAmBE,EAA8B,CAC/C,MAAM,EADW,mBAAAA,EAJnB,UAAO,UAaP,KAAO,gBAAkB,CAACC,EAAaC,KACjCD,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,OAAQ,sBACR,QAAS,MACT,OAAQ,CACN,OAAAA,EACA,KAAAC,CACF,CACF,CAAC,GAGH,KAAO,eAAiB,CACtBC,EACAC,EACAH,EACAI,EACAC,EACAJ,KAEID,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,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
+ }
@@ -0,0 +1,2 @@
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
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts"],
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,OAAS,aAAAA,MAAiB,qBAGnB,IAAMC,EAAN,cAA+BD,EAAU,QAAmC,CAKjF,YAAmBE,EAA8B,CAC/C,MAAM,EADW,mBAAAA,EAJnB,UAAO,UAaP,KAAO,gBAAkB,CAACC,EAAaC,KACjCD,EAAO,SAAQA,EAAO,OAAS,OAAOA,EAAO,QAAW,SAAWA,EAAO,OAASA,EAAO,OAAO,SAAS,GAC1GA,EAAO,WACTA,EAAO,SAAW,OAAOA,EAAO,UAAa,S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F,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
+ }
@@ -0,0 +1,2 @@
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
+ if (MagicZilliqaExtension && MagicZilliqaExtension.default != null) { MagicZilliqaExtension = Object.assign(MagicZilliqaExtension.default, MagicZilliqaExtension); delete MagicZilliqaExtension.default; }
@@ -0,0 +1,2 @@
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
+ //# sourceMappingURL=index.native.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.native.ts", "../../src/index.ts"],
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": "yaAAA,IAAAA,E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AAS,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": ["index_native_exports", "__export", "ZilliqaExtension", "__toCommonJS", "import_commons", "ZilliqaExtension", "zilliqaConfig", "params", "toDs", "init", "code", "attempts", "interval", "transition", "args", "contractAddress"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import { ZilliqaExtension } from './index';
2
+ export default ZilliqaExtension;
@@ -0,0 +1,16 @@
1
+ import { Extension } from '@magic-sdk/commons';
2
+ import { ZilliqaConfig, ConfigType } from './type';
3
+ export declare class ZilliqaExtension extends Extension.Internal<'zilliqa', ZilliqaConfig> {
4
+ zilliqaConfig: ZilliqaConfig;
5
+ name: "zilliqa";
6
+ config: ConfigType;
7
+ constructor(zilliqaConfig: ZilliqaConfig);
8
+ sendTransaction: (params: any, toDs: boolean) => Promise<any>;
9
+ deployContract: (init: any, code: string, params: any, attempts: number, interval: number, toDs: boolean) => Promise<any>;
10
+ callContract: (transition: string, args: any[], params: any, attempts: number | undefined, interval: number | undefined, toDs: boolean | undefined, contractAddress: string) => import("@magic-sdk/commons").PromiEvent<any, {
11
+ done: (result: any) => void;
12
+ error: (reason: any) => void;
13
+ settled: () => void;
14
+ }>;
15
+ getWallet: () => Promise<object>;
16
+ }
@@ -0,0 +1 @@
1
+ export * from './index';
@@ -0,0 +1,7 @@
1
+ export interface ZilliqaConfig {
2
+ rpcUrl: string;
3
+ }
4
+ export interface ConfigType {
5
+ rpcUrl: string;
6
+ chainType: string;
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magic-ext/zilliqa",
3
- "version": "7.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": "^8.0.0"
31
+ "@magic-sdk/commons": "^9.0.0"
32
32
  },
33
- "gitHead": "8ce6f975f0a1238c2945994f2d4aa6d6ac786998"
33
+ "gitHead": "4f0dd0871531afe5db7b966ec2ab502943cf8679"
34
34
  }