@kynesyslabs/demosdk 2.4.10 → 2.4.12
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/bridge/index.d.ts +2 -1
- package/build/bridge/index.js +28 -7
- package/build/bridge/index.js.map +1 -1
- package/build/bridge/nativeBridgeTypes.d.ts +29 -0
- package/build/bridge/nativeBridgeTypes.js +1 -1
- package/build/bridge/nativeBridgeTypes.js.map +1 -1
- package/build/types/index.d.ts +1 -1
- package/package.json +10 -1
package/build/bridge/index.d.ts
CHANGED
|
@@ -4,5 +4,6 @@ import RubicBridge from "./rubicBridge";
|
|
|
4
4
|
export { BLOCKCHAIN_NAME, CROSS_CHAIN_TRADE_TYPE, CrossChainTrade, RubicSdkError, WrappedCrossChainTrade, } from "rubic-sdk";
|
|
5
5
|
import { methods as NativeBridgeMethods } from "./nativeBridge";
|
|
6
6
|
export { NativeBridgeMethods };
|
|
7
|
-
export { BridgeOperation as NativeBridgeOperation, BridgeOperationCompiled as NativeBridgeOperationCompiled, SupportedChain as NativeBridgeSupportedChain, SupportedStablecoin as NativeBridgeSupportedStablecoin, SupportedEVMChain as NativeBridgeSupportedEVMChain, supportedChains as NativeBridgeSupportedChains, supportedStablecoins as NativeBridgeSupportedStablecoins, supportedEVMChains as NativeBridgeSupportedEVMChains, usdcContracts as NativeBridgeUSDCContracts, usdcAbi as NativeBridgeUSDCAbi, } from "./nativeBridgeTypes";
|
|
7
|
+
export { BridgeOperation as NativeBridgeOperation, BridgeOperationCompiled as NativeBridgeOperationCompiled, BridgeOperationCompiledLegacy as NativeBridgeOperationCompiledLegacy, CompiledContent, EVMTankData, SolanaTankData, SupportedChain as NativeBridgeSupportedChain, SupportedStablecoin as NativeBridgeSupportedStablecoin, SupportedEVMChain as NativeBridgeSupportedEVMChain, supportedChains as NativeBridgeSupportedChains, supportedStablecoins as NativeBridgeSupportedStablecoins, supportedEVMChains as NativeBridgeSupportedEVMChains, usdcContracts as NativeBridgeUSDCContracts, usdcAbi as NativeBridgeUSDCAbi, supportedEVMChains, supportedNonEVMChains, } from "./nativeBridgeTypes";
|
|
8
8
|
export { RubicBridge };
|
|
9
|
+
export declare function validateChain(chain: string, isOrigin: boolean): void;
|
package/build/bridge/index.js
CHANGED
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.RubicBridge = exports.NativeBridgeUSDCAbi = exports.NativeBridgeUSDCContracts = exports.NativeBridgeSupportedEVMChains = exports.NativeBridgeSupportedStablecoins = exports.NativeBridgeSupportedChains = exports.NativeBridgeMethods = exports.RubicSdkError = exports.CrossChainTrade = exports.CROSS_CHAIN_TRADE_TYPE = exports.BLOCKCHAIN_NAME = exports.SupportedTokens = exports.SupportedChains = exports.ChainProviders = void 0;
|
|
6
|
+
exports.RubicBridge = exports.supportedNonEVMChains = exports.supportedEVMChains = exports.NativeBridgeUSDCAbi = exports.NativeBridgeUSDCContracts = exports.NativeBridgeSupportedEVMChains = exports.NativeBridgeSupportedStablecoins = exports.NativeBridgeSupportedChains = exports.NativeBridgeMethods = exports.RubicSdkError = exports.CrossChainTrade = exports.CROSS_CHAIN_TRADE_TYPE = exports.BLOCKCHAIN_NAME = exports.SupportedTokens = exports.SupportedChains = exports.ChainProviders = void 0;
|
|
7
|
+
exports.validateChain = validateChain;
|
|
7
8
|
var constants_1 = require("../types/bridge/constants");
|
|
8
9
|
Object.defineProperty(exports, "ChainProviders", { enumerable: true, get: function () { return constants_1.ChainProviders; } });
|
|
9
10
|
Object.defineProperty(exports, "SupportedChains", { enumerable: true, get: function () { return constants_1.SupportedChains; } });
|
|
@@ -17,11 +18,31 @@ Object.defineProperty(exports, "CrossChainTrade", { enumerable: true, get: funct
|
|
|
17
18
|
Object.defineProperty(exports, "RubicSdkError", { enumerable: true, get: function () { return rubic_sdk_1.RubicSdkError; } });
|
|
18
19
|
const nativeBridge_1 = require("./nativeBridge");
|
|
19
20
|
Object.defineProperty(exports, "NativeBridgeMethods", { enumerable: true, get: function () { return nativeBridge_1.methods; } });
|
|
21
|
+
const nativeBridgeTypes_1 = require("./nativeBridgeTypes");
|
|
20
22
|
// Export types from nativeBridgeTypes
|
|
21
|
-
var
|
|
22
|
-
Object.defineProperty(exports, "NativeBridgeSupportedChains", { enumerable: true, get: function () { return
|
|
23
|
-
Object.defineProperty(exports, "NativeBridgeSupportedStablecoins", { enumerable: true, get: function () { return
|
|
24
|
-
Object.defineProperty(exports, "NativeBridgeSupportedEVMChains", { enumerable: true, get: function () { return
|
|
25
|
-
Object.defineProperty(exports, "NativeBridgeUSDCContracts", { enumerable: true, get: function () { return
|
|
26
|
-
Object.defineProperty(exports, "NativeBridgeUSDCAbi", { enumerable: true, get: function () { return
|
|
23
|
+
var nativeBridgeTypes_2 = require("./nativeBridgeTypes");
|
|
24
|
+
Object.defineProperty(exports, "NativeBridgeSupportedChains", { enumerable: true, get: function () { return nativeBridgeTypes_2.supportedChains; } });
|
|
25
|
+
Object.defineProperty(exports, "NativeBridgeSupportedStablecoins", { enumerable: true, get: function () { return nativeBridgeTypes_2.supportedStablecoins; } });
|
|
26
|
+
Object.defineProperty(exports, "NativeBridgeSupportedEVMChains", { enumerable: true, get: function () { return nativeBridgeTypes_2.supportedEVMChains; } });
|
|
27
|
+
Object.defineProperty(exports, "NativeBridgeUSDCContracts", { enumerable: true, get: function () { return nativeBridgeTypes_2.usdcContracts; } });
|
|
28
|
+
Object.defineProperty(exports, "NativeBridgeUSDCAbi", { enumerable: true, get: function () { return nativeBridgeTypes_2.usdcAbi; } });
|
|
29
|
+
Object.defineProperty(exports, "supportedEVMChains", { enumerable: true, get: function () { return nativeBridgeTypes_2.supportedEVMChains; } });
|
|
30
|
+
Object.defineProperty(exports, "supportedNonEVMChains", { enumerable: true, get: function () { return nativeBridgeTypes_2.supportedNonEVMChains; } });
|
|
31
|
+
// Export standalone validateChain function
|
|
32
|
+
function validateChain(chain, isOrigin) {
|
|
33
|
+
// Determine chain type based on supported chains
|
|
34
|
+
let chainType;
|
|
35
|
+
if (nativeBridgeTypes_1.supportedEVMChains.includes(chain)) {
|
|
36
|
+
chainType = "EVM";
|
|
37
|
+
}
|
|
38
|
+
else if (nativeBridgeTypes_1.supportedNonEVMChains.includes(chain)) {
|
|
39
|
+
chainType = "SOLANA";
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
const chainTypeStr = isOrigin ? "origin" : "destination";
|
|
43
|
+
throw new Error(`Invalid ${chainTypeStr} chain: ${chain} is not supported`);
|
|
44
|
+
}
|
|
45
|
+
// Use the bridge's validation method directly
|
|
46
|
+
nativeBridge_1.methods.validateChain(chain, chainType, isOrigin);
|
|
47
|
+
}
|
|
27
48
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/bridge/index.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/bridge/index.ts"],"names":[],"mappings":";;;;;;AAyCA,sCAcC;AAtDD,sDAIiC;AAH7B,2GAAA,cAAc,OAAA;AACd,4GAAA,eAAe,OAAA;AACf,4GAAA,eAAe,OAAA;AAEnB,gEAAuC;AAgC9B,sBAhCF,qBAAW,CAgCE;AA/BpB,uCAMkB;AALd,4GAAA,eAAe,OAAA;AACf,mHAAA,sBAAsB,OAAA;AACtB,4GAAA,eAAe,OAAA;AACf,0GAAA,aAAa,OAAA;AAIjB,iDAA+D;AAEtD,oGAFW,sBAAmB,OAEX;AAD5B,2DAA+E;AAG/E,sCAAsC;AACtC,yDAiB4B;AAPxB,gIAAA,eAAe,OAA+B;AAC9C,qIAAA,oBAAoB,OAAoC;AACxD,mIAAA,kBAAkB,OAAkC;AACpD,8HAAA,aAAa,OAA6B;AAC1C,wHAAA,OAAO,OAAuB;AAC9B,uHAAA,kBAAkB,OAAA;AAClB,0HAAA,qBAAqB,OAAA;AAIzB,2CAA2C;AAC3C,SAAgB,aAAa,CAAC,KAAa,EAAE,QAAiB;IAC1D,iDAAiD;IACjD,IAAI,SAAiB,CAAA;IACrB,IAAI,sCAAkB,CAAC,QAAQ,CAAC,KAAY,CAAC,EAAE,CAAC;QAC5C,SAAS,GAAG,KAAK,CAAA;IACrB,CAAC;SAAM,IAAI,yCAAqB,CAAC,QAAQ,CAAC,KAAY,CAAC,EAAE,CAAC;QACtD,SAAS,GAAG,QAAQ,CAAA;IACxB,CAAC;SAAM,CAAC;QACJ,MAAM,YAAY,GAAG,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAA;QACxD,MAAM,IAAI,KAAK,CAAC,WAAW,YAAY,WAAW,KAAK,mBAAmB,CAAC,CAAA;IAC/E,CAAC;IAED,8CAA8C;IAC9C,sBAAmB,CAAC,aAAa,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAA;AACjE,CAAC"}
|
|
@@ -13,7 +13,36 @@ export type BridgeOperation = {
|
|
|
13
13
|
txHash: string;
|
|
14
14
|
status: "empty" | "pending" | "completed" | "failed";
|
|
15
15
|
};
|
|
16
|
+
export type EVMTankData = {
|
|
17
|
+
type: "evm";
|
|
18
|
+
abi: string[];
|
|
19
|
+
address: string;
|
|
20
|
+
amountExpected: number;
|
|
21
|
+
};
|
|
22
|
+
export type SolanaTankData = {
|
|
23
|
+
type: "solana";
|
|
24
|
+
address: string;
|
|
25
|
+
amountExpected: number;
|
|
26
|
+
};
|
|
27
|
+
export type CompiledContent = {
|
|
28
|
+
operation: BridgeOperation;
|
|
29
|
+
tankData: EVMTankData | SolanaTankData;
|
|
30
|
+
bridgeId: string;
|
|
31
|
+
validUntil: number;
|
|
32
|
+
};
|
|
16
33
|
export type BridgeOperationCompiled = {
|
|
34
|
+
content: CompiledContent;
|
|
35
|
+
signature: {
|
|
36
|
+
type: string;
|
|
37
|
+
data: string;
|
|
38
|
+
};
|
|
39
|
+
rpcPublicKey: string;
|
|
40
|
+
};
|
|
41
|
+
export type NativeBridgeTxPayload = {
|
|
42
|
+
operation: BridgeOperationCompiled;
|
|
43
|
+
bridgeId: string;
|
|
44
|
+
};
|
|
45
|
+
export type BridgeOperationCompiledLegacy = {
|
|
17
46
|
content: {
|
|
18
47
|
operation: BridgeOperation;
|
|
19
48
|
amountExpected: number;
|
|
@@ -22,7 +22,7 @@ exports.usdcContracts = {
|
|
|
22
22
|
POLYGON: "0x0FA8781a83E46826621b3BC094Ea2A0212e71B23", // Mumbai USDC
|
|
23
23
|
BSC: "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d", // BSC Testnet USDC
|
|
24
24
|
ARBITRUM: "0xfd064A18f3BF249cf1f87FC203E90D8f650f2d63", // Arbitrum Sepolia USDC
|
|
25
|
-
OPTIMISM: "0x5fd84259d66Cd46123540766Be93DFE6D43130D7", // Optimism Sepolia
|
|
25
|
+
OPTIMISM: "0x5fd84259d66Cd46123540766Be93DFE6D43130D7", // Optimism Sepolia USDN
|
|
26
26
|
AVALANCHE: "0x5425890298aed601595a70AB815c96711a31Bc65", // Fuji USDC
|
|
27
27
|
BASE: "0x036CbD53842c5426634e7929541eC2318f3dCF7e", // Base Sepolia USDC
|
|
28
28
|
SOLANA: "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU", // Solana Devnet USDC
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nativeBridgeTypes.js","sourceRoot":"","sources":["../../../src/bridge/nativeBridgeTypes.ts"],"names":[],"mappings":";AAAA,8FAA8F;;;AAE9F,mCAAmC;AACtB,QAAA,eAAe,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAU,CAAA;AAC5C,QAAA,oBAAoB,GAAG,CAAC,MAAM,CAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"nativeBridgeTypes.js","sourceRoot":"","sources":["../../../src/bridge/nativeBridgeTypes.ts"],"names":[],"mappings":";AAAA,8FAA8F;;;AAE9F,mCAAmC;AACtB,QAAA,eAAe,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAU,CAAA;AAC5C,QAAA,oBAAoB,GAAG,CAAC,MAAM,CAAU,CAAA;AA8ErD,2BAA2B;AACd,QAAA,kBAAkB,GAAG;IAC9B,KAAK;IACL,SAAS;IACT,KAAK;IACL,UAAU;IACV,UAAU;IACV,WAAW;IACX,MAAM;CACA,CAAA;AAEG,QAAA,qBAAqB,GAAG,CAAC,QAAQ,CAAU,CAAA;AAExD,mEAAmE;AACtD,QAAA,aAAa,GAAG;IACzB,QAAQ,EAAE,4CAA4C,EAAE,eAAe;IACvE,OAAO,EAAE,4CAA4C,EAAE,cAAc;IACrE,GAAG,EAAE,4CAA4C,EAAE,mBAAmB;IACtE,QAAQ,EAAE,4CAA4C,EAAE,wBAAwB;IAChF,QAAQ,EAAE,4CAA4C,EAAE,wBAAwB;IAChF,SAAS,EAAE,4CAA4C,EAAE,YAAY;IACrE,IAAI,EAAE,4CAA4C,EAAE,oBAAoB;IACxE,MAAM,EAAE,8CAA8C,EAAE,qBAAqB;CAChF,CAAA;AAED,gCAAgC;AACnB,QAAA,OAAO,GAAG;IACnB,0DAA0D;IAC1D,0CAA0C;CAC7C,CAAA"}
|
package/build/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { GenesisArtifact, GenesisImmutableProperties, GenesisMutableProperties, StandardGenesis, forkGenesis, } from "./blockchain/genesisTypes";
|
|
2
|
-
export { Block, BlockContent, NativeTablesHashes } from "./blockchain/blocks";
|
|
2
|
+
export { Block, BlockContent, NativeTablesHashes, GenesisBlock } from "./blockchain/blocks";
|
|
3
3
|
export { ISignature } from "./blockchain/ISignature";
|
|
4
4
|
export { RawTransaction } from "./blockchain/rawTransaction";
|
|
5
5
|
export { Transaction, TransactionContent, TransactionContentData, } from "./blockchain/Transaction";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kynesyslabs/demosdk",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.12",
|
|
4
4
|
"description": "Demosdk is a JavaScript/TypeScript SDK that provides a unified interface for interacting with Demos network",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -16,6 +16,15 @@
|
|
|
16
16
|
"./websdk": "./build/websdk/index.js",
|
|
17
17
|
"./demoswork": "./build/demoswork/index.js",
|
|
18
18
|
"./xmcore": "./build/multichain/core/index.js",
|
|
19
|
+
"./xmcore/evm": "./build/multichain/core/evm.js",
|
|
20
|
+
"./xmcore/ibc": "./build/multichain/core/ibc.js",
|
|
21
|
+
"./xmcore/multiversx": "./build/multichain/core/multiversx.js",
|
|
22
|
+
"./xmcore/solana": "./build/multichain/core/solana.js",
|
|
23
|
+
"./xmcore/ton": "./build/multichain/core/ton.js",
|
|
24
|
+
"./xmcore/xrpl": "./build/multichain/core/xrp.js",
|
|
25
|
+
"./xmcore/btc": "./build/multichain/core/btc.js",
|
|
26
|
+
"./xmcore/aptos": "./build/multichain/core/aptos.js",
|
|
27
|
+
"./xmcore/near": "./build/multichain/core/near.js",
|
|
19
28
|
"./xm-websdk": "./build/multichain/websdk/index.js",
|
|
20
29
|
"./xm-localsdk": "./build/multichain/localsdk/index.js",
|
|
21
30
|
"./wallet": "./build/wallet/index.js",
|