Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lock #15

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open

Lock #15

Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ secrets.json
database.sqlite
test.ts
test.bash
test2.ts
test2.ts
dist/
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"@types/mocha": "^10.0.3",
"@types/web3": "^1.2.2",
"axios": "^1.6.0",
"bignumber.js": "^9.1.2",
"bip39": "^3.1.0",
"borsh": "^1.0.0",
"bullmq": "^4.12.5",
Expand Down
28 changes: 15 additions & 13 deletions src/config/chainSpecs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const storageTestnetConfig: IEvmChainConfig = {
lastBlock: 17608314,
};

const bridgeTestChains: TChain[] = [
const bridgeTestChains = [
{
chain: 'BSC',
rpcURL: 'https://bsc-testnet.publicnode.com',
Expand Down Expand Up @@ -76,16 +76,16 @@ const bridgeTestChains: TChain[] = [
// chainId: 'pulsar-3',
// lastBlock: 50883
// },
// {
// chain: "TEZOS",
// rpcURL: "https://ghostnet.ecadinfra.com",
// restApiURL: "https://api.ghostnet.tzkt.io",
// contractAddress: "KT1NHxTSXAFKH2y94PpfqDsg4bZ5SiF2V8a4",
// intialFund: "50000",
// lastBlock: 5058309,
// nativeCoinSymbol: "XTZ",
// chainType: "tezos"
// },
{
chain: 'TEZOS',
rpcURL: 'https://ghostnet.ecadinfra.com',
restApiURL: 'https://api.ghostnet.tzkt.io',
contractAddress: 'KT1NHxTSXAFKH2y94PpfqDsg4bZ5SiF2V8a4',
intialFund: '50000',
lastBlock: 5058309,
nativeCoinSymbol: 'XTZ',
chainType: 'tezos',
},
{
chain: 'HEDERA',
rpcURL: 'https://testnet.hashio.io/api',
Expand All @@ -96,7 +96,7 @@ const bridgeTestChains: TChain[] = [
lastBlock: 7095475,
royaltyInfoProxyAddress: '0x870f7b68c0a64733dcF4D95E5C06aa34387B98BF',
},
];
] as const satisfies readonly TChain[];

const stakingTestChain: IStakingConfig = {
chain: 'BSC',
Expand All @@ -111,7 +111,7 @@ const stakingTestChain: IStakingConfig = {
};

const testnetBridgeConfig: IBridgeConfig = {
bridgeChains: bridgeTestChains,
bridgeChains: bridgeTestChains as unknown as TChain[],
storageConfig: storageTestnetConfig,
stakingConfig: stakingTestChain,
};
Expand Down Expand Up @@ -169,4 +169,6 @@ const prodBridgeConfig: IBridgeConfig = {

const BLOCK_CHUNKS = 1000;

export type SupportedChains = (typeof bridgeTestChains)[number]['chain'];

export { BLOCK_CHUNKS, testnetBridgeConfig, prodBridgeConfig };
2 changes: 1 addition & 1 deletion src/contractsTypes/tezosContractTypes/Bridge.code.ts

Large diffs are not rendered by default.

38 changes: 20 additions & 18 deletions src/contractsTypes/tezosContractTypes/Bridge.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,48 +19,48 @@ export type Storage = {
storage_deployer: address;
original_to_duplicate_mapping: BigMap<
{
0: address;
0: { addr: address } | { str: string };
1: string;
},
{
chain: string;
contract: bytes;
contract: { addr: address } | { str: string };
}
>;
duplicate_to_original_mapping: BigMap<
{
0: address;
0: { addr: address } | { str: string };
1: string;
},
{
chain: string;
contract: bytes;
contract: { addr: address } | { str: string };
}
>;
original_storage_mapping_nft: BigMap<
{
0: address;
0: { addr: address } | { str: string };
1: string;
},
address
>;
original_storage_mapping_sft: BigMap<
{
0: address;
0: { addr: address } | { str: string };
1: string;
},
address
>;
duplicate_storage_mapping_nft: BigMap<
{
0: address;
0: { addr: address } | { str: string };
1: string;
},
address
>;
duplicate_storage_mapping_sft: BigMap<
{
0: address;
0: { addr: address } | { str: string };
1: string;
},
address
Expand All @@ -74,7 +74,7 @@ type Methods = {
source_chain: string,
dest_chain: string,
dest_address: address,
source_nft_contract_address: bytes,
source_nft_contract_address: { addr: address } | { str: string },
name: string,
symbol: string,
royalty: nat,
Expand All @@ -94,7 +94,7 @@ type Methods = {
token_id: nat,
dest_chain: string,
dest_address: address,
collection: address,
collection: { addr: address } | { str: string },
token_amount: nat,
source_chain: string,
md: string,
Expand All @@ -104,22 +104,23 @@ type Methods = {
token_id: nat,
dest_chain: string,
dest_address: string,
source_nft_address: address,
source_nft_address: { addr: address } | { str: string },
token_amount: nat,
) => Promise<void>;
lock_internal: (
to: string,
token_id: nat,
collection: address,
collection: { addr: address } | { str: string },
original: boolean,
amt: nat,
new_deploy: boolean,
dest_chain: string,
) => Promise<void>;
lock_nft: (
token_id: nat,
dest_chain: string,
dest_address: string,
source_nft_address: address,
source_nft_address: { addr: address } | { str: string },
) => Promise<void>;
claim_validator_rewards: (
validator: address,
Expand All @@ -145,7 +146,7 @@ type MethodsObject = {
source_chain: string;
dest_chain: string;
dest_address: address;
source_nft_contract_address: bytes;
source_nft_contract_address: { addr: address } | { str: string };
name: string;
symbol: string;
royalty: nat;
Expand All @@ -165,7 +166,7 @@ type MethodsObject = {
token_id: nat;
dest_chain: string;
dest_address: address;
collection: address;
collection: { addr: address } | { str: string };
token_amount: nat;
source_chain: string;
md: string;
Expand All @@ -175,22 +176,23 @@ type MethodsObject = {
token_id: nat;
dest_chain: string;
dest_address: string;
source_nft_address: address;
source_nft_address: { addr: address } | { str: string };
token_amount: nat;
}) => Promise<void>;
lock_internal: (params: {
to: string;
token_id: nat;
collection: address;
collection: { addr: address } | { str: string };
original: boolean;
amt: nat;
new_deploy: boolean;
dest_chain: string;
}) => Promise<void>;
lock_nft: (params: {
token_id: nat;
dest_chain: string;
dest_address: string;
source_nft_address: address;
source_nft_address: { addr: address } | { str: string };
}) => Promise<void>;
claim_validator_rewards: (params: {
validator: address;
Expand Down

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/contractsTypes/tezosContractTypes/CollectionFactory.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ import { address, MMap } from './type-aliases';

export type Storage = {
owner: { Some: address } | null;
collection_to_store: MMap<address, address>;
collection_to_store: MMap<{ addr: address } | { str: string }, address>;
};

type Methods = {
deploy_sft: (param: address) => Promise<void>;
deploy_nft: (param: address) => Promise<void>;
addr: (param: address) => Promise<void>;
str: (param: string) => Promise<void>;
set_owner: (param: address) => Promise<void>;
};

type MethodsObject = {
deploy_sft: (param: address) => Promise<void>;
deploy_nft: (param: address) => Promise<void>;
addr: (param: address) => Promise<void>;
str: (param: string) => Promise<void>;
set_owner: (param: address) => Promise<void>;
};

Expand Down
Loading