@t2000/sdk 0.14.0 → 0.14.1
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/README.md +8 -0
- package/dist/adapters/index.cjs.map +1 -1
- package/dist/adapters/index.js.map +1 -1
- package/dist/index.cjs +6 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -323,6 +323,11 @@ function formatSui(amount) {
|
|
|
323
323
|
if (amount < 1e-3) return `${amount.toFixed(6)} SUI`;
|
|
324
324
|
return `${amount.toFixed(3)} SUI`;
|
|
325
325
|
}
|
|
326
|
+
function formatAssetAmount(amount, asset) {
|
|
327
|
+
if (asset === "BTC") return amount.toFixed(8);
|
|
328
|
+
if (asset === "ETH") return amount.toFixed(6);
|
|
329
|
+
return amount.toFixed(4);
|
|
330
|
+
}
|
|
326
331
|
var ASSET_LOOKUP = /* @__PURE__ */ new Map();
|
|
327
332
|
for (const [key, info] of Object.entries(SUPPORTED_ASSETS)) {
|
|
328
333
|
ASSET_LOOKUP.set(key.toUpperCase(), key);
|
|
@@ -4418,6 +4423,7 @@ exports.cetusDescriptor = descriptor3;
|
|
|
4418
4423
|
exports.executeAutoTopUp = executeAutoTopUp;
|
|
4419
4424
|
exports.executeWithGas = executeWithGas;
|
|
4420
4425
|
exports.exportPrivateKey = exportPrivateKey;
|
|
4426
|
+
exports.formatAssetAmount = formatAssetAmount;
|
|
4421
4427
|
exports.formatSui = formatSui;
|
|
4422
4428
|
exports.formatUsd = formatUsd;
|
|
4423
4429
|
exports.generateKeypair = generateKeypair;
|