@magic-ext/harmony 0.1.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 +44 -0
- package/LICENSE +21 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/es/index.js +2 -0
- package/dist/es/index.js.map +7 -0
- package/dist/extension.js +2 -1
- package/dist/react-native/index.native.js +2 -0
- package/dist/react-native/index.native.js.map +7 -0
- package/dist/{commonjs → types}/index.cdn.d.ts +1 -1
- package/dist/{module → types}/index.d.ts +1 -1
- package/dist/types/index.native.d.ts +1 -0
- package/dist/{commonjs → types}/types.d.ts +0 -0
- package/package.json +19 -36
- package/dist/commonjs/index.cdn.js +0 -6
- package/dist/commonjs/index.cdn.js.map +0 -1
- package/dist/commonjs/index.d.ts +0 -9
- package/dist/commonjs/index.js +0 -81
- package/dist/commonjs/index.js.map +0 -1
- package/dist/commonjs/types.js +0 -8
- package/dist/commonjs/types.js.map +0 -1
- package/dist/module/index.cdn.d.ts +0 -2
- package/dist/module/index.cdn.js +0 -3
- package/dist/module/index.cdn.js.map +0 -1
- package/dist/module/index.js +0 -78
- package/dist/module/index.js.map +0 -1
- package/dist/module/types.d.ts +0 -8
- package/dist/module/types.js +0 -5
- package/dist/module/types.js.map +0 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
|
|
33
|
+
# v1.0.0 (Thu Dec 09 2021)
|
|
34
|
+
|
|
35
|
+
#### 💥 Breaking Change
|
|
36
|
+
|
|
37
|
+
- Jerryliu sc 44386 migrate web3 related magic ext repos to magic (PART 1) [#248](https://github.com/magiclabs/magic-js/pull/248) ([@Ethella](https://github.com/Ethella))
|
|
38
|
+
|
|
39
|
+
#### Authors: 1
|
|
40
|
+
|
|
41
|
+
- Jerry Liu ([@Ethella](https://github.com/Ethella))
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018-present Magic Labs, Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var f=r=>e(r,"__esModule",{value:!0});var H=(r,n)=>{for(var a in n)e(r,a,{get:n[a],enumerable:!0})},T=(r,n,a,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of u(n))!d.call(r,i)&&(a||i!=="default")&&e(r,i,{get:()=>n[i],enumerable:!(t=l(n,i))||t.enumerable});return r};var x=(r=>(n,a)=>r&&r.get(n)||(a=T(f({}),n,1),r&&r.set(n,a),a))(typeof WeakMap!="undefined"?new WeakMap:0);var p=(r,n,a)=>new Promise((t,i)=>{var h=o=>{try{s(a.next(o))}catch(c){i(c)}},g=o=>{try{s(a.throw(o))}catch(c){i(c)}},s=o=>o.done?t(o.value):Promise.resolve(o.value).then(h,g);s((a=a.apply(r,n)).next())});var I={};H(I,{HarmonyExtension:()=>m});var y=require("@magic-sdk/commons");var m=class extends y.Extension.Internal{constructor(n){super();this.harmonyConfig=n;this.name="harmony";this.config={};this.config={rpcUrl:n.rpcUrl,chainType:"HARMONY",options:{chainId:n.chainId}}}sendTransaction(n){return p(this,null,function*(){return this.request(this.utils.createJsonRpcRequestPayload("hmy_sendTransaction",n))})}};module.exports=x(I);
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["import { Extension } from '@magic-sdk/commons';\nimport { HarmonyPayloadMethod, HarmonyConfig } from './types';\n\nexport class HarmonyExtension extends Extension.Internal<'harmony', any> {\n name = 'harmony' as const;\n config: any = {};\n\n constructor(public harmonyConfig: HarmonyConfig) {\n super();\n\n this.config = {\n rpcUrl: harmonyConfig.rpcUrl,\n chainType: 'HARMONY',\n options: {\n chainId: harmonyConfig.chainId,\n },\n };\n }\n\n public async sendTransaction(params: any) {\n return this.request(this.utils.createJsonRpcRequestPayload(HarmonyPayloadMethod.HarmonySignTransaction, params));\n }\n}\n"],
|
|
5
|
+
"mappings": "2tBAAA,6CAA0B,8BAGnB,mBAA+B,aAAU,QAAyB,CAIvE,YAAmB,EAA8B,CAC/C,QADiB,qBAHnB,UAAO,UACP,YAAc,GAKZ,KAAK,OAAS,CACZ,OAAQ,EAAc,OACtB,UAAW,UACX,QAAS,CACP,QAAS,EAAc,UAKhB,gBAAgB,EAAa,gCACxC,MAAO,MAAK,QAAQ,KAAK,MAAM,4BAA4B,sBAA6C",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/es/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var c=(t,r,a)=>new Promise((e,s)=>{var p=n=>{try{i(a.next(n))}catch(o){s(o)}},y=n=>{try{i(a.throw(n))}catch(o){s(o)}},i=n=>n.done?e(n.value):Promise.resolve(n.value).then(p,y);i((a=a.apply(t,r)).next())});import{Extension as m}from"@magic-sdk/commons";var h=class extends m.Internal{constructor(r){super();this.harmonyConfig=r;this.name="harmony";this.config={};this.config={rpcUrl:r.rpcUrl,chainType:"HARMONY",options:{chainId:r.chainId}}}sendTransaction(r){return c(this,null,function*(){return this.request(this.utils.createJsonRpcRequestPayload("hmy_sendTransaction",r))})}};export{h as HarmonyExtension};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["import { Extension } from '@magic-sdk/commons';\nimport { HarmonyPayloadMethod, HarmonyConfig } from './types';\n\nexport class HarmonyExtension extends Extension.Internal<'harmony', any> {\n name = 'harmony' as const;\n config: any = {};\n\n constructor(public harmonyConfig: HarmonyConfig) {\n super();\n\n this.config = {\n rpcUrl: harmonyConfig.rpcUrl,\n chainType: 'HARMONY',\n options: {\n chainId: harmonyConfig.chainId,\n },\n };\n }\n\n public async sendTransaction(params: any) {\n return this.request(this.utils.createJsonRpcRequestPayload(HarmonyPayloadMethod.HarmonySignTransaction, params));\n }\n}\n"],
|
|
5
|
+
"mappings": "6MAAA,+CAGO,mBAA+B,GAAU,QAAyB,CAIvE,YAAmB,EAA8B,CAC/C,QADiB,qBAHnB,UAAO,UACP,YAAc,GAKZ,KAAK,OAAS,CACZ,OAAQ,EAAc,OACtB,UAAW,UACX,QAAS,CACP,QAAS,EAAc,UAKhB,gBAAgB,EAAa,gCACxC,MAAO,MAAK,QAAQ,KAAK,MAAM,4BAA4B,sBAA6C",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/extension.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
var MagicHarmonyExtension=
|
|
1
|
+
var MagicHarmonyExtension=(()=>{var x=Object.create;var s=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,R=Object.prototype.hasOwnProperty;var m=r=>s(r,"__esModule",{value:!0});var U=(r,n)=>()=>(n||r((n={exports:{}}).exports,n),n.exports),b=(r,n)=>{for(var o in n)s(r,o,{get:n[o],enumerable:!0})},y=(r,n,o,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of T(n))!R.call(r,a)&&(o||a!=="default")&&s(r,a,{get:()=>n[a],enumerable:!(i=H(n,a))||i.enumerable});return r},q=(r,n)=>y(m(s(r!=null?x(I(r)):{},"default",!n&&r&&r.__esModule?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r),C=(r=>(n,o)=>r&&r.get(n)||(o=y(m({}),n,1),r&&r.set(n,o),o))(typeof WeakMap!="undefined"?new WeakMap:0);var g=(r,n,o)=>new Promise((i,a)=>{var f=t=>{try{e(o.next(t))}catch(c){a(c)}},d=t=>{try{e(o.throw(t))}catch(c){a(c)}},e=t=>t.done?i(t.value):Promise.resolve(t.value).then(f,d);e((o=o.apply(r,n)).next())});var l=U((A,h)=>{h.exports=Magic});var M={};b(M,{default:()=>E});var u=q(l());var p=class extends u.Extension.Internal{constructor(n){super();this.harmonyConfig=n;this.name="harmony";this.config={};this.config={rpcUrl:n.rpcUrl,chainType:"HARMONY",options:{chainId:n.chainId}}}sendTransaction(n){return g(this,null,function*(){return this.request(this.utils.createJsonRpcRequestPayload("hmy_sendTransaction",n))})}};var E=p;return C(M);})();
|
|
2
|
+
if (MagicHarmonyExtension && MagicHarmonyExtension.default != null) { MagicHarmonyExtension = Object.assign(MagicHarmonyExtension.default, MagicHarmonyExtension); delete MagicHarmonyExtension.default; }
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var f=r=>e(r,"__esModule",{value:!0});var H=(r,n)=>{for(var a in n)e(r,a,{get:n[a],enumerable:!0})},T=(r,n,a,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of u(n))!d.call(r,i)&&(a||i!=="default")&&e(r,i,{get:()=>n[i],enumerable:!(t=l(n,i))||t.enumerable});return r};var x=(r=>(n,a)=>r&&r.get(n)||(a=T(f({}),n,1),r&&r.set(n,a),a))(typeof WeakMap!="undefined"?new WeakMap:0);var p=(r,n,a)=>new Promise((t,i)=>{var h=o=>{try{s(a.next(o))}catch(c){i(c)}},g=o=>{try{s(a.throw(o))}catch(c){i(c)}},s=o=>o.done?t(o.value):Promise.resolve(o.value).then(h,g);s((a=a.apply(r,n)).next())});var I={};H(I,{HarmonyExtension:()=>m});var y=require("@magic-sdk/commons");var m=class extends y.Extension.Internal{constructor(n){super();this.harmonyConfig=n;this.name="harmony";this.config={};this.config={rpcUrl:n.rpcUrl,chainType:"HARMONY",options:{chainId:n.chainId}}}sendTransaction(n){return p(this,null,function*(){return this.request(this.utils.createJsonRpcRequestPayload("hmy_sendTransaction",n))})}};module.exports=x(I);
|
|
2
|
+
//# sourceMappingURL=index.native.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["import { Extension } from '@magic-sdk/commons';\nimport { HarmonyPayloadMethod, HarmonyConfig } from './types';\n\nexport class HarmonyExtension extends Extension.Internal<'harmony', any> {\n name = 'harmony' as const;\n config: any = {};\n\n constructor(public harmonyConfig: HarmonyConfig) {\n super();\n\n this.config = {\n rpcUrl: harmonyConfig.rpcUrl,\n chainType: 'HARMONY',\n options: {\n chainId: harmonyConfig.chainId,\n },\n };\n }\n\n public async sendTransaction(params: any) {\n return this.request(this.utils.createJsonRpcRequestPayload(HarmonyPayloadMethod.HarmonySignTransaction, params));\n }\n}\n"],
|
|
5
|
+
"mappings": "2tBAAA,6CAA0B,8BAGnB,mBAA+B,aAAU,QAAyB,CAIvE,YAAmB,EAA8B,CAC/C,QADiB,qBAHnB,UAAO,UACP,YAAc,GAKZ,KAAK,OAAS,CACZ,OAAQ,EAAc,OACtB,UAAW,UACX,QAAS,CACP,QAAS,EAAc,UAKhB,gBAAgB,EAAa,gCACxC,MAAO,MAAK,QAAQ,KAAK,MAAM,4BAA4B,sBAA6C",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { HarmonyExtension } from './index';
|
|
2
|
-
export
|
|
2
|
+
export default HarmonyExtension;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './index';
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,53 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magic-ext/harmony",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "magic harmony extension",
|
|
5
5
|
"author": "Magic <hello@magic.link> (https://magic.link/)",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "https://github.com/
|
|
9
|
+
"url": "https://github.com/magiclabs/magic-js"
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
12
|
"dist/**/*.js",
|
|
13
13
|
"dist/**/*.js.map",
|
|
14
14
|
"dist/**/*.d.ts"
|
|
15
15
|
],
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"module": "dist/
|
|
20
|
-
"types": "dist/
|
|
21
|
-
"
|
|
22
|
-
|
|
16
|
+
"target": "neutral",
|
|
17
|
+
"cdnGlobalName": "MagicHarmonyExtension",
|
|
18
|
+
"main": "./dist/cjs/index.js",
|
|
19
|
+
"module": "./dist/es/index.js",
|
|
20
|
+
"types": "./dist/types/index.d.ts",
|
|
21
|
+
"jsdelivr": "./dist/extension.js",
|
|
22
|
+
"react-native": "./dist/react-native/index.native.js",
|
|
23
|
+
"exports": {
|
|
24
|
+
"import": "./dist/es/index.mjs",
|
|
25
|
+
"require": "./dist/cjs/index.js"
|
|
23
26
|
},
|
|
24
|
-
"
|
|
25
|
-
"
|
|
27
|
+
"externals": {
|
|
28
|
+
"include": [
|
|
29
|
+
"@magic-sdk/commons"
|
|
30
|
+
]
|
|
26
31
|
},
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"ts-node/register",
|
|
30
|
-
"./test/setup.ts"
|
|
31
|
-
],
|
|
32
|
-
"files": [
|
|
33
|
-
"test/**/*.spec.ts"
|
|
34
|
-
],
|
|
35
|
-
"extensions": [
|
|
36
|
-
"ts"
|
|
37
|
-
],
|
|
38
|
-
"verbose": true
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@magic-sdk/commons": "^4.0.0"
|
|
39
34
|
},
|
|
40
|
-
"
|
|
41
|
-
"extends": "@istanbuljs/nyc-config-typescript",
|
|
42
|
-
"all": false,
|
|
43
|
-
"check-coverage": true,
|
|
44
|
-
"per-file": true,
|
|
45
|
-
"lines": 99,
|
|
46
|
-
"statements": 99,
|
|
47
|
-
"functions": 99,
|
|
48
|
-
"branches": 99,
|
|
49
|
-
"reporter": [
|
|
50
|
-
"lcov"
|
|
51
|
-
]
|
|
52
|
-
}
|
|
35
|
+
"gitHead": "d438b0b289fd4dd06a19bbb0f9f8d27bb067cea0"
|
|
53
36
|
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = void 0;
|
|
4
|
-
var index_1 = require("./index");
|
|
5
|
-
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return index_1.HarmonyExtension; } });
|
|
6
|
-
//# sourceMappingURL=index.cdn.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cdn.js","sourceRoot":"","sources":["../../src/index.cdn.ts"],"names":[],"mappings":";;;AAAA,iCAA2C;AAEd,wFAFpB,wBAAgB,OAEW"}
|
package/dist/commonjs/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Extension } from 'magic-sdk';
|
|
2
|
-
import { HarmonyConfig } from './types';
|
|
3
|
-
export declare class HarmonyExtension extends Extension.Internal<'harmony', any> {
|
|
4
|
-
harmonyConfig: HarmonyConfig;
|
|
5
|
-
name: "harmony";
|
|
6
|
-
config: any;
|
|
7
|
-
constructor(harmonyConfig: HarmonyConfig);
|
|
8
|
-
sendTransaction(params: any): Promise<any>;
|
|
9
|
-
}
|
package/dist/commonjs/index.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
16
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
17
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
18
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
19
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
20
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
21
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
25
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
26
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
27
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
28
|
-
function step(op) {
|
|
29
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
30
|
-
while (_) try {
|
|
31
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
32
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
33
|
-
switch (op[0]) {
|
|
34
|
-
case 0: case 1: t = op; break;
|
|
35
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
36
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
37
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
38
|
-
default:
|
|
39
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
40
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
41
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
42
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
43
|
-
if (t[2]) _.ops.pop();
|
|
44
|
-
_.trys.pop(); continue;
|
|
45
|
-
}
|
|
46
|
-
op = body.call(thisArg, _);
|
|
47
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
48
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52
|
-
exports.HarmonyExtension = void 0;
|
|
53
|
-
var magic_sdk_1 = require("magic-sdk");
|
|
54
|
-
var types_1 = require("./types");
|
|
55
|
-
var HarmonyExtension = /** @class */ (function (_super) {
|
|
56
|
-
__extends(HarmonyExtension, _super);
|
|
57
|
-
function HarmonyExtension(harmonyConfig) {
|
|
58
|
-
var _this = _super.call(this) || this;
|
|
59
|
-
_this.harmonyConfig = harmonyConfig;
|
|
60
|
-
_this.name = 'harmony';
|
|
61
|
-
_this.config = {};
|
|
62
|
-
_this.config = {
|
|
63
|
-
rpcUrl: harmonyConfig.rpcUrl,
|
|
64
|
-
chainType: 'HARMONY',
|
|
65
|
-
options: {
|
|
66
|
-
chainId: harmonyConfig.chainId
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
return _this;
|
|
70
|
-
}
|
|
71
|
-
HarmonyExtension.prototype.sendTransaction = function (params) {
|
|
72
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
73
|
-
return __generator(this, function (_a) {
|
|
74
|
-
return [2 /*return*/, this.request(this.utils.createJsonRpcRequestPayload(types_1.HarmonyPayloadMethod.HarmonySignTransaction, params))];
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
};
|
|
78
|
-
return HarmonyExtension;
|
|
79
|
-
}(magic_sdk_1.Extension.Internal));
|
|
80
|
-
exports.HarmonyExtension = HarmonyExtension;
|
|
81
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAsC;AACtC,iCAA8D;AAE9D;IAAsC,oCAAkC;IAItE,0BAAmB,aAA4B;QAA/C,YACE,iBAAO,SASR;QAVkB,mBAAa,GAAb,aAAa,CAAe;QAH/C,UAAI,GAAG,SAAkB,CAAC;QAC1B,YAAM,GAAQ,EAAE,CAAC;QAKf,KAAI,CAAC,MAAM,GAAG;YACZ,MAAM,EAAE,aAAa,CAAC,MAAM;YAC5B,SAAS,EAAE,SAAS;YACpB,OAAO,EAAE;gBACP,OAAO,EAAE,aAAa,CAAC,OAAO;aAC/B;SACF,CAAA;;IACH,CAAC;IAEY,0CAAe,GAA5B,UAA6B,MAAW;;;gBACtC,sBAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,2BAA2B,CAAC,4BAAoB,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAC,EAAC;;;KAClH;IAEH,uBAAC;AAAD,CAAC,AApBD,CAAsC,qBAAS,CAAC,QAAQ,GAoBvD;AApBY,4CAAgB"}
|
package/dist/commonjs/types.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HarmonyPayloadMethod = void 0;
|
|
4
|
-
var HarmonyPayloadMethod;
|
|
5
|
-
(function (HarmonyPayloadMethod) {
|
|
6
|
-
HarmonyPayloadMethod["HarmonySignTransaction"] = "hmy_sendTransaction";
|
|
7
|
-
})(HarmonyPayloadMethod = exports.HarmonyPayloadMethod || (exports.HarmonyPayloadMethod = {}));
|
|
8
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;AAAA,IAAY,oBAEX;AAFD,WAAY,oBAAoB;IAC5B,sEAA8C,CAAA;AAClD,CAAC,EAFW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAE/B"}
|
package/dist/module/index.cdn.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cdn.js","sourceRoot":"","sources":["../../src/index.cdn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,EAAE,gBAAgB,IAAI,OAAO,EAAE,CAAC"}
|
package/dist/module/index.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
extendStatics(d, b);
|
|
10
|
-
function __() { this.constructor = d; }
|
|
11
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
-
};
|
|
13
|
-
})();
|
|
14
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
24
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
25
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
26
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
27
|
-
function step(op) {
|
|
28
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
29
|
-
while (_) try {
|
|
30
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
31
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
32
|
-
switch (op[0]) {
|
|
33
|
-
case 0: case 1: t = op; break;
|
|
34
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
35
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
36
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
37
|
-
default:
|
|
38
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
39
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
40
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
41
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
42
|
-
if (t[2]) _.ops.pop();
|
|
43
|
-
_.trys.pop(); continue;
|
|
44
|
-
}
|
|
45
|
-
op = body.call(thisArg, _);
|
|
46
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
47
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
import { Extension } from 'magic-sdk';
|
|
51
|
-
import { HarmonyPayloadMethod } from './types';
|
|
52
|
-
var HarmonyExtension = /** @class */ (function (_super) {
|
|
53
|
-
__extends(HarmonyExtension, _super);
|
|
54
|
-
function HarmonyExtension(harmonyConfig) {
|
|
55
|
-
var _this = _super.call(this) || this;
|
|
56
|
-
_this.harmonyConfig = harmonyConfig;
|
|
57
|
-
_this.name = 'harmony';
|
|
58
|
-
_this.config = {};
|
|
59
|
-
_this.config = {
|
|
60
|
-
rpcUrl: harmonyConfig.rpcUrl,
|
|
61
|
-
chainType: 'HARMONY',
|
|
62
|
-
options: {
|
|
63
|
-
chainId: harmonyConfig.chainId
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
return _this;
|
|
67
|
-
}
|
|
68
|
-
HarmonyExtension.prototype.sendTransaction = function (params) {
|
|
69
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
70
|
-
return __generator(this, function (_a) {
|
|
71
|
-
return [2 /*return*/, this.request(this.utils.createJsonRpcRequestPayload(HarmonyPayloadMethod.HarmonySignTransaction, params))];
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
};
|
|
75
|
-
return HarmonyExtension;
|
|
76
|
-
}(Extension.Internal));
|
|
77
|
-
export { HarmonyExtension };
|
|
78
|
-
//# sourceMappingURL=index.js.map
|
package/dist/module/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,oBAAoB,EAAiB,MAAM,SAAS,CAAC;AAE9D;IAAsC,oCAAkC;IAItE,0BAAmB,aAA4B;QAA/C,YACE,iBAAO,SASR;QAVkB,mBAAa,GAAb,aAAa,CAAe;QAH/C,UAAI,GAAG,SAAkB,CAAC;QAC1B,YAAM,GAAQ,EAAE,CAAC;QAKf,KAAI,CAAC,MAAM,GAAG;YACZ,MAAM,EAAE,aAAa,CAAC,MAAM;YAC5B,SAAS,EAAE,SAAS;YACpB,OAAO,EAAE;gBACP,OAAO,EAAE,aAAa,CAAC,OAAO;aAC/B;SACF,CAAA;;IACH,CAAC;IAEY,0CAAe,GAA5B,UAA6B,MAAW;;;gBACtC,sBAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,2BAA2B,CAAC,oBAAoB,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAC,EAAC;;;KAClH;IAEH,uBAAC;AAAD,CAAC,AApBD,CAAsC,SAAS,CAAC,QAAQ,GAoBvD"}
|
package/dist/module/types.d.ts
DELETED
package/dist/module/types.js
DELETED
package/dist/module/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,oBAEX;AAFD,WAAY,oBAAoB;IAC5B,sEAA8C,CAAA;AAClD,CAAC,EAFW,oBAAoB,KAApB,oBAAoB,QAE/B"}
|