@pioneer-platform/mayachain-client 0.8.3 → 0.8.5
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 +12 -0
- package/lib/index.d.ts +4 -1
- package/lib/index.js +29 -8
- package/package.json +3 -3
- package/lib/index.js.map +0 -850
package/CHANGELOG.md
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -10,6 +10,9 @@ declare let Web3: any;
|
|
|
10
10
|
declare let web3: any;
|
|
11
11
|
declare function getWeb3(): any;
|
|
12
12
|
declare let networkSupport: any[];
|
|
13
|
-
declare
|
|
13
|
+
declare const caipToMayachainName: Record<string, string>;
|
|
14
|
+
declare let assets: string[];
|
|
15
|
+
declare function caipToAssetName(caip: string): string | null;
|
|
16
|
+
declare let assetSupport: string[];
|
|
14
17
|
declare function nodeRequest(path: any): Promise<any>;
|
|
15
18
|
declare const get_quote: (quote: any) => Promise<any>;
|
package/lib/index.js
CHANGED
|
@@ -67,14 +67,34 @@ var networkSupport = [
|
|
|
67
67
|
ChainToNetworkId["DASH"],
|
|
68
68
|
ChainToNetworkId["ARB"],
|
|
69
69
|
];
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
70
|
+
// CAIP to MayaChain name mapping - SINGLE SOURCE OF TRUTH
|
|
71
|
+
var caipToMayachainName = {
|
|
72
|
+
// Native Layer 1 Assets
|
|
73
|
+
'bip122:000000000019d6689c085ae165831e93/slip44:0': 'BTC.BTC',
|
|
74
|
+
'eip155:1/slip44:60': 'ETH.ETH',
|
|
75
|
+
'bip122:000007d91d1254d60e2dd1ae58038307/slip44:5': 'DASH.DASH',
|
|
76
|
+
'cosmos:mayachain-mainnet-v1/slip44:931': 'MAYA.CACAO',
|
|
77
|
+
'eip155:42161/slip44:60': 'ARB.ETH',
|
|
78
|
+
// Ethereum ERC20 Tokens (if supported by Maya)
|
|
79
|
+
// Add Maya-supported ERC20 tokens here with format:
|
|
80
|
+
// 'eip155:1/erc20:0xcontractaddress': 'ETH.SYMBOL-0XCONTRACTADDRESS',
|
|
81
|
+
// Arbitrum Tokens (if supported by Maya)
|
|
82
|
+
// Add Maya-supported Arbitrum tokens here
|
|
83
|
+
};
|
|
84
|
+
// Comprehensive list of all MayaChain-supported assets (derived from mapping keys)
|
|
85
|
+
var assets = Object.keys(caipToMayachainName);
|
|
86
|
+
// Convert CAIP identifier to MayaChain asset name
|
|
87
|
+
function caipToAssetName(caip) {
|
|
88
|
+
var tag = TAG + " | caipToAssetName | ";
|
|
89
|
+
var mayachainName = caipToMayachainName[caip];
|
|
90
|
+
if (!mayachainName) {
|
|
91
|
+
log.error(tag, "No MayaChain name found for CAIP: ".concat(caip));
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
return mayachainName;
|
|
95
|
+
}
|
|
96
|
+
// Legacy support - will be removed
|
|
97
|
+
var assetSupport = assets;
|
|
78
98
|
// Function to make a request to the node
|
|
79
99
|
function nodeRequest(path) {
|
|
80
100
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -109,6 +129,7 @@ module.exports = {
|
|
|
109
129
|
assetSupport: function () {
|
|
110
130
|
return assetSupport;
|
|
111
131
|
},
|
|
132
|
+
caipToAssetName: caipToAssetName,
|
|
112
133
|
getQuote: function (quote) {
|
|
113
134
|
return get_quote(quote);
|
|
114
135
|
},
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pioneer-platform/mayachain-client",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.5",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"types": "./lib/index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@pioneer-platform/loggerdog": "^8.11.0",
|
|
8
|
-
"@pioneer-platform/maya-network": "^8.
|
|
8
|
+
"@pioneer-platform/maya-network": "^8.13.19",
|
|
9
9
|
"@pioneer-platform/pioneer-caip": "^9.10.0",
|
|
10
10
|
"@pioneer-platform/pioneer-coins": "^9.11.0",
|
|
11
11
|
"axios": "^1.6.0",
|
|
@@ -32,4 +32,4 @@
|
|
|
32
32
|
"typescript": "^5.0.4"
|
|
33
33
|
},
|
|
34
34
|
"gitHead": "a76012f6693a12181c4744e53e977a9eaeef0ed3"
|
|
35
|
-
}
|
|
35
|
+
}
|