@kynesyslabs/demosdk 1.6.1 → 1.6.2
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/build/abstraction/CoinFinder.d.ts +1 -1
- package/build/abstraction/CoinFinder.js +10 -7
- package/build/abstraction/CoinFinder.js.map +1 -1
- package/build/abstraction/EvmCoinFinder.d.ts +2 -1
- package/build/abstraction/EvmCoinFinder.js +11 -3
- package/build/abstraction/EvmCoinFinder.js.map +1 -1
- package/build/abstraction/Identities.d.ts +32 -0
- package/build/abstraction/Identities.js +18 -0
- package/build/abstraction/Identities.js.map +1 -0
- package/build/abstraction/index.d.ts +3 -1
- package/build/abstraction/index.js +3 -1
- package/build/abstraction/index.js.map +1 -1
- package/build/abstraction/providers/CoinAddresses.d.ts +25 -0
- package/build/abstraction/providers/CoinAddresses.js +32 -0
- package/build/abstraction/providers/CoinAddresses.js.map +1 -0
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* ? that breaks when the call is successful.
|
|
5
5
|
* ? This is to prevent any single RPC from being overloaded and
|
|
6
6
|
* ? to be able to fail over to the next one in the list.
|
|
7
|
-
*/
|
|
7
|
+
*/
|
|
8
8
|
export default class CoinFinder {
|
|
9
9
|
constructor();
|
|
10
10
|
static findSol(targetChain: string): Promise<void>;
|
|
@@ -7,22 +7,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
* ? that breaks when the call is successful.
|
|
8
8
|
* ? This is to prevent any single RPC from being overloaded and
|
|
9
9
|
* ? to be able to fail over to the next one in the list.
|
|
10
|
-
*/
|
|
10
|
+
*/
|
|
11
11
|
class CoinFinder {
|
|
12
|
-
constructor() {
|
|
13
|
-
}
|
|
12
|
+
constructor() { }
|
|
14
13
|
// TODO Implement supported chains (e.g. solana, multiversx, etc.) tokens cross search
|
|
15
14
|
static async findSol(targetChain) {
|
|
16
|
-
// TODO
|
|
15
|
+
// TODO Validate the target chain id
|
|
16
|
+
// TODO Get the wrapped sol address for the target chain
|
|
17
17
|
}
|
|
18
18
|
static async findMultiversx(targetChain) {
|
|
19
|
-
// TODO
|
|
19
|
+
// TODO Validate the target chain id
|
|
20
|
+
// TODO Get the wrapped multiversx address for the target chain
|
|
20
21
|
}
|
|
21
22
|
static async findXRP(targetChain) {
|
|
22
|
-
// TODO
|
|
23
|
+
// TODO Validate the target chain id
|
|
24
|
+
// TODO Get the wrapped xrp address for the target chain
|
|
23
25
|
}
|
|
24
26
|
static async findBTC(targetChain) {
|
|
25
|
-
// TODO
|
|
27
|
+
// TODO Validate the target chain id
|
|
28
|
+
// TODO Get the wrapped btc address for the target chain
|
|
26
29
|
}
|
|
27
30
|
}
|
|
28
31
|
exports.default = CoinFinder;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoinFinder.js","sourceRoot":"","sources":["../../../src/abstraction/CoinFinder.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"CoinFinder.js","sourceRoot":"","sources":["../../../src/abstraction/CoinFinder.ts"],"names":[],"mappings":";;AAIA,kFAAkF;AAClF;;;;;;GAMG;AAEH,MAAqB,UAAU;IAC3B,gBAAe,CAAC;IAEhB,sFAAsF;IAEtF,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,WAAmB;QACpC,oCAAoC;QACpC,wDAAwD;IAC5D,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,WAAmB;QAC3C,oCAAoC;QACpC,+DAA+D;IACnE,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,WAAmB;QACpC,oCAAoC;QACpC,wDAAwD;IAC5D,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,WAAmB;QACpC,oCAAoC;QACpC,wDAAwD;IAC5D,CAAC;CACJ;AAxBD,6BAwBC"}
|
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
* ? that breaks when the call is successful.
|
|
5
5
|
* ? This is to prevent any single RPC from being overloaded and
|
|
6
6
|
* ? to be able to fail over to the next one in the list.
|
|
7
|
-
*/
|
|
7
|
+
*/
|
|
8
8
|
export default class EvmCoinFinder {
|
|
9
9
|
constructor();
|
|
10
10
|
static findNativeEth(targetChainIds: number[]): Promise<void>;
|
|
11
11
|
static findNativeAssets(sourceChainId: number, targetChainIds: number[]): Promise<void>;
|
|
12
12
|
static findTokenPairs(tokenAddress: string, sourceChainId: number, targetChainIds: number[]): Promise<void>;
|
|
13
|
+
static getNativeforSupportedChain(chain: string, targetChainId: number): void;
|
|
13
14
|
}
|
|
@@ -7,13 +7,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
* ? that breaks when the call is successful.
|
|
8
8
|
* ? This is to prevent any single RPC from being overloaded and
|
|
9
9
|
* ? to be able to fail over to the next one in the list.
|
|
10
|
-
*/
|
|
10
|
+
*/
|
|
11
11
|
class EvmCoinFinder {
|
|
12
|
-
constructor() {
|
|
13
|
-
}
|
|
12
|
+
constructor() { }
|
|
14
13
|
// TODO Method to find native and wrapped eth across evms (from mainnet to other evms)
|
|
15
14
|
static async findNativeEth(targetChainIds) {
|
|
16
15
|
// TODO
|
|
16
|
+
// TODO Get the wrapped eth address for the target chain
|
|
17
17
|
}
|
|
18
18
|
// TODO Method to find native and wrapped assets across evms (e.g. opt, arb, etc.)
|
|
19
19
|
static async findNativeAssets(sourceChainId, targetChainIds) {
|
|
@@ -22,6 +22,14 @@ class EvmCoinFinder {
|
|
|
22
22
|
// TODO Method to find token pairs on evms (from an evm to other(s) evm(s))
|
|
23
23
|
static async findTokenPairs(tokenAddress, sourceChainId, targetChainIds) {
|
|
24
24
|
// TODO
|
|
25
|
+
// TODO Validate the base token address for the source chain
|
|
26
|
+
// TODO Get the wrapped token address for the target chain if known or return false
|
|
27
|
+
}
|
|
28
|
+
static getNativeforSupportedChain(chain, targetChainId) {
|
|
29
|
+
// ! Typize this for supported chains
|
|
30
|
+
// TODO validate the chain
|
|
31
|
+
// TODO get the target chain id
|
|
32
|
+
// TODO return the native address for the target chain
|
|
25
33
|
}
|
|
26
34
|
}
|
|
27
35
|
exports.default = EvmCoinFinder;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EvmCoinFinder.js","sourceRoot":"","sources":["../../../src/abstraction/EvmCoinFinder.ts"],"names":[],"mappings":";;AAGA,kFAAkF;AAClF;;;;;;
|
|
1
|
+
{"version":3,"file":"EvmCoinFinder.js","sourceRoot":"","sources":["../../../src/abstraction/EvmCoinFinder.ts"],"names":[],"mappings":";;AAGA,kFAAkF;AAClF;;;;;;GAMG;AAEH,MAAqB,aAAa;IAC9B,gBAAe,CAAC;IAEhB,sFAAsF;IACtF,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,cAAwB;QAC/C,OAAO;QACP,wDAAwD;IAC5D,CAAC;IAED,kFAAkF;IAClF,MAAM,CAAC,KAAK,CAAC,gBAAgB,CACzB,aAAqB,EACrB,cAAwB;QAExB,OAAO;IACX,CAAC;IAED,2EAA2E;IAC3E,MAAM,CAAC,KAAK,CAAC,cAAc,CACvB,YAAoB,EACpB,aAAqB,EACrB,cAAwB;QAExB,OAAO;QACP,4DAA4D;QAC5D,mFAAmF;IACvF,CAAC;IAED,MAAM,CAAC,0BAA0B,CAAC,KAAa,EAAE,aAAqB;QAClE,qCAAqC;QACrC,0BAA0B;QAC1B,+BAA+B;QAC/B,sDAAsD;IAC1D,CAAC;CACJ;AAlCD,gCAkCC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface InferFromWritePayload {
|
|
2
|
+
demos_identity: {
|
|
3
|
+
address: string;
|
|
4
|
+
signedData: string;
|
|
5
|
+
signature: string;
|
|
6
|
+
};
|
|
7
|
+
target_identity: {
|
|
8
|
+
txHash: string;
|
|
9
|
+
targetAddress: string;
|
|
10
|
+
isEVM: boolean;
|
|
11
|
+
chainId: number | string;
|
|
12
|
+
rpcUrl?: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export interface InferFromSignaturePayload {
|
|
16
|
+
demos_identity: {
|
|
17
|
+
address: string;
|
|
18
|
+
signedData: string;
|
|
19
|
+
signature: string;
|
|
20
|
+
};
|
|
21
|
+
target_identity: {
|
|
22
|
+
signature: string;
|
|
23
|
+
signedData: string;
|
|
24
|
+
targetAddress: string;
|
|
25
|
+
isEVM: boolean;
|
|
26
|
+
chainId: number | string;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export default class Identities {
|
|
30
|
+
constructor();
|
|
31
|
+
inferIdentity(payload: InferFromWritePayload | InferFromSignaturePayload): Promise<string | false>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// TODO Implement the identities abstraction
|
|
3
|
+
// This should be able to query and set the GCR identities for a Demos address
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
class Identities {
|
|
6
|
+
constructor() { }
|
|
7
|
+
// Infer identity from either a write transaction or a signature
|
|
8
|
+
async inferIdentity(payload) {
|
|
9
|
+
const basePayload = {
|
|
10
|
+
method: "gcr_routine",
|
|
11
|
+
params: [payload],
|
|
12
|
+
};
|
|
13
|
+
// TODO Implement the RPC call
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.default = Identities;
|
|
18
|
+
//# sourceMappingURL=Identities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Identities.js","sourceRoot":"","sources":["../../../src/abstraction/Identities.ts"],"names":[],"mappings":";AAAA,4CAA4C;AAC5C,8EAA8E;;AAkC9E,MAAqB,UAAU;IAC3B,gBAAe,CAAC;IAEhB,gEAAgE;IAChE,KAAK,CAAC,aAAa,CAAC,OAA0D;QAC1E,MAAM,WAAW,GAAG;YAChB,MAAM,EAAE,aAAa;YACrB,MAAM,EAAE,CAAC,OAAO,CAAC;SACpB,CAAA;QACD,8BAA8B;QAC9B,OAAO,KAAK,CAAA;IAChB,CAAC;CAEJ;AAbD,6BAaC"}
|
|
@@ -6,4 +6,6 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import EvmCoinFinder from "./EvmCoinFinder";
|
|
8
8
|
import CoinFinder from "./CoinFinder";
|
|
9
|
-
|
|
9
|
+
import Identities from "./Identities";
|
|
10
|
+
import { InferFromWritePayload, InferFromSignaturePayload } from "./Identities";
|
|
11
|
+
export { EvmCoinFinder, CoinFinder, Identities, InferFromWritePayload, InferFromSignaturePayload };
|
|
@@ -9,9 +9,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.CoinFinder = exports.EvmCoinFinder = void 0;
|
|
12
|
+
exports.Identities = exports.CoinFinder = exports.EvmCoinFinder = void 0;
|
|
13
13
|
const EvmCoinFinder_1 = __importDefault(require("./EvmCoinFinder"));
|
|
14
14
|
exports.EvmCoinFinder = EvmCoinFinder_1.default;
|
|
15
15
|
const CoinFinder_1 = __importDefault(require("./CoinFinder"));
|
|
16
16
|
exports.CoinFinder = CoinFinder_1.default;
|
|
17
|
+
const Identities_1 = __importDefault(require("./Identities"));
|
|
18
|
+
exports.Identities = Identities_1.default;
|
|
17
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/abstraction/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;AAEH,oEAA4C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/abstraction/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;AAEH,oEAA4C;AAKnC,wBALF,uBAAa,CAKE;AAJtB,8DAAsC;AAId,qBAJjB,oBAAU,CAIiB;AAHlC,8DAAsC;AAGF,qBAH7B,oBAAU,CAG6B"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const tokenAddresses: {
|
|
2
|
+
eth: {
|
|
3
|
+
mainnet: string;
|
|
4
|
+
sepolia: string;
|
|
5
|
+
holesky: string;
|
|
6
|
+
wrapped: {
|
|
7
|
+
polygon: {
|
|
8
|
+
mainnet: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
btc: {
|
|
13
|
+
mainnet: string;
|
|
14
|
+
wrapped: {
|
|
15
|
+
ethereum: {
|
|
16
|
+
mainnet: string;
|
|
17
|
+
sepolia: string;
|
|
18
|
+
holesky: string;
|
|
19
|
+
};
|
|
20
|
+
polygon: {
|
|
21
|
+
mainnet: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ! This is an absolute test and could be changed anytime
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.tokenAddresses = void 0;
|
|
5
|
+
exports.tokenAddresses = {
|
|
6
|
+
// ANCHOR Ethereum
|
|
7
|
+
eth: {
|
|
8
|
+
mainnet: "0x0000000000000000000000000000000000000000",
|
|
9
|
+
sepolia: "0x0000000000000000000000000000000000000000",
|
|
10
|
+
holesky: "0x0000000000000000000000000000000000000000",
|
|
11
|
+
wrapped: {
|
|
12
|
+
polygon: {
|
|
13
|
+
mainnet: "0x0000000000000000000000000000000000000000",
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
// ANCHOR Bitcoin
|
|
18
|
+
btc: {
|
|
19
|
+
mainnet: "0x0000000000000000000000000000000000000000",
|
|
20
|
+
wrapped: {
|
|
21
|
+
ethereum: {
|
|
22
|
+
mainnet: "0x0000000000000000000000000000000000000000",
|
|
23
|
+
sepolia: "0x0000000000000000000000000000000000000000",
|
|
24
|
+
holesky: "0x0000000000000000000000000000000000000000",
|
|
25
|
+
},
|
|
26
|
+
polygon: {
|
|
27
|
+
mainnet: "0x0000000000000000000000000000000000000000",
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=CoinAddresses.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CoinAddresses.js","sourceRoot":"","sources":["../../../../src/abstraction/providers/CoinAddresses.ts"],"names":[],"mappings":";AAAA,0DAA0D;;;AAE7C,QAAA,cAAc,GAAG;IAC1B,kBAAkB;IAClB,GAAG,EAAE;QACD,OAAO,EAAE,4CAA4C;QACrD,OAAO,EAAE,4CAA4C;QACrD,OAAO,EAAE,4CAA4C;QACrD,OAAO,EAAE;YACL,OAAO,EAAE;gBACL,OAAO,EAAE,4CAA4C;aACxD;SACJ;KACJ;IACD,iBAAiB;IACjB,GAAG,EAAE;QACD,OAAO,EAAE,4CAA4C;QACrD,OAAO,EAAE;YACL,QAAQ,EAAE;gBACN,OAAO,EAAE,4CAA4C;gBACrD,OAAO,EAAE,4CAA4C;gBACrD,OAAO,EAAE,4CAA4C;aACxD;YACD,OAAO,EAAE;gBACL,OAAO,EAAE,4CAA4C;aACxD;SACJ;KACJ;CACJ,CAAA"}
|