@magic-ext/cosmos 8.0.0 → 8.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magic-ext/cosmos",
3
- "version": "8.0.0",
3
+ "version": "8.1.0",
4
4
  "description": "magic cosmos 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": "^9.0.0"
31
+ "@magic-sdk/commons": "^9.1.0"
32
32
  },
33
- "gitHead": "4f0dd0871531afe5db7b966ec2ab502943cf8679"
33
+ "gitHead": "d2439bad1fd448d1109b642b777db7220e7c3608"
34
34
  }
@@ -1,2 +0,0 @@
1
- "use strict";var d=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var A=(r,s)=>{for(var n in s)d(r,n,{get:s[n],enumerable:!0})},S=(r,s,n,e)=>{if(s&&typeof s=="object"||typeof s=="function")for(let i of f(s))!y.call(r,i)&&i!==n&&d(r,i,{get:()=>s[i],enumerable:!(e=h(s,i))||e.enumerable});return r};var l=r=>S(d({},"__esModule",{value:!0}),r);var t=(r,s,n)=>new Promise((e,i)=>{var o=c=>{try{a(n.next(c))}catch(p){i(p)}},u=c=>{try{a(n.throw(c))}catch(p){i(p)}},a=c=>c.done?e(c.value):Promise.resolve(c.value).then(o,u);a((n=n.apply(r,s)).next())});var b={};A(b,{CosmosExtension:()=>g});module.exports=l(b);var m=require("@magic-sdk/commons");var g=class extends m.Extension.Internal{constructor(n){super();this.cosmosConfig=n;this.name="cosmos";this.config={};this.signAndBroadcast=(n,e)=>t(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_signAndBroadcast",params:{message:n,fee:e}})});this.sign=(n,e)=>t(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_sign",params:{message:n,fee:e}})});this.sendTokens=(n,e,i,o)=>t(this,null,function*(){return this.request({id:42,jsonrpc:"2.0",method:"cos_sendTokens",params:{recipientAddress:n,transferAmount:e,denom:i,memo:o}})});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"}}};
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", "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": "snBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qBAAAE,IAAA,eAAAC,EAAAH,GCAA,IAAAI,EAA0B,8BAGnB,IAAMC,EAAN,cAA8B,YAAU,QAAwB,CAIrE,YAAmBC,EAA4B,CAC7C,MAAM,EADW,kBAAAA,EAHnB,UAAO,SACP,YAAc,CAAC,EAWf,KAAO,iBAAmB,CAAOC,EAAcC,IAAaC,EAAA,sBAC1D,OAAO,KAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,8BACA,OAAQ,CAAE,QAAAF,EAAS,IAAAC,CAAI,CACzB,CAAC,CACH,GAEA,KAAO,KAAO,CAAOD,EAAcC,IAAaC,EAAA,sBAC9C,OAAO,KAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,kBACA,OAAQ,CAAE,QAAAF,EAAS,IAAAC,CAAI,CACzB,CAAC,CACH,GAEA,KAAO,WAAa,CAClBE,EACAC,EACAC,EACAC,IACGJ,EAAA,sBACH,OAAO,KAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,wBACA,OAAQ,CAAE,iBAAAC,EAAkB,eAAAC,EAAgB,MAAAC,EAAO,KAAAC,CAAK,CAC1D,CAAC,CACH,GAEA,KAAO,cAAuBC,GAAmBL,EAAA,sBAC/C,OAAO,KAAK,QAAQ,CAClB,GAAI,GACJ,QAAS,MACT,2BACA,OAAQ,CAAE,OAAAK,CAAO,CACnB,CAAC,CACH,GA7CE,KAAK,OAAS,CACZ,OAAQR,EAAa,OACrB,UAAW,QACb,CACF,CA0CF",
6
- "names": ["index_native_exports", "__export", "CosmosExtension", "__toCommonJS", "import_commons", "CosmosExtension", "cosmosConfig", "message", "fee", "__async", "recipientAddress", "transferAmount", "denom", "memo", "prefix"]
7
- }