@injectivelabs/wallet-cosmos-strategy 1.14.56 → 1.15.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 +7 -7
- package/dist/cjs/index.d.ts +0 -2
- package/dist/cjs/index.d.ts.map +0 -1
- package/dist/cjs/index.js +0 -18
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/package.json +0 -3
- package/dist/cjs/strategy/WalletStrategy.d.ts +0 -9
- package/dist/cjs/strategy/WalletStrategy.d.ts.map +0 -1
- package/dist/cjs/strategy/WalletStrategy.js +0 -52
- package/dist/cjs/strategy/WalletStrategy.js.map +0 -1
- package/dist/cjs/strategy/index.d.ts +0 -2
- package/dist/cjs/strategy/index.d.ts.map +0 -1
- package/dist/cjs/strategy/index.js +0 -18
- package/dist/cjs/strategy/index.js.map +0 -1
- package/dist/cjs/strategy/strategies/cosmos.d.ts +0 -15
- package/dist/cjs/strategy/strategies/cosmos.d.ts.map +0 -1
- package/dist/cjs/strategy/strategies/cosmos.js +0 -11
- package/dist/cjs/strategy/strategies/cosmos.js.map +0 -1
- package/dist/cjs/strategy/strategies/cosmostation.d.ts +0 -15
- package/dist/cjs/strategy/strategies/cosmostation.d.ts.map +0 -1
- package/dist/cjs/strategy/strategies/cosmostation.js +0 -11
- package/dist/cjs/strategy/strategies/cosmostation.js.map +0 -1
- package/dist/cjs/strategy/strategies/index.d.ts +0 -3
- package/dist/cjs/strategy/strategies/index.d.ts.map +0 -1
- package/dist/cjs/strategy/strategies/index.js +0 -19
- package/dist/cjs/strategy/strategies/index.js.map +0 -1
- package/dist/cjs/strategy/types.d.ts +0 -7
- package/dist/cjs/strategy/types.d.ts.map +0 -1
- package/dist/cjs/strategy/types.js +0 -3
- package/dist/cjs/strategy/types.js.map +0 -1
- package/dist/esm/index.d.ts +0 -2
- package/dist/esm/index.d.ts.map +0 -1
- package/dist/esm/index.js +0 -2
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/package.json +0 -3
- package/dist/esm/strategy/WalletStrategy.d.ts +0 -9
- package/dist/esm/strategy/WalletStrategy.d.ts.map +0 -1
- package/dist/esm/strategy/WalletStrategy.js +0 -47
- package/dist/esm/strategy/WalletStrategy.js.map +0 -1
- package/dist/esm/strategy/index.d.ts +0 -2
- package/dist/esm/strategy/index.d.ts.map +0 -1
- package/dist/esm/strategy/index.js +0 -2
- package/dist/esm/strategy/index.js.map +0 -1
- package/dist/esm/strategy/strategies/cosmos.d.ts +0 -15
- package/dist/esm/strategy/strategies/cosmos.d.ts.map +0 -1
- package/dist/esm/strategy/strategies/cosmos.js +0 -7
- package/dist/esm/strategy/strategies/cosmos.js.map +0 -1
- package/dist/esm/strategy/strategies/cosmostation.d.ts +0 -15
- package/dist/esm/strategy/strategies/cosmostation.d.ts.map +0 -1
- package/dist/esm/strategy/strategies/cosmostation.js +0 -7
- package/dist/esm/strategy/strategies/cosmostation.js.map +0 -1
- package/dist/esm/strategy/strategies/index.d.ts +0 -3
- package/dist/esm/strategy/strategies/index.d.ts.map +0 -1
- package/dist/esm/strategy/strategies/index.js +0 -3
- package/dist/esm/strategy/strategies/index.js.map +0 -1
- package/dist/esm/strategy/types.d.ts +0 -7
- package/dist/esm/strategy/types.d.ts.map +0 -1
- package/dist/esm/strategy/types.js +0 -2
- package/dist/esm/strategy/types.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@injectivelabs/wallet-cosmos-strategy",
|
|
3
3
|
"description": "Wallet Cosmos Strategy with instantiated wallets",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.15.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"author": {
|
|
@@ -56,14 +56,14 @@
|
|
|
56
56
|
"start": "node dist/index.js"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@injectivelabs/ts-types": "^1.
|
|
60
|
-
"@injectivelabs/wallet-base": "^1.
|
|
61
|
-
"@injectivelabs/wallet-core": "^1.
|
|
62
|
-
"@injectivelabs/wallet-cosmos": "^1.
|
|
63
|
-
"@injectivelabs/wallet-cosmostation": "^1.
|
|
59
|
+
"@injectivelabs/ts-types": "^1.15.0",
|
|
60
|
+
"@injectivelabs/wallet-base": "^1.15.0",
|
|
61
|
+
"@injectivelabs/wallet-core": "^1.15.0",
|
|
62
|
+
"@injectivelabs/wallet-cosmos": "^1.15.0",
|
|
63
|
+
"@injectivelabs/wallet-cosmostation": "^1.15.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"shx": "^0.3.3"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "acae5b41a4c8a0ac4f137cce434b9db81800a1c5"
|
|
69
69
|
}
|
package/dist/cjs/index.d.ts
DELETED
package/dist/cjs/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA"}
|
package/dist/cjs/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./strategy/index.js"), exports);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAmC"}
|
package/dist/cjs/package.json
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Wallet } from '@injectivelabs/wallet-base';
|
|
2
|
-
import { BaseWalletStrategy } from '@injectivelabs/wallet-core';
|
|
3
|
-
import { CosmosWalletStrategyArguments } from './types.js';
|
|
4
|
-
export declare class BaseCosmosWalletStrategy extends BaseWalletStrategy {
|
|
5
|
-
constructor(args: CosmosWalletStrategyArguments);
|
|
6
|
-
setWallet(wallet: Wallet): void;
|
|
7
|
-
}
|
|
8
|
-
export declare const createCosmosStrategyFactory: (args: CosmosWalletStrategyArguments) => BaseCosmosWalletStrategy;
|
|
9
|
-
//# sourceMappingURL=WalletStrategy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WalletStrategy.d.ts","sourceRoot":"","sources":["../../../src/strategy/WalletStrategy.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EAKP,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAE/D,OAAO,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAA;AA6C1D,qBAAa,wBAAyB,SAAQ,kBAAkB;gBAClD,IAAI,EAAE,6BAA6B;IASxC,SAAS,CAAC,MAAM,EAAE,MAAM;CAGhC;AAED,eAAO,MAAM,2BAA2B,GACtC,MAAM,6BAA6B,6BAGpC,CAAA"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createCosmosStrategyFactory = exports.BaseCosmosWalletStrategy = void 0;
|
|
4
|
-
const wallet_base_1 = require("@injectivelabs/wallet-base");
|
|
5
|
-
const wallet_core_1 = require("@injectivelabs/wallet-core");
|
|
6
|
-
const index_js_1 = require("./strategies/index.js");
|
|
7
|
-
const createStrategy = ({ args, wallet, }) => {
|
|
8
|
-
switch (wallet) {
|
|
9
|
-
case wallet_base_1.Wallet.Keplr:
|
|
10
|
-
return new index_js_1.CosmosWalletStrategy({ ...args, wallet: wallet_base_1.Wallet.Keplr });
|
|
11
|
-
case wallet_base_1.Wallet.Cosmostation:
|
|
12
|
-
return new index_js_1.CosmostationWalletStrategy({
|
|
13
|
-
...args,
|
|
14
|
-
wallet: wallet_base_1.Wallet.Cosmostation,
|
|
15
|
-
});
|
|
16
|
-
case wallet_base_1.Wallet.Leap:
|
|
17
|
-
return new index_js_1.CosmosWalletStrategy({ ...args, wallet: wallet_base_1.Wallet.Leap });
|
|
18
|
-
case wallet_base_1.Wallet.Ninji:
|
|
19
|
-
return new index_js_1.CosmosWalletStrategy({ ...args, wallet: wallet_base_1.Wallet.Ninji });
|
|
20
|
-
case wallet_base_1.Wallet.OWallet:
|
|
21
|
-
return new index_js_1.CosmosWalletStrategy({ ...args, wallet: wallet_base_1.Wallet.OWallet });
|
|
22
|
-
default:
|
|
23
|
-
return undefined;
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
const createAllStrategies = (args) => {
|
|
27
|
-
return Object.values(wallet_base_1.Wallet).reduce((strategies, wallet) => {
|
|
28
|
-
if (strategies[wallet]) {
|
|
29
|
-
return strategies;
|
|
30
|
-
}
|
|
31
|
-
strategies[wallet] = createStrategy({ args, wallet: wallet });
|
|
32
|
-
return strategies;
|
|
33
|
-
}, {});
|
|
34
|
-
};
|
|
35
|
-
class BaseCosmosWalletStrategy extends wallet_core_1.BaseWalletStrategy {
|
|
36
|
-
constructor(args) {
|
|
37
|
-
const strategies = createAllStrategies(args);
|
|
38
|
-
super({
|
|
39
|
-
...args,
|
|
40
|
-
strategies,
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
setWallet(wallet) {
|
|
44
|
-
this.wallet = (0, wallet_base_1.isCosmosWallet)(wallet) ? wallet : wallet_base_1.Wallet.Keplr;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
exports.BaseCosmosWalletStrategy = BaseCosmosWalletStrategy;
|
|
48
|
-
const createCosmosStrategyFactory = (args) => {
|
|
49
|
-
return new BaseCosmosWalletStrategy(args);
|
|
50
|
-
};
|
|
51
|
-
exports.createCosmosStrategyFactory = createCosmosStrategyFactory;
|
|
52
|
-
//# sourceMappingURL=WalletStrategy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WalletStrategy.js","sourceRoot":"","sources":["../../../src/strategy/WalletStrategy.ts"],"names":[],"mappings":";;;AAAA,4DAMmC;AACnC,4DAA+D;AAC/D,oDAAwF;AAGxF,MAAM,cAAc,GAAG,CAAC,EACtB,IAAI,EACJ,MAAM,GAIP,EAAsC,EAAE;IACvC,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,oBAAM,CAAC,KAAK;YACf,OAAO,IAAI,+BAAoB,CAAC,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,oBAAM,CAAC,KAAK,EAAE,CAAC,CAAA;QACpE,KAAK,oBAAM,CAAC,YAAY;YACtB,OAAO,IAAI,qCAA0B,CAAC;gBACpC,GAAG,IAAI;gBACP,MAAM,EAAE,oBAAM,CAAC,YAAY;aAC5B,CAAC,CAAA;QACJ,KAAK,oBAAM,CAAC,IAAI;YACd,OAAO,IAAI,+BAAoB,CAAC,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,oBAAM,CAAC,IAAI,EAAE,CAAC,CAAA;QACnE,KAAK,oBAAM,CAAC,KAAK;YACf,OAAO,IAAI,+BAAoB,CA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-1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/strategy/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./WalletStrategy.js"), exports);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/strategy/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAmC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { CosmosWalletStrategy as BaseCosmosWalletStrategy } from '@injectivelabs/wallet-cosmos';
|
|
2
|
-
import { CosmosChainId } from '@injectivelabs/ts-types';
|
|
3
|
-
import { Wallet } from '@injectivelabs/wallet-base';
|
|
4
|
-
export declare class CosmosWalletStrategy extends BaseCosmosWalletStrategy {
|
|
5
|
-
constructor(args: {
|
|
6
|
-
chainId: CosmosChainId;
|
|
7
|
-
endpoints?: {
|
|
8
|
-
rest: string;
|
|
9
|
-
rpc: string;
|
|
10
|
-
};
|
|
11
|
-
} & {
|
|
12
|
-
wallet: Wallet;
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=cosmos.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cosmos.d.ts","sourceRoot":"","sources":["../../../../src/strategy/strategies/cosmos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,IAAI,wBAAwB,EAAE,MAAM,8BAA8B,CAAA;AAC/F,OAAO,EAAW,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAEnD,qBAAa,oBAAqB,SAAQ,wBAAwB;gBAE9D,IAAI,EAAE;QACJ,OAAO,EAAE,aAAa,CAAA;QACtB,SAAS,CAAC,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE,CAAA;KAC1C,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE;CAUzB"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CosmosWalletStrategy = void 0;
|
|
4
|
-
const wallet_cosmos_1 = require("@injectivelabs/wallet-cosmos");
|
|
5
|
-
class CosmosWalletStrategy extends wallet_cosmos_1.CosmosWalletStrategy {
|
|
6
|
-
constructor(args) {
|
|
7
|
-
super(args);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
exports.CosmosWalletStrategy = CosmosWalletStrategy;
|
|
11
|
-
//# sourceMappingURL=cosmos.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cosmos.js","sourceRoot":"","sources":["../../../../src/strategy/strategies/cosmos.ts"],"names":[],"mappings":";;;AAAA,gEAA+F;AAI/F,MAAa,oBAAqB,SAAQ,oCAAwB;IAChE,YACE,IAGsB;QAEtB,KAAK,CACH,IAIC,CACF,CAAA;IACH,CAAC;CACF;AAfD,oDAeC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { CosmostationWalletStrategy as BaseCosmostationWalletStrategy } from '@injectivelabs/wallet-cosmostation';
|
|
2
|
-
import { CosmosChainId } from '@injectivelabs/ts-types';
|
|
3
|
-
import { Wallet } from '@injectivelabs/wallet-base';
|
|
4
|
-
export declare class CosmostationWalletStrategy extends BaseCosmostationWalletStrategy {
|
|
5
|
-
constructor(args: {
|
|
6
|
-
chainId: CosmosChainId;
|
|
7
|
-
endpoints?: {
|
|
8
|
-
rest: string;
|
|
9
|
-
rpc: string;
|
|
10
|
-
};
|
|
11
|
-
} & {
|
|
12
|
-
wallet: Wallet;
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=cosmostation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cosmostation.d.ts","sourceRoot":"","sources":["../../../../src/strategy/strategies/cosmostation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,IAAI,8BAA8B,EAAE,MAAM,oCAAoC,CAAA;AACjH,OAAO,EAAW,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAEnD,qBAAa,0BAA2B,SAAQ,8BAA8B;gBAE1E,IAAI,EAAE;QACJ,OAAO,EAAE,aAAa,CAAA;QACtB,SAAS,CAAC,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE,CAAA;KAC1C,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE;CAUzB"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CosmostationWalletStrategy = void 0;
|
|
4
|
-
const wallet_cosmostation_1 = require("@injectivelabs/wallet-cosmostation");
|
|
5
|
-
class CosmostationWalletStrategy extends wallet_cosmostation_1.CosmostationWalletStrategy {
|
|
6
|
-
constructor(args) {
|
|
7
|
-
super(args);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
exports.CosmostationWalletStrategy = CosmostationWalletStrategy;
|
|
11
|
-
//# sourceMappingURL=cosmostation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cosmostation.js","sourceRoot":"","sources":["../../../../src/strategy/strategies/cosmostation.ts"],"names":[],"mappings":";;;AAAA,4EAAiH;AAIjH,MAAa,0BAA2B,SAAQ,gDAA8B;IAC5E,YACE,IAGsB;QAEtB,KAAK,CACH,IAIC,CACF,CAAA;IACH,CAAC;CACF;AAfD,gEAeC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/strategy/strategies/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./cosmos.js"), exports);
|
|
18
|
-
__exportStar(require("./cosmostation.js"), exports);
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/strategy/strategies/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,oDAAiC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/strategy/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAEnD,MAAM,WAAW,6BAA6B;IAC5C,OAAO,EAAE,aAAa,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/strategy/types.ts"],"names":[],"mappings":""}
|
package/dist/esm/index.d.ts
DELETED
package/dist/esm/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA"}
|
package/dist/esm/index.js
DELETED
package/dist/esm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA"}
|
package/dist/esm/package.json
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Wallet } from '@injectivelabs/wallet-base';
|
|
2
|
-
import { BaseWalletStrategy } from '@injectivelabs/wallet-core';
|
|
3
|
-
import { CosmosWalletStrategyArguments } from './types.js';
|
|
4
|
-
export declare class BaseCosmosWalletStrategy extends BaseWalletStrategy {
|
|
5
|
-
constructor(args: CosmosWalletStrategyArguments);
|
|
6
|
-
setWallet(wallet: Wallet): void;
|
|
7
|
-
}
|
|
8
|
-
export declare const createCosmosStrategyFactory: (args: CosmosWalletStrategyArguments) => BaseCosmosWalletStrategy;
|
|
9
|
-
//# sourceMappingURL=WalletStrategy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WalletStrategy.d.ts","sourceRoot":"","sources":["../../../src/strategy/WalletStrategy.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EAKP,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAE/D,OAAO,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAA;AA6C1D,qBAAa,wBAAyB,SAAQ,kBAAkB;gBAClD,IAAI,EAAE,6BAA6B;IASxC,SAAS,CAAC,MAAM,EAAE,MAAM;CAGhC;AAED,eAAO,MAAM,2BAA2B,GACtC,MAAM,6BAA6B,6BAGpC,CAAA"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { Wallet, isCosmosWallet, } from '@injectivelabs/wallet-base';
|
|
2
|
-
import { BaseWalletStrategy } from '@injectivelabs/wallet-core';
|
|
3
|
-
import { CosmosWalletStrategy, CosmostationWalletStrategy } from './strategies/index.js';
|
|
4
|
-
const createStrategy = ({ args, wallet, }) => {
|
|
5
|
-
switch (wallet) {
|
|
6
|
-
case Wallet.Keplr:
|
|
7
|
-
return new CosmosWalletStrategy({ ...args, wallet: Wallet.Keplr });
|
|
8
|
-
case Wallet.Cosmostation:
|
|
9
|
-
return new CosmostationWalletStrategy({
|
|
10
|
-
...args,
|
|
11
|
-
wallet: Wallet.Cosmostation,
|
|
12
|
-
});
|
|
13
|
-
case Wallet.Leap:
|
|
14
|
-
return new CosmosWalletStrategy({ ...args, wallet: Wallet.Leap });
|
|
15
|
-
case Wallet.Ninji:
|
|
16
|
-
return new CosmosWalletStrategy({ ...args, wallet: Wallet.Ninji });
|
|
17
|
-
case Wallet.OWallet:
|
|
18
|
-
return new CosmosWalletStrategy({ ...args, wallet: Wallet.OWallet });
|
|
19
|
-
default:
|
|
20
|
-
return undefined;
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
const createAllStrategies = (args) => {
|
|
24
|
-
return Object.values(Wallet).reduce((strategies, wallet) => {
|
|
25
|
-
if (strategies[wallet]) {
|
|
26
|
-
return strategies;
|
|
27
|
-
}
|
|
28
|
-
strategies[wallet] = createStrategy({ args, wallet: wallet });
|
|
29
|
-
return strategies;
|
|
30
|
-
}, {});
|
|
31
|
-
};
|
|
32
|
-
export class BaseCosmosWalletStrategy extends BaseWalletStrategy {
|
|
33
|
-
constructor(args) {
|
|
34
|
-
const strategies = createAllStrategies(args);
|
|
35
|
-
super({
|
|
36
|
-
...args,
|
|
37
|
-
strategies,
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
setWallet(wallet) {
|
|
41
|
-
this.wallet = isCosmosWallet(wallet) ? wallet : Wallet.Keplr;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
export const createCosmosStrategyFactory = (args) => {
|
|
45
|
-
return new BaseCosmosWalletStrategy(args);
|
|
46
|
-
};
|
|
47
|
-
//# sourceMappingURL=WalletStrategy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WalletStrategy.js","sourceRoot":"","sources":["../../../src/strategy/WalletStrategy.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EAIN,cAAc,GACf,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAA;AAGxF,MAAM,cAAc,GA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;AAED,MAAM,OAAO,wBAAyB,SAAQ,kBAAkB;IAC9D,YAAY,IAAmC;QAC7C,MAAM,UAAU,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAA;QAE5C,KAAK,CAAC;YACJ,GAAG,IAAI;YACP,UAAU;SAC2B,CAAC,CAAA;IAC1C,CAAC;IAEM,SAAS,CAAC,MAAc;QAC7B,IAAI,CAAC,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAA;IAC9D,CAAC;CACF;AAED,MAAM,CAAC,MAAM,2BAA2B,GAAG,CACzC,IAAmC,EACnC,EAAE;IACF,OAAO,IAAI,wBAAwB,CAAC,IAAI,CAAC,CAAA;AAC3C,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/strategy/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/strategy/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { CosmosWalletStrategy as BaseCosmosWalletStrategy } from '@injectivelabs/wallet-cosmos';
|
|
2
|
-
import { CosmosChainId } from '@injectivelabs/ts-types';
|
|
3
|
-
import { Wallet } from '@injectivelabs/wallet-base';
|
|
4
|
-
export declare class CosmosWalletStrategy extends BaseCosmosWalletStrategy {
|
|
5
|
-
constructor(args: {
|
|
6
|
-
chainId: CosmosChainId;
|
|
7
|
-
endpoints?: {
|
|
8
|
-
rest: string;
|
|
9
|
-
rpc: string;
|
|
10
|
-
};
|
|
11
|
-
} & {
|
|
12
|
-
wallet: Wallet;
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=cosmos.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cosmos.d.ts","sourceRoot":"","sources":["../../../../src/strategy/strategies/cosmos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,IAAI,wBAAwB,EAAE,MAAM,8BAA8B,CAAA;AAC/F,OAAO,EAAW,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAEnD,qBAAa,oBAAqB,SAAQ,wBAAwB;gBAE9D,IAAI,EAAE;QACJ,OAAO,EAAE,aAAa,CAAA;QACtB,SAAS,CAAC,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE,CAAA;KAC1C,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE;CAUzB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cosmos.js","sourceRoot":"","sources":["../../../../src/strategy/strategies/cosmos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,IAAI,wBAAwB,EAAE,MAAM,8BAA8B,CAAA;AAI/F,MAAM,OAAO,oBAAqB,SAAQ,wBAAwB;IAChE,YACE,IAGsB;QAEtB,KAAK,CACH,IAIC,CACF,CAAA;IACH,CAAC;CACF"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { CosmostationWalletStrategy as BaseCosmostationWalletStrategy } from '@injectivelabs/wallet-cosmostation';
|
|
2
|
-
import { CosmosChainId } from '@injectivelabs/ts-types';
|
|
3
|
-
import { Wallet } from '@injectivelabs/wallet-base';
|
|
4
|
-
export declare class CosmostationWalletStrategy extends BaseCosmostationWalletStrategy {
|
|
5
|
-
constructor(args: {
|
|
6
|
-
chainId: CosmosChainId;
|
|
7
|
-
endpoints?: {
|
|
8
|
-
rest: string;
|
|
9
|
-
rpc: string;
|
|
10
|
-
};
|
|
11
|
-
} & {
|
|
12
|
-
wallet: Wallet;
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=cosmostation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cosmostation.d.ts","sourceRoot":"","sources":["../../../../src/strategy/strategies/cosmostation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,IAAI,8BAA8B,EAAE,MAAM,oCAAoC,CAAA;AACjH,OAAO,EAAW,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAEnD,qBAAa,0BAA2B,SAAQ,8BAA8B;gBAE1E,IAAI,EAAE;QACJ,OAAO,EAAE,aAAa,CAAA;QACtB,SAAS,CAAC,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE,CAAA;KAC1C,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE;CAUzB"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { CosmostationWalletStrategy as BaseCosmostationWalletStrategy } from '@injectivelabs/wallet-cosmostation';
|
|
2
|
-
export class CosmostationWalletStrategy extends BaseCosmostationWalletStrategy {
|
|
3
|
-
constructor(args) {
|
|
4
|
-
super(args);
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=cosmostation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cosmostation.js","sourceRoot":"","sources":["../../../../src/strategy/strategies/cosmostation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,IAAI,8BAA8B,EAAE,MAAM,oCAAoC,CAAA;AAIjH,MAAM,OAAO,0BAA2B,SAAQ,8BAA8B;IAC5E,YACE,IAGsB;QAEtB,KAAK,CACH,IAIC,CACF,CAAA;IACH,CAAC;CACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/strategy/strategies/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/strategy/strategies/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/strategy/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAEnD,MAAM,WAAW,6BAA6B;IAC5C,OAAO,EAAE,aAAa,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/strategy/types.ts"],"names":[],"mappings":""}
|