@magic-ext/cosmos 3.0.0 → 3.0.1

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,16 @@
1
+ # v3.0.1 (Tue Jan 25 2022)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - Fix CDN build targets [#270](https://github.com/magiclabs/magic-js/pull/270) ([@smithki](https://github.com/smithki))
6
+ - Fix CDN issues related to ESBuild ([@smithki](https://github.com/smithki))
7
+
8
+ #### Authors: 1
9
+
10
+ - Ian K Smith ([@smithki](https://github.com/smithki))
11
+
12
+ ---
13
+
1
14
  # v3.0.0 (Tue Jan 25 2022)
2
15
 
3
16
  #### 💥 Breaking Change
package/dist/cjs/index.js CHANGED
@@ -1,2 +1,2 @@
1
- var b=Object.create;var o=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty;var m=n=>o(n,"__esModule",{value:!0});var A=(n,s)=>{m(n);for(var r in s)o(n,r,{get:s[r],enumerable:!0})},B=(n,s,r)=>{if(s&&typeof s=="object"||typeof s=="function")for(let i of x(s))!T.call(n,i)&&i!=="default"&&o(n,i,{get:()=>s[i],enumerable:!(r=k(s,i))||r.enumerable});return n},j=n=>B(m(o(n!=null?b(y(n)):{},"default",n&&n.__esModule&&"default"in n?{get:()=>n.default,enumerable:!0}:{value:n,enumerable:!0})),n);var p=(n,s,r)=>new Promise((i,t)=>{var f=c=>{try{g(r.next(c))}catch(a){t(a)}},S=c=>{try{g(r.throw(c))}catch(a){t(a)}},g=c=>c.done?i(c.value):Promise.resolve(c.value).then(f,S);g((r=r.apply(n,s)).next())});A(exports,{CosmosExtension:()=>d});var u=j(require("@magic-sdk/commons"));var e;(function(i){i.Sign="cos_sign",i.SignAndBroadcast="cos_signAndBroadcast",i.SendTokens="cos_sendTokens"})(e||(e={}));var d=class extends u.Extension.Internal{constructor(s){super();this.cosmosConfig=s;this.name="cosmos";this.config={};this.signAndBroadcast=(s,r)=>p(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:e.SignAndBroadcast,params:{message:s,fee:r}})});this.sign=(s,r)=>p(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:e.Sign,params:{message:s,fee:r}})});this.sendTokens=(s,r,i,t)=>p(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:e.SendTokens,params:{recipientAddress:s,transferAmount:r,denom:i,memo:t}})});this.config={rpcUrl:s.rpcUrl,chainType:"COSMOS"}}};
1
+ var p=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var l=r=>p(r,"__esModule",{value:!0});var h=(r,n)=>{for(var s in n)p(r,s,{get:n[s],enumerable:!0})},b=(r,n,s,e)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of y(n))!S.call(r,o)&&(s||o!=="default")&&p(r,o,{get:()=>n[o],enumerable:!(e=f(n,o))||e.enumerable});return r};var x=(r=>(n,s)=>r&&r.get(n)||(s=b(l({}),n,1),r&&r.set(n,s),s))(typeof WeakMap!="undefined"?new WeakMap:0);var t=(r,n,s)=>new Promise((e,o)=>{var d=i=>{try{c(s.next(i))}catch(a){o(a)}},u=i=>{try{c(s.throw(i))}catch(a){o(a)}},c=i=>i.done?e(i.value):Promise.resolve(i.value).then(d,u);c((s=s.apply(r,n)).next())});var C={};h(C,{CosmosExtension:()=>m});var g=require("@magic-sdk/commons");var m=class extends g.Extension.Internal{constructor(n){super();this.cosmosConfig=n;this.name="cosmos";this.config={};this.signAndBroadcast=(n,s)=>t(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_signAndBroadcast",params:{message:n,fee:s}})});this.sign=(n,s)=>t(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_sign",params:{message:n,fee:s}})});this.sendTokens=(n,s,e,o)=>t(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_sendTokens",params:{recipientAddress:n,transferAmount:s,denom:e,memo:o}})});this.config={rpcUrl:n.rpcUrl,chainType:"COSMOS"}}};module.exports=x(C);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/index.ts", "../../src/type.ts"],
4
- "sourcesContent": ["import { Extension } from '@magic-sdk/commons';\nimport { CosmosConfig, CosmosPayloadMethod } from './type';\n\nexport class CosmosExtension extends Extension.Internal<'cosmos', any> {\n name = 'cosmos' as const;\n config: any = {};\n\n constructor(public cosmosConfig: CosmosConfig) {\n super();\n\n this.config = {\n rpcUrl: cosmosConfig.rpcUrl,\n chainType: 'COSMOS',\n };\n }\n\n public signAndBroadcast = async (message: any, fee: any) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: CosmosPayloadMethod.SignAndBroadcast,\n params: { message, fee },\n });\n };\n\n public sign = async (message: any, fee: any) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: CosmosPayloadMethod.Sign,\n params: { message, fee },\n });\n };\n\n public sendTokens = async (\n recipientAddress: string,\n transferAmount: string | number,\n denom: string,\n memo?: string,\n ) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: CosmosPayloadMethod.SendTokens,\n params: { recipientAddress, transferAmount, denom, memo },\n });\n };\n}\n", "export interface CosmosConfig {\n rpcUrl: string;\n}\n\nexport enum CosmosPayloadMethod {\n Sign = 'cos_sign',\n SignAndBroadcast = 'cos_signAndBroadcast',\n SendTokens = 'cos_sendTokens',\n}\n"],
5
- "mappings": "gyBAAA,yCAA0B,iCCInB,GAAK,GAAL,UAAK,EAAL,CACL,OAAO,WACP,mBAAmB,uBACnB,aAAa,mBAHH,WDDL,mBAA8B,aAAU,QAAwB,CAIrE,YAAmB,EAA4B,CAC7C,QADiB,oBAHnB,UAAO,SACP,YAAc,GAWP,sBAAmB,CAAO,EAAc,IAAa,wBAC1D,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,EAAoB,iBAC5B,OAAQ,CAAE,UAAS,WAIhB,UAAO,CAAO,EAAc,IAAa,wBAC9C,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,EAAoB,KAC5B,OAAQ,CAAE,UAAS,WAIhB,gBAAa,CAClB,EACA,EACA,EACA,IACG,wBACH,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,EAAoB,WAC5B,OAAQ,CAAE,mBAAkB,iBAAgB,QAAO,YAlCrD,KAAK,OAAS,CACZ,OAAQ,EAAa,OACrB,UAAW",
3
+ "sources": ["../../src/index.ts"],
4
+ "sourcesContent": ["import { Extension } from '@magic-sdk/commons';\nimport { CosmosConfig, CosmosPayloadMethod } from './type';\n\nexport class CosmosExtension extends Extension.Internal<'cosmos', any> {\n name = 'cosmos' as const;\n config: any = {};\n\n constructor(public cosmosConfig: CosmosConfig) {\n super();\n\n this.config = {\n rpcUrl: cosmosConfig.rpcUrl,\n chainType: 'COSMOS',\n };\n }\n\n public signAndBroadcast = async (message: any, fee: any) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: CosmosPayloadMethod.SignAndBroadcast,\n params: { message, fee },\n });\n };\n\n public sign = async (message: any, fee: any) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: CosmosPayloadMethod.Sign,\n params: { message, fee },\n });\n };\n\n public sendTokens = async (\n recipientAddress: string,\n transferAmount: string | number,\n denom: string,\n memo?: string,\n ) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: CosmosPayloadMethod.SendTokens,\n params: { recipientAddress, transferAmount, denom, memo },\n });\n };\n}\n"],
5
+ "mappings": "2tBAAA,4CAA0B,8BAGnB,mBAA8B,aAAU,QAAwB,CAIrE,YAAmB,EAA4B,CAC7C,QADiB,oBAHnB,UAAO,SACP,YAAc,GAWP,sBAAmB,CAAO,EAAc,IAAa,wBAC1D,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,uBACR,OAAQ,CAAE,UAAS,WAIhB,UAAO,CAAO,EAAc,IAAa,wBAC9C,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,WACR,OAAQ,CAAE,UAAS,WAIhB,gBAAa,CAClB,EACA,EACA,EACA,IACG,wBACH,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,iBACR,OAAQ,CAAE,mBAAkB,iBAAgB,QAAO,YAlCrD,KAAK,OAAS,CACZ,OAAQ,EAAa,OACrB,UAAW",
6
6
  "names": []
7
7
  }
package/dist/es/index.js CHANGED
@@ -1,2 +1,2 @@
1
- var t=(g,r,n)=>new Promise((s,e)=>{var a=i=>{try{o(n.next(i))}catch(p){e(p)}},m=i=>{try{o(n.throw(i))}catch(p){e(p)}},o=i=>i.done?s(i.value):Promise.resolve(i.value).then(a,m);o((n=n.apply(g,r)).next())});import{Extension as u}from"@magic-sdk/commons";var c;(function(s){s.Sign="cos_sign",s.SignAndBroadcast="cos_signAndBroadcast",s.SendTokens="cos_sendTokens"})(c||(c={}));var d=class extends u.Internal{constructor(r){super();this.cosmosConfig=r;this.name="cosmos";this.config={};this.signAndBroadcast=(r,n)=>t(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:c.SignAndBroadcast,params:{message:r,fee:n}})});this.sign=(r,n)=>t(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:c.Sign,params:{message:r,fee:n}})});this.sendTokens=(r,n,s,e)=>t(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:c.SendTokens,params:{recipientAddress:r,transferAmount:n,denom:s,memo:e}})});this.config={rpcUrl:r.rpcUrl,chainType:"COSMOS"}}};export{d as CosmosExtension};
1
+ var i=(a,s,n)=>new Promise((e,o)=>{var p=r=>{try{t(n.next(r))}catch(c){o(c)}},g=r=>{try{t(n.throw(r))}catch(c){o(c)}},t=r=>r.done?e(r.value):Promise.resolve(r.value).then(p,g);t((n=n.apply(a,s)).next())});import{Extension as m}from"@magic-sdk/commons";var d=class extends m.Internal{constructor(s){super();this.cosmosConfig=s;this.name="cosmos";this.config={};this.signAndBroadcast=(s,n)=>i(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_signAndBroadcast",params:{message:s,fee:n}})});this.sign=(s,n)=>i(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_sign",params:{message:s,fee:n}})});this.sendTokens=(s,n,e,o)=>i(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_sendTokens",params:{recipientAddress:s,transferAmount:n,denom:e,memo:o}})});this.config={rpcUrl:s.rpcUrl,chainType:"COSMOS"}}};export{d as CosmosExtension};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/index.ts", "../../src/type.ts"],
4
- "sourcesContent": ["import { Extension } from '@magic-sdk/commons';\nimport { CosmosConfig, CosmosPayloadMethod } from './type';\n\nexport class CosmosExtension extends Extension.Internal<'cosmos', any> {\n name = 'cosmos' as const;\n config: any = {};\n\n constructor(public cosmosConfig: CosmosConfig) {\n super();\n\n this.config = {\n rpcUrl: cosmosConfig.rpcUrl,\n chainType: 'COSMOS',\n };\n }\n\n public signAndBroadcast = async (message: any, fee: any) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: CosmosPayloadMethod.SignAndBroadcast,\n params: { message, fee },\n });\n };\n\n public sign = async (message: any, fee: any) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: CosmosPayloadMethod.Sign,\n params: { message, fee },\n });\n };\n\n public sendTokens = async (\n recipientAddress: string,\n transferAmount: string | number,\n denom: string,\n memo?: string,\n ) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: CosmosPayloadMethod.SendTokens,\n params: { recipientAddress, transferAmount, denom, memo },\n });\n };\n}\n", "export interface CosmosConfig {\n rpcUrl: string;\n}\n\nexport enum CosmosPayloadMethod {\n Sign = 'cos_sign',\n SignAndBroadcast = 'cos_signAndBroadcast',\n SendTokens = 'cos_sendTokens',\n}\n"],
5
- "mappings": "6MAAA,+CCIO,GAAK,GAAL,UAAK,EAAL,CACL,OAAO,WACP,mBAAmB,uBACnB,aAAa,mBAHH,WDDL,mBAA8B,GAAU,QAAwB,CAIrE,YAAmB,EAA4B,CAC7C,QADiB,oBAHnB,UAAO,SACP,YAAc,GAWP,sBAAmB,CAAO,EAAc,IAAa,wBAC1D,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,EAAoB,iBAC5B,OAAQ,CAAE,UAAS,WAIhB,UAAO,CAAO,EAAc,IAAa,wBAC9C,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,EAAoB,KAC5B,OAAQ,CAAE,UAAS,WAIhB,gBAAa,CAClB,EACA,EACA,EACA,IACG,wBACH,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,EAAoB,WAC5B,OAAQ,CAAE,mBAAkB,iBAAgB,QAAO,YAlCrD,KAAK,OAAS,CACZ,OAAQ,EAAa,OACrB,UAAW",
3
+ "sources": ["../../src/index.ts"],
4
+ "sourcesContent": ["import { Extension } from '@magic-sdk/commons';\nimport { CosmosConfig, CosmosPayloadMethod } from './type';\n\nexport class CosmosExtension extends Extension.Internal<'cosmos', any> {\n name = 'cosmos' as const;\n config: any = {};\n\n constructor(public cosmosConfig: CosmosConfig) {\n super();\n\n this.config = {\n rpcUrl: cosmosConfig.rpcUrl,\n chainType: 'COSMOS',\n };\n }\n\n public signAndBroadcast = async (message: any, fee: any) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: CosmosPayloadMethod.SignAndBroadcast,\n params: { message, fee },\n });\n };\n\n public sign = async (message: any, fee: any) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: CosmosPayloadMethod.Sign,\n params: { message, fee },\n });\n };\n\n public sendTokens = async (\n recipientAddress: string,\n transferAmount: string | number,\n denom: string,\n memo?: string,\n ) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: CosmosPayloadMethod.SendTokens,\n params: { recipientAddress, transferAmount, denom, memo },\n });\n };\n}\n"],
5
+ "mappings": "6MAAA,+CAGO,mBAA8B,GAAU,QAAwB,CAIrE,YAAmB,EAA4B,CAC7C,QADiB,oBAHnB,UAAO,SACP,YAAc,GAWP,sBAAmB,CAAO,EAAc,IAAa,wBAC1D,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,uBACR,OAAQ,CAAE,UAAS,WAIhB,UAAO,CAAO,EAAc,IAAa,wBAC9C,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,WACR,OAAQ,CAAE,UAAS,WAIhB,gBAAa,CAClB,EACA,EACA,EACA,IACG,wBACH,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,iBACR,OAAQ,CAAE,mBAAkB,iBAAgB,QAAO,YAlCrD,KAAK,OAAS,CACZ,OAAQ,EAAa,OACrB,UAAW",
6
6
  "names": []
7
7
  }
package/dist/es/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- var t=(g,r,n)=>new Promise((s,e)=>{var a=i=>{try{o(n.next(i))}catch(p){e(p)}},m=i=>{try{o(n.throw(i))}catch(p){e(p)}},o=i=>i.done?s(i.value):Promise.resolve(i.value).then(a,m);o((n=n.apply(g,r)).next())});import{Extension as u}from"@magic-sdk/commons";var c;(function(s){s.Sign="cos_sign",s.SignAndBroadcast="cos_signAndBroadcast",s.SendTokens="cos_sendTokens"})(c||(c={}));var d=class extends u.Internal{constructor(r){super();this.cosmosConfig=r;this.name="cosmos";this.config={};this.signAndBroadcast=(r,n)=>t(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:c.SignAndBroadcast,params:{message:r,fee:n}})});this.sign=(r,n)=>t(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:c.Sign,params:{message:r,fee:n}})});this.sendTokens=(r,n,s,e)=>t(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:c.SendTokens,params:{recipientAddress:r,transferAmount:n,denom:s,memo:e}})});this.config={rpcUrl:r.rpcUrl,chainType:"COSMOS"}}};export{d as CosmosExtension};
1
+ var i=(a,s,n)=>new Promise((e,o)=>{var p=r=>{try{t(n.next(r))}catch(c){o(c)}},g=r=>{try{t(n.throw(r))}catch(c){o(c)}},t=r=>r.done?e(r.value):Promise.resolve(r.value).then(p,g);t((n=n.apply(a,s)).next())});import{Extension as m}from"@magic-sdk/commons";var d=class extends m.Internal{constructor(s){super();this.cosmosConfig=s;this.name="cosmos";this.config={};this.signAndBroadcast=(s,n)=>i(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_signAndBroadcast",params:{message:s,fee:n}})});this.sign=(s,n)=>i(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_sign",params:{message:s,fee:n}})});this.sendTokens=(s,n,e,o)=>i(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_sendTokens",params:{recipientAddress:s,transferAmount:n,denom:e,memo:o}})});this.config={rpcUrl:s.rpcUrl,chainType:"COSMOS"}}};export{d as CosmosExtension};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/index.ts", "../../src/type.ts"],
4
- "sourcesContent": ["import { Extension } from '@magic-sdk/commons';\nimport { CosmosConfig, CosmosPayloadMethod } from './type';\n\nexport class CosmosExtension extends Extension.Internal<'cosmos', any> {\n name = 'cosmos' as const;\n config: any = {};\n\n constructor(public cosmosConfig: CosmosConfig) {\n super();\n\n this.config = {\n rpcUrl: cosmosConfig.rpcUrl,\n chainType: 'COSMOS',\n };\n }\n\n public signAndBroadcast = async (message: any, fee: any) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: CosmosPayloadMethod.SignAndBroadcast,\n params: { message, fee },\n });\n };\n\n public sign = async (message: any, fee: any) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: CosmosPayloadMethod.Sign,\n params: { message, fee },\n });\n };\n\n public sendTokens = async (\n recipientAddress: string,\n transferAmount: string | number,\n denom: string,\n memo?: string,\n ) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: CosmosPayloadMethod.SendTokens,\n params: { recipientAddress, transferAmount, denom, memo },\n });\n };\n}\n", "export interface CosmosConfig {\n rpcUrl: string;\n}\n\nexport enum CosmosPayloadMethod {\n Sign = 'cos_sign',\n SignAndBroadcast = 'cos_signAndBroadcast',\n SendTokens = 'cos_sendTokens',\n}\n"],
5
- "mappings": "6MAAA,+CCIO,GAAK,GAAL,UAAK,EAAL,CACL,OAAO,WACP,mBAAmB,uBACnB,aAAa,mBAHH,WDDL,mBAA8B,GAAU,QAAwB,CAIrE,YAAmB,EAA4B,CAC7C,QADiB,oBAHnB,UAAO,SACP,YAAc,GAWP,sBAAmB,CAAO,EAAc,IAAa,wBAC1D,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,EAAoB,iBAC5B,OAAQ,CAAE,UAAS,WAIhB,UAAO,CAAO,EAAc,IAAa,wBAC9C,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,EAAoB,KAC5B,OAAQ,CAAE,UAAS,WAIhB,gBAAa,CAClB,EACA,EACA,EACA,IACG,wBACH,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,EAAoB,WAC5B,OAAQ,CAAE,mBAAkB,iBAAgB,QAAO,YAlCrD,KAAK,OAAS,CACZ,OAAQ,EAAa,OACrB,UAAW",
3
+ "sources": ["../../src/index.ts"],
4
+ "sourcesContent": ["import { Extension } from '@magic-sdk/commons';\nimport { CosmosConfig, CosmosPayloadMethod } from './type';\n\nexport class CosmosExtension extends Extension.Internal<'cosmos', any> {\n name = 'cosmos' as const;\n config: any = {};\n\n constructor(public cosmosConfig: CosmosConfig) {\n super();\n\n this.config = {\n rpcUrl: cosmosConfig.rpcUrl,\n chainType: 'COSMOS',\n };\n }\n\n public signAndBroadcast = async (message: any, fee: any) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: CosmosPayloadMethod.SignAndBroadcast,\n params: { message, fee },\n });\n };\n\n public sign = async (message: any, fee: any) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: CosmosPayloadMethod.Sign,\n params: { message, fee },\n });\n };\n\n public sendTokens = async (\n recipientAddress: string,\n transferAmount: string | number,\n denom: string,\n memo?: string,\n ) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: CosmosPayloadMethod.SendTokens,\n params: { recipientAddress, transferAmount, denom, memo },\n });\n };\n}\n"],
5
+ "mappings": "6MAAA,+CAGO,mBAA8B,GAAU,QAAwB,CAIrE,YAAmB,EAA4B,CAC7C,QADiB,oBAHnB,UAAO,SACP,YAAc,GAWP,sBAAmB,CAAO,EAAc,IAAa,wBAC1D,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,uBACR,OAAQ,CAAE,UAAS,WAIhB,UAAO,CAAO,EAAc,IAAa,wBAC9C,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,WACR,OAAQ,CAAE,UAAS,WAIhB,gBAAa,CAClB,EACA,EACA,EACA,IACG,wBACH,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,iBACR,OAAQ,CAAE,mBAAkB,iBAAgB,QAAO,YAlCrD,KAAK,OAAS,CACZ,OAAQ,EAAa,OACrB,UAAW",
6
6
  "names": []
7
7
  }
package/dist/extension.js CHANGED
@@ -1 +1,2 @@
1
- var MagicCosmosExtension=(()=>{var b=Object.create;var g=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var T=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var u=s=>g(s,"__esModule",{value:!0});var B=(s,n)=>()=>(n||s((n={exports:{}}).exports,n),n.exports);var j=(s,n,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of l(n))!A.call(s,r)&&r!=="default"&&g(s,r,{get:()=>n[r],enumerable:!(i=k(n,r))||i.enumerable});return s},q=s=>j(u(g(s!=null?b(T(s)):{},"default",s&&s.__esModule&&"default"in s?{get:()=>s.default,enumerable:!0}:{value:s,enumerable:!0})),s);var o=(s,n,i)=>new Promise((r,c)=>{var S=e=>{try{p(i.next(e))}catch(a){c(a)}},y=e=>{try{p(i.throw(e))}catch(a){c(a)}},p=e=>e.done?r(e.value):Promise.resolve(e.value).then(S,y);p((i=i.apply(s,n)).next())});var x=B((U,d)=>{d.exports=Magic});var C={};u(C);var f=q(x());var t;(function(r){r.Sign="cos_sign",r.SignAndBroadcast="cos_signAndBroadcast",r.SendTokens="cos_sendTokens"})(t||(t={}));var m=class extends f.Extension.Internal{constructor(n){super();this.cosmosConfig=n;this.name="cosmos";this.config={};this.signAndBroadcast=(n,i)=>o(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:t.SignAndBroadcast,params:{message:n,fee:i}})});this.sign=(n,i)=>o(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:t.Sign,params:{message:n,fee:i}})});this.sendTokens=(n,i,r,c)=>o(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:t.SendTokens,params:{recipientAddress:n,transferAmount:i,denom:r,memo:c}})});this.config={rpcUrl:n.rpcUrl,chainType:"COSMOS"}}};module.exports=m;return C;})();
1
+ var MagicCosmosExtension=(()=>{var S=Object.create;var e=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty;var m=s=>e(s,"__esModule",{value:!0});var k=(s,n)=>()=>(n||s((n={exports:{}}).exports,n),n.exports),A=(s,n)=>{for(var r in n)e(s,r,{get:n[r],enumerable:!0})},d=(s,n,r,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of C(n))!T.call(s,o)&&(r||o!=="default")&&e(s,o,{get:()=>n[o],enumerable:!(t=h(n,o))||t.enumerable});return s},B=(s,n)=>d(m(e(s!=null?S(b(s)):{},"default",!n&&s&&s.__esModule?{get:()=>s.default,enumerable:!0}:{value:s,enumerable:!0})),s),j=(s=>(n,r)=>s&&s.get(n)||(r=d(m({}),n,1),s&&s.set(n,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var c=(s,n,r)=>new Promise((t,o)=>{var x=i=>{try{a(r.next(i))}catch(p){o(p)}},y=i=>{try{a(r.throw(i))}catch(p){o(p)}},a=i=>i.done?t(i.value):Promise.resolve(i.value).then(x,y);a((r=r.apply(s,n)).next())});var f=k((E,u)=>{u.exports=Magic});var U={};A(U,{default:()=>q});var l=B(f());var g=class extends l.Extension.Internal{constructor(n){super();this.cosmosConfig=n;this.name="cosmos";this.config={};this.signAndBroadcast=(n,r)=>c(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_signAndBroadcast",params:{message:n,fee:r}})});this.sign=(n,r)=>c(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_sign",params:{message:n,fee:r}})});this.sendTokens=(n,r,t,o)=>c(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_sendTokens",params:{recipientAddress:n,transferAmount:r,denom:t,memo:o}})});this.config={rpcUrl:n.rpcUrl,chainType:"COSMOS"}}};var q=g;return j(U);})();
2
+ if (MagicCosmosExtension && MagicCosmosExtension.default != null) { MagicCosmosExtension = Object.assign(MagicCosmosExtension.default, MagicCosmosExtension); delete MagicCosmosExtension.default; }
@@ -1,2 +1,2 @@
1
- var b=Object.create;var o=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty;var m=n=>o(n,"__esModule",{value:!0});var A=(n,s)=>{m(n);for(var r in s)o(n,r,{get:s[r],enumerable:!0})},B=(n,s,r)=>{if(s&&typeof s=="object"||typeof s=="function")for(let i of x(s))!T.call(n,i)&&i!=="default"&&o(n,i,{get:()=>s[i],enumerable:!(r=k(s,i))||r.enumerable});return n},j=n=>B(m(o(n!=null?b(y(n)):{},"default",n&&n.__esModule&&"default"in n?{get:()=>n.default,enumerable:!0}:{value:n,enumerable:!0})),n);var p=(n,s,r)=>new Promise((i,t)=>{var f=c=>{try{g(r.next(c))}catch(a){t(a)}},S=c=>{try{g(r.throw(c))}catch(a){t(a)}},g=c=>c.done?i(c.value):Promise.resolve(c.value).then(f,S);g((r=r.apply(n,s)).next())});A(exports,{CosmosExtension:()=>d});var u=j(require("@magic-sdk/commons"));var e;(function(i){i.Sign="cos_sign",i.SignAndBroadcast="cos_signAndBroadcast",i.SendTokens="cos_sendTokens"})(e||(e={}));var d=class extends u.Extension.Internal{constructor(s){super();this.cosmosConfig=s;this.name="cosmos";this.config={};this.signAndBroadcast=(s,r)=>p(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:e.SignAndBroadcast,params:{message:s,fee:r}})});this.sign=(s,r)=>p(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:e.Sign,params:{message:s,fee:r}})});this.sendTokens=(s,r,i,t)=>p(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:e.SendTokens,params:{recipientAddress:s,transferAmount:r,denom:i,memo:t}})});this.config={rpcUrl:s.rpcUrl,chainType:"COSMOS"}}};
1
+ var p=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var l=r=>p(r,"__esModule",{value:!0});var h=(r,n)=>{for(var s in n)p(r,s,{get:n[s],enumerable:!0})},b=(r,n,s,e)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of y(n))!S.call(r,o)&&(s||o!=="default")&&p(r,o,{get:()=>n[o],enumerable:!(e=f(n,o))||e.enumerable});return r};var x=(r=>(n,s)=>r&&r.get(n)||(s=b(l({}),n,1),r&&r.set(n,s),s))(typeof WeakMap!="undefined"?new WeakMap:0);var t=(r,n,s)=>new Promise((e,o)=>{var d=i=>{try{c(s.next(i))}catch(a){o(a)}},u=i=>{try{c(s.throw(i))}catch(a){o(a)}},c=i=>i.done?e(i.value):Promise.resolve(i.value).then(d,u);c((s=s.apply(r,n)).next())});var C={};h(C,{CosmosExtension:()=>m});var g=require("@magic-sdk/commons");var m=class extends g.Extension.Internal{constructor(n){super();this.cosmosConfig=n;this.name="cosmos";this.config={};this.signAndBroadcast=(n,s)=>t(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_signAndBroadcast",params:{message:n,fee:s}})});this.sign=(n,s)=>t(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_sign",params:{message:n,fee:s}})});this.sendTokens=(n,s,e,o)=>t(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_sendTokens",params:{recipientAddress:n,transferAmount:s,denom:e,memo:o}})});this.config={rpcUrl:n.rpcUrl,chainType:"COSMOS"}}};module.exports=x(C);
2
2
  //# sourceMappingURL=index.native.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/index.ts", "../../src/type.ts"],
4
- "sourcesContent": ["import { Extension } from '@magic-sdk/commons';\nimport { CosmosConfig, CosmosPayloadMethod } from './type';\n\nexport class CosmosExtension extends Extension.Internal<'cosmos', any> {\n name = 'cosmos' as const;\n config: any = {};\n\n constructor(public cosmosConfig: CosmosConfig) {\n super();\n\n this.config = {\n rpcUrl: cosmosConfig.rpcUrl,\n chainType: 'COSMOS',\n };\n }\n\n public signAndBroadcast = async (message: any, fee: any) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: CosmosPayloadMethod.SignAndBroadcast,\n params: { message, fee },\n });\n };\n\n public sign = async (message: any, fee: any) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: CosmosPayloadMethod.Sign,\n params: { message, fee },\n });\n };\n\n public sendTokens = async (\n recipientAddress: string,\n transferAmount: string | number,\n denom: string,\n memo?: string,\n ) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: CosmosPayloadMethod.SendTokens,\n params: { recipientAddress, transferAmount, denom, memo },\n });\n };\n}\n", "export interface CosmosConfig {\n rpcUrl: string;\n}\n\nexport enum CosmosPayloadMethod {\n Sign = 'cos_sign',\n SignAndBroadcast = 'cos_signAndBroadcast',\n SendTokens = 'cos_sendTokens',\n}\n"],
5
- "mappings": "gyBAAA,yCAA0B,iCCInB,GAAK,GAAL,UAAK,EAAL,CACL,OAAO,WACP,mBAAmB,uBACnB,aAAa,mBAHH,WDDL,mBAA8B,aAAU,QAAwB,CAIrE,YAAmB,EAA4B,CAC7C,QADiB,oBAHnB,UAAO,SACP,YAAc,GAWP,sBAAmB,CAAO,EAAc,IAAa,wBAC1D,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,EAAoB,iBAC5B,OAAQ,CAAE,UAAS,WAIhB,UAAO,CAAO,EAAc,IAAa,wBAC9C,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,EAAoB,KAC5B,OAAQ,CAAE,UAAS,WAIhB,gBAAa,CAClB,EACA,EACA,EACA,IACG,wBACH,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,EAAoB,WAC5B,OAAQ,CAAE,mBAAkB,iBAAgB,QAAO,YAlCrD,KAAK,OAAS,CACZ,OAAQ,EAAa,OACrB,UAAW",
3
+ "sources": ["../../src/index.ts"],
4
+ "sourcesContent": ["import { Extension } from '@magic-sdk/commons';\nimport { CosmosConfig, CosmosPayloadMethod } from './type';\n\nexport class CosmosExtension extends Extension.Internal<'cosmos', any> {\n name = 'cosmos' as const;\n config: any = {};\n\n constructor(public cosmosConfig: CosmosConfig) {\n super();\n\n this.config = {\n rpcUrl: cosmosConfig.rpcUrl,\n chainType: 'COSMOS',\n };\n }\n\n public signAndBroadcast = async (message: any, fee: any) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: CosmosPayloadMethod.SignAndBroadcast,\n params: { message, fee },\n });\n };\n\n public sign = async (message: any, fee: any) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: CosmosPayloadMethod.Sign,\n params: { message, fee },\n });\n };\n\n public sendTokens = async (\n recipientAddress: string,\n transferAmount: string | number,\n denom: string,\n memo?: string,\n ) => {\n return this.request({\n id: 42,\n jsonrpc: '2.0',\n method: CosmosPayloadMethod.SendTokens,\n params: { recipientAddress, transferAmount, denom, memo },\n });\n };\n}\n"],
5
+ "mappings": "2tBAAA,4CAA0B,8BAGnB,mBAA8B,aAAU,QAAwB,CAIrE,YAAmB,EAA4B,CAC7C,QADiB,oBAHnB,UAAO,SACP,YAAc,GAWP,sBAAmB,CAAO,EAAc,IAAa,wBAC1D,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,uBACR,OAAQ,CAAE,UAAS,WAIhB,UAAO,CAAO,EAAc,IAAa,wBAC9C,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,WACR,OAAQ,CAAE,UAAS,WAIhB,gBAAa,CAClB,EACA,EACA,EACA,IACG,wBACH,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,iBACR,OAAQ,CAAE,mBAAkB,iBAAgB,QAAO,YAlCrD,KAAK,OAAS,CACZ,OAAQ,EAAa,OACrB,UAAW",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,2 @@
1
1
  import { CosmosExtension } from './index';
2
- export type { CosmosExtension as default };
2
+ export default CosmosExtension;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magic-ext/cosmos",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "magic cosmos extension",
5
5
  "author": "Magic <team@magic.link> (https://magic.link/)",
6
6
  "license": "MIT",
@@ -30,5 +30,5 @@
30
30
  "devDependencies": {
31
31
  "@magic-sdk/commons": "^4.0.0"
32
32
  },
33
- "gitHead": "5a1afc093cfec98bdcfb232cb2878510014da70a"
33
+ "gitHead": "d438b0b289fd4dd06a19bbb0f9f8d27bb067cea0"
34
34
  }