hermes-swap 0.0.10 → 0.0.11
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/dist/cjs/index.d.ts +9 -0
- package/dist/cjs/index.js +52 -0
- package/dist/cjs/types.d.ts +24 -0
- package/dist/cjs/types.js +17 -0
- package/dist/esm/index.js +45 -1
- package/dist/esm/types.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IExpectParams, ISwapParams, IBridgeParams, ISwapAndBridgeParams, IReceipt } from './types';
|
|
2
|
+
declare class Hermes {
|
|
3
|
+
constructor();
|
|
4
|
+
expect(params: IExpectParams): Promise<bigint>;
|
|
5
|
+
swap(params: ISwapParams): Promise<IReceipt>;
|
|
6
|
+
bridge(params: IBridgeParams): Promise<IReceipt>;
|
|
7
|
+
swapAndBridge(params: ISwapAndBridgeParams): Promise<IReceipt>;
|
|
8
|
+
}
|
|
9
|
+
export default Hermes;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/index.ts
|
|
20
|
+
var src_exports = {};
|
|
21
|
+
__export(src_exports, {
|
|
22
|
+
default: () => src_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(src_exports);
|
|
25
|
+
var Hermes = class {
|
|
26
|
+
constructor() {
|
|
27
|
+
}
|
|
28
|
+
expect(params) {
|
|
29
|
+
return Promise.resolve(BigInt(0));
|
|
30
|
+
}
|
|
31
|
+
swap(params) {
|
|
32
|
+
const receipt = {
|
|
33
|
+
fromToken: params.fromToken,
|
|
34
|
+
toToken: params.toToken,
|
|
35
|
+
amount: params.amount
|
|
36
|
+
};
|
|
37
|
+
return Promise.resolve(receipt);
|
|
38
|
+
}
|
|
39
|
+
bridge(params) {
|
|
40
|
+
const receipt = {
|
|
41
|
+
fromToken: params.fromToken,
|
|
42
|
+
toToken: params.toToken,
|
|
43
|
+
amount: params.amount
|
|
44
|
+
};
|
|
45
|
+
return Promise.resolve(receipt);
|
|
46
|
+
}
|
|
47
|
+
swapAndBridge(params) {
|
|
48
|
+
const receipt = {};
|
|
49
|
+
return Promise.resolve(receipt);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
var src_default = Hermes;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface IExpectParams {
|
|
2
|
+
fromToken: string;
|
|
3
|
+
toToken: string;
|
|
4
|
+
amount: bigint;
|
|
5
|
+
}
|
|
6
|
+
export interface ISwapParams {
|
|
7
|
+
fromToken: string;
|
|
8
|
+
toToken: string;
|
|
9
|
+
amount: bigint;
|
|
10
|
+
}
|
|
11
|
+
export interface IBridgeParams {
|
|
12
|
+
fromToken: string;
|
|
13
|
+
toToken: string;
|
|
14
|
+
amount: bigint;
|
|
15
|
+
}
|
|
16
|
+
export interface ISwapAndBridgeParams {
|
|
17
|
+
swapParams: ISwapParams;
|
|
18
|
+
bridgeParams: IBridgeParams;
|
|
19
|
+
}
|
|
20
|
+
export interface IReceipt {
|
|
21
|
+
fromToken?: string;
|
|
22
|
+
toToken?: string;
|
|
23
|
+
amount?: bigint;
|
|
24
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
|
|
15
|
+
// src/types.ts
|
|
16
|
+
var types_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(types_exports);
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1,45 @@
|
|
|
1
|
-
function _typeof(
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
4
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
var Hermes = /*#__PURE__*/function () {
|
|
8
|
+
function Hermes() {
|
|
9
|
+
_classCallCheck(this, Hermes);
|
|
10
|
+
}
|
|
11
|
+
_createClass(Hermes, [{
|
|
12
|
+
key: "expect",
|
|
13
|
+
value: function expect(params) {
|
|
14
|
+
return Promise.resolve(BigInt(0));
|
|
15
|
+
}
|
|
16
|
+
}, {
|
|
17
|
+
key: "swap",
|
|
18
|
+
value: function swap(params) {
|
|
19
|
+
var receipt = {
|
|
20
|
+
fromToken: params.fromToken,
|
|
21
|
+
toToken: params.toToken,
|
|
22
|
+
amount: params.amount
|
|
23
|
+
};
|
|
24
|
+
return Promise.resolve(receipt);
|
|
25
|
+
}
|
|
26
|
+
}, {
|
|
27
|
+
key: "bridge",
|
|
28
|
+
value: function bridge(params) {
|
|
29
|
+
var receipt = {
|
|
30
|
+
fromToken: params.fromToken,
|
|
31
|
+
toToken: params.toToken,
|
|
32
|
+
amount: params.amount
|
|
33
|
+
};
|
|
34
|
+
return Promise.resolve(receipt);
|
|
35
|
+
}
|
|
36
|
+
}, {
|
|
37
|
+
key: "swapAndBridge",
|
|
38
|
+
value: function swapAndBridge(params) {
|
|
39
|
+
var receipt = {};
|
|
40
|
+
return Promise.resolve(receipt);
|
|
41
|
+
}
|
|
42
|
+
}]);
|
|
43
|
+
return Hermes;
|
|
44
|
+
}();
|
|
45
|
+
export default Hermes;
|
package/dist/esm/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{};
|
|
1
|
+
export {};
|