Skip to content

Commit

Permalink
update(tezos): tezos types
Browse files Browse the repository at this point in the history
  • Loading branch information
D4mph1r committed Sep 11, 2024
1 parent f9e8572 commit 0fbfa53
Show file tree
Hide file tree
Showing 24 changed files with 485 additions and 662 deletions.
11 changes: 3 additions & 8 deletions src/contractsTypes/tezos/Bridge.code.ts

Large diffs are not rendered by default.

289 changes: 169 additions & 120 deletions src/contractsTypes/tezos/Bridge.types.ts
Original file line number Diff line number Diff line change
@@ -1,70 +1,68 @@
import {
ContractAbstractionFromContractType,
WalletContractAbstractionFromContractType,
} from './type-utils';
import {
address,
BigMap,
bytes,
key,
mutez,
nat,
signature,
} from './type-aliases';

import { ContractAbstractionFromContractType, WalletContractAbstractionFromContractType } from './type-utils';
import { address, BigMap, bytes, key, mutez, nat, signature } from './type-aliases';

export type Storage = {
validators: BigMap<address, mutez>;
blacklisted_validators: BigMap<address, boolean>;
unique_identifiers: BigMap<bytes, boolean>;
collection_deployer: address;
nft_collection_deployer: address;
sft_collection_deployer: address;
storage_deployer: address;
original_to_duplicate_mapping: BigMap<
{
0: { addr: address } | { str: string };
1: string;
},
{
chain: string;
contract: { addr: address } | { str: string };
}
>;
duplicate_to_original_mapping: BigMap<
{
0: { addr: address } | { str: string };
1: string;
},
{
chain: string;
contract: { addr: address } | { str: string };
}
>;
original_storage_mapping_nft: BigMap<
{
0: { addr: address } | { str: string };
1: string;
},
address
>;
original_storage_mapping_sft: BigMap<
{
0: { addr: address } | { str: string };
1: string;
},
address
>;
duplicate_storage_mapping_nft: BigMap<
{
0: { addr: address } | { str: string };
1: string;
},
address
>;
duplicate_storage_mapping_sft: BigMap<
{
0: { addr: address } | { str: string };
1: string;
},
address
>;
original_to_duplicate_mapping: BigMap<{
0: (
{ addr: address }
| { str: string }
);
1: string;
}, {
chain: string;
contract: (
{ addr: address }
| { str: string }
);
}>;
duplicate_to_original_mapping: BigMap<{
0: (
{ addr: address }
| { str: string }
);
1: string;
}, {
chain: string;
contract: (
{ addr: address }
| { str: string }
);
}>;
original_storage_mapping_nft: BigMap<{
0: (
{ addr: address }
| { str: string }
);
1: string;
}, address>;
original_storage_mapping_sft: BigMap<{
0: (
{ addr: address }
| { str: string }
);
1: string;
}, address>;
duplicate_storage_mapping_nft: BigMap<{
0: (
{ addr: address }
| { str: string }
);
1: string;
}, address>;
duplicate_storage_mapping_sft: BigMap<{
0: (
{ addr: address }
| { str: string }
);
1: string;
}, address>;
validators_count: nat;
};

Expand All @@ -74,7 +72,10 @@ type Methods = {
source_chain: string,
dest_chain: string,
dest_address: address,
source_nft_contract_address: { addr: address } | { str: string },
source_nft_contract_address: (
{ addr: address }
| { str: string }
),
name: string,
symbol: string,
royalty: nat,
Expand All @@ -84,6 +85,7 @@ type Methods = {
token_amount: nat,
nft_type: string,
fee: mutez,
lock_tx_chain: string,
sigs: Array<{
signer: key;
sig: signature;
Expand All @@ -94,33 +96,50 @@ type Methods = {
token_id: nat,
dest_chain: string,
dest_address: address,
collection: { addr: address } | { str: string },
collection: (
{ addr: address }
| { str: string }
),
token_amount: nat,
token_type: string,
source_chain: string,
md: string,
transaction_hash: string,
lock_tx_chain: string,
) => Promise<void>;
lock_sft: (
token_id: nat,
dest_chain: string,
dest_address: string,
source_nft_address: { addr: address } | { str: string },
source_nft_address: (
{ addr: address }
| { str: string }
),
token_amount: nat,
metadata_uri: string,
) => Promise<void>;
lock_internal: (
to: string,
token_id: nat,
collection: { addr: address } | { str: string },
collection: (
{ addr: address }
| { str: string }
),
original: boolean,
amt: nat,
new_deploy: boolean,
dest_chain: string,
metadata_uri: string,
) => Promise<void>;
lock_nft: (
token_id: nat,
dest_chain: string,
dest_address: string,
source_nft_address: { addr: address } | { str: string },
source_nft_address: (
{ addr: address }
| { str: string }
),
metadata_uri: string,
) => Promise<void>;
claim_validator_rewards: (
validator: address,
Expand All @@ -130,6 +149,14 @@ type Methods = {
addr: address;
}>,
) => Promise<void>;
blacklist_validator: (
validator: address,
sigs: Array<{
signer: key;
sig: signature;
addr: address;
}>,
) => Promise<void>;
add_validator: (
validator: address,
sigs: Array<{
Expand All @@ -142,83 +169,105 @@ type Methods = {

type MethodsObject = {
claim_nft: (params: {
token_id: nat;
source_chain: string;
dest_chain: string;
dest_address: address;
source_nft_contract_address: { addr: address } | { str: string };
name: string;
symbol: string;
royalty: nat;
royalty_receiver: address;
metadata: string;
transaction_hash: string;
token_amount: nat;
nft_type: string;
fee: mutez;
token_id: nat,
source_chain: string,
dest_chain: string,
dest_address: address,
source_nft_contract_address: (
{ addr: address }
| { str: string }
),
name: string,
symbol: string,
royalty: nat,
royalty_receiver: address,
metadata: string,
transaction_hash: string,
token_amount: nat,
nft_type: string,
fee: mutez,
lock_tx_chain: string,
sigs: Array<{
signer: key;
sig: signature;
addr: address;
}>;
}>,
}) => Promise<void>;
internal_ns_nd_part: (params: {
token_id: nat;
dest_chain: string;
dest_address: address;
collection: { addr: address } | { str: string };
token_amount: nat;
source_chain: string;
md: string;
transaction_hash: string;
token_id: nat,
dest_chain: string,
dest_address: address,
collection: (
{ addr: address }
| { str: string }
),
token_amount: nat,
token_type: string,
source_chain: string,
md: string,
transaction_hash: string,
lock_tx_chain: string,
}) => Promise<void>;
lock_sft: (params: {
token_id: nat;
dest_chain: string;
dest_address: string;
source_nft_address: { addr: address } | { str: string };
token_amount: nat;
token_id: nat,
dest_chain: string,
dest_address: string,
source_nft_address: (
{ addr: address }
| { str: string }
),
token_amount: nat,
metadata_uri: string,
}) => Promise<void>;
lock_internal: (params: {
to: string;
token_id: nat;
collection: { addr: address } | { str: string };
original: boolean;
amt: nat;
new_deploy: boolean;
dest_chain: string;
to: string,
token_id: nat,
collection: (
{ addr: address }
| { str: string }
),
original: boolean,
amt: nat,
new_deploy: boolean,
dest_chain: string,
metadata_uri: string,
}) => Promise<void>;
lock_nft: (params: {
token_id: nat;
dest_chain: string;
dest_address: string;
source_nft_address: { addr: address } | { str: string };
token_id: nat,
dest_chain: string,
dest_address: string,
source_nft_address: (
{ addr: address }
| { str: string }
),
metadata_uri: string,
}) => Promise<void>;
claim_validator_rewards: (params: {
validator: address;
validator: address,
sigs: Array<{
signer: key;
sig: signature;
addr: address;
}>;
}>,
}) => Promise<void>;
blacklist_validator: (params: {
validator: address,
sigs: Array<{
signer: key;
sig: signature;
addr: address;
}>,
}) => Promise<void>;
add_validator: (params: {
validator: address;
validator: address,
sigs: Array<{
signer: key;
sig: signature;
addr: address;
}>;
}>,
}) => Promise<void>;
};

type contractTypes = {
methods: Methods;
methodsObject: MethodsObject;
storage: Storage;
code: { __type: 'BridgeCode'; protocol: string; code: object[] };
};
export type BridgeContractType =
ContractAbstractionFromContractType<contractTypes>;
export type BridgeWalletType =
WalletContractAbstractionFromContractType<contractTypes>;
type contractTypes = { methods: Methods, methodsObject: MethodsObject, storage: Storage, code: { __type: 'BridgeCode', protocol: string, code: object[] } };
export type BridgeContractType = ContractAbstractionFromContractType<contractTypes>;
export type BridgeWalletType = WalletContractAbstractionFromContractType<contractTypes>;
11 changes: 0 additions & 11 deletions src/contractsTypes/tezos/BridgeStorage.code.ts

This file was deleted.

Loading

0 comments on commit 0fbfa53

Please sign in to comment.