@magic-ext/harmony 0.1.0 → 1.0.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 ADDED
@@ -0,0 +1,12 @@
1
+ # v1.0.0 (Thu Dec 09 2021)
2
+
3
+ #### 💥 Breaking Change
4
+
5
+ - 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))
6
+
7
+ #### Authors: 1
8
+
9
+ - Jerry Liu ([@Ethella](https://github.com/Ethella))
10
+
11
+ ---
12
+
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 n,r=require("@magic-sdk/commons");function t(n,r){return(t=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n})(n,r)}!function(n){n.HarmonySignTransaction="hmy_sendTransaction"}(n||(n={})),exports.HarmonyExtension=function(r){var o,e;function i(n){var t;return(t=r.call(this)||this).harmonyConfig=void 0,t.name="harmony",t.config={},t.harmonyConfig=n,t.config={rpcUrl:n.rpcUrl,chainType:"HARMONY",options:{chainId:n.chainId}},t}return e=r,(o=i).prototype=Object.create(e.prototype),o.prototype.constructor=o,t(o,e),i.prototype.sendTransaction=function(r){try{return Promise.resolve(this.request(this.utils.createJsonRpcRequestPayload(n.HarmonySignTransaction,r)))}catch(n){return Promise.reject(n)}},i}(r.Extension.Internal);
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/types.ts","../../src/index.ts"],"sourcesContent":["export enum HarmonyPayloadMethod {\n HarmonySignTransaction = 'hmy_sendTransaction',\n}\n\nexport interface HarmonyConfig {\n rpcUrl: string;\n chainId: string;\n chainType: string;\n}\n","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"],"names":["HarmonyPayloadMethod","harmonyConfig","_this","name","config","rpcUrl","chainType","options","chainId","sendTransaction","params","this","request","utils","createJsonRpcRequestPayload","HarmonySignTransaction","Extension","Internal"],"mappings":"IAAYA,+HAAZ,SAAYA,GACVA,+CADF,CAAYA,IAAAA,oDCOV,WAAmBC,gBACjBC,sBADiBD,uBAHnBE,KAAO,YACPC,OAAc,GAEKF,gBAAAD,EAGjBC,EAAKE,OAAS,CACZC,OAAQJ,EAAcI,OACtBC,UAAW,UACXC,QAAS,CACPC,QAASP,EAAcO,+GAKhBC,yBAAgBC,OAC3B,uBAAOC,KAAKC,QAALD,KAAkBE,MAAMC,4BAA4Bd,EAAqBe,uBAAwBL,KAjB5G,uCAAsCM,YAAUC"}
@@ -0,0 +1,2 @@
1
+ import{Extension as n}from"@magic-sdk/commons";function r(n,t){return(r=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n})(n,t)}var t;!function(n){n.HarmonySignTransaction="hmy_sendTransaction"}(t||(t={}));var o=function(n){var o,e;function c(r){var t;return(t=n.call(this)||this).harmonyConfig=void 0,t.name="harmony",t.config={},t.harmonyConfig=r,t.config={rpcUrl:r.rpcUrl,chainType:"HARMONY",options:{chainId:r.chainId}},t}return e=n,(o=c).prototype=Object.create(e.prototype),o.prototype.constructor=o,r(o,e),c.prototype.sendTransaction=function(n){try{return Promise.resolve(this.request(this.utils.createJsonRpcRequestPayload(t.HarmonySignTransaction,n)))}catch(n){return Promise.reject(n)}},c}(n.Internal);export{o as HarmonyExtension};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/types.ts","../../src/index.ts"],"sourcesContent":["export enum HarmonyPayloadMethod {\n HarmonySignTransaction = 'hmy_sendTransaction',\n}\n\nexport interface HarmonyConfig {\n rpcUrl: string;\n chainId: string;\n chainType: string;\n}\n","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"],"names":["HarmonyPayloadMethod","HarmonyExtension","harmonyConfig","_this","name","config","rpcUrl","chainType","options","chainId","sendTransaction","params","this","request","utils","createJsonRpcRequestPayload","HarmonySignTransaction","Extension","Internal"],"mappings":"+IAAYA,GAAZ,SAAYA,GACVA,+CADF,CAAYA,IAAAA,OCGCC,IAAAA,sBAIX,WAAmBC,gBACjBC,sBADiBD,uBAHnBE,KAAO,YACPC,OAAc,GAEKF,gBAAAD,EAGjBC,EAAKE,OAAS,CACZC,OAAQJ,EAAcI,OACtBC,UAAW,UACXC,QAAS,CACPC,QAASP,EAAcO,+GAKhBC,yBAAgBC,OAC3B,uBAAOC,KAAKC,QAALD,KAAkBE,MAAMC,4BAA4Bf,EAAqBgB,uBAAwBL,KAjB5G,uCAAsCM,EAAUC"}
package/dist/extension.js CHANGED
@@ -1 +1 @@
1
- var MagicHarmonyExtension=function(n){var r;return function(n){n.HarmonySignTransaction="hmy_sendTransaction"}(r||(r={})),function(n){var t,o;function e(r){var t;return(t=n.call(this)||this).harmonyConfig=r,t.name="harmony",t.config={},t.config={rpcUrl:r.rpcUrl,chainType:"HARMONY",options:{chainId:r.chainId}},t}return o=n,(t=e).prototype=Object.create(o.prototype),t.prototype.constructor=t,t.__proto__=o,e.prototype.sendTransaction=function(n){try{return Promise.resolve(this.request(this.utils.createJsonRpcRequestPayload(r.HarmonySignTransaction,n)))}catch(n){return Promise.reject(n)}},e}(n.Extension.Internal)}(Magic);
1
+ var MagicHarmonyExtension=function(n){function t(n,r){return(t=Object.setPrototypeOf||function(n,t){return n.__proto__=t,n})(n,r)}var r;return function(n){n.HarmonySignTransaction="hmy_sendTransaction"}(r||(r={})),function(n){var o,e;function i(t){var r;return(r=n.call(this)||this).harmonyConfig=void 0,r.name="harmony",r.config={},r.harmonyConfig=t,r.config={rpcUrl:t.rpcUrl,chainType:"HARMONY",options:{chainId:t.chainId}},r}return e=n,(o=i).prototype=Object.create(e.prototype),o.prototype.constructor=o,t(o,e),i.prototype.sendTransaction=function(n){try{return Promise.resolve(this.request(this.utils.createJsonRpcRequestPayload(r.HarmonySignTransaction,n)))}catch(n){return Promise.reject(n)}},i}(n.Extension.Internal)}(Magic);
@@ -0,0 +1,2 @@
1
+ var n,r=require("@magic-sdk/commons");function t(n,r){return(t=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n})(n,r)}!function(n){n.HarmonySignTransaction="hmy_sendTransaction"}(n||(n={})),exports.HarmonyExtension=function(r){var o,e;function i(n){var t;return(t=r.call(this)||this).harmonyConfig=void 0,t.name="harmony",t.config={},t.harmonyConfig=n,t.config={rpcUrl:n.rpcUrl,chainType:"HARMONY",options:{chainId:n.chainId}},t}return e=r,(o=i).prototype=Object.create(e.prototype),o.prototype.constructor=o,t(o,e),i.prototype.sendTransaction=function(r){try{return Promise.resolve(this.request(this.utils.createJsonRpcRequestPayload(n.HarmonySignTransaction,r)))}catch(n){return Promise.reject(n)}},i}(r.Extension.Internal);
2
+ //# sourceMappingURL=index.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.native.js","sources":["../../src/types.ts","../../src/index.ts"],"sourcesContent":["export enum HarmonyPayloadMethod {\n HarmonySignTransaction = 'hmy_sendTransaction',\n}\n\nexport interface HarmonyConfig {\n rpcUrl: string;\n chainId: string;\n chainType: string;\n}\n","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"],"names":["HarmonyPayloadMethod","harmonyConfig","_this","name","config","rpcUrl","chainType","options","chainId","sendTransaction","params","this","request","utils","createJsonRpcRequestPayload","HarmonySignTransaction","Extension","Internal"],"mappings":"IAAYA,+HAAZ,SAAYA,GACVA,+CADF,CAAYA,IAAAA,oDCOV,WAAmBC,gBACjBC,sBADiBD,uBAHnBE,KAAO,YACPC,OAAc,GAEKF,gBAAAD,EAGjBC,EAAKE,OAAS,CACZC,OAAQJ,EAAcI,OACtBC,UAAW,UACXC,QAAS,CACPC,QAASP,EAAcO,+GAKhBC,yBAAgBC,OAC3B,uBAAOC,KAAKC,QAALD,KAAkBE,MAAMC,4BAA4Bd,EAAqBe,uBAAwBL,KAjB5G,uCAAsCM,YAAUC"}
@@ -1,2 +1,2 @@
1
- import { HarmonyExtension } from './index';
2
- export { HarmonyExtension as default };
1
+ import { HarmonyExtension } from './index';
2
+ export { HarmonyExtension as default };
@@ -1,9 +1,9 @@
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
- }
1
+ import { Extension } from '@magic-sdk/commons';
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
+ }
@@ -1,8 +1,8 @@
1
- export declare enum HarmonyPayloadMethod {
2
- HarmonySignTransaction = "hmy_sendTransaction"
3
- }
4
- export interface HarmonyConfig {
5
- rpcUrl: string;
6
- chainId: string;
7
- chainType: string;
8
- }
1
+ export declare enum HarmonyPayloadMethod {
2
+ HarmonySignTransaction = "hmy_sendTransaction"
3
+ }
4
+ export interface HarmonyConfig {
5
+ rpcUrl: string;
6
+ chainId: string;
7
+ chainType: string;
8
+ }
package/package.json CHANGED
@@ -1,53 +1,36 @@
1
1
  {
2
2
  "name": "@magic-ext/harmony",
3
- "version": "0.1.0",
3
+ "version": "1.0.0",
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/fortmatic/magic-sdk-extensions"
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
- "umdGlobal": "MagicHarmonyExtension",
17
- "main": "dist/commonjs/index.js",
18
- "umd:main": "dist/extension.js",
19
- "module": "dist/module/index.js",
20
- "types": "dist/commonjs/index.d.ts",
21
- "scripts": {
22
- "precommit": "lint-staged"
16
+ "target": "web",
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/modern/index.mjs",
25
+ "require": "./dist/cjs/index.js"
23
26
  },
24
- "devDependencies": {
25
- "magic-sdk": "^2.6.0"
27
+ "externals": {
28
+ "include": [
29
+ "@magic-sdk/commons"
30
+ ]
26
31
  },
27
- "ava": {
28
- "require": [
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": "^2.2.1"
39
34
  },
40
- "nyc": {
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": "d309ebe9694341a39001f233e2e426839de4713d"
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"}
@@ -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
- }
@@ -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"}
@@ -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"}
@@ -1,2 +0,0 @@
1
- import { HarmonyExtension } from './index';
2
- export { HarmonyExtension as default };
@@ -1,3 +0,0 @@
1
- import { HarmonyExtension } from './index';
2
- export { HarmonyExtension as default };
3
- //# sourceMappingURL=index.cdn.js.map
@@ -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"}
@@ -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
@@ -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"}
@@ -1,8 +0,0 @@
1
- export declare enum HarmonyPayloadMethod {
2
- HarmonySignTransaction = "hmy_sendTransaction"
3
- }
4
- export interface HarmonyConfig {
5
- rpcUrl: string;
6
- chainId: string;
7
- chainType: string;
8
- }
@@ -1,5 +0,0 @@
1
- export var HarmonyPayloadMethod;
2
- (function (HarmonyPayloadMethod) {
3
- HarmonyPayloadMethod["HarmonySignTransaction"] = "hmy_sendTransaction";
4
- })(HarmonyPayloadMethod || (HarmonyPayloadMethod = {}));
5
- //# sourceMappingURL=types.js.map
@@ -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"}