@kynesyslabs/demosdk 2.2.30 → 2.2.32

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.
@@ -1,4 +1,6 @@
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
- export * as NativeBridge from "./nativeBridge";
4
+ import { methods as NativeBridgeMethods } from "./nativeBridge";
5
+ export { NativeBridgeMethods };
6
+ export { BridgeOperation as NativeBridgeOperation, NativeBridgePayload, 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";
@@ -1,43 +1,17 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
2
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.NativeBridge = exports.SupportedTokens = exports.SupportedChains = exports.ChainProviders = void 0;
3
+ exports.NativeBridgeUSDCAbi = exports.NativeBridgeUSDCContracts = exports.NativeBridgeSupportedEVMChains = exports.NativeBridgeSupportedStablecoins = exports.NativeBridgeSupportedChains = exports.NativeBridgeMethods = exports.SupportedTokens = exports.SupportedChains = exports.ChainProviders = void 0;
37
4
  const constants_1 = require("../types/bridge/constants");
38
5
  Object.defineProperty(exports, "ChainProviders", { enumerable: true, get: function () { return constants_1.ChainProviders; } });
39
6
  Object.defineProperty(exports, "SupportedChains", { enumerable: true, get: function () { return constants_1.SupportedChains; } });
40
7
  Object.defineProperty(exports, "SupportedTokens", { enumerable: true, get: function () { return constants_1.SupportedTokens; } });
41
- // Native bridge exports
42
- exports.NativeBridge = __importStar(require("./nativeBridge"));
8
+ const nativeBridge_1 = require("./nativeBridge");
9
+ Object.defineProperty(exports, "NativeBridgeMethods", { enumerable: true, get: function () { return nativeBridge_1.methods; } });
10
+ // Export types from nativeBridgeTypes
11
+ var nativeBridgeTypes_1 = require("./nativeBridgeTypes");
12
+ Object.defineProperty(exports, "NativeBridgeSupportedChains", { enumerable: true, get: function () { return nativeBridgeTypes_1.supportedChains; } });
13
+ Object.defineProperty(exports, "NativeBridgeSupportedStablecoins", { enumerable: true, get: function () { return nativeBridgeTypes_1.supportedStablecoins; } });
14
+ Object.defineProperty(exports, "NativeBridgeSupportedEVMChains", { enumerable: true, get: function () { return nativeBridgeTypes_1.supportedEVMChains; } });
15
+ Object.defineProperty(exports, "NativeBridgeUSDCContracts", { enumerable: true, get: function () { return nativeBridgeTypes_1.usdcContracts; } });
16
+ Object.defineProperty(exports, "NativeBridgeUSDCAbi", { enumerable: true, get: function () { return nativeBridgeTypes_1.usdcAbi; } });
43
17
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/bridge/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,wDAIiC;AAI7B,+FAPA,0BAAc,OAOA;AACd,gGAPA,2BAAe,OAOA;AACf,gGAPA,2BAAe,OAOA;AAGnB,wBAAwB;AACxB,+DAA8C"}
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,iDAA+D;AACtD,oGADW,sBAAmB,OACX;AAE5B,sCAAsC;AACtC,yDAW4B;AALxB,gIAAA,eAAe,OAA+B;AAC9C,qIAAA,oBAAoB,OAAoC;AACxD,mIAAA,kBAAkB,OAAkC;AACpD,8HAAA,aAAa,OAA6B;AAC1C,wHAAA,OAAO,OAAuB"}
@@ -1,28 +1,12 @@
1
- export declare const supportedChains: readonly ["EVM", "SOLANA"];
2
- export declare const supportedStablecoins: readonly ["USDC"];
3
- export declare const supportedEVMChains: readonly ["eth", "polygon", "bsc", "arbitrum", "optimism", "avalanche", "base"];
4
- export declare const usdcContracts: {
5
- ETHEREUM: string;
6
- POLYGON: string;
7
- BSC: string;
8
- ARBITRUM: string;
9
- OPTIMISM: string;
10
- AVALANCHE: string;
11
- BASE: string;
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.usdcAbi = exports.usdcContracts = exports.supportedEVMChains = exports.supportedStablecoins = exports.supportedChains = void 0;
4
- // Supported chains and stablecoins
5
- exports.supportedChains = ["EVM", "SOLANA"];
6
- exports.supportedStablecoins = ["USDC"];
7
- // Supported chains for EVM
8
- exports.supportedEVMChains = [
9
- "eth",
10
- "polygon",
11
- "bsc",
12
- "arbitrum",
13
- "optimism",
14
- "avalanche",
15
- "base",
16
- ];
17
- // USDC contract addresses for different chains (testnet addresses)
18
- exports.usdcContracts = {
19
- ETHEREUM: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238", // Sepolia USDC
20
- POLYGON: "0x0FA8781a83E46826621b3BC094Ea2A0212e71B23", // Mumbai USDC
21
- BSC: "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d", // BSC Testnet USDC
22
- ARBITRUM: "0xfd064A18f3BF249cf1f87FC203E90D8f650f2d63", // Arbitrum Sepolia USDC
23
- OPTIMISM: "0x5fd84259d66Cd46123540766Be93DFE6D43130D7", // Optimism Sepolia USDC
24
- AVALANCHE: "0x5425890298aed601595a70AB815c96711a31Bc65", // Fuji USDC
25
- BASE: "0x036CbD53842c5426634e7929541eC2318f3dCF7e", // Base Sepolia USDC
26
- SOLANA: "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU", // Solana Devnet USDC
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,mCAAmC;AACtB,QAAA,eAAe,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAU,CAAA;AAC5C,QAAA,oBAAoB,GAAG,CAAC,MAAM,CAAU,CAAA;AAErD,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"}
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 BridgeOperation = {
4
+ demoAddress: string;
5
+ originChain: SupportedChain;
6
+ destinationChain: SupportedChain;
7
+ originAddress: string;
8
+ destinationAddress: string;
9
+ amount: string;
10
+ token: SupportedStablecoin;
11
+ txHash: string;
12
+ status: "empty" | "pending" | "completed" | "failed";
13
+ };
14
+ export type NativeBridgePayload = {
15
+ operation: BridgeOperation;
16
+ };
17
+ export declare const supportedEVMChains: readonly ["eth", "polygon", "bsc", "arbitrum", "optimism", "avalanche", "base"];
18
+ export declare const usdcContracts: {
19
+ ETHEREUM: string;
20
+ POLYGON: string;
21
+ BSC: string;
22
+ ARBITRUM: string;
23
+ OPTIMISM: string;
24
+ AVALANCHE: string;
25
+ BASE: string;
26
+ SOLANA: string;
27
+ };
28
+ export declare const usdcAbi: string[];
29
+ export type SupportedChain = typeof supportedChains[number];
30
+ export type SupportedStablecoin = typeof supportedStablecoins[number];
31
+ export type SupportedEVMChain = typeof supportedEVMChains[number];
@@ -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;AAoBrD,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"}
package/build/index.js CHANGED
@@ -49,5 +49,6 @@ exports.l2ps = __importStar(require("./l2ps")); // REVIEW This is exporting the
49
49
  exports.websdk = __importStar(require("./websdk"));
50
50
  exports.abstraction = __importStar(require("./abstraction"));
51
51
  exports.web2 = __importStar(require("./websdk/Web2Calls"));
52
+ // Export bridge module and its types
52
53
  exports.bridge = __importStar(require("./bridge"));
53
54
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAA6B;AAC7B,iDAAgC;AAChC,sDAAsD;AACtD,2DAA0C;AAC1C,iDAAgC;AAEhC,gCAAgC;AAChC,oEAAmD;AACnD,gEAA+C;AAC/C,4DAA2C,CAAC,gCAAgC;AAE5E,mDAAkC;AAClC,yDAAwC;AAExC,+CAA8B,CAAC,oFAAoF;AAEnH,mDAAkC;AAClC,6DAA4C;AAC5C,2DAA0C;AAE1C,mDAAkC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAA6B;AAC7B,iDAAgC;AAChC,sDAAsD;AACtD,2DAA0C;AAC1C,iDAAgC;AAEhC,gCAAgC;AAChC,oEAAmD;AACnD,gEAA+C;AAC/C,4DAA2C,CAAC,gCAAgC;AAE5E,mDAAkC;AAClC,yDAAwC;AAExC,+CAA8B,CAAC,oFAAoF;AAEnH,mDAAkC;AAClC,6DAA4C;AAC5C,2DAA0C;AAE1C,qCAAqC;AACrC,mDAAkC"}
@@ -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
- export type TransactionContentData = ["web2Request", IWeb2Payload] | ["crosschainOperation", XMScript] | ["native", INativePayload] | ["demoswork", DemoScript] | ["subnet", SubnetPayload] | ["identity", IdentityPayload] | ["instantMessaging", InstantMessagingPayload];
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kynesyslabs/demosdk",
3
- "version": "2.2.30",
3
+ "version": "2.2.32",
4
4
  "main": "build/index.js",
5
5
  "types": "build/index.d.ts",
6
6
  "author": "Kynesys Labs",