@magic-ext/cosmos 3.1.0-beta.1 → 3.2.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,15 @@
1
+ # v3.2.0 (Tue Apr 05 2022)
2
+
3
+ #### 🚀 Enhancement
4
+
5
+ - Add cosmos change address function [#299](https://github.com/magiclabs/magic-js/pull/299) ([@harryEth](https://github.com/harryEth))
6
+
7
+ #### Authors: 1
8
+
9
+ - [@harryEth](https://github.com/harryEth)
10
+
11
+ ---
12
+
1
13
  # v3.0.1 (Tue Jan 25 2022)
2
14
 
3
15
  #### 🐛 Bug Fix
package/dist/cjs/index.js CHANGED
@@ -1,2 +1,2 @@
1
- var d=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var A=r=>d(r,"__esModule",{value:!0});var S=(r,n)=>{for(var s in n)d(r,s,{get:n[s],enumerable:!0})},l=(r,n,s,c)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of f(n))!y.call(r,e)&&(s||e!=="default")&&d(r,e,{get:()=>n[e],enumerable:!(c=h(n,e))||c.enumerable});return r};var b=(r=>(n,s)=>r&&r.get(n)||(s=l(A({}),n,1),r&&r.set(n,s),s))(typeof WeakMap!="undefined"?new WeakMap:0);var t=(r,n,s)=>new Promise((c,e)=>{var m=i=>{try{o(s.next(i))}catch(a){e(a)}},u=i=>{try{o(s.throw(i))}catch(a){e(a)}},o=i=>i.done?c(i.value):Promise.resolve(i.value).then(m,u);o((s=s.apply(r,n)).next())});var C={};S(C,{CosmosExtension:()=>p});var g=require("@magic-sdk/commons");var p=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.changeAddress=n=>t(this,null,function*(){return this.request({id:41,jsonrpc:"2.0",method:"cos_changeAddress",params:{prefix:n}})});this.sendTokens=(n,s,c,e)=>t(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_sendTokens",params:{recipientAddress:n,transferAmount:s,denom:c,memo:e}})});this.config={rpcUrl:n.rpcUrl,chainType:"COSMOS"}}};module.exports=b(C);
1
+ var d=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var A=r=>d(r,"__esModule",{value:!0});var S=(r,n)=>{for(var s in n)d(r,s,{get:n[s],enumerable:!0})},l=(r,n,s,c)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of f(n))!y.call(r,e)&&(s||e!=="default")&&d(r,e,{get:()=>n[e],enumerable:!(c=h(n,e))||c.enumerable});return r};var b=(r=>(n,s)=>r&&r.get(n)||(s=l(A({}),n,1),r&&r.set(n,s),s))(typeof WeakMap!="undefined"?new WeakMap:0);var t=(r,n,s)=>new Promise((c,e)=>{var m=i=>{try{o(s.next(i))}catch(a){e(a)}},u=i=>{try{o(s.throw(i))}catch(a){e(a)}},o=i=>i.done?c(i.value):Promise.resolve(i.value).then(m,u);o((s=s.apply(r,n)).next())});var C={};S(C,{CosmosExtension:()=>p});var g=require("@magic-sdk/commons");var p=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,c,e)=>t(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_sendTokens",params:{recipientAddress:n,transferAmount:s,denom:c,memo:e}})});this.changeAddress=n=>t(this,null,function*(){return this.request({id:41,jsonrpc:"2.0",method:"cos_changeAddress",params:{prefix:n}})});this.config={rpcUrl:n.rpcUrl,chainType:"COSMOS"}}};module.exports=b(C);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
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 changeAddress = async (prefix: string) => {\n return this.request({\n id: 41,\n jsonrpc: '2.0',\n method: CosmosPayloadMethod.ChangeAddress,\n params: { prefix },\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,mBAAgB,AAAO,GAAmB,wBAC/C,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,oBACR,OAAQ,CAAE,cAIP,gBAAa,CAClB,EACA,EACA,EACA,IACG,wBACH,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,iBACR,OAAQ,CAAE,mBAAkB,iBAAgB,QAAO,YA3CrD,KAAK,OAAS,CACZ,OAAQ,EAAa,OACrB,UAAW",
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 public changeAddress = async (prefix: string) => {\n return this.request({\n id: 41,\n jsonrpc: '2.0',\n method: CosmosPayloadMethod.ChangeAddress,\n params: { prefix },\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,YAIhD,mBAAgB,AAAO,GAAmB,wBAC/C,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,oBACR,OAAQ,CAAE,cA3CZ,KAAK,OAAS,CACZ,OAAQ,EAAa,OACrB,UAAW",
6
6
  "names": []
7
7
  }
package/dist/es/index.js CHANGED
@@ -1,2 +1,2 @@
1
- var e=(a,n,s)=>new Promise((c,i)=>{var d=r=>{try{t(s.next(r))}catch(o){i(o)}},g=r=>{try{t(s.throw(r))}catch(o){i(o)}},t=r=>r.done?c(r.value):Promise.resolve(r.value).then(d,g);t((s=s.apply(a,n)).next())});import{Extension as p}from"@magic-sdk/commons";var m=class extends p.Internal{constructor(n){super();this.cosmosConfig=n;this.name="cosmos";this.config={};this.signAndBroadcast=(n,s)=>e(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_signAndBroadcast",params:{message:n,fee:s}})});this.sign=(n,s)=>e(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_sign",params:{message:n,fee:s}})});this.changeAddress=n=>e(this,null,function*(){return this.request({id:41,jsonrpc:"2.0",method:"cos_changeAddress",params:{prefix:n}})});this.sendTokens=(n,s,c,i)=>e(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_sendTokens",params:{recipientAddress:n,transferAmount:s,denom:c,memo:i}})});this.config={rpcUrl:n.rpcUrl,chainType:"COSMOS"}}};export{m as CosmosExtension};
1
+ var e=(a,n,s)=>new Promise((c,i)=>{var d=r=>{try{t(s.next(r))}catch(o){i(o)}},g=r=>{try{t(s.throw(r))}catch(o){i(o)}},t=r=>r.done?c(r.value):Promise.resolve(r.value).then(d,g);t((s=s.apply(a,n)).next())});import{Extension as p}from"@magic-sdk/commons";var m=class extends p.Internal{constructor(n){super();this.cosmosConfig=n;this.name="cosmos";this.config={};this.signAndBroadcast=(n,s)=>e(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_signAndBroadcast",params:{message:n,fee:s}})});this.sign=(n,s)=>e(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_sign",params:{message:n,fee:s}})});this.sendTokens=(n,s,c,i)=>e(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_sendTokens",params:{recipientAddress:n,transferAmount:s,denom:c,memo:i}})});this.changeAddress=n=>e(this,null,function*(){return this.request({id:41,jsonrpc:"2.0",method:"cos_changeAddress",params:{prefix:n}})});this.config={rpcUrl:n.rpcUrl,chainType:"COSMOS"}}};export{m as CosmosExtension};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
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 changeAddress = async (prefix: string) => {\n return this.request({\n id: 41,\n jsonrpc: '2.0',\n method: CosmosPayloadMethod.ChangeAddress,\n params: { prefix },\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,mBAAgB,AAAO,GAAmB,wBAC/C,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,oBACR,OAAQ,CAAE,cAIP,gBAAa,CAClB,EACA,EACA,EACA,IACG,wBACH,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,iBACR,OAAQ,CAAE,mBAAkB,iBAAgB,QAAO,YA3CrD,KAAK,OAAS,CACZ,OAAQ,EAAa,OACrB,UAAW",
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 public changeAddress = async (prefix: string) => {\n return this.request({\n id: 41,\n jsonrpc: '2.0',\n method: CosmosPayloadMethod.ChangeAddress,\n params: { prefix },\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,YAIhD,mBAAgB,AAAO,GAAmB,wBAC/C,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,oBACR,OAAQ,CAAE,cA3CZ,KAAK,OAAS,CACZ,OAAQ,EAAa,OACrB,UAAW",
6
6
  "names": []
7
7
  }
package/dist/es/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- var e=(a,n,s)=>new Promise((c,i)=>{var d=r=>{try{t(s.next(r))}catch(o){i(o)}},g=r=>{try{t(s.throw(r))}catch(o){i(o)}},t=r=>r.done?c(r.value):Promise.resolve(r.value).then(d,g);t((s=s.apply(a,n)).next())});import{Extension as p}from"@magic-sdk/commons";var m=class extends p.Internal{constructor(n){super();this.cosmosConfig=n;this.name="cosmos";this.config={};this.signAndBroadcast=(n,s)=>e(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_signAndBroadcast",params:{message:n,fee:s}})});this.sign=(n,s)=>e(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_sign",params:{message:n,fee:s}})});this.changeAddress=n=>e(this,null,function*(){return this.request({id:41,jsonrpc:"2.0",method:"cos_changeAddress",params:{prefix:n}})});this.sendTokens=(n,s,c,i)=>e(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_sendTokens",params:{recipientAddress:n,transferAmount:s,denom:c,memo:i}})});this.config={rpcUrl:n.rpcUrl,chainType:"COSMOS"}}};export{m as CosmosExtension};
1
+ var e=(a,n,s)=>new Promise((c,i)=>{var d=r=>{try{t(s.next(r))}catch(o){i(o)}},g=r=>{try{t(s.throw(r))}catch(o){i(o)}},t=r=>r.done?c(r.value):Promise.resolve(r.value).then(d,g);t((s=s.apply(a,n)).next())});import{Extension as p}from"@magic-sdk/commons";var m=class extends p.Internal{constructor(n){super();this.cosmosConfig=n;this.name="cosmos";this.config={};this.signAndBroadcast=(n,s)=>e(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_signAndBroadcast",params:{message:n,fee:s}})});this.sign=(n,s)=>e(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_sign",params:{message:n,fee:s}})});this.sendTokens=(n,s,c,i)=>e(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_sendTokens",params:{recipientAddress:n,transferAmount:s,denom:c,memo:i}})});this.changeAddress=n=>e(this,null,function*(){return this.request({id:41,jsonrpc:"2.0",method:"cos_changeAddress",params:{prefix:n}})});this.config={rpcUrl:n.rpcUrl,chainType:"COSMOS"}}};export{m as CosmosExtension};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
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 changeAddress = async (prefix: string) => {\n return this.request({\n id: 41,\n jsonrpc: '2.0',\n method: CosmosPayloadMethod.ChangeAddress,\n params: { prefix },\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,mBAAgB,AAAO,GAAmB,wBAC/C,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,oBACR,OAAQ,CAAE,cAIP,gBAAa,CAClB,EACA,EACA,EACA,IACG,wBACH,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,iBACR,OAAQ,CAAE,mBAAkB,iBAAgB,QAAO,YA3CrD,KAAK,OAAS,CACZ,OAAQ,EAAa,OACrB,UAAW",
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 public changeAddress = async (prefix: string) => {\n return this.request({\n id: 41,\n jsonrpc: '2.0',\n method: CosmosPayloadMethod.ChangeAddress,\n params: { prefix },\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,YAIhD,mBAAgB,AAAO,GAAmB,wBAC/C,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,oBACR,OAAQ,CAAE,cA3CZ,KAAK,OAAS,CACZ,OAAQ,EAAa,OACrB,UAAW",
6
6
  "names": []
7
7
  }
package/dist/extension.js CHANGED
@@ -1,2 +1,2 @@
1
- var MagicCosmosExtension=(()=>{var y=Object.create;var c=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var C=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty;var g=n=>c(n,"__esModule",{value:!0});var T=(n,s)=>()=>(s||n((s={exports:{}}).exports,s),s.exports),j=(n,s)=>{for(var r in s)c(n,r,{get:s[r],enumerable:!0})},m=(n,s,r,o)=>{if(s&&typeof s=="object"||typeof s=="function")for(let e of S(s))!b.call(n,e)&&(r||e!=="default")&&c(n,e,{get:()=>s[e],enumerable:!(o=A(s,e))||o.enumerable});return n},k=(n,s)=>m(g(c(n!=null?y(C(n)):{},"default",!s&&n&&n.__esModule?{get:()=>n.default,enumerable:!0}:{value:n,enumerable:!0})),n),q=(n=>(s,r)=>n&&n.get(s)||(r=m(g({}),s,1),n&&n.set(s,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var t=(n,s,r)=>new Promise((o,e)=>{var l=i=>{try{a(r.next(i))}catch(p){e(p)}},x=i=>{try{a(r.throw(i))}catch(p){e(p)}},a=i=>i.done?o(i.value):Promise.resolve(i.value).then(l,x);a((r=r.apply(n,s)).next())});var h=T((E,u)=>{u.exports=Magic});var _={};j(_,{default:()=>B});var f=k(h());var d=class extends f.Extension.Internal{constructor(s){super();this.cosmosConfig=s;this.name="cosmos";this.config={};this.signAndBroadcast=(s,r)=>t(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_signAndBroadcast",params:{message:s,fee:r}})});this.sign=(s,r)=>t(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_sign",params:{message:s,fee:r}})});this.changeAddress=s=>t(this,null,function*(){return this.request({id:41,jsonrpc:"2.0",method:"cos_changeAddress",params:{prefix:s}})});this.sendTokens=(s,r,o,e)=>t(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_sendTokens",params:{recipientAddress:s,transferAmount:r,denom:o,memo:e}})});this.config={rpcUrl:s.rpcUrl,chainType:"COSMOS"}}};var B=d;return q(_);})();
1
+ var MagicCosmosExtension=(()=>{var y=Object.create;var c=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var C=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty;var g=n=>c(n,"__esModule",{value:!0});var T=(n,s)=>()=>(s||n((s={exports:{}}).exports,s),s.exports),j=(n,s)=>{for(var r in s)c(n,r,{get:s[r],enumerable:!0})},m=(n,s,r,o)=>{if(s&&typeof s=="object"||typeof s=="function")for(let e of S(s))!b.call(n,e)&&(r||e!=="default")&&c(n,e,{get:()=>s[e],enumerable:!(o=A(s,e))||o.enumerable});return n},k=(n,s)=>m(g(c(n!=null?y(C(n)):{},"default",!s&&n&&n.__esModule?{get:()=>n.default,enumerable:!0}:{value:n,enumerable:!0})),n),q=(n=>(s,r)=>n&&n.get(s)||(r=m(g({}),s,1),n&&n.set(s,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var t=(n,s,r)=>new Promise((o,e)=>{var l=i=>{try{a(r.next(i))}catch(p){e(p)}},x=i=>{try{a(r.throw(i))}catch(p){e(p)}},a=i=>i.done?o(i.value):Promise.resolve(i.value).then(l,x);a((r=r.apply(n,s)).next())});var h=T((E,u)=>{u.exports=Magic});var _={};j(_,{default:()=>B});var f=k(h());var d=class extends f.Extension.Internal{constructor(s){super();this.cosmosConfig=s;this.name="cosmos";this.config={};this.signAndBroadcast=(s,r)=>t(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_signAndBroadcast",params:{message:s,fee:r}})});this.sign=(s,r)=>t(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_sign",params:{message:s,fee:r}})});this.sendTokens=(s,r,o,e)=>t(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_sendTokens",params:{recipientAddress:s,transferAmount:r,denom:o,memo:e}})});this.changeAddress=s=>t(this,null,function*(){return this.request({id:41,jsonrpc:"2.0",method:"cos_changeAddress",params:{prefix:s}})});this.config={rpcUrl:s.rpcUrl,chainType:"COSMOS"}}};var B=d;return q(_);})();
2
2
  if (MagicCosmosExtension && MagicCosmosExtension.default != null) { MagicCosmosExtension = Object.assign(MagicCosmosExtension.default, MagicCosmosExtension); delete MagicCosmosExtension.default; }
@@ -1,2 +1,2 @@
1
- var p=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var A=r=>p(r,"__esModule",{value:!0});var S=(r,n)=>{for(var s in n)p(r,s,{get:n[s],enumerable:!0})},l=(r,n,s,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of f(n))!y.call(r,e)&&(s||e!=="default")&&p(r,e,{get:()=>n[e],enumerable:!(t=h(n,e))||t.enumerable});return r};var b=(r=>(n,s)=>r&&r.get(n)||(s=l(A({}),n,1),r&&r.set(n,s),s))(typeof WeakMap!="undefined"?new WeakMap:0);var c=(r,n,s)=>new Promise((t,e)=>{var m=i=>{try{o(s.next(i))}catch(a){e(a)}},u=i=>{try{o(s.throw(i))}catch(a){e(a)}},o=i=>i.done?t(i.value):Promise.resolve(i.value).then(m,u);o((s=s.apply(r,n)).next())});var x={};S(x,{CosmosExtension:()=>g});var d=require("@magic-sdk/commons");var g=class extends d.Extension.Internal{constructor(n){super();this.cosmosConfig=n;this.name="cosmos";this.config={};this.signAndBroadcast=(n,s)=>c(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_signAndBroadcast",params:{message:n,fee:s}})});this.sign=(n,s)=>c(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_sign",params:{message:n,fee:s}})});this.changeAddress=n=>c(this,null,function*(){return this.request({id:41,jsonrpc:"2.0",method:"cos_changeAddress",params:{prefix:n}})});this.sendTokens=(n,s,t,e)=>c(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_sendTokens",params:{recipientAddress:n,transferAmount:s,denom:t,memo:e}})});this.config={rpcUrl:n.rpcUrl,chainType:"COSMOS"}}};module.exports=b(x);
1
+ var p=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var A=r=>p(r,"__esModule",{value:!0});var S=(r,n)=>{for(var s in n)p(r,s,{get:n[s],enumerable:!0})},l=(r,n,s,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of f(n))!y.call(r,e)&&(s||e!=="default")&&p(r,e,{get:()=>n[e],enumerable:!(t=h(n,e))||t.enumerable});return r};var b=(r=>(n,s)=>r&&r.get(n)||(s=l(A({}),n,1),r&&r.set(n,s),s))(typeof WeakMap!="undefined"?new WeakMap:0);var c=(r,n,s)=>new Promise((t,e)=>{var m=i=>{try{o(s.next(i))}catch(a){e(a)}},u=i=>{try{o(s.throw(i))}catch(a){e(a)}},o=i=>i.done?t(i.value):Promise.resolve(i.value).then(m,u);o((s=s.apply(r,n)).next())});var x={};S(x,{CosmosExtension:()=>g});var d=require("@magic-sdk/commons");var g=class extends d.Extension.Internal{constructor(n){super();this.cosmosConfig=n;this.name="cosmos";this.config={};this.signAndBroadcast=(n,s)=>c(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_signAndBroadcast",params:{message:n,fee:s}})});this.sign=(n,s)=>c(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_sign",params:{message:n,fee:s}})});this.sendTokens=(n,s,t,e)=>c(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_sendTokens",params:{recipientAddress:n,transferAmount:s,denom:t,memo:e}})});this.changeAddress=n=>c(this,null,function*(){return this.request({id:41,jsonrpc:"2.0",method:"cos_changeAddress",params:{prefix:n}})});this.config={rpcUrl:n.rpcUrl,chainType:"COSMOS"}}};module.exports=b(x);
2
2
  //# sourceMappingURL=index.native.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.native.ts", "../../src/index.ts"],
4
- "sourcesContent": ["export * from './index';\n", "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 changeAddress = async (prefix: string) => {\n return this.request({\n id: 41,\n jsonrpc: '2.0',\n method: CosmosPayloadMethod.ChangeAddress,\n params: { prefix },\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,sCCAA,MAA0B,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,mBAAgB,AAAO,GAAmB,wBAC/C,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,oBACR,OAAQ,CAAE,cAIP,gBAAa,CAClB,EACA,EACA,EACA,IACG,wBACH,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,iBACR,OAAQ,CAAE,mBAAkB,iBAAgB,QAAO,YA3CrD,KAAK,OAAS,CACZ,OAAQ,EAAa,OACrB,UAAW",
4
+ "sourcesContent": ["export * from './index';\n", "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 public changeAddress = async (prefix: string) => {\n return this.request({\n id: 41,\n jsonrpc: '2.0',\n method: CosmosPayloadMethod.ChangeAddress,\n params: { prefix },\n });\n };\n}\n"],
5
+ "mappings": "2tBAAA,sCCAA,MAA0B,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,YAIhD,mBAAgB,AAAO,GAAmB,wBAC/C,MAAO,MAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,OAAQ,oBACR,OAAQ,CAAE,cA3CZ,KAAK,OAAS,CACZ,OAAQ,EAAa,OACrB,UAAW",
6
6
  "names": []
7
7
  }
@@ -7,6 +7,6 @@ export declare class CosmosExtension extends Extension.Internal<'cosmos', any> {
7
7
  constructor(cosmosConfig: CosmosConfig);
8
8
  signAndBroadcast: (message: any, fee: any) => Promise<any>;
9
9
  sign: (message: any, fee: any) => Promise<any>;
10
- changeAddress: (prefix: string) => Promise<any>;
11
10
  sendTokens: (recipientAddress: string, transferAmount: string | number, denom: string, memo?: string | undefined) => Promise<any>;
11
+ changeAddress: (prefix: string) => Promise<any>;
12
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magic-ext/cosmos",
3
- "version": "3.1.0-beta.01",
3
+ "version": "3.2.0",
4
4
  "description": "magic cosmos extension",
5
5
  "author": "Magic <team@magic.link> (https://magic.link/)",
6
6
  "license": "MIT",
@@ -28,6 +28,7 @@
28
28
  ]
29
29
  },
30
30
  "devDependencies": {
31
- "@magic-sdk/commons": "^4.0.0"
32
- }
31
+ "@magic-sdk/commons": "^4.1.0"
32
+ },
33
+ "gitHead": "1328bf3fc125fe2e20ada263ba36abf608e1251b"
33
34
  }