@magic-ext/zilliqa 5.1.0 → 7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magic-ext/zilliqa",
3
- "version": "5.1.0",
3
+ "version": "7.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": "^6.1.0"
31
+ "@magic-sdk/commons": "^8.0.0"
32
32
  },
33
- "gitHead": "ce15cdf96479464a1c6fd705c8e00f157eb844dd"
33
+ "gitHead": "8ce6f975f0a1238c2945994f2d4aa6d6ac786998"
34
34
  }
package/dist/cjs/index.js DELETED
@@ -1,2 +0,0 @@
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);
2
- //# sourceMappingURL=index.js.map
@@ -1,7 +0,0 @@
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": "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,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,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,mBACR,OAAQ,CACN,aACA,OACA,SACA,WACA,WACA,OACA,sBAKC,eAAY,IACV,KAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,gBACR,OAAQ,KAzFV,KAAK,OAAS,CACZ,OAAQ,EAAc,OACtB,UAAW",
6
- "names": []
7
- }
package/dist/es/index.js DELETED
@@ -1,2 +0,0 @@
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};
2
- //# sourceMappingURL=index.js.map
@@ -1,7 +0,0 @@
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,+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,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,mBACR,OAAQ,CACN,aACA,OACA,SACA,WACA,WACA,OACA,sBAKC,eAAY,IACV,KAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,gBACR,OAAQ,KAzFV,KAAK,OAAS,CACZ,OAAQ,EAAc,OACtB,UAAW",
6
- "names": []
7
- }
package/dist/es/index.mjs DELETED
@@ -1,2 +0,0 @@
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};
2
- //# sourceMappingURL=index.mjs.map
@@ -1,7 +0,0 @@
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,+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,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,mBACR,OAAQ,CACN,aACA,OACA,SACA,WACA,WACA,OACA,sBAKC,eAAY,IACV,KAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,gBACR,OAAQ,KAzFV,KAAK,OAAS,CACZ,OAAQ,EAAc,OACtB,UAAW",
6
- "names": []
7
- }
package/dist/extension.js DELETED
@@ -1,2 +0,0 @@
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);})();
2
- if (MagicZilliqaExtension && MagicZilliqaExtension.default != null) { MagicZilliqaExtension = Object.assign(MagicZilliqaExtension.default, MagicZilliqaExtension); delete MagicZilliqaExtension.default; }
@@ -1,2 +0,0 @@
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);
2
- //# sourceMappingURL=index.native.js.map
@@ -1,7 +0,0 @@
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": "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,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,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,mBACR,OAAQ,CACN,aACA,OACA,SACA,WACA,WACA,OACA,sBAKC,eAAY,IACV,KAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,gBACR,OAAQ,KAzFV,KAAK,OAAS,CACZ,OAAQ,EAAc,OACtB,UAAW",
6
- "names": []
7
- }
@@ -1,2 +0,0 @@
1
- import { ZilliqaExtension } from './index';
2
- export default ZilliqaExtension;
@@ -1,16 +0,0 @@
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
- }
@@ -1 +0,0 @@
1
- export * from './index';
@@ -1,7 +0,0 @@
1
- export interface ZilliqaConfig {
2
- rpcUrl: string;
3
- }
4
- export interface ConfigType {
5
- rpcUrl: string;
6
- chainType: string;
7
- }