@magic-ext/polkadot 2.0.0 → 3.1.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/CHANGELOG.md CHANGED
@@ -1,3 +1,51 @@
1
+ # v3.1.0 (Mon Mar 07 2022)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - Update READMEs with outdated context/hyperlinks ([@smithki](https://github.com/smithki))
6
+
7
+ #### 🏠 Internal
8
+
9
+ - Internal documentation updates (`BUILD_SYSTEM.md`) [#283](https://github.com/magiclabs/magic-js/pull/283) ([@smithki](https://github.com/smithki))
10
+
11
+ #### Authors: 1
12
+
13
+ - Ian K Smith ([@smithki](https://github.com/smithki))
14
+
15
+ ---
16
+
17
+ # v3.0.1 (Tue Jan 25 2022)
18
+
19
+ #### 🐛 Bug Fix
20
+
21
+ - Fix CDN build targets [#270](https://github.com/magiclabs/magic-js/pull/270) ([@smithki](https://github.com/smithki))
22
+ - Fix CDN issues related to ESBuild ([@smithki](https://github.com/smithki))
23
+
24
+ #### Authors: 1
25
+
26
+ - Ian K Smith ([@smithki](https://github.com/smithki))
27
+
28
+ ---
29
+
30
+ # v3.0.0 (Tue Jan 25 2022)
31
+
32
+ #### 💥 Breaking Change
33
+
34
+ - Switch from `microbundle` to `esbuild` [#220](https://github.com/magiclabs/magic-js/pull/220) ([@smithki](https://github.com/smithki))
35
+
36
+ #### 🐛 Bug Fix
37
+
38
+ - Merge with master ([@smithki](https://github.com/smithki))
39
+ - Merge branch 'master' into feat/faster-builds ([@smithki](https://github.com/smithki))
40
+ - Modify CDN default exports ([@smithki](https://github.com/smithki))
41
+ - Support newly added Magic JS extensions in ESBuild ([@smithki](https://github.com/smithki))
42
+
43
+ #### Authors: 1
44
+
45
+ - Ian K Smith ([@smithki](https://github.com/smithki))
46
+
47
+ ---
48
+
1
49
  # v1.0.0 (Fri Dec 10 2021)
2
50
 
3
51
  #### 💥 Breaking Change
package/README.md CHANGED
@@ -32,7 +32,7 @@ const magic = new Magic('YOUR_API_KEY', {
32
32
  ```
33
33
 
34
34
  ## Magic SDK
35
- See the [developer documentation](https://docs.magic.link) to learn how you can master the Magic SDK in a matter of minutes.
35
+ See the [developer documentation](https://magic.link/docs) to learn how you can master the Magic SDK in a matter of minutes.
36
36
 
37
37
 
38
38
  ## Usage
@@ -76,4 +76,4 @@ Send polkadot native currency
76
76
 
77
77
  console.log('transaction hash', tx)
78
78
  }
79
- ```
79
+ ```
package/dist/cjs/index.js CHANGED
@@ -1,2 +1,2 @@
1
- var t=require("@magic-sdk/commons");function o(t,n){return(o=Object.setPrototypeOf||function(t,o){return t.__proto__=o,t})(t,n)}exports.PolkadotExtension=function(t){var n,r;function e(o){var n;return(n=t.call(this)||this).polkadotConfig=void 0,n.name="polkadot",n.config=void 0,n.sendTransaction=function(t,o){return n.request({id:42,jsonrpc:"2.0",method:"pdt_sendTransaction",params:{to:t,value:o}})},n.contractCall=function(t,o,r,e){return n.request({id:42,jsonrpc:"2.0",method:"pdt_contractCall",params:{contractAddress:t,value:o,maxGas:r,data:e}})},n.getAccount=function(){return n.request({id:42,jsonrpc:"2.0",method:"pdt_getAccount",params:[]})},n.polkadotConfig=o,n.config={rpcUrl:o.rpcUrl,chainType:"POLKADOT"},n}return r=t,(n=e).prototype=Object.create(r.prototype),n.prototype.constructor=n,o(n,r),e}(t.Extension.Internal);
1
+ var e=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var l=r=>e(r,"__esModule",{value:!0});var m=(r,t)=>{for(var n in t)e(r,n,{get:t[n],enumerable:!0})},u=(r,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of p(t))!d.call(r,o)&&(n||o!=="default")&&e(r,o,{get:()=>t[o],enumerable:!(s=a(t,o))||s.enumerable});return r};var g=(r=>(t,n)=>r&&r.get(t)||(n=u(l({}),t,1),r&&r.set(t,n),n))(typeof WeakMap!="undefined"?new WeakMap:0);var f={};m(f,{PolkadotExtension:()=>c});var i=require("@magic-sdk/commons"),c=class extends i.Extension.Internal{constructor(t){super();this.polkadotConfig=t;this.name="polkadot";this.sendTransaction=(t,n)=>this.request({id:42,jsonrpc:"2.0",method:"pdt_sendTransaction",params:{to:t,value:n}});this.contractCall=(t,n,s,o)=>this.request({id:42,jsonrpc:"2.0",method:"pdt_contractCall",params:{contractAddress:t,value:n,maxGas:s,data:o}});this.getAccount=()=>this.request({id:42,jsonrpc:"2.0",method:"pdt_getAccount",params:[]});this.config={rpcUrl:t.rpcUrl,chainType:"POLKADOT"}}};module.exports=g(f);
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import { Extension } from '@magic-sdk/commons';\nimport { PolkadotConfig, ConfigType } from './type';\n\nexport class PolkadotExtension extends Extension.Internal<'polkadot', PolkadotConfig> {\n name = 'polkadot' as const;\n\n config: ConfigType;\n\n constructor(public polkadotConfig: PolkadotConfig) {\n super();\n\n this.config = {\n rpcUrl: polkadotConfig.rpcUrl,\n chainType: 'POLKADOT',\n };\n }\n\n public sendTransaction = (to: string, value: number): Promise<string> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'pdt_sendTransaction',\n params: { to, value },\n });\n };\n\n public contractCall = (contractAddress: string, value: number, maxGas: number, data: any): Promise<string> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'pdt_contractCall',\n params: { contractAddress, value, maxGas, data },\n });\n };\n\n public getAccount = (): Promise<string> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'pdt_getAccount',\n params: [],\n });\n };\n}\n"],"names":["polkadotConfig","_this","name","config","sendTransaction","to","value","request","id","jsonrpc","method","params","contractCall","contractAddress","maxGas","data","getAccount","rpcUrl","chainType","Extension","Internal"],"mappings":"8KAQE,WAAmBA,gBACjBC,sBADiBD,wBAJnBE,KAAO,aAEPC,gBAWOC,gBAAkB,SAACC,EAAYC,GACpC,SAAYC,QAAQ,CAClBC,GAAI,GACJC,QAAS,MACTC,OAAQ,sBACRC,OAAQ,CAAEN,GAAAA,EAAIC,MAAAA,QAIXM,aAAe,SAACC,EAAyBP,EAAeQ,EAAgBC,GAC7E,SAAYR,QAAQ,CAClBC,GAAI,GACJC,QAAS,MACTC,OAAQ,mBACRC,OAAQ,CAAEE,gBAAAA,EAAiBP,MAAAA,EAAOQ,OAAAA,EAAQC,KAAAA,QAIvCC,WAAa,WAClB,SAAYT,QAAQ,CAClBC,GAAI,GACJC,QAAS,MACTC,OAAQ,iBACRC,OAAQ,MAhCOV,iBAAAD,EAGjBC,EAAKE,OAAS,CACZc,OAAQjB,EAAeiB,OACvBC,UAAW,cAVjB,0FAAuCC,YAAUC"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts"],
4
+ "sourcesContent": ["import { Extension } from '@magic-sdk/commons';\nimport { PolkadotConfig, ConfigType } from './type';\n\nexport class PolkadotExtension extends Extension.Internal<'polkadot', PolkadotConfig> {\n name = 'polkadot' as const;\n\n config: ConfigType;\n\n constructor(public polkadotConfig: PolkadotConfig) {\n super();\n\n this.config = {\n rpcUrl: polkadotConfig.rpcUrl,\n chainType: 'POLKADOT',\n };\n }\n\n public sendTransaction = (to: string, value: number): Promise<string> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'pdt_sendTransaction',\n params: { to, value },\n });\n };\n\n public contractCall = (contractAddress: string, value: number, maxGas: number, data: any): Promise<string> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'pdt_contractCall',\n params: { contractAddress, value, maxGas, data },\n });\n };\n\n public getAccount = (): Promise<string> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'pdt_getAccount',\n params: [],\n });\n };\n}\n"],
5
+ "mappings": "8gBAAA,8CAA0B,8BAGnB,eAAgC,aAAU,QAAqC,CAKpF,YAAmB,EAAgC,CACjD,QADiB,sBAJnB,UAAO,WAaA,qBAAkB,CAAC,EAAY,IAC7B,KAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,sBACR,OAAQ,CAAE,KAAI,WAIX,kBAAe,CAAC,EAAyB,EAAe,EAAgB,IACtE,KAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,mBACR,OAAQ,CAAE,kBAAiB,QAAO,SAAQ,UAIvC,gBAAa,IACX,KAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,iBACR,OAAQ,KA7BV,KAAK,OAAS,CACZ,OAAQ,EAAe,OACvB,UAAW",
6
+ "names": []
7
+ }
package/dist/es/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{Extension as t}from"@magic-sdk/commons";function o(t,r){return(o=Object.setPrototypeOf||function(t,o){return t.__proto__=o,t})(t,r)}var r=function(t){var r,n;function e(o){var r;return(r=t.call(this)||this).polkadotConfig=void 0,r.name="polkadot",r.config=void 0,r.sendTransaction=function(t,o){return r.request({id:42,jsonrpc:"2.0",method:"pdt_sendTransaction",params:{to:t,value:o}})},r.contractCall=function(t,o,n,e){return r.request({id:42,jsonrpc:"2.0",method:"pdt_contractCall",params:{contractAddress:t,value:o,maxGas:n,data:e}})},r.getAccount=function(){return r.request({id:42,jsonrpc:"2.0",method:"pdt_getAccount",params:[]})},r.polkadotConfig=o,r.config={rpcUrl:o.rpcUrl,chainType:"POLKADOT"},r}return n=t,(r=e).prototype=Object.create(n.prototype),r.prototype.constructor=r,o(r,n),e}(t.Internal);export{r as PolkadotExtension};
1
+ import{Extension as s}from"@magic-sdk/commons";var e=class extends s.Internal{constructor(t){super();this.polkadotConfig=t;this.name="polkadot";this.sendTransaction=(t,r)=>this.request({id:42,jsonrpc:"2.0",method:"pdt_sendTransaction",params:{to:t,value:r}});this.contractCall=(t,r,n,o)=>this.request({id:42,jsonrpc:"2.0",method:"pdt_contractCall",params:{contractAddress:t,value:r,maxGas:n,data:o}});this.getAccount=()=>this.request({id:42,jsonrpc:"2.0",method:"pdt_getAccount",params:[]});this.config={rpcUrl:t.rpcUrl,chainType:"POLKADOT"}}};export{e as PolkadotExtension};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import { Extension } from '@magic-sdk/commons';\nimport { PolkadotConfig, ConfigType } from './type';\n\nexport class PolkadotExtension extends Extension.Internal<'polkadot', PolkadotConfig> {\n name = 'polkadot' as const;\n\n config: ConfigType;\n\n constructor(public polkadotConfig: PolkadotConfig) {\n super();\n\n this.config = {\n rpcUrl: polkadotConfig.rpcUrl,\n chainType: 'POLKADOT',\n };\n }\n\n public sendTransaction = (to: string, value: number): Promise<string> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'pdt_sendTransaction',\n params: { to, value },\n });\n };\n\n public contractCall = (contractAddress: string, value: number, maxGas: number, data: any): Promise<string> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'pdt_contractCall',\n params: { contractAddress, value, maxGas, data },\n });\n };\n\n public getAccount = (): Promise<string> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'pdt_getAccount',\n params: [],\n });\n };\n}\n"],"names":["PolkadotExtension","polkadotConfig","_this","name","config","sendTransaction","to","value","request","id","jsonrpc","method","params","contractCall","contractAddress","maxGas","data","getAccount","rpcUrl","chainType","Extension","Internal"],"mappings":"2IAGaA,IAAAA,sBAKX,WAAmBC,gBACjBC,sBADiBD,wBAJnBE,KAAO,aAEPC,gBAWOC,gBAAkB,SAACC,EAAYC,GACpC,SAAYC,QAAQ,CAClBC,GAAI,GACJC,QAAS,MACTC,OAAQ,sBACRC,OAAQ,CAAEN,GAAAA,EAAIC,MAAAA,QAIXM,aAAe,SAACC,EAAyBP,EAAeQ,EAAgBC,GAC7E,SAAYR,QAAQ,CAClBC,GAAI,GACJC,QAAS,MACTC,OAAQ,mBACRC,OAAQ,CAAEE,gBAAAA,EAAiBP,MAAAA,EAAOQ,OAAAA,EAAQC,KAAAA,QAIvCC,WAAa,WAClB,SAAYT,QAAQ,CAClBC,GAAI,GACJC,QAAS,MACTC,OAAQ,iBACRC,OAAQ,MAhCOV,iBAAAD,EAGjBC,EAAKE,OAAS,CACZc,OAAQjB,EAAeiB,OACvBC,UAAW,cAVjB,0FAAuCC,EAAUC"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts"],
4
+ "sourcesContent": ["import { Extension } from '@magic-sdk/commons';\nimport { PolkadotConfig, ConfigType } from './type';\n\nexport class PolkadotExtension extends Extension.Internal<'polkadot', PolkadotConfig> {\n name = 'polkadot' as const;\n\n config: ConfigType;\n\n constructor(public polkadotConfig: PolkadotConfig) {\n super();\n\n this.config = {\n rpcUrl: polkadotConfig.rpcUrl,\n chainType: 'POLKADOT',\n };\n }\n\n public sendTransaction = (to: string, value: number): Promise<string> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'pdt_sendTransaction',\n params: { to, value },\n });\n };\n\n public contractCall = (contractAddress: string, value: number, maxGas: number, data: any): Promise<string> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'pdt_contractCall',\n params: { contractAddress, value, maxGas, data },\n });\n };\n\n public getAccount = (): Promise<string> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'pdt_getAccount',\n params: [],\n });\n };\n}\n"],
5
+ "mappings": "AAAA,+CAGO,mBAAgC,GAAU,QAAqC,CAKpF,YAAmB,EAAgC,CACjD,QADiB,sBAJnB,UAAO,WAaA,qBAAkB,CAAC,EAAY,IAC7B,KAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,sBACR,OAAQ,CAAE,KAAI,WAIX,kBAAe,CAAC,EAAyB,EAAe,EAAgB,IACtE,KAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,mBACR,OAAQ,CAAE,kBAAiB,QAAO,SAAQ,UAIvC,gBAAa,IACX,KAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,iBACR,OAAQ,KA7BV,KAAK,OAAS,CACZ,OAAQ,EAAe,OACvB,UAAW",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ import{Extension as s}from"@magic-sdk/commons";var e=class extends s.Internal{constructor(t){super();this.polkadotConfig=t;this.name="polkadot";this.sendTransaction=(t,r)=>this.request({id:42,jsonrpc:"2.0",method:"pdt_sendTransaction",params:{to:t,value:r}});this.contractCall=(t,r,n,o)=>this.request({id:42,jsonrpc:"2.0",method:"pdt_contractCall",params:{contractAddress:t,value:r,maxGas:n,data:o}});this.getAccount=()=>this.request({id:42,jsonrpc:"2.0",method:"pdt_getAccount",params:[]});this.config={rpcUrl:t.rpcUrl,chainType:"POLKADOT"}}};export{e as PolkadotExtension};
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts"],
4
+ "sourcesContent": ["import { Extension } from '@magic-sdk/commons';\nimport { PolkadotConfig, ConfigType } from './type';\n\nexport class PolkadotExtension extends Extension.Internal<'polkadot', PolkadotConfig> {\n name = 'polkadot' as const;\n\n config: ConfigType;\n\n constructor(public polkadotConfig: PolkadotConfig) {\n super();\n\n this.config = {\n rpcUrl: polkadotConfig.rpcUrl,\n chainType: 'POLKADOT',\n };\n }\n\n public sendTransaction = (to: string, value: number): Promise<string> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'pdt_sendTransaction',\n params: { to, value },\n });\n };\n\n public contractCall = (contractAddress: string, value: number, maxGas: number, data: any): Promise<string> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'pdt_contractCall',\n params: { contractAddress, value, maxGas, data },\n });\n };\n\n public getAccount = (): Promise<string> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'pdt_getAccount',\n params: [],\n });\n };\n}\n"],
5
+ "mappings": "AAAA,+CAGO,mBAAgC,GAAU,QAAqC,CAKpF,YAAmB,EAAgC,CACjD,QADiB,sBAJnB,UAAO,WAaA,qBAAkB,CAAC,EAAY,IAC7B,KAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,sBACR,OAAQ,CAAE,KAAI,WAIX,kBAAe,CAAC,EAAyB,EAAe,EAAgB,IACtE,KAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,mBACR,OAAQ,CAAE,kBAAiB,QAAO,SAAQ,UAIvC,gBAAa,IACX,KAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,iBACR,OAAQ,KA7BV,KAAK,OAAS,CACZ,OAAQ,EAAe,OACvB,UAAW",
6
+ "names": []
7
+ }
package/dist/extension.js CHANGED
@@ -1 +1,2 @@
1
- var MagicPolkadotExtension=function(t){function n(t,o){return(n=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,o)}return function(t){var o,r;function e(n){var o;return(o=t.call(this)||this).polkadotConfig=void 0,o.name="polkadot",o.config=void 0,o.sendTransaction=function(t,n){return o.request({id:42,jsonrpc:"2.0",method:"pdt_sendTransaction",params:{to:t,value:n}})},o.contractCall=function(t,n,r,e){return o.request({id:42,jsonrpc:"2.0",method:"pdt_contractCall",params:{contractAddress:t,value:n,maxGas:r,data:e}})},o.getAccount=function(){return o.request({id:42,jsonrpc:"2.0",method:"pdt_getAccount",params:[]})},o.polkadotConfig=n,o.config={rpcUrl:n.rpcUrl,chainType:"POLKADOT"},o}return r=t,(o=e).prototype=Object.create(r.prototype),o.prototype.constructor=o,n(o,r),e}(Magic.Extension.Internal)}();
1
+ var MagicPolkadotExtension=(()=>{var m=Object.create;var i=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var f=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var a=o=>i(o,"__esModule",{value:!0});var P=(o,t)=>()=>(t||o((t={exports:{}}).exports,t),t.exports),b=(o,t)=>{for(var r in t)i(o,r,{get:t[r],enumerable:!0})},c=(o,t,r,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of g(t))!h.call(o,n)&&(r||n!=="default")&&i(o,n,{get:()=>t[n],enumerable:!(e=u(t,n))||e.enumerable});return o},C=(o,t)=>c(a(i(o!=null?m(f(o)):{},"default",!t&&o&&o.__esModule?{get:()=>o.default,enumerable:!0}:{value:o,enumerable:!0})),o),k=(o=>(t,r)=>o&&o.get(t)||(r=c(a({}),t,1),o&&o.set(t,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var d=P((j,p)=>{p.exports=Magic});var T={};b(T,{default:()=>x});var l=C(d()),s=class extends l.Extension.Internal{constructor(t){super();this.polkadotConfig=t;this.name="polkadot";this.sendTransaction=(t,r)=>this.request({id:42,jsonrpc:"2.0",method:"pdt_sendTransaction",params:{to:t,value:r}});this.contractCall=(t,r,e,n)=>this.request({id:42,jsonrpc:"2.0",method:"pdt_contractCall",params:{contractAddress:t,value:r,maxGas:e,data:n}});this.getAccount=()=>this.request({id:42,jsonrpc:"2.0",method:"pdt_getAccount",params:[]});this.config={rpcUrl:t.rpcUrl,chainType:"POLKADOT"}}};var x=s;return k(T);})();
2
+ if (MagicPolkadotExtension && MagicPolkadotExtension.default != null) { MagicPolkadotExtension = Object.assign(MagicPolkadotExtension.default, MagicPolkadotExtension); delete MagicPolkadotExtension.default; }
@@ -1,2 +1,2 @@
1
- var t=require("@magic-sdk/commons");function o(t,n){return(o=Object.setPrototypeOf||function(t,o){return t.__proto__=o,t})(t,n)}exports.PolkadotExtension=function(t){var n,r;function e(o){var n;return(n=t.call(this)||this).polkadotConfig=void 0,n.name="polkadot",n.config=void 0,n.sendTransaction=function(t,o){return n.request({id:42,jsonrpc:"2.0",method:"pdt_sendTransaction",params:{to:t,value:o}})},n.contractCall=function(t,o,r,e){return n.request({id:42,jsonrpc:"2.0",method:"pdt_contractCall",params:{contractAddress:t,value:o,maxGas:r,data:e}})},n.getAccount=function(){return n.request({id:42,jsonrpc:"2.0",method:"pdt_getAccount",params:[]})},n.polkadotConfig=o,n.config={rpcUrl:o.rpcUrl,chainType:"POLKADOT"},n}return r=t,(n=e).prototype=Object.create(r.prototype),n.prototype.constructor=n,o(n,r),e}(t.Extension.Internal);
1
+ var s=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var d=r=>s(r,"__esModule",{value:!0});var l=(r,t)=>{for(var o in t)s(r,o,{get:t[o],enumerable:!0})},u=(r,t,o,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of p(t))!m.call(r,n)&&(o||n!=="default")&&s(r,n,{get:()=>t[n],enumerable:!(e=a(t,n))||e.enumerable});return r};var g=(r=>(t,o)=>r&&r.get(t)||(o=u(d({}),t,1),r&&r.set(t,o),o))(typeof WeakMap!="undefined"?new WeakMap:0);var f={};l(f,{PolkadotExtension:()=>c});var i=require("@magic-sdk/commons"),c=class extends i.Extension.Internal{constructor(t){super();this.polkadotConfig=t;this.name="polkadot";this.sendTransaction=(t,o)=>this.request({id:42,jsonrpc:"2.0",method:"pdt_sendTransaction",params:{to:t,value:o}});this.contractCall=(t,o,e,n)=>this.request({id:42,jsonrpc:"2.0",method:"pdt_contractCall",params:{contractAddress:t,value:o,maxGas:e,data:n}});this.getAccount=()=>this.request({id:42,jsonrpc:"2.0",method:"pdt_getAccount",params:[]});this.config={rpcUrl:t.rpcUrl,chainType:"POLKADOT"}}};module.exports=g(f);
2
2
  //# sourceMappingURL=index.native.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"index.native.js","sources":["../../src/index.ts"],"sourcesContent":["import { Extension } from '@magic-sdk/commons';\nimport { PolkadotConfig, ConfigType } from './type';\n\nexport class PolkadotExtension extends Extension.Internal<'polkadot', PolkadotConfig> {\n name = 'polkadot' as const;\n\n config: ConfigType;\n\n constructor(public polkadotConfig: PolkadotConfig) {\n super();\n\n this.config = {\n rpcUrl: polkadotConfig.rpcUrl,\n chainType: 'POLKADOT',\n };\n }\n\n public sendTransaction = (to: string, value: number): Promise<string> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'pdt_sendTransaction',\n params: { to, value },\n });\n };\n\n public contractCall = (contractAddress: string, value: number, maxGas: number, data: any): Promise<string> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'pdt_contractCall',\n params: { contractAddress, value, maxGas, data },\n });\n };\n\n public getAccount = (): Promise<string> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'pdt_getAccount',\n params: [],\n });\n };\n}\n"],"names":["polkadotConfig","_this","name","config","sendTransaction","to","value","request","id","jsonrpc","method","params","contractCall","contractAddress","maxGas","data","getAccount","rpcUrl","chainType","Extension","Internal"],"mappings":"8KAQE,WAAmBA,gBACjBC,sBADiBD,wBAJnBE,KAAO,aAEPC,gBAWOC,gBAAkB,SAACC,EAAYC,GACpC,SAAYC,QAAQ,CAClBC,GAAI,GACJC,QAAS,MACTC,OAAQ,sBACRC,OAAQ,CAAEN,GAAAA,EAAIC,MAAAA,QAIXM,aAAe,SAACC,EAAyBP,EAAeQ,EAAgBC,GAC7E,SAAYR,QAAQ,CAClBC,GAAI,GACJC,QAAS,MACTC,OAAQ,mBACRC,OAAQ,CAAEE,gBAAAA,EAAiBP,MAAAA,EAAOQ,OAAAA,EAAQC,KAAAA,QAIvCC,WAAa,WAClB,SAAYT,QAAQ,CAClBC,GAAI,GACJC,QAAS,MACTC,OAAQ,iBACRC,OAAQ,MAhCOV,iBAAAD,EAGjBC,EAAKE,OAAS,CACZc,OAAQjB,EAAeiB,OACvBC,UAAW,cAVjB,0FAAuCC,YAAUC"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.native.ts", "../../src/index.ts"],
4
+ "sourcesContent": ["export * from './index';\n", "import { Extension } from '@magic-sdk/commons';\nimport { PolkadotConfig, ConfigType } from './type';\n\nexport class PolkadotExtension extends Extension.Internal<'polkadot', PolkadotConfig> {\n name = 'polkadot' as const;\n\n config: ConfigType;\n\n constructor(public polkadotConfig: PolkadotConfig) {\n super();\n\n this.config = {\n rpcUrl: polkadotConfig.rpcUrl,\n chainType: 'POLKADOT',\n };\n }\n\n public sendTransaction = (to: string, value: number): Promise<string> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'pdt_sendTransaction',\n params: { to, value },\n });\n };\n\n public contractCall = (contractAddress: string, value: number, maxGas: number, data: any): Promise<string> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'pdt_contractCall',\n params: { contractAddress, value, maxGas, data },\n });\n };\n\n public getAccount = (): Promise<string> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'pdt_getAccount',\n params: [],\n });\n };\n}\n"],
5
+ "mappings": "8gBAAA,wCCAA,MAA0B,8BAGnB,eAAgC,aAAU,QAAqC,CAKpF,YAAmB,EAAgC,CACjD,QADiB,sBAJnB,UAAO,WAaA,qBAAkB,CAAC,EAAY,IAC7B,KAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,sBACR,OAAQ,CAAE,KAAI,WAIX,kBAAe,CAAC,EAAyB,EAAe,EAAgB,IACtE,KAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,mBACR,OAAQ,CAAE,kBAAiB,QAAO,SAAQ,UAIvC,gBAAa,IACX,KAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,iBACR,OAAQ,KA7BV,KAAK,OAAS,CACZ,OAAQ,EAAe,OACvB,UAAW",
6
+ "names": []
7
+ }
@@ -1,2 +1,2 @@
1
- import { PolkadotExtension } from './index';
2
- export { PolkadotExtension as default };
1
+ import { PolkadotExtension } from './index';
2
+ export default PolkadotExtension;
@@ -1,11 +1,11 @@
1
- import { Extension } from '@magic-sdk/commons';
2
- import { PolkadotConfig, ConfigType } from './type';
3
- export declare class PolkadotExtension extends Extension.Internal<'polkadot', PolkadotConfig> {
4
- polkadotConfig: PolkadotConfig;
5
- name: "polkadot";
6
- config: ConfigType;
7
- constructor(polkadotConfig: PolkadotConfig);
8
- sendTransaction: (to: string, value: number) => Promise<string>;
9
- contractCall: (contractAddress: string, value: number, maxGas: number, data: any) => Promise<string>;
10
- getAccount: () => Promise<string>;
11
- }
1
+ import { Extension } from '@magic-sdk/commons';
2
+ import { PolkadotConfig, ConfigType } from './type';
3
+ export declare class PolkadotExtension extends Extension.Internal<'polkadot', PolkadotConfig> {
4
+ polkadotConfig: PolkadotConfig;
5
+ name: "polkadot";
6
+ config: ConfigType;
7
+ constructor(polkadotConfig: PolkadotConfig);
8
+ sendTransaction: (to: string, value: number) => Promise<string>;
9
+ contractCall: (contractAddress: string, value: number, maxGas: number, data: any) => Promise<string>;
10
+ getAccount: () => Promise<string>;
11
+ }
@@ -0,0 +1 @@
1
+ export * from './index';
@@ -0,0 +1,7 @@
1
+ export interface PolkadotConfig {
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/polkadot",
3
- "version": "2.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "magic polkadot extension",
5
5
  "author": "Magic <team@magic.link> (https://magic.link/)",
6
6
  "license": "MIT",
@@ -11,7 +11,7 @@
11
11
  "files": [
12
12
  "dist"
13
13
  ],
14
- "target": "web",
14
+ "target": "neutral",
15
15
  "cdnGlobalName": "MagicPolkadotExtension",
16
16
  "main": "./dist/cjs/index.js",
17
17
  "module": "./dist/es/index.js",
@@ -19,7 +19,7 @@
19
19
  "jsdelivr": "./dist/extension.js",
20
20
  "react-native": "./dist/react-native/index.native.js",
21
21
  "exports": {
22
- "import": "./dist/modern/index.mjs",
22
+ "import": "./dist/es/index.mjs",
23
23
  "require": "./dist/cjs/index.js"
24
24
  },
25
25
  "externals": {
@@ -28,7 +28,7 @@
28
28
  ]
29
29
  },
30
30
  "devDependencies": {
31
- "@magic-sdk/commons": "^3.0.0"
31
+ "@magic-sdk/commons": "^4.1.0"
32
32
  },
33
- "gitHead": "a85f41892cbd7985ee1743764f7f905b89004eaa"
33
+ "gitHead": "6aa5a25b33865cfe27444ca6094efade16a82f9f"
34
34
  }
@@ -1,2 +0,0 @@
1
- import{Extension as t}from"@magic-sdk/commons";class s extends t.Internal{constructor(t){super(),this.polkadotConfig=void 0,this.name="polkadot",this.config=void 0,this.sendTransaction=(t,s)=>this.request({id:42,jsonrpc:"2.0",method:"pdt_sendTransaction",params:{to:t,value:s}}),this.contractCall=(t,s,o,a)=>this.request({id:42,jsonrpc:"2.0",method:"pdt_contractCall",params:{contractAddress:t,value:s,maxGas:o,data:a}}),this.getAccount=()=>this.request({id:42,jsonrpc:"2.0",method:"pdt_getAccount",params:[]}),this.polkadotConfig=t,this.config={rpcUrl:t.rpcUrl,chainType:"POLKADOT"}}}export{s as PolkadotExtension};
2
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/index.ts"],"sourcesContent":["import { Extension } from '@magic-sdk/commons';\nimport { PolkadotConfig, ConfigType } from './type';\n\nexport class PolkadotExtension extends Extension.Internal<'polkadot', PolkadotConfig> {\n name = 'polkadot' as const;\n\n config: ConfigType;\n\n constructor(public polkadotConfig: PolkadotConfig) {\n super();\n\n this.config = {\n rpcUrl: polkadotConfig.rpcUrl,\n chainType: 'POLKADOT',\n };\n }\n\n public sendTransaction = (to: string, value: number): Promise<string> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'pdt_sendTransaction',\n params: { to, value },\n });\n };\n\n public contractCall = (contractAddress: string, value: number, maxGas: number, data: any): Promise<string> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'pdt_contractCall',\n params: { contractAddress, value, maxGas, data },\n });\n };\n\n public getAccount = (): Promise<string> => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: 'pdt_getAccount',\n params: [],\n });\n };\n}\n"],"names":["PolkadotExtension","Extension","Internal","constructor","polkadotConfig","super","name","config","sendTransaction","to","value","request","id","jsonrpc","method","params","contractCall","contractAddress","maxGas","data","getAccount","this","rpcUrl","chainType"],"mappings":"qDAGaA,UAA0BC,EAAUC,SAK/CC,YAAmBC,GACjBC,aADiBD,2BAJnBE,KAAO,gBAEPC,mBAWOC,gBAAkB,CAACC,EAAYC,SACxBC,QAAQ,CAClBC,GAAI,GACJC,QAAS,MACTC,OAAQ,sBACRC,OAAQ,CAAEN,GAAAA,EAAIC,MAAAA,UAIXM,aAAe,CAACC,EAAyBP,EAAeQ,EAAgBC,SACjER,QAAQ,CAClBC,GAAI,GACJC,QAAS,MACTC,OAAQ,mBACRC,OAAQ,CAAEE,gBAAAA,EAAiBP,MAAAA,EAAOQ,OAAAA,EAAQC,KAAAA,UAIvCC,WAAa,SACNT,QAAQ,CAClBC,GAAI,GACJC,QAAS,MACTC,OAAQ,iBACRC,OAAQ,KAhCOM,oBAAAjB,EAGjBiB,KAAKd,OAAS,CACZe,OAAQlB,EAAekB,OACvBC,UAAW"}