@kynesyslabs/demosdk 2.2.30 → 2.2.31
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 +11 -1
- package/build/bridge/index.js +7 -1
- package/build/bridge/index.js.map +1 -1
- package/build/bridge/nativeBridge.d.ts +11 -27
- package/build/bridge/nativeBridge.js +26 -29
- package/build/bridge/nativeBridge.js.map +1 -1
- package/build/bridge/nativeBridgeTypes.d.ts +31 -0
- package/build/bridge/nativeBridgeTypes.js +34 -0
- package/build/bridge/nativeBridgeTypes.js.map +1 -0
- package/build/types/blockchain/Transaction.d.ts +3 -2
- package/package.json +1 -1
package/build/bridge/index.d.ts
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import { BridgeTradePayload } from "../types/bridge/bridgeTradePayload";
|
|
2
2
|
import { ChainProviders, SupportedChains, SupportedTokens } from "../types/bridge/constants";
|
|
3
3
|
export { BridgeTradePayload, ChainProviders, SupportedChains, SupportedTokens };
|
|
4
|
-
|
|
4
|
+
import * as NativeBridgeTypes from "./nativeBridgeTypes";
|
|
5
|
+
declare const NativeBridge: {
|
|
6
|
+
types: typeof NativeBridgeTypes;
|
|
7
|
+
methods: {
|
|
8
|
+
generateOperation(): {
|
|
9
|
+
operation: NativeBridgeTypes.BridgeOperation;
|
|
10
|
+
transaction: import("../types").Transaction;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export { NativeBridge };
|
package/build/bridge/index.js
CHANGED
|
@@ -39,5 +39,11 @@ Object.defineProperty(exports, "ChainProviders", { enumerable: true, get: functi
|
|
|
39
39
|
Object.defineProperty(exports, "SupportedChains", { enumerable: true, get: function () { return constants_1.SupportedChains; } });
|
|
40
40
|
Object.defineProperty(exports, "SupportedTokens", { enumerable: true, get: function () { return constants_1.SupportedTokens; } });
|
|
41
41
|
// Native bridge exports
|
|
42
|
-
|
|
42
|
+
const NativeBridgeTypes = __importStar(require("./nativeBridgeTypes"));
|
|
43
|
+
const nativeBridge_1 = require("./nativeBridge");
|
|
44
|
+
const NativeBridge = {
|
|
45
|
+
types: NativeBridgeTypes,
|
|
46
|
+
methods: nativeBridge_1.methods,
|
|
47
|
+
};
|
|
48
|
+
exports.NativeBridge = NativeBridge;
|
|
43
49
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/bridge/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,wDAIiC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/bridge/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,wDAIiC;AAEJ,+FALzB,0BAAc,OAKyB;AAAE,gGAJzC,2BAAe,OAIyC;AAAE,gGAH1D,2BAAe,OAG0D;AAE7E,wBAAwB;AACxB,uEAAwD;AACxD,iDAA+D;AAE/D,MAAM,YAAY,GAAG;IACjB,KAAK,EAAE,iBAAiB;IACxB,OAAO,EAAE,sBAAmB;CAC/B,CAAA;AAEQ,oCAAY"}
|
|
@@ -1,28 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
SOLANA: string;
|
|
1
|
+
import { BridgeOperation } from "./nativeBridgeTypes";
|
|
2
|
+
import { Transaction } from "../types/blockchain/Transaction";
|
|
3
|
+
export declare const methods: {
|
|
4
|
+
/**
|
|
5
|
+
* Generates a new operation, its corresponding Transaction and returns it
|
|
6
|
+
* TODO Implement the params
|
|
7
|
+
*/
|
|
8
|
+
generateOperation(): {
|
|
9
|
+
operation: BridgeOperation;
|
|
10
|
+
transaction: Transaction;
|
|
11
|
+
};
|
|
13
12
|
};
|
|
14
|
-
export declare const usdcAbi: string[];
|
|
15
|
-
export type SupportedChain = typeof supportedChains[number];
|
|
16
|
-
export type SupportedStablecoin = typeof supportedStablecoins[number];
|
|
17
|
-
export type SupportedEVMChain = typeof supportedEVMChains[number];
|
|
18
|
-
export interface BridgeOperation {
|
|
19
|
-
demoAddress: string;
|
|
20
|
-
originChain: SupportedChain;
|
|
21
|
-
destinationChain: SupportedChain;
|
|
22
|
-
originAddress: string;
|
|
23
|
-
destinationAddress: string;
|
|
24
|
-
amount: string;
|
|
25
|
-
token: SupportedStablecoin;
|
|
26
|
-
txHash: string;
|
|
27
|
-
status: "empty" | "pending" | "completed" | "failed";
|
|
28
|
-
}
|
|
@@ -1,33 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
exports.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
3
|
+
exports.methods = void 0;
|
|
4
|
+
const websdk_1 = require("../websdk");
|
|
5
|
+
exports.methods = {
|
|
6
|
+
/**
|
|
7
|
+
* Generates a new operation, its corresponding Transaction and returns it
|
|
8
|
+
* TODO Implement the params
|
|
9
|
+
*/
|
|
10
|
+
generateOperation() {
|
|
11
|
+
// Defining the operation
|
|
12
|
+
const operation = {
|
|
13
|
+
demoAddress: "",
|
|
14
|
+
originChain: null,
|
|
15
|
+
destinationChain: null,
|
|
16
|
+
originAddress: "",
|
|
17
|
+
destinationAddress: "",
|
|
18
|
+
amount: "",
|
|
19
|
+
token: null,
|
|
20
|
+
txHash: "",
|
|
21
|
+
status: "empty",
|
|
22
|
+
};
|
|
23
|
+
// Defining the transaction
|
|
24
|
+
var transaction = websdk_1.demos.transactions.empty();
|
|
25
|
+
// TODO Implement the operation
|
|
26
|
+
// TODO Implement the transaction
|
|
27
|
+
return { operation, transaction };
|
|
28
|
+
}
|
|
27
29
|
};
|
|
28
|
-
// USDC ABI for balance checking
|
|
29
|
-
exports.usdcAbi = [
|
|
30
|
-
"function balanceOf(address owner) view returns (uint256)",
|
|
31
|
-
"function decimals() view returns (uint8)",
|
|
32
|
-
];
|
|
33
30
|
//# sourceMappingURL=nativeBridge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nativeBridge.js","sourceRoot":"","sources":["../../../src/bridge/nativeBridge.ts"],"names":[],"mappings":";;;AAEA,
|
|
1
|
+
{"version":3,"file":"nativeBridge.js","sourceRoot":"","sources":["../../../src/bridge/nativeBridge.ts"],"names":[],"mappings":";;;AAEA,qCAAgC;AAEnB,QAAA,OAAO,GAAG;IAEnB;;;MAGE;IACF,iBAAiB;QACb,yBAAyB;QACzB,MAAM,SAAS,GAAoB;YAC/B,WAAW,EAAE,EAAE;YACf,WAAW,EAAE,IAAI;YACjB,gBAAgB,EAAE,IAAI;YACtB,aAAa,EAAE,EAAE;YACjB,kBAAkB,EAAE,EAAE;YACtB,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,EAAE;YACV,MAAM,EAAE,OAAO;SAClB,CAAA;QAED,2BAA2B;QAC3B,IAAI,WAAW,GAAgB,cAAK,CAAC,YAAY,CAAC,KAAK,EAAE,CAAA;QAEzD,gCAAgC;QAChC,iCAAiC;QAEjC,OAAO,EAAC,SAAS,EAAE,WAAW,EAAC,CAAA;IACnC,CAAC;CACJ,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare const supportedChains: readonly ["EVM", "SOLANA"];
|
|
2
|
+
export declare const supportedStablecoins: readonly ["USDC"];
|
|
3
|
+
export type NativeBridgePayload = {
|
|
4
|
+
operation: BridgeOperation;
|
|
5
|
+
};
|
|
6
|
+
export declare const supportedEVMChains: readonly ["eth", "polygon", "bsc", "arbitrum", "optimism", "avalanche", "base"];
|
|
7
|
+
export declare const usdcContracts: {
|
|
8
|
+
ETHEREUM: string;
|
|
9
|
+
POLYGON: string;
|
|
10
|
+
BSC: string;
|
|
11
|
+
ARBITRUM: string;
|
|
12
|
+
OPTIMISM: string;
|
|
13
|
+
AVALANCHE: string;
|
|
14
|
+
BASE: string;
|
|
15
|
+
SOLANA: string;
|
|
16
|
+
};
|
|
17
|
+
export declare const usdcAbi: string[];
|
|
18
|
+
export type SupportedChain = typeof supportedChains[number];
|
|
19
|
+
export type SupportedStablecoin = typeof supportedStablecoins[number];
|
|
20
|
+
export type SupportedEVMChain = typeof supportedEVMChains[number];
|
|
21
|
+
export interface BridgeOperation {
|
|
22
|
+
demoAddress: string;
|
|
23
|
+
originChain: SupportedChain;
|
|
24
|
+
destinationChain: SupportedChain;
|
|
25
|
+
originAddress: string;
|
|
26
|
+
destinationAddress: string;
|
|
27
|
+
amount: string;
|
|
28
|
+
token: SupportedStablecoin;
|
|
29
|
+
txHash: string;
|
|
30
|
+
status: "empty" | "pending" | "completed" | "failed";
|
|
31
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// We separate the types from the methods to avoid circular dependencies (transactions mainly)
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.usdcAbi = exports.usdcContracts = exports.supportedEVMChains = exports.supportedStablecoins = exports.supportedChains = void 0;
|
|
5
|
+
// Supported chains and stablecoins
|
|
6
|
+
exports.supportedChains = ["EVM", "SOLANA"];
|
|
7
|
+
exports.supportedStablecoins = ["USDC"];
|
|
8
|
+
// Supported chains for EVM
|
|
9
|
+
exports.supportedEVMChains = [
|
|
10
|
+
"eth",
|
|
11
|
+
"polygon",
|
|
12
|
+
"bsc",
|
|
13
|
+
"arbitrum",
|
|
14
|
+
"optimism",
|
|
15
|
+
"avalanche",
|
|
16
|
+
"base",
|
|
17
|
+
];
|
|
18
|
+
// USDC contract addresses for different chains (testnet addresses)
|
|
19
|
+
exports.usdcContracts = {
|
|
20
|
+
ETHEREUM: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238", // Sepolia USDC
|
|
21
|
+
POLYGON: "0x0FA8781a83E46826621b3BC094Ea2A0212e71B23", // Mumbai USDC
|
|
22
|
+
BSC: "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d", // BSC Testnet USDC
|
|
23
|
+
ARBITRUM: "0xfd064A18f3BF249cf1f87FC203E90D8f650f2d63", // Arbitrum Sepolia USDC
|
|
24
|
+
OPTIMISM: "0x5fd84259d66Cd46123540766Be93DFE6D43130D7", // Optimism Sepolia USDC
|
|
25
|
+
AVALANCHE: "0x5425890298aed601595a70AB815c96711a31Bc65", // Fuji USDC
|
|
26
|
+
BASE: "0x036CbD53842c5426634e7929541eC2318f3dCF7e", // Base Sepolia USDC
|
|
27
|
+
SOLANA: "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU", // Solana Devnet USDC
|
|
28
|
+
};
|
|
29
|
+
// USDC ABI for balance checking
|
|
30
|
+
exports.usdcAbi = [
|
|
31
|
+
"function balanceOf(address owner) view returns (uint256)",
|
|
32
|
+
"function decimals() view returns (uint8)",
|
|
33
|
+
];
|
|
34
|
+
//# sourceMappingURL=nativeBridgeTypes.js.map
|
|
@@ -0,0 +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;AAMrD,2BAA2B;AACd,QAAA,kBAAkB,GAAG;IAC9B,KAAK;IACL,SAAS;IACT,KAAK;IACL,UAAU;IACV,UAAU;IACV,WAAW;IACX,MAAM;CACA,CAAA;AAEV,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"}
|
|
@@ -9,9 +9,10 @@ import { INativePayload } from "../native";
|
|
|
9
9
|
import { SubnetPayload } from "../../l2ps";
|
|
10
10
|
import { IdentityPayload } from "../abstraction";
|
|
11
11
|
import { InstantMessagingPayload } from "../instantMessaging";
|
|
12
|
-
|
|
12
|
+
import { NativeBridgePayload } from "../../bridge/nativeBridgeTypes";
|
|
13
|
+
export type TransactionContentData = ["web2Request", IWeb2Payload] | ["crosschainOperation", XMScript] | ["native", INativePayload] | ["demoswork", DemoScript] | ["subnet", SubnetPayload] | ["identity", IdentityPayload] | ["instantMessaging", InstantMessagingPayload] | ["nativeBridge", NativeBridgePayload];
|
|
13
14
|
export interface TransactionContent {
|
|
14
|
-
type: "web2Request" | "crosschainOperation" | "subnet" | "native" | "demoswork" | "genesis" | "NODE_ONLINE" | "identity" | "instantMessaging";
|
|
15
|
+
type: "web2Request" | "crosschainOperation" | "subnet" | "native" | "demoswork" | "genesis" | "NODE_ONLINE" | "identity" | "instantMessaging" | "nativeBridge";
|
|
15
16
|
from: forge.pki.ed25519.BinaryBuffer | forge.pki.PublicKey | ISignature;
|
|
16
17
|
to: forge.pki.ed25519.BinaryBuffer | forge.pki.PrivateKey | ISignature;
|
|
17
18
|
amount: number;
|