@magic-ext/cosmos 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 +32 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +7 -1
- package/dist/es/index.js +1 -1
- package/dist/es/index.js.map +7 -1
- package/dist/es/index.mjs +2 -0
- package/dist/es/index.mjs.map +7 -0
- package/dist/extension.js +2 -1
- package/dist/react-native/index.native.js +1 -1
- package/dist/react-native/index.native.js.map +7 -1
- package/dist/types/index.cdn.d.ts +2 -2
- package/dist/types/index.d.ts +11 -11
- package/dist/types/index.native.d.ts +1 -0
- package/dist/types/type.d.ts +8 -8
- package/package.json +5 -5
- package/dist/modern/index.mjs +0 -2
- package/dist/modern/index.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,35 @@
|
|
|
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
|
+
|
|
14
|
+
# v3.0.0 (Tue Jan 25 2022)
|
|
15
|
+
|
|
16
|
+
#### 💥 Breaking Change
|
|
17
|
+
|
|
18
|
+
- Switch from `microbundle` to `esbuild` [#220](https://github.com/magiclabs/magic-js/pull/220) ([@smithki](https://github.com/smithki))
|
|
19
|
+
|
|
20
|
+
#### 🐛 Bug Fix
|
|
21
|
+
|
|
22
|
+
- Merge with master ([@smithki](https://github.com/smithki))
|
|
23
|
+
- Merge branch 'master' into feat/faster-builds ([@smithki](https://github.com/smithki))
|
|
24
|
+
- Modify CDN default exports ([@smithki](https://github.com/smithki))
|
|
25
|
+
- Support newly added Magic JS extensions in ESBuild ([@smithki](https://github.com/smithki))
|
|
26
|
+
|
|
27
|
+
#### Authors: 1
|
|
28
|
+
|
|
29
|
+
- Ian K Smith ([@smithki](https://github.com/smithki))
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
1
33
|
# v1.0.0 (Thu Dec 09 2021)
|
|
2
34
|
|
|
3
35
|
#### 💥 Breaking Change
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
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
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 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 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
|
+
"names": []
|
|
7
|
+
}
|
package/dist/es/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
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
|
package/dist/es/index.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 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 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
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
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
|
+
//# 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 { 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
|
+
"names": []
|
|
7
|
+
}
|
package/dist/extension.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
var MagicCosmosExtension=
|
|
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
|
|
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})},x=(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 b=(r=>(n,s)=>r&&r.get(n)||(s=x(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=b(C);
|
|
2
2
|
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
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"],
|
|
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,YAlCrD,KAAK,OAAS,CACZ,OAAQ,EAAa,OACrB,UAAW",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CosmosExtension } from './index';
|
|
2
|
-
export
|
|
1
|
+
import { CosmosExtension } from './index';
|
|
2
|
+
export default CosmosExtension;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Extension } from '@magic-sdk/commons';
|
|
2
|
-
import { CosmosConfig } from './type';
|
|
3
|
-
export declare class CosmosExtension extends Extension.Internal<'cosmos', any> {
|
|
4
|
-
cosmosConfig: CosmosConfig;
|
|
5
|
-
name: "cosmos";
|
|
6
|
-
config: any;
|
|
7
|
-
constructor(cosmosConfig: CosmosConfig);
|
|
8
|
-
signAndBroadcast: (message: any, fee: any) => Promise<any>;
|
|
9
|
-
sign: (message: any, fee: any) => Promise<any>;
|
|
10
|
-
sendTokens: (recipientAddress: string, transferAmount: string | number, denom: string, memo?: string | undefined) => Promise<any>;
|
|
11
|
-
}
|
|
1
|
+
import { Extension } from '@magic-sdk/commons';
|
|
2
|
+
import { CosmosConfig } from './type';
|
|
3
|
+
export declare class CosmosExtension extends Extension.Internal<'cosmos', any> {
|
|
4
|
+
cosmosConfig: CosmosConfig;
|
|
5
|
+
name: "cosmos";
|
|
6
|
+
config: any;
|
|
7
|
+
constructor(cosmosConfig: CosmosConfig);
|
|
8
|
+
signAndBroadcast: (message: any, fee: any) => Promise<any>;
|
|
9
|
+
sign: (message: any, fee: any) => Promise<any>;
|
|
10
|
+
sendTokens: (recipientAddress: string, transferAmount: string | number, denom: string, memo?: string | undefined) => Promise<any>;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './index';
|
package/dist/types/type.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export interface CosmosConfig {
|
|
2
|
-
rpcUrl: string;
|
|
3
|
-
}
|
|
4
|
-
export declare enum CosmosPayloadMethod {
|
|
5
|
-
Sign = "cos_sign",
|
|
6
|
-
SignAndBroadcast = "cos_signAndBroadcast",
|
|
7
|
-
SendTokens = "cos_sendTokens"
|
|
8
|
-
}
|
|
1
|
+
export interface CosmosConfig {
|
|
2
|
+
rpcUrl: string;
|
|
3
|
+
}
|
|
4
|
+
export declare enum CosmosPayloadMethod {
|
|
5
|
+
Sign = "cos_sign",
|
|
6
|
+
SignAndBroadcast = "cos_signAndBroadcast",
|
|
7
|
+
SendTokens = "cos_sendTokens"
|
|
8
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magic-ext/cosmos",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "magic cosmos 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": "
|
|
14
|
+
"target": "neutral",
|
|
15
15
|
"cdnGlobalName": "MagicCosmosExtension",
|
|
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/
|
|
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": "^
|
|
31
|
+
"@magic-sdk/commons": "^4.1.0"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "6aa5a25b33865cfe27444ca6094efade16a82f9f"
|
|
34
34
|
}
|
package/dist/modern/index.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Extension as s}from"@magic-sdk/commons";var n;!function(s){s.Sign="cos_sign",s.SignAndBroadcast="cos_signAndBroadcast",s.SendTokens="cos_sendTokens"}(n||(n={}));class o extends s.Internal{constructor(s){var o;super(),o=this,this.cosmosConfig=void 0,this.name="cosmos",this.config={},this.signAndBroadcast=async function(s,e){return o.request({id:42,jsonrpc:"2.0",method:n.SignAndBroadcast,params:{message:s,fee:e}})},this.sign=async function(s,e){return o.request({id:42,jsonrpc:"2.0",method:n.Sign,params:{message:s,fee:e}})},this.sendTokens=async function(s,e,r,t){return o.request({id:42,jsonrpc:"2.0",method:n.SendTokens,params:{recipientAddress:s,transferAmount:e,denom:r,memo:t}})},this.cosmosConfig=s,this.config={rpcUrl:s.rpcUrl,chainType:"COSMOS"}}}export{o as CosmosExtension};
|
|
2
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/type.ts","../../src/index.ts"],"sourcesContent":["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","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"],"names":["CosmosPayloadMethod","CosmosExtension","Extension","Internal","constructor","cosmosConfig","super","name","config","signAndBroadcast","async","message","fee","_this","request","id","jsonrpc","method","SignAndBroadcast","params","sign","Sign","sendTokens","recipientAddress","transferAmount","denom","memo","SendTokens","this","rpcUrl","chainType"],"mappings":"mDAIYA,GAAZ,SAAYA,GACVA,kBACAA,0CACAA,8BAHF,CAAYA,IAAAA,aCDCC,UAAwBC,EAAUC,SAI7CC,YAAmBC,SACjBC,oBADiBD,yBAHnBE,KAAO,cACPC,OAAc,QAWPC,iBAAmBC,eAAOC,EAAcC,GAC7C,OAAOC,EAAKC,QAAQ,CAClBC,GAAI,GACJC,QAAS,MACTC,OAAQjB,EAAoBkB,iBAC5BC,OAAQ,CAAER,QAAAA,EAASC,IAAAA,WAIhBQ,KAAOV,eAAOC,EAAcC,GACjC,OAAOC,EAAKC,QAAQ,CAClBC,GAAI,GACJC,QAAS,MACTC,OAAQjB,EAAoBqB,KAC5BF,OAAQ,CAAER,QAAAA,EAASC,IAAAA,WAIhBU,WAAaZ,eAClBa,EACAC,EACAC,EACAC,GAEA,OAAOb,EAAKC,QAAQ,CAClBC,GAAI,GACJC,QAAS,MACTC,OAAQjB,EAAoB2B,WAC5BR,OAAQ,CAAEI,iBAAAA,EAAkBC,eAAAA,EAAgBC,MAAAA,EAAOC,KAAAA,MArCpCE,kBAAAvB,EAGjBuB,KAAKpB,OAAS,CACZqB,OAAQxB,EAAawB,OACrBC,UAAW"}
|