From d801722deadc287b53a6a78c57c66595864dca41 Mon Sep 17 00:00:00 2001 From: Cifko Date: Mon, 29 Jan 2024 17:05:40 +0100 Subject: [PATCH] feat: transparent bindings and bigints --- bindings/index.ts | 11 ---- .../AccountsCreateFreeTestCoinsRequest.ts | 5 +- .../AccountsCreateFreeTestCoinsResponse.ts | 8 ++- bindings/src/types/AccountsCreateRequest.ts | 5 +- bindings/src/types/AccountsInvokeRequest.ts | 3 +- bindings/src/types/AccountsListResponse.ts | 2 +- bindings/src/types/Amount.ts | 3 -- bindings/src/types/BalanceEntry.ts | 5 +- bindings/src/types/BalanceProofSignature.ts | 3 -- bindings/src/types/Block.ts | 10 ++-- bindings/src/types/BlockId.ts | 3 -- bindings/src/types/CallInstructionRequest.ts | 2 +- bindings/src/types/ClaimBurnRequest.ts | 3 +- bindings/src/types/ClaimBurnResponse.ts | 6 +-- .../src/types/ClaimValidatorFeesRequest.ts | 3 +- .../src/types/ClaimValidatorFeesResponse.ts | 6 +-- bindings/src/types/CommitteeShard.ts | 3 +- bindings/src/types/CommitteeShardInfo.ts | 3 +- bindings/src/types/ComponentAccessRules.ts | 1 + bindings/src/types/ComponentHeader.ts | 3 +- bindings/src/types/ConfidentialClaim.ts | 3 +- .../ConfidentialCreateOutputProofRequest.ts | 3 +- bindings/src/types/ConfidentialOutput.ts | 5 +- bindings/src/types/ConfidentialStatement.ts | 11 ++-- .../src/types/ConfidentialTransferRequest.ts | 5 +- .../src/types/ConfidentialTransferResponse.ts | 6 +-- .../src/types/ConfidentialWithdrawProof.ts | 6 +-- bindings/src/types/EncryptedData.ts | 3 -- bindings/src/types/FeeClaim.ts | 5 +- bindings/src/types/FeeCostBreakdown.ts | 6 +-- bindings/src/types/FeeReceipt.ts | 8 ++- bindings/src/types/FinalizeResult.ts | 3 +- bindings/src/types/ForeignProposal.ts | 6 +-- bindings/src/types/GetBlockRequest.ts | 3 +- bindings/src/types/GetBlocksCountResponse.ts | 2 +- bindings/src/types/GetBlocksRequest.ts | 4 +- .../src/types/GetEpochManagerStatsResponse.ts | 2 +- bindings/src/types/GetNonFungiblesRequest.ts | 4 +- bindings/src/types/GetShardKey.ts | 2 +- bindings/src/types/GetSubstateResponse.ts | 3 +- .../types/GetSubstatesByTransactionRequest.ts | 3 +- bindings/src/types/GetTemplateRequest.ts | 3 +- bindings/src/types/GetTemplatesRequest.ts | 2 +- bindings/src/types/GetTransactionRequest.ts | 3 +- .../src/types/GetTransactionResultRequest.ts | 3 +- .../src/types/GetValidatorFeesResponse.ts | 4 +- bindings/src/types/Hash.ts | 3 -- bindings/src/types/InspectSubstateResponse.ts | 3 +- bindings/src/types/Instruction.ts | 8 ++- bindings/src/types/KeysCreateResponse.ts | 2 +- bindings/src/types/ListBlocksRequest.ts | 3 +- bindings/src/types/MintAccountNftRequest.ts | 5 +- bindings/src/types/MintAccountNftResponse.ts | 3 +- bindings/src/types/NodeHeight.ts | 2 +- bindings/src/types/NonFungibleId.ts | 2 +- bindings/src/types/NonFungibleSubstate.ts | 2 +- bindings/src/types/PedersonCommitmentBytes.ts | 3 -- bindings/src/types/ProofsCancelRequest.ts | 2 +- bindings/src/types/ProofsFinalizeRequest.ts | 2 +- bindings/src/types/ProofsGenerateRequest.ts | 5 +- bindings/src/types/ProofsGenerateResponse.ts | 2 +- bindings/src/types/QcId.ts | 3 -- bindings/src/types/QuorumCertificate.ts | 6 +-- bindings/src/types/Resource.ts | 3 +- bindings/src/types/ResourceContainer.ts | 13 +++-- bindings/src/types/RevealFundsRequest.ts | 5 +- bindings/src/types/RevealFundsResponse.ts | 6 +-- bindings/src/types/RistrettoPublicKeyBytes.ts | 3 -- bindings/src/types/RuleRequirement.ts | 3 +- bindings/src/types/Shard.ts | 3 -- bindings/src/types/ShardEvidence.ts | 3 +- .../src/types/SubmitTransactionResponse.ts | 3 +- bindings/src/types/SubstateDestroyed.ts | 9 ++-- bindings/src/types/SubstateId.ts | 3 +- bindings/src/types/SubstateRecord.ts | 9 ++-- bindings/src/types/TemplateMetadata.ts | 5 +- .../src/types/TemplateRegistrationResponse.ts | 2 +- bindings/src/types/TransactionAtom.ts | 7 ++- .../src/types/TransactionClaimBurnResponse.ts | 3 +- bindings/src/types/TransactionGetRequest.ts | 3 +- .../src/types/TransactionGetResultRequest.ts | 3 +- .../src/types/TransactionGetResultResponse.ts | 3 +- bindings/src/types/TransactionId.ts | 5 -- bindings/src/types/TransactionReceipt.ts | 3 +- .../src/types/TransactionSubmitRequest.ts | 4 +- .../src/types/TransactionSubmitResponse.ts | 3 +- .../src/types/TransactionWaitResultRequest.ts | 5 +- .../types/TransactionWaitResultResponse.ts | 6 +-- bindings/src/types/TransferRequest.ts | 5 +- bindings/src/types/TransferResponse.ts | 8 ++- .../src/types/UnclaimedConfidentialOutput.ts | 3 +- .../UnclaimedConfidentialOutputAddress.ts | 3 -- bindings/src/types/ValidatorFee.ts | 7 ++- bindings/src/types/ValidatorNode.ts | 3 +- clients/tari_indexer_client/src/types.rs | 8 +++ clients/validator_node_client/src/types.rs | 21 ++++++++ clients/wallet_daemon_client/src/types.rs | 53 +++++++++++++++++++ dan_layer/common_types/src/committee.rs | 1 + dan_layer/common_types/src/node_height.rs | 2 +- dan_layer/common_types/src/shard.rs | 3 -- dan_layer/engine_types/src/commit_result.rs | 1 + dan_layer/engine_types/src/component.rs | 1 + .../engine_types/src/confidential/claim.rs | 1 + .../src/confidential/unclaimed.rs | 1 + .../engine_types/src/confidential/withdraw.rs | 2 + dan_layer/engine_types/src/fee_claim.rs | 2 + dan_layer/engine_types/src/fees.rs | 5 ++ dan_layer/engine_types/src/instruction.rs | 3 ++ dan_layer/engine_types/src/resource.rs | 1 + .../engine_types/src/resource_container.rs | 8 ++- dan_layer/engine_types/src/substate.rs | 2 +- .../engine_types/src/transaction_receipt.rs | 1 + .../storage/src/consensus_models/block.rs | 11 ++-- .../storage/src/consensus_models/command.rs | 4 ++ .../src/consensus_models/foreign_proposal.rs | 2 + .../consensus_models/quorum_certificate.rs | 9 ++-- .../storage/src/consensus_models/substate.rs | 6 +++ .../src/global/models/validator_node.rs | 1 + .../template_lib/src/auth/access_rules.rs | 4 +- .../template_lib/src/crypto/balance_proof.rs | 3 -- .../template_lib/src/crypto/commitment.rs | 3 -- .../template_lib/src/crypto/ristretto.rs | 9 +--- dan_layer/template_lib/src/hash.rs | 3 -- dan_layer/template_lib/src/models/amount.rs | 7 +-- .../src/models/confidential_proof.rs | 7 ++- .../src/models/layer_one_commitment.rs | 5 +- .../template_lib/src/models/non_fungible.rs | 2 +- dan_layer/transaction/src/transaction.rs | 2 +- dan_layer/transaction/src/transaction_id.rs | 4 -- 129 files changed, 281 insertions(+), 313 deletions(-) delete mode 100644 bindings/src/types/Amount.ts delete mode 100644 bindings/src/types/BalanceProofSignature.ts delete mode 100644 bindings/src/types/BlockId.ts delete mode 100644 bindings/src/types/EncryptedData.ts delete mode 100644 bindings/src/types/Hash.ts delete mode 100644 bindings/src/types/PedersonCommitmentBytes.ts delete mode 100644 bindings/src/types/QcId.ts delete mode 100644 bindings/src/types/RistrettoPublicKeyBytes.ts delete mode 100644 bindings/src/types/Shard.ts delete mode 100644 bindings/src/types/TransactionId.ts delete mode 100644 bindings/src/types/UnclaimedConfidentialOutputAddress.ts diff --git a/bindings/index.ts b/bindings/index.ts index 14d5f46425..ca175d8e72 100644 --- a/bindings/index.ts +++ b/bindings/index.ts @@ -23,7 +23,6 @@ export * from "./src/types/AccountsListResponse"; export * from "./src/types/AddAddressRequest"; export * from "./src/types/AddPeerRequest"; export * from "./src/types/AddPeerResponse"; -export * from "./src/types/Amount"; export * from "./src/types/Arg"; export * from "./src/types/ArgDef"; export * from "./src/types/AuthGetAllJwtRequest"; @@ -37,9 +36,7 @@ export * from "./src/types/AuthLoginResponse"; export * from "./src/types/AuthRevokeTokenRequest"; export * from "./src/types/AuthRevokeTokenResponse"; export * from "./src/types/BalanceEntry"; -export * from "./src/types/BalanceProofSignature"; export * from "./src/types/Block"; -export * from "./src/types/BlockId"; export * from "./src/types/BucketId"; export * from "./src/types/CallInstructionRequest"; export * from "./src/types/ClaimBurnRequest"; @@ -69,7 +66,6 @@ export * from "./src/types/ConnectionDirection"; export * from "./src/types/Decision"; export * from "./src/types/DeleteAddressRequest"; export * from "./src/types/DryRunTransactionFinalizeResult"; -export * from "./src/types/EncryptedData"; export * from "./src/types/Epoch"; export * from "./src/types/Event"; export * from "./src/types/Evidence"; @@ -119,7 +115,6 @@ export * from "./src/types/GetTransactionResultRequest"; export * from "./src/types/GetTransactionResultResponse"; export * from "./src/types/GetValidatorFeesRequest"; export * from "./src/types/GetValidatorFeesResponse"; -export * from "./src/types/Hash"; export * from "./src/types/IndexedValue"; export * from "./src/types/IndexedWellKnownTypes"; export * from "./src/types/IndexerTransactionFinalizedResult"; @@ -156,7 +151,6 @@ export * from "./src/types/NonFungibleIndexAddress"; export * from "./src/types/NonFungibleSubstate"; export * from "./src/types/Ordering"; export * from "./src/types/OwnerRule"; -export * from "./src/types/PedersonCommitmentBytes"; export * from "./src/types/ProofId"; export * from "./src/types/ProofsCancelRequest"; export * from "./src/types/ProofsCancelResponse"; @@ -164,7 +158,6 @@ export * from "./src/types/ProofsFinalizeRequest"; export * from "./src/types/ProofsFinalizeResponse"; export * from "./src/types/ProofsGenerateRequest"; export * from "./src/types/ProofsGenerateResponse"; -export * from "./src/types/QcId"; export * from "./src/types/QuorumCertificate"; export * from "./src/types/QuorumDecision"; export * from "./src/types/RegisterValidatorNodeRequest"; @@ -179,12 +172,10 @@ export * from "./src/types/ResourceType"; export * from "./src/types/RestrictedAccessRule"; export * from "./src/types/RevealFundsRequest"; export * from "./src/types/RevealFundsResponse"; -export * from "./src/types/RistrettoPublicKeyBytes"; export * from "./src/types/RuleRequirement"; export * from "./src/types/SettingsGetResponse"; export * from "./src/types/SettingsSetRequest"; export * from "./src/types/SettingsSetResponse"; -export * from "./src/types/Shard"; export * from "./src/types/ShardEvidence"; export * from "./src/types/SubmitTransactionRequest"; export * from "./src/types/SubmitTransactionResponse"; @@ -210,7 +201,6 @@ export * from "./src/types/TransactionGetRequest"; export * from "./src/types/TransactionGetResponse"; export * from "./src/types/TransactionGetResultRequest"; export * from "./src/types/TransactionGetResultResponse"; -export * from "./src/types/TransactionId"; export * from "./src/types/TransactionReceipt"; export * from "./src/types/TransactionReceiptAddress"; export * from "./src/types/TransactionResult"; @@ -224,7 +214,6 @@ export * from "./src/types/TransferRequest"; export * from "./src/types/TransferResponse"; export * from "./src/types/Type"; export * from "./src/types/UnclaimedConfidentialOutput"; -export * from "./src/types/UnclaimedConfidentialOutputAddress"; export * from "./src/types/ValidatorFee"; export * from "./src/types/ValidatorNode"; export * from "./src/types/ValidatorSignature"; diff --git a/bindings/src/types/AccountsCreateFreeTestCoinsRequest.ts b/bindings/src/types/AccountsCreateFreeTestCoinsRequest.ts index 750ca5f16e..b0b4c93250 100644 --- a/bindings/src/types/AccountsCreateFreeTestCoinsRequest.ts +++ b/bindings/src/types/AccountsCreateFreeTestCoinsRequest.ts @@ -1,10 +1,9 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Amount } from "./Amount"; import type { ComponentAddressOrName } from "./ComponentAddressOrName"; export interface AccountsCreateFreeTestCoinsRequest { account: ComponentAddressOrName | null; - amount: Amount; - max_fee: Amount | null; + amount: number; + max_fee: number | null; key_id: number | null; } diff --git a/bindings/src/types/AccountsCreateFreeTestCoinsResponse.ts b/bindings/src/types/AccountsCreateFreeTestCoinsResponse.ts index c3b206447e..32779695f0 100644 --- a/bindings/src/types/AccountsCreateFreeTestCoinsResponse.ts +++ b/bindings/src/types/AccountsCreateFreeTestCoinsResponse.ts @@ -1,12 +1,10 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Amount } from "./Amount"; import type { FinalizeResult } from "./FinalizeResult"; -import type { TransactionId } from "./TransactionId"; export interface AccountsCreateFreeTestCoinsResponse { - transaction_id: TransactionId; - amount: Amount; - fee: Amount; + transaction_id: string; + amount: number; + fee: number; result: FinalizeResult; public_key: string; } diff --git a/bindings/src/types/AccountsCreateRequest.ts b/bindings/src/types/AccountsCreateRequest.ts index 246c6d77c3..47bd21959f 100644 --- a/bindings/src/types/AccountsCreateRequest.ts +++ b/bindings/src/types/AccountsCreateRequest.ts @@ -1,11 +1,10 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Amount } from "./Amount"; import type { ComponentAccessRules } from "./ComponentAccessRules"; export interface AccountsCreateRequest { account_name: string | null; custom_access_rules: ComponentAccessRules | null; - max_fee: Amount | null; + max_fee: number | null; is_default: boolean; - key_id: bigint | null; + key_id: number | null; } diff --git a/bindings/src/types/AccountsInvokeRequest.ts b/bindings/src/types/AccountsInvokeRequest.ts index fef6794dfb..b84114eb16 100644 --- a/bindings/src/types/AccountsInvokeRequest.ts +++ b/bindings/src/types/AccountsInvokeRequest.ts @@ -1,5 +1,4 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Amount } from "./Amount"; import type { Arg } from "./Arg"; import type { ComponentAddressOrName } from "./ComponentAddressOrName"; @@ -7,5 +6,5 @@ export interface AccountsInvokeRequest { account: ComponentAddressOrName | null; method: string; args: Array; - max_fee: Amount | null; + max_fee: number | null; } diff --git a/bindings/src/types/AccountsListResponse.ts b/bindings/src/types/AccountsListResponse.ts index d786c27648..84e17e314f 100644 --- a/bindings/src/types/AccountsListResponse.ts +++ b/bindings/src/types/AccountsListResponse.ts @@ -3,5 +3,5 @@ import type { AccountInfo } from "./AccountInfo"; export interface AccountsListResponse { accounts: Array; - total: bigint; + total: number; } diff --git a/bindings/src/types/Amount.ts b/bindings/src/types/Amount.ts deleted file mode 100644 index 07f91ec68a..0000000000 --- a/bindings/src/types/Amount.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type Amount = number; diff --git a/bindings/src/types/BalanceEntry.ts b/bindings/src/types/BalanceEntry.ts index 35d70ab5e7..306f44ab3e 100644 --- a/bindings/src/types/BalanceEntry.ts +++ b/bindings/src/types/BalanceEntry.ts @@ -1,5 +1,4 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Amount } from "./Amount"; import type { ResourceAddress } from "./ResourceAddress"; import type { ResourceType } from "./ResourceType"; import type { SubstateId } from "./SubstateId"; @@ -7,8 +6,8 @@ import type { SubstateId } from "./SubstateId"; export interface BalanceEntry { vault_address: SubstateId; resource_address: ResourceAddress; - balance: Amount; + balance: number; resource_type: ResourceType; - confidential_balance: Amount; + confidential_balance: number; token_symbol: string | null; } diff --git a/bindings/src/types/BalanceProofSignature.ts b/bindings/src/types/BalanceProofSignature.ts deleted file mode 100644 index 0efd5da591..0000000000 --- a/bindings/src/types/BalanceProofSignature.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type BalanceProofSignature = Array; diff --git a/bindings/src/types/Block.ts b/bindings/src/types/Block.ts index 08e6354663..cdea351a90 100644 --- a/bindings/src/types/Block.ts +++ b/bindings/src/types/Block.ts @@ -1,25 +1,23 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { BlockId } from "./BlockId"; import type { Command } from "./Command"; import type { Epoch } from "./Epoch"; import type { NodeHeight } from "./NodeHeight"; import type { QuorumCertificate } from "./QuorumCertificate"; -import type { Shard } from "./Shard"; export interface Block { - id: BlockId; - parent: BlockId; + id: string; + parent: string; justify: QuorumCertificate; height: NodeHeight; epoch: Epoch; proposed_by: string; - total_leader_fee: bigint; + total_leader_fee: number; merkle_root: string; commands: Array; is_dummy: boolean; is_processed: boolean; is_committed: boolean; - foreign_indexes: Record; + foreign_indexes: Array<{ shard: string; counter: number }>; stored_at: string | null; signature: { public_nonce: string; signature: string } | null; } diff --git a/bindings/src/types/BlockId.ts b/bindings/src/types/BlockId.ts deleted file mode 100644 index 7d993fa8a2..0000000000 --- a/bindings/src/types/BlockId.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type BlockId = string; diff --git a/bindings/src/types/CallInstructionRequest.ts b/bindings/src/types/CallInstructionRequest.ts index c38af67760..b1d2b38046 100644 --- a/bindings/src/types/CallInstructionRequest.ts +++ b/bindings/src/types/CallInstructionRequest.ts @@ -12,7 +12,7 @@ export interface CallInstructionRequest { override_inputs: boolean | null; new_outputs: number | null; is_dry_run: boolean; - proof_ids: Array; + proof_ids: Array; min_epoch: number | null; max_epoch: number | null; } diff --git a/bindings/src/types/ClaimBurnRequest.ts b/bindings/src/types/ClaimBurnRequest.ts index 725395d8fa..723a282e19 100644 --- a/bindings/src/types/ClaimBurnRequest.ts +++ b/bindings/src/types/ClaimBurnRequest.ts @@ -1,10 +1,9 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Amount } from "./Amount"; import type { ComponentAddressOrName } from "./ComponentAddressOrName"; export interface ClaimBurnRequest { account: ComponentAddressOrName | null; claim_proof: string; - max_fee: Amount | null; + max_fee: number | null; key_id: number | null; } diff --git a/bindings/src/types/ClaimBurnResponse.ts b/bindings/src/types/ClaimBurnResponse.ts index ffad4d7112..adc97db244 100644 --- a/bindings/src/types/ClaimBurnResponse.ts +++ b/bindings/src/types/ClaimBurnResponse.ts @@ -1,10 +1,8 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Amount } from "./Amount"; import type { FinalizeResult } from "./FinalizeResult"; -import type { TransactionId } from "./TransactionId"; export interface ClaimBurnResponse { - transaction_id: TransactionId; - fee: Amount; + transaction_id: string; + fee: number; result: FinalizeResult; } diff --git a/bindings/src/types/ClaimValidatorFeesRequest.ts b/bindings/src/types/ClaimValidatorFeesRequest.ts index 5ef60f5447..89f2a32a1c 100644 --- a/bindings/src/types/ClaimValidatorFeesRequest.ts +++ b/bindings/src/types/ClaimValidatorFeesRequest.ts @@ -1,11 +1,10 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Amount } from "./Amount"; import type { ComponentAddressOrName } from "./ComponentAddressOrName"; import type { Epoch } from "./Epoch"; export interface ClaimValidatorFeesRequest { account: ComponentAddressOrName | null; - max_fee: Amount | null; + max_fee: number | null; validator_public_key: string; epoch: Epoch; dry_run: boolean; diff --git a/bindings/src/types/ClaimValidatorFeesResponse.ts b/bindings/src/types/ClaimValidatorFeesResponse.ts index c1855db1dd..bbd65e3712 100644 --- a/bindings/src/types/ClaimValidatorFeesResponse.ts +++ b/bindings/src/types/ClaimValidatorFeesResponse.ts @@ -1,10 +1,8 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Amount } from "./Amount"; import type { FinalizeResult } from "./FinalizeResult"; -import type { TransactionId } from "./TransactionId"; export interface ClaimValidatorFeesResponse { - transaction_id: TransactionId; - fee: Amount; + transaction_id: string; + fee: number; result: FinalizeResult; } diff --git a/bindings/src/types/CommitteeShard.ts b/bindings/src/types/CommitteeShard.ts index 2fc3eca3d4..26e7b3311e 100644 --- a/bindings/src/types/CommitteeShard.ts +++ b/bindings/src/types/CommitteeShard.ts @@ -1,8 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Shard } from "./Shard"; export interface CommitteeShard { num_committees: number; num_members: number; - shard: Shard; + shard: number; } diff --git a/bindings/src/types/CommitteeShardInfo.ts b/bindings/src/types/CommitteeShardInfo.ts index 8c67e6ca9f..248d1219b5 100644 --- a/bindings/src/types/CommitteeShardInfo.ts +++ b/bindings/src/types/CommitteeShardInfo.ts @@ -1,10 +1,9 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Shard } from "./Shard"; import type { SubstateAddress } from "./SubstateAddress"; import type { ValidatorNode } from "./ValidatorNode"; export interface CommitteeShardInfo { - shard: Shard; + shard: number; substate_address_range: { start: SubstateAddress; end: SubstateAddress }; validators: Array>; } diff --git a/bindings/src/types/ComponentAccessRules.ts b/bindings/src/types/ComponentAccessRules.ts index 1db3651946..df5f783340 100644 --- a/bindings/src/types/ComponentAccessRules.ts +++ b/bindings/src/types/ComponentAccessRules.ts @@ -2,5 +2,6 @@ import type { AccessRule } from "./AccessRule"; export interface ComponentAccessRules { + method_access: Record; default: AccessRule; } diff --git a/bindings/src/types/ComponentHeader.ts b/bindings/src/types/ComponentHeader.ts index f6248f3456..1288f75f33 100644 --- a/bindings/src/types/ComponentHeader.ts +++ b/bindings/src/types/ComponentHeader.ts @@ -1,11 +1,10 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { ComponentAccessRules } from "./ComponentAccessRules"; import type { ComponentBody } from "./ComponentBody"; -import type { Hash } from "./Hash"; import type { OwnerRule } from "./OwnerRule"; export interface ComponentHeader { - template_address: Hash; + template_address: string; module_name: string; owner_key: string; owner_rule: OwnerRule; diff --git a/bindings/src/types/ConfidentialClaim.ts b/bindings/src/types/ConfidentialClaim.ts index 22964823de..f980f9e1ea 100644 --- a/bindings/src/types/ConfidentialClaim.ts +++ b/bindings/src/types/ConfidentialClaim.ts @@ -1,10 +1,9 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { ConfidentialWithdrawProof } from "./ConfidentialWithdrawProof"; -import type { UnclaimedConfidentialOutputAddress } from "./UnclaimedConfidentialOutputAddress"; export interface ConfidentialClaim { public_key: string; - output_address: UnclaimedConfidentialOutputAddress; + output_address: string; range_proof: Array; proof_of_knowledge: string; withdraw_proof: ConfidentialWithdrawProof | null; diff --git a/bindings/src/types/ConfidentialCreateOutputProofRequest.ts b/bindings/src/types/ConfidentialCreateOutputProofRequest.ts index 4f81f4e6a6..a6f9fb273c 100644 --- a/bindings/src/types/ConfidentialCreateOutputProofRequest.ts +++ b/bindings/src/types/ConfidentialCreateOutputProofRequest.ts @@ -1,6 +1,5 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Amount } from "./Amount"; export interface ConfidentialCreateOutputProofRequest { - amount: Amount; + amount: number; } diff --git a/bindings/src/types/ConfidentialOutput.ts b/bindings/src/types/ConfidentialOutput.ts index 0c36b52f47..0c7d1b2ff8 100644 --- a/bindings/src/types/ConfidentialOutput.ts +++ b/bindings/src/types/ConfidentialOutput.ts @@ -1,9 +1,8 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { EncryptedData } from "./EncryptedData"; export interface ConfidentialOutput { commitment: string; stealth_public_nonce: string; - encrypted_data: EncryptedData; - minimum_value_promise: bigint; + encrypted_data: Array; + minimum_value_promise: number; } diff --git a/bindings/src/types/ConfidentialStatement.ts b/bindings/src/types/ConfidentialStatement.ts index 5e2492f8c9..c0ed8fd2a3 100644 --- a/bindings/src/types/ConfidentialStatement.ts +++ b/bindings/src/types/ConfidentialStatement.ts @@ -1,12 +1,9 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Amount } from "./Amount"; -import type { EncryptedData } from "./EncryptedData"; -import type { RistrettoPublicKeyBytes } from "./RistrettoPublicKeyBytes"; export interface ConfidentialStatement { commitment: Array; - sender_public_nonce: RistrettoPublicKeyBytes; - encrypted_data: EncryptedData; - minimum_value_promise: bigint; - revealed_amount: Amount; + sender_public_nonce: Array; + encrypted_data: Array; + minimum_value_promise: number; + revealed_amount: number; } diff --git a/bindings/src/types/ConfidentialTransferRequest.ts b/bindings/src/types/ConfidentialTransferRequest.ts index da4b833d03..0f4683e30b 100644 --- a/bindings/src/types/ConfidentialTransferRequest.ts +++ b/bindings/src/types/ConfidentialTransferRequest.ts @@ -1,13 +1,12 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Amount } from "./Amount"; import type { ComponentAddressOrName } from "./ComponentAddressOrName"; import type { ResourceAddress } from "./ResourceAddress"; export interface ConfidentialTransferRequest { account: ComponentAddressOrName | null; - amount: Amount; + amount: number; resource_address: ResourceAddress; destination_public_key: string; - max_fee: Amount | null; + max_fee: number | null; dry_run: boolean; } diff --git a/bindings/src/types/ConfidentialTransferResponse.ts b/bindings/src/types/ConfidentialTransferResponse.ts index a0452c54f1..2dd666329b 100644 --- a/bindings/src/types/ConfidentialTransferResponse.ts +++ b/bindings/src/types/ConfidentialTransferResponse.ts @@ -1,10 +1,8 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Amount } from "./Amount"; import type { FinalizeResult } from "./FinalizeResult"; -import type { TransactionId } from "./TransactionId"; export interface ConfidentialTransferResponse { - transaction_id: TransactionId; - fee: Amount; + transaction_id: string; + fee: number; result: FinalizeResult; } diff --git a/bindings/src/types/ConfidentialWithdrawProof.ts b/bindings/src/types/ConfidentialWithdrawProof.ts index de624dd32a..3f7afa400b 100644 --- a/bindings/src/types/ConfidentialWithdrawProof.ts +++ b/bindings/src/types/ConfidentialWithdrawProof.ts @@ -1,10 +1,8 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { BalanceProofSignature } from "./BalanceProofSignature"; import type { ConfidentialOutputProof } from "./ConfidentialOutputProof"; -import type { PedersonCommitmentBytes } from "./PedersonCommitmentBytes"; export interface ConfidentialWithdrawProof { - inputs: Array; + inputs: Array; output_proof: ConfidentialOutputProof; - balance_proof: BalanceProofSignature; + balance_proof: Array; } diff --git a/bindings/src/types/EncryptedData.ts b/bindings/src/types/EncryptedData.ts deleted file mode 100644 index 8eb5aa818c..0000000000 --- a/bindings/src/types/EncryptedData.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type EncryptedData = Array; diff --git a/bindings/src/types/FeeClaim.ts b/bindings/src/types/FeeClaim.ts index 715b761925..cbb140329a 100644 --- a/bindings/src/types/FeeClaim.ts +++ b/bindings/src/types/FeeClaim.ts @@ -1,8 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Amount } from "./Amount"; export interface FeeClaim { - epoch: bigint; + epoch: number; validator_public_key: string; - amount: Amount; + amount: number; } diff --git a/bindings/src/types/FeeCostBreakdown.ts b/bindings/src/types/FeeCostBreakdown.ts index 2c0f0566a3..4344938d9a 100644 --- a/bindings/src/types/FeeCostBreakdown.ts +++ b/bindings/src/types/FeeCostBreakdown.ts @@ -1,8 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Amount } from "./Amount"; -import type { FeeSource } from "./FeeSource"; export interface FeeCostBreakdown { - total_fees_charged: Amount; - breakdown: Array<[FeeSource, bigint]>; + total_fees_charged: number; + breakdown: Array<[FeeSource, number]>; } diff --git a/bindings/src/types/FeeReceipt.ts b/bindings/src/types/FeeReceipt.ts index 31feb4bebf..fcfaf604f7 100644 --- a/bindings/src/types/FeeReceipt.ts +++ b/bindings/src/types/FeeReceipt.ts @@ -1,9 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Amount } from "./Amount"; -import type { FeeSource } from "./FeeSource"; export interface FeeReceipt { - total_fee_payment: Amount; - total_fees_paid: Amount; - cost_breakdown: Array<[FeeSource, bigint]>; + total_fee_payment: number; + total_fees_paid: number; + cost_breakdown: Array<[FeeSource, number]>; } diff --git a/bindings/src/types/FinalizeResult.ts b/bindings/src/types/FinalizeResult.ts index ae3e4c1ef0..d71479de9f 100644 --- a/bindings/src/types/FinalizeResult.ts +++ b/bindings/src/types/FinalizeResult.ts @@ -1,13 +1,12 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { Event } from "./Event"; import type { FeeCostBreakdown } from "./FeeCostBreakdown"; -import type { Hash } from "./Hash"; import type { InstructionResult } from "./InstructionResult"; import type { LogEntry } from "./LogEntry"; import type { TransactionResult } from "./TransactionResult"; export interface FinalizeResult { - transaction_hash: Hash; + transaction_hash: string; events: Array; logs: Array; execution_results: Array; diff --git a/bindings/src/types/ForeignProposal.ts b/bindings/src/types/ForeignProposal.ts index bdadf26b42..210ed7e6b8 100644 --- a/bindings/src/types/ForeignProposal.ts +++ b/bindings/src/types/ForeignProposal.ts @@ -1,12 +1,10 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { BlockId } from "./BlockId"; import type { ForeignProposalState } from "./ForeignProposalState"; import type { NodeHeight } from "./NodeHeight"; -import type { Shard } from "./Shard"; export interface ForeignProposal { - bucket: Shard; - block_id: BlockId; + bucket: number; + block_id: string; state: ForeignProposalState; proposed_height: NodeHeight | null; } diff --git a/bindings/src/types/GetBlockRequest.ts b/bindings/src/types/GetBlockRequest.ts index aaec6654aa..b66e759dc9 100644 --- a/bindings/src/types/GetBlockRequest.ts +++ b/bindings/src/types/GetBlockRequest.ts @@ -1,6 +1,5 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { BlockId } from "./BlockId"; export interface GetBlockRequest { - block_id: BlockId; + block_id: string; } diff --git a/bindings/src/types/GetBlocksCountResponse.ts b/bindings/src/types/GetBlocksCountResponse.ts index 8e9a091baf..8202452d5f 100644 --- a/bindings/src/types/GetBlocksCountResponse.ts +++ b/bindings/src/types/GetBlocksCountResponse.ts @@ -1,5 +1,5 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. export interface GetBlocksCountResponse { - count: bigint; + count: number; } diff --git a/bindings/src/types/GetBlocksRequest.ts b/bindings/src/types/GetBlocksRequest.ts index 3890877af5..11e261e7ed 100644 --- a/bindings/src/types/GetBlocksRequest.ts +++ b/bindings/src/types/GetBlocksRequest.ts @@ -2,7 +2,7 @@ import type { Ordering } from "./Ordering"; export interface GetBlocksRequest { - limit: bigint; - offset: bigint; + limit: number; + offset: number; ordering: Ordering | null; } diff --git a/bindings/src/types/GetEpochManagerStatsResponse.ts b/bindings/src/types/GetEpochManagerStatsResponse.ts index 2f5eb1736c..653c256ddc 100644 --- a/bindings/src/types/GetEpochManagerStatsResponse.ts +++ b/bindings/src/types/GetEpochManagerStatsResponse.ts @@ -4,7 +4,7 @@ import type { Epoch } from "./Epoch"; export interface GetEpochManagerStatsResponse { current_epoch: Epoch; - current_block_height: bigint; + current_block_height: number; is_valid: boolean; committee_shard: CommitteeShard | null; } diff --git a/bindings/src/types/GetNonFungiblesRequest.ts b/bindings/src/types/GetNonFungiblesRequest.ts index f95fbb836b..3dcc0d0b57 100644 --- a/bindings/src/types/GetNonFungiblesRequest.ts +++ b/bindings/src/types/GetNonFungiblesRequest.ts @@ -3,6 +3,6 @@ import type { SubstateId } from "./SubstateId"; export interface GetNonFungiblesRequest { address: SubstateId; - start_index: bigint; - end_index: bigint; + start_index: number; + end_index: number; } diff --git a/bindings/src/types/GetShardKey.ts b/bindings/src/types/GetShardKey.ts index 7e7dab1e52..e0fb9b181e 100644 --- a/bindings/src/types/GetShardKey.ts +++ b/bindings/src/types/GetShardKey.ts @@ -1,6 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. export interface GetShardKey { - height: bigint; + height: number; public_key: string; } diff --git a/bindings/src/types/GetSubstateResponse.ts b/bindings/src/types/GetSubstateResponse.ts index d6797f8ce4..7ca4f72e9e 100644 --- a/bindings/src/types/GetSubstateResponse.ts +++ b/bindings/src/types/GetSubstateResponse.ts @@ -1,10 +1,9 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { SubstateStatus } from "./SubstateStatus"; import type { SubstateValue } from "./SubstateValue"; -import type { TransactionId } from "./TransactionId"; export interface GetSubstateResponse { value: SubstateValue | null; - created_by_tx: TransactionId | null; + created_by_tx: string | null; status: SubstateStatus; } diff --git a/bindings/src/types/GetSubstatesByTransactionRequest.ts b/bindings/src/types/GetSubstatesByTransactionRequest.ts index 961e4f083a..f3578ed53f 100644 --- a/bindings/src/types/GetSubstatesByTransactionRequest.ts +++ b/bindings/src/types/GetSubstatesByTransactionRequest.ts @@ -1,6 +1,5 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { TransactionId } from "./TransactionId"; export interface GetSubstatesByTransactionRequest { - transaction_id: TransactionId; + transaction_id: string; } diff --git a/bindings/src/types/GetTemplateRequest.ts b/bindings/src/types/GetTemplateRequest.ts index 62ecf4c0e3..cc387340ef 100644 --- a/bindings/src/types/GetTemplateRequest.ts +++ b/bindings/src/types/GetTemplateRequest.ts @@ -1,6 +1,5 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Hash } from "./Hash"; export interface GetTemplateRequest { - template_address: Hash; + template_address: string; } diff --git a/bindings/src/types/GetTemplatesRequest.ts b/bindings/src/types/GetTemplatesRequest.ts index 62e71deab3..a8e40e6c00 100644 --- a/bindings/src/types/GetTemplatesRequest.ts +++ b/bindings/src/types/GetTemplatesRequest.ts @@ -1,5 +1,5 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. export interface GetTemplatesRequest { - limit: bigint; + limit: number; } diff --git a/bindings/src/types/GetTransactionRequest.ts b/bindings/src/types/GetTransactionRequest.ts index 3ce05d285b..dd65db5c52 100644 --- a/bindings/src/types/GetTransactionRequest.ts +++ b/bindings/src/types/GetTransactionRequest.ts @@ -1,6 +1,5 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { TransactionId } from "./TransactionId"; export interface GetTransactionRequest { - transaction_id: TransactionId; + transaction_id: string; } diff --git a/bindings/src/types/GetTransactionResultRequest.ts b/bindings/src/types/GetTransactionResultRequest.ts index 73b506c393..2327054352 100644 --- a/bindings/src/types/GetTransactionResultRequest.ts +++ b/bindings/src/types/GetTransactionResultRequest.ts @@ -1,6 +1,5 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { TransactionId } from "./TransactionId"; export interface GetTransactionResultRequest { - transaction_id: TransactionId; + transaction_id: string; } diff --git a/bindings/src/types/GetValidatorFeesResponse.ts b/bindings/src/types/GetValidatorFeesResponse.ts index 39b11ab635..510661b8c9 100644 --- a/bindings/src/types/GetValidatorFeesResponse.ts +++ b/bindings/src/types/GetValidatorFeesResponse.ts @@ -1,7 +1,5 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Amount } from "./Amount"; -import type { Epoch } from "./Epoch"; export interface GetValidatorFeesResponse { - fee_summary: Record; + fee_summary: Record; } diff --git a/bindings/src/types/Hash.ts b/bindings/src/types/Hash.ts deleted file mode 100644 index 3053896346..0000000000 --- a/bindings/src/types/Hash.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type Hash = Array; diff --git a/bindings/src/types/InspectSubstateResponse.ts b/bindings/src/types/InspectSubstateResponse.ts index 6a30bc9d7c..f77a7e5036 100644 --- a/bindings/src/types/InspectSubstateResponse.ts +++ b/bindings/src/types/InspectSubstateResponse.ts @@ -1,10 +1,9 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { SubstateId } from "./SubstateId"; -import type { TransactionId } from "./TransactionId"; export interface InspectSubstateResponse { address: SubstateId; version: number; substate_contents: string; - created_by_transaction: TransactionId; + created_by_transaction: string; } diff --git a/bindings/src/types/Instruction.ts b/bindings/src/types/Instruction.ts index fd635d4bfd..88351610d2 100644 --- a/bindings/src/types/Instruction.ts +++ b/bindings/src/types/Instruction.ts @@ -1,18 +1,16 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Amount } from "./Amount"; import type { Arg } from "./Arg"; import type { ComponentAddress } from "./ComponentAddress"; import type { ConfidentialClaim } from "./ConfidentialClaim"; import type { ConfidentialOutput } from "./ConfidentialOutput"; -import type { Hash } from "./Hash"; import type { LogLevel } from "./LogLevel"; export type Instruction = - | { CallFunction: { template_address: Hash; function: string; args: Array } } + | { CallFunction: { template_address: string; function: string; args: Array } } | { CallMethod: { component_address: ComponentAddress; method: string; args: Array } } | { PutLastInstructionOutputOnWorkspace: { key: Array } } | { EmitLog: { level: LogLevel; message: string } } | { ClaimBurn: { claim: ConfidentialClaim } } - | { ClaimValidatorFees: { epoch: bigint; validator_public_key: string } } + | { ClaimValidatorFees: { epoch: number; validator_public_key: string } } | "DropAllProofsInWorkspace" - | { CreateFreeTestCoins: { revealed_amount: Amount; output: ConfidentialOutput | null } }; + | { CreateFreeTestCoins: { revealed_amount: number; output: ConfidentialOutput | null } }; diff --git a/bindings/src/types/KeysCreateResponse.ts b/bindings/src/types/KeysCreateResponse.ts index 640f2410ef..26a50d6c93 100644 --- a/bindings/src/types/KeysCreateResponse.ts +++ b/bindings/src/types/KeysCreateResponse.ts @@ -1,6 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. export interface KeysCreateResponse { - id: bigint; + id: number; public_key: string; } diff --git a/bindings/src/types/ListBlocksRequest.ts b/bindings/src/types/ListBlocksRequest.ts index ee6cdb52cb..0c247b5b2e 100644 --- a/bindings/src/types/ListBlocksRequest.ts +++ b/bindings/src/types/ListBlocksRequest.ts @@ -1,7 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { BlockId } from "./BlockId"; export interface ListBlocksRequest { - from_id: BlockId | null; + from_id: string | null; limit: number; } diff --git a/bindings/src/types/MintAccountNftRequest.ts b/bindings/src/types/MintAccountNftRequest.ts index 4c3b3be6c7..48809c2d20 100644 --- a/bindings/src/types/MintAccountNftRequest.ts +++ b/bindings/src/types/MintAccountNftRequest.ts @@ -1,10 +1,9 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Amount } from "./Amount"; import type { ComponentAddressOrName } from "./ComponentAddressOrName"; export interface MintAccountNftRequest { account: ComponentAddressOrName; metadata: string; - mint_fee: Amount | null; - create_account_nft_fee: Amount | null; + mint_fee: number | null; + create_account_nft_fee: number | null; } diff --git a/bindings/src/types/MintAccountNftResponse.ts b/bindings/src/types/MintAccountNftResponse.ts index c7e9b0c63f..59042c2e81 100644 --- a/bindings/src/types/MintAccountNftResponse.ts +++ b/bindings/src/types/MintAccountNftResponse.ts @@ -1,5 +1,4 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Amount } from "./Amount"; import type { FinalizeResult } from "./FinalizeResult"; import type { NonFungibleId } from "./NonFungibleId"; import type { ResourceAddress } from "./ResourceAddress"; @@ -8,5 +7,5 @@ export interface MintAccountNftResponse { nft_id: NonFungibleId; resource_address: ResourceAddress; result: FinalizeResult; - fee: Amount; + fee: number; } diff --git a/bindings/src/types/NodeHeight.ts b/bindings/src/types/NodeHeight.ts index 58a2e016dd..9845034594 100644 --- a/bindings/src/types/NodeHeight.ts +++ b/bindings/src/types/NodeHeight.ts @@ -1,3 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type NodeHeight = bigint; +export type NodeHeight = number; diff --git a/bindings/src/types/NonFungibleId.ts b/bindings/src/types/NonFungibleId.ts index 565fdb5452..264e393253 100644 --- a/bindings/src/types/NonFungibleId.ts +++ b/bindings/src/types/NonFungibleId.ts @@ -1,3 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type NonFungibleId = { U256: Array } | { String: string } | { Uint32: number } | { Uint64: bigint }; +export type NonFungibleId = { U256: Array } | { String: string } | { Uint32: number } | { Uint64: number }; diff --git a/bindings/src/types/NonFungibleSubstate.ts b/bindings/src/types/NonFungibleSubstate.ts index d3a9011b7e..f3acf88932 100644 --- a/bindings/src/types/NonFungibleSubstate.ts +++ b/bindings/src/types/NonFungibleSubstate.ts @@ -3,7 +3,7 @@ import type { Substate } from "./Substate"; import type { SubstateId } from "./SubstateId"; export interface NonFungibleSubstate { - index: bigint; + index: number; address: SubstateId; substate: Substate; } diff --git a/bindings/src/types/PedersonCommitmentBytes.ts b/bindings/src/types/PedersonCommitmentBytes.ts deleted file mode 100644 index e0200e6eb4..0000000000 --- a/bindings/src/types/PedersonCommitmentBytes.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type PedersonCommitmentBytes = Array; diff --git a/bindings/src/types/ProofsCancelRequest.ts b/bindings/src/types/ProofsCancelRequest.ts index ecab2f6a25..767cf58947 100644 --- a/bindings/src/types/ProofsCancelRequest.ts +++ b/bindings/src/types/ProofsCancelRequest.ts @@ -1,5 +1,5 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. export interface ProofsCancelRequest { - proof_id: bigint; + proof_id: number; } diff --git a/bindings/src/types/ProofsFinalizeRequest.ts b/bindings/src/types/ProofsFinalizeRequest.ts index 5f72f3ad6c..1cd92a2a84 100644 --- a/bindings/src/types/ProofsFinalizeRequest.ts +++ b/bindings/src/types/ProofsFinalizeRequest.ts @@ -1,5 +1,5 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. export interface ProofsFinalizeRequest { - proof_id: bigint; + proof_id: number; } diff --git a/bindings/src/types/ProofsGenerateRequest.ts b/bindings/src/types/ProofsGenerateRequest.ts index 15a4f8058f..297efc34cf 100644 --- a/bindings/src/types/ProofsGenerateRequest.ts +++ b/bindings/src/types/ProofsGenerateRequest.ts @@ -1,11 +1,10 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Amount } from "./Amount"; import type { ComponentAddressOrName } from "./ComponentAddressOrName"; import type { ResourceAddress } from "./ResourceAddress"; export interface ProofsGenerateRequest { - amount: Amount; - reveal_amount: Amount; + amount: number; + reveal_amount: number; account: ComponentAddressOrName | null; resource_address: ResourceAddress; destination_public_key: string; diff --git a/bindings/src/types/ProofsGenerateResponse.ts b/bindings/src/types/ProofsGenerateResponse.ts index 7782251b15..cf04f206f8 100644 --- a/bindings/src/types/ProofsGenerateResponse.ts +++ b/bindings/src/types/ProofsGenerateResponse.ts @@ -2,6 +2,6 @@ import type { ConfidentialWithdrawProof } from "./ConfidentialWithdrawProof"; export interface ProofsGenerateResponse { - proof_id: bigint; + proof_id: number; proof: ConfidentialWithdrawProof; } diff --git a/bindings/src/types/QcId.ts b/bindings/src/types/QcId.ts deleted file mode 100644 index e7591e629f..0000000000 --- a/bindings/src/types/QcId.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type QcId = string | null; diff --git a/bindings/src/types/QuorumCertificate.ts b/bindings/src/types/QuorumCertificate.ts index feb6d8405e..079ac40679 100644 --- a/bindings/src/types/QuorumCertificate.ts +++ b/bindings/src/types/QuorumCertificate.ts @@ -1,14 +1,12 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { BlockId } from "./BlockId"; import type { Epoch } from "./Epoch"; import type { NodeHeight } from "./NodeHeight"; -import type { QcId } from "./QcId"; import type { QuorumDecision } from "./QuorumDecision"; import type { ValidatorSignature } from "./ValidatorSignature"; export interface QuorumCertificate { - qc_id: QcId; - block_id: BlockId; + qc_id: string; + block_id: string; block_height: NodeHeight; epoch: Epoch; signatures: Array; diff --git a/bindings/src/types/Resource.ts b/bindings/src/types/Resource.ts index d2992b141a..b5b25b86a9 100644 --- a/bindings/src/types/Resource.ts +++ b/bindings/src/types/Resource.ts @@ -3,12 +3,11 @@ import type { Metadata } from "./Metadata"; import type { OwnerRule } from "./OwnerRule"; import type { ResourceAccessRules } from "./ResourceAccessRules"; import type { ResourceType } from "./ResourceType"; -import type { RistrettoPublicKeyBytes } from "./RistrettoPublicKeyBytes"; export interface Resource { resource_type: ResourceType; owner_rule: OwnerRule; - owner_key: RistrettoPublicKeyBytes; + owner_key: Array; access_rules: ResourceAccessRules; metadata: Metadata; total_supply: number; diff --git a/bindings/src/types/ResourceContainer.ts b/bindings/src/types/ResourceContainer.ts index 7a72354492..73727f3f7b 100644 --- a/bindings/src/types/ResourceContainer.ts +++ b/bindings/src/types/ResourceContainer.ts @@ -1,10 +1,9 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Amount } from "./Amount"; import type { NonFungibleId } from "./NonFungibleId"; import type { ResourceAddress } from "./ResourceAddress"; export type ResourceContainer = - | { Fungible: { address: ResourceAddress; amount: Amount; locked_amount: Amount } } + | { Fungible: { address: ResourceAddress; amount: number; locked_amount: number } } | { NonFungible: { address: ResourceAddress; @@ -12,4 +11,12 @@ export type ResourceContainer = locked_token_ids: Array; }; } - | { Confidential: { address: ResourceAddress; revealed_amount: Amount; locked_revealed_amount: Amount } }; + | { + Confidential: { + address: ResourceAddress; + commitments: Record; + revealed_amount: number; + locked_commitments: Record; + locked_revealed_amount: number; + }; + }; diff --git a/bindings/src/types/RevealFundsRequest.ts b/bindings/src/types/RevealFundsRequest.ts index 46fcb1f245..1df01042da 100644 --- a/bindings/src/types/RevealFundsRequest.ts +++ b/bindings/src/types/RevealFundsRequest.ts @@ -1,10 +1,9 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Amount } from "./Amount"; import type { ComponentAddressOrName } from "./ComponentAddressOrName"; export interface RevealFundsRequest { account: ComponentAddressOrName | null; - amount_to_reveal: Amount; + amount_to_reveal: number; pay_fee_from_reveal: boolean; - max_fee: Amount | null; + max_fee: number | null; } diff --git a/bindings/src/types/RevealFundsResponse.ts b/bindings/src/types/RevealFundsResponse.ts index 3d610b2870..9312d9ca9e 100644 --- a/bindings/src/types/RevealFundsResponse.ts +++ b/bindings/src/types/RevealFundsResponse.ts @@ -1,10 +1,8 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Amount } from "./Amount"; import type { FinalizeResult } from "./FinalizeResult"; -import type { TransactionId } from "./TransactionId"; export interface RevealFundsResponse { - transaction_id: TransactionId; - fee: Amount; + transaction_id: string; + fee: number; result: FinalizeResult; } diff --git a/bindings/src/types/RistrettoPublicKeyBytes.ts b/bindings/src/types/RistrettoPublicKeyBytes.ts deleted file mode 100644 index 630c16a4c2..0000000000 --- a/bindings/src/types/RistrettoPublicKeyBytes.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type RistrettoPublicKeyBytes = string; diff --git a/bindings/src/types/RuleRequirement.ts b/bindings/src/types/RuleRequirement.ts index 0446b5070c..b7a99bbbf6 100644 --- a/bindings/src/types/RuleRequirement.ts +++ b/bindings/src/types/RuleRequirement.ts @@ -1,6 +1,5 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { ComponentAddress } from "./ComponentAddress"; -import type { Hash } from "./Hash"; import type { NonFungibleAddress } from "./NonFungibleAddress"; import type { ResourceAddress } from "./ResourceAddress"; @@ -8,4 +7,4 @@ export type RuleRequirement = | { Resource: ResourceAddress } | { NonFungibleAddress: NonFungibleAddress } | { ScopedToComponent: ComponentAddress } - | { ScopedToTemplate: Hash }; + | { ScopedToTemplate: Array }; diff --git a/bindings/src/types/Shard.ts b/bindings/src/types/Shard.ts deleted file mode 100644 index ce3f3f311c..0000000000 --- a/bindings/src/types/Shard.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type Shard = number; diff --git a/bindings/src/types/ShardEvidence.ts b/bindings/src/types/ShardEvidence.ts index 5b95a344c5..a2bd8c6fd3 100644 --- a/bindings/src/types/ShardEvidence.ts +++ b/bindings/src/types/ShardEvidence.ts @@ -1,8 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { LockFlag } from "./LockFlag"; -import type { QcId } from "./QcId"; export interface ShardEvidence { - qc_ids: Array; + qc_ids: Array; lock: LockFlag; } diff --git a/bindings/src/types/SubmitTransactionResponse.ts b/bindings/src/types/SubmitTransactionResponse.ts index 744da4e6dc..9cc4c75d90 100644 --- a/bindings/src/types/SubmitTransactionResponse.ts +++ b/bindings/src/types/SubmitTransactionResponse.ts @@ -1,8 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { DryRunTransactionFinalizeResult } from "./DryRunTransactionFinalizeResult"; -import type { TransactionId } from "./TransactionId"; export interface SubmitTransactionResponse { - transaction_id: TransactionId; + transaction_id: string; dry_run_result: DryRunTransactionFinalizeResult | null; } diff --git a/bindings/src/types/SubstateDestroyed.ts b/bindings/src/types/SubstateDestroyed.ts index 8c37599337..f1918ae93c 100644 --- a/bindings/src/types/SubstateDestroyed.ts +++ b/bindings/src/types/SubstateDestroyed.ts @@ -1,12 +1,9 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { BlockId } from "./BlockId"; import type { Epoch } from "./Epoch"; -import type { QcId } from "./QcId"; -import type { TransactionId } from "./TransactionId"; export interface SubstateDestroyed { - by_transaction: TransactionId; - justify: QcId; - by_block: BlockId; + by_transaction: string; + justify: string; + by_block: string; at_epoch: Epoch; } diff --git a/bindings/src/types/SubstateId.ts b/bindings/src/types/SubstateId.ts index 3f40e1ddfe..ab876382b8 100644 --- a/bindings/src/types/SubstateId.ts +++ b/bindings/src/types/SubstateId.ts @@ -5,14 +5,13 @@ import type { NonFungibleAddress } from "./NonFungibleAddress"; import type { NonFungibleIndexAddress } from "./NonFungibleIndexAddress"; import type { ResourceAddress } from "./ResourceAddress"; import type { TransactionReceiptAddress } from "./TransactionReceiptAddress"; -import type { UnclaimedConfidentialOutputAddress } from "./UnclaimedConfidentialOutputAddress"; import type { VaultId } from "./VaultId"; export type SubstateId = | { Component: ComponentAddress } | { Resource: ResourceAddress } | { Vault: VaultId } - | { UnclaimedConfidentialOutput: UnclaimedConfidentialOutputAddress } + | { UnclaimedConfidentialOutput: string } | { NonFungible: NonFungibleAddress } | { NonFungibleIndex: NonFungibleIndexAddress } | { TransactionReceipt: TransactionReceiptAddress } diff --git a/bindings/src/types/SubstateRecord.ts b/bindings/src/types/SubstateRecord.ts index 2ca39e3375..26bf2e9171 100644 --- a/bindings/src/types/SubstateRecord.ts +++ b/bindings/src/types/SubstateRecord.ts @@ -1,21 +1,18 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { BlockId } from "./BlockId"; import type { Epoch } from "./Epoch"; import type { NodeHeight } from "./NodeHeight"; -import type { QcId } from "./QcId"; import type { SubstateDestroyed } from "./SubstateDestroyed"; import type { SubstateId } from "./SubstateId"; import type { SubstateValue } from "./SubstateValue"; -import type { TransactionId } from "./TransactionId"; export interface SubstateRecord { substate_id: SubstateId; version: number; substate_value: SubstateValue; state_hash: string; - created_by_transaction: TransactionId; - created_justify: QcId; - created_block: BlockId; + created_by_transaction: string; + created_justify: string; + created_block: string; created_height: NodeHeight; created_at_epoch: Epoch; destroyed: SubstateDestroyed | null; diff --git a/bindings/src/types/TemplateMetadata.ts b/bindings/src/types/TemplateMetadata.ts index 2d4f33bc52..783cbb6bc0 100644 --- a/bindings/src/types/TemplateMetadata.ts +++ b/bindings/src/types/TemplateMetadata.ts @@ -1,10 +1,9 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Hash } from "./Hash"; export interface TemplateMetadata { name: string; - address: Hash; + address: string; url: string; binary_sha: Array; - height: bigint; + height: number; } diff --git a/bindings/src/types/TemplateRegistrationResponse.ts b/bindings/src/types/TemplateRegistrationResponse.ts index 100aae44d6..c00719a127 100644 --- a/bindings/src/types/TemplateRegistrationResponse.ts +++ b/bindings/src/types/TemplateRegistrationResponse.ts @@ -2,5 +2,5 @@ export interface TemplateRegistrationResponse { template_address: Array; - transaction_id: bigint; + transaction_id: number; } diff --git a/bindings/src/types/TransactionAtom.ts b/bindings/src/types/TransactionAtom.ts index e72e23050f..001e59e30c 100644 --- a/bindings/src/types/TransactionAtom.ts +++ b/bindings/src/types/TransactionAtom.ts @@ -1,12 +1,11 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { Decision } from "./Decision"; import type { Evidence } from "./Evidence"; -import type { TransactionId } from "./TransactionId"; export interface TransactionAtom { - id: TransactionId; + id: string; decision: Decision; evidence: Evidence; - transaction_fee: bigint; - leader_fee: bigint; + transaction_fee: number; + leader_fee: number; } diff --git a/bindings/src/types/TransactionClaimBurnResponse.ts b/bindings/src/types/TransactionClaimBurnResponse.ts index bd86637f60..9d92f5043f 100644 --- a/bindings/src/types/TransactionClaimBurnResponse.ts +++ b/bindings/src/types/TransactionClaimBurnResponse.ts @@ -1,9 +1,8 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { SubstateAddress } from "./SubstateAddress"; -import type { TransactionId } from "./TransactionId"; export interface TransactionClaimBurnResponse { - transaction_id: TransactionId; + transaction_id: string; inputs: Array; outputs: Array; } diff --git a/bindings/src/types/TransactionGetRequest.ts b/bindings/src/types/TransactionGetRequest.ts index c726ca6e17..0fb934a2c6 100644 --- a/bindings/src/types/TransactionGetRequest.ts +++ b/bindings/src/types/TransactionGetRequest.ts @@ -1,6 +1,5 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { TransactionId } from "./TransactionId"; export interface TransactionGetRequest { - transaction_id: TransactionId; + transaction_id: string; } diff --git a/bindings/src/types/TransactionGetResultRequest.ts b/bindings/src/types/TransactionGetResultRequest.ts index 93a8a8b0be..0127a1e2ee 100644 --- a/bindings/src/types/TransactionGetResultRequest.ts +++ b/bindings/src/types/TransactionGetResultRequest.ts @@ -1,6 +1,5 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { TransactionId } from "./TransactionId"; export interface TransactionGetResultRequest { - transaction_id: TransactionId; + transaction_id: string; } diff --git a/bindings/src/types/TransactionGetResultResponse.ts b/bindings/src/types/TransactionGetResultResponse.ts index 91348f1508..6e05d02b0a 100644 --- a/bindings/src/types/TransactionGetResultResponse.ts +++ b/bindings/src/types/TransactionGetResultResponse.ts @@ -1,10 +1,9 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { FinalizeResult } from "./FinalizeResult"; -import type { TransactionId } from "./TransactionId"; import type { TransactionStatus } from "./TransactionStatus"; export interface TransactionGetResultResponse { - transaction_id: TransactionId; + transaction_id: string; status: TransactionStatus; result: FinalizeResult | null; json_result: Array | null; diff --git a/bindings/src/types/TransactionId.ts b/bindings/src/types/TransactionId.ts deleted file mode 100644 index a140afa9bf..0000000000 --- a/bindings/src/types/TransactionId.ts +++ /dev/null @@ -1,5 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export interface TransactionId { - id: string; -} diff --git a/bindings/src/types/TransactionReceipt.ts b/bindings/src/types/TransactionReceipt.ts index e68f67601a..4acac18b34 100644 --- a/bindings/src/types/TransactionReceipt.ts +++ b/bindings/src/types/TransactionReceipt.ts @@ -1,11 +1,10 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { Event } from "./Event"; import type { FeeReceipt } from "./FeeReceipt"; -import type { Hash } from "./Hash"; import type { LogEntry } from "./LogEntry"; export interface TransactionReceipt { - transaction_hash: Hash; + transaction_hash: string; events: Array; logs: Array; fee_receipt: FeeReceipt; diff --git a/bindings/src/types/TransactionSubmitRequest.ts b/bindings/src/types/TransactionSubmitRequest.ts index 19c3543629..85e777b5da 100644 --- a/bindings/src/types/TransactionSubmitRequest.ts +++ b/bindings/src/types/TransactionSubmitRequest.ts @@ -4,13 +4,13 @@ import type { Instruction } from "./Instruction"; import type { SubstateRequirement } from "./SubstateRequirement"; export interface TransactionSubmitRequest { - signing_key_index: bigint | null; + signing_key_index: number | null; fee_instructions: Array; instructions: Array; inputs: Array; override_inputs: boolean; is_dry_run: boolean; - proof_ids: Array; + proof_ids: Array; min_epoch: Epoch | null; max_epoch: Epoch | null; } diff --git a/bindings/src/types/TransactionSubmitResponse.ts b/bindings/src/types/TransactionSubmitResponse.ts index 50d515f626..566b317369 100644 --- a/bindings/src/types/TransactionSubmitResponse.ts +++ b/bindings/src/types/TransactionSubmitResponse.ts @@ -1,10 +1,9 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { ExecuteResult } from "./ExecuteResult"; import type { SubstateRequirement } from "./SubstateRequirement"; -import type { TransactionId } from "./TransactionId"; export interface TransactionSubmitResponse { - transaction_id: TransactionId; + transaction_id: string; inputs: Array; result: ExecuteResult | null; json_result: Array | null; diff --git a/bindings/src/types/TransactionWaitResultRequest.ts b/bindings/src/types/TransactionWaitResultRequest.ts index 3df763358d..55a5ce931b 100644 --- a/bindings/src/types/TransactionWaitResultRequest.ts +++ b/bindings/src/types/TransactionWaitResultRequest.ts @@ -1,7 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { TransactionId } from "./TransactionId"; export interface TransactionWaitResultRequest { - transaction_id: TransactionId; - timeout_secs: bigint | null; + transaction_id: string; + timeout_secs: number | null; } diff --git a/bindings/src/types/TransactionWaitResultResponse.ts b/bindings/src/types/TransactionWaitResultResponse.ts index 39756f410e..4ab1be5276 100644 --- a/bindings/src/types/TransactionWaitResultResponse.ts +++ b/bindings/src/types/TransactionWaitResultResponse.ts @@ -1,14 +1,12 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Amount } from "./Amount"; import type { FinalizeResult } from "./FinalizeResult"; -import type { TransactionId } from "./TransactionId"; import type { TransactionStatus } from "./TransactionStatus"; export interface TransactionWaitResultResponse { - transaction_id: TransactionId; + transaction_id: string; result: FinalizeResult | null; json_result: Array | null; status: TransactionStatus; - final_fee: Amount; + final_fee: number; timed_out: boolean; } diff --git a/bindings/src/types/TransferRequest.ts b/bindings/src/types/TransferRequest.ts index 2be0c02663..fa3649db04 100644 --- a/bindings/src/types/TransferRequest.ts +++ b/bindings/src/types/TransferRequest.ts @@ -1,13 +1,12 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Amount } from "./Amount"; import type { ComponentAddressOrName } from "./ComponentAddressOrName"; import type { ResourceAddress } from "./ResourceAddress"; export interface TransferRequest { account: ComponentAddressOrName | null; - amount: Amount; + amount: number; resource_address: ResourceAddress; destination_public_key: string; - max_fee: Amount | null; + max_fee: number | null; dry_run: boolean; } diff --git a/bindings/src/types/TransferResponse.ts b/bindings/src/types/TransferResponse.ts index 5103d05d99..fa7b97ab9b 100644 --- a/bindings/src/types/TransferResponse.ts +++ b/bindings/src/types/TransferResponse.ts @@ -1,11 +1,9 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Amount } from "./Amount"; import type { FinalizeResult } from "./FinalizeResult"; -import type { TransactionId } from "./TransactionId"; export interface TransferResponse { - transaction_id: TransactionId; - fee: Amount; - fee_refunded: Amount; + transaction_id: string; + fee: number; + fee_refunded: number; result: FinalizeResult; } diff --git a/bindings/src/types/UnclaimedConfidentialOutput.ts b/bindings/src/types/UnclaimedConfidentialOutput.ts index 013b42752b..636aef156b 100644 --- a/bindings/src/types/UnclaimedConfidentialOutput.ts +++ b/bindings/src/types/UnclaimedConfidentialOutput.ts @@ -1,7 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { EncryptedData } from "./EncryptedData"; export interface UnclaimedConfidentialOutput { commitment: string; - encrypted_data: EncryptedData; + encrypted_data: Array; } diff --git a/bindings/src/types/UnclaimedConfidentialOutputAddress.ts b/bindings/src/types/UnclaimedConfidentialOutputAddress.ts deleted file mode 100644 index db538cd5e1..0000000000 --- a/bindings/src/types/UnclaimedConfidentialOutputAddress.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type UnclaimedConfidentialOutputAddress = string; diff --git a/bindings/src/types/ValidatorFee.ts b/bindings/src/types/ValidatorFee.ts index e731594228..5fea51e778 100644 --- a/bindings/src/types/ValidatorFee.ts +++ b/bindings/src/types/ValidatorFee.ts @@ -1,11 +1,10 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { BlockId } from "./BlockId"; import type { Epoch } from "./Epoch"; export interface ValidatorFee { validator_public_key: string; epoch: Epoch; - block_id: BlockId; - total_fee_due: bigint; - total_transaction_fee: bigint; + block_id: string; + total_fee_due: number; + total_transaction_fee: number; } diff --git a/bindings/src/types/ValidatorNode.ts b/bindings/src/types/ValidatorNode.ts index 21e653abe8..f7476bc51b 100644 --- a/bindings/src/types/ValidatorNode.ts +++ b/bindings/src/types/ValidatorNode.ts @@ -1,6 +1,5 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { Epoch } from "./Epoch"; -import type { Shard } from "./Shard"; import type { SubstateAddress } from "./SubstateAddress"; export interface ValidatorNode { @@ -8,6 +7,6 @@ export interface ValidatorNode { public_key: string; shard_key: SubstateAddress; epoch: Epoch; - committee_shard: Shard | null; + committee_shard: number | null; fee_claim_public_key: string; } diff --git a/clients/tari_indexer_client/src/types.rs b/clients/tari_indexer_client/src/types.rs index 71c38ffbf7..ad813af92d 100644 --- a/clients/tari_indexer_client/src/types.rs +++ b/clients/tari_indexer_client/src/types.rs @@ -36,6 +36,7 @@ pub struct GetSubstateResponse { pub address: SubstateId, pub version: u32, pub substate: Substate, + #[cfg_attr(feature = "ts", ts(type = "string"))] pub created_by_transaction: TransactionId, } @@ -57,6 +58,7 @@ pub struct InspectSubstateResponse { pub version: u32, #[cfg_attr(feature = "ts", ts(type = "string"))] pub substate_contents: serde_json::Value, + #[cfg_attr(feature = "ts", ts(type = "string"))] pub created_by_transaction: TransactionId, } @@ -71,6 +73,7 @@ pub struct SubmitTransactionRequest { #[derive(Debug, Clone, Serialize, Deserialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct SubmitTransactionResponse { + #[cfg_attr(feature = "ts", ts(type = "string"))] pub transaction_id: TransactionId, pub result: IndexerTransactionFinalizedResult, } @@ -78,6 +81,7 @@ pub struct SubmitTransactionResponse { #[derive(Debug, Clone, Serialize, Deserialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct GetTransactionResultRequest { + #[cfg_attr(feature = "ts", ts(type = "string"))] pub transaction_id: TransactionId, } @@ -144,7 +148,9 @@ pub struct GetNonFungibleCountRequest { pub struct GetNonFungiblesRequest { #[serde_as(as = "DisplayFromStr")] pub address: SubstateId, + #[cfg_attr(feature = "ts", ts(type = "number"))] pub start_index: u64, + #[cfg_attr(feature = "ts", ts(type = "number"))] pub end_index: u64, } @@ -158,6 +164,7 @@ pub struct GetNonFungiblesResponse { #[derive(Debug, Serialize, Deserialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct NonFungibleSubstate { + #[cfg_attr(feature = "ts", ts(type = "number"))] pub index: u64, #[serde_as(as = "DisplayFromStr")] pub address: SubstateId, @@ -197,6 +204,7 @@ pub struct AddPeerResponse {} #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct GetEpochManagerStatsResponse { pub current_epoch: Epoch, + #[cfg_attr(feature = "ts", ts(type = "number"))] pub current_block_height: u64, } diff --git a/clients/validator_node_client/src/types.rs b/clients/validator_node_client/src/types.rs index 390f133cac..d965a15179 100644 --- a/clients/validator_node_client/src/types.rs +++ b/clients/validator_node_client/src/types.rs @@ -74,12 +74,14 @@ pub struct TemplateRegistrationRequest { pub struct TemplateRegistrationResponse { #[serde(with = "serde_with::base64")] pub template_address: Vec, + #[cfg_attr(feature = "ts", ts(type = "number"))] pub transaction_id: u64, } #[derive(Debug, Clone, Serialize, Deserialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct GetTemplateRequest { + #[cfg_attr(feature = "ts", ts(type = "string"))] pub template_address: TemplateAddress, } @@ -116,6 +118,7 @@ pub struct ArgDef { #[derive(Debug, Clone, Serialize, Deserialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct GetTemplatesRequest { + #[cfg_attr(feature = "ts", ts(type = "number"))] pub limit: u64, } @@ -129,11 +132,13 @@ pub struct GetTemplatesResponse { #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct TemplateMetadata { pub name: String, + #[cfg_attr(feature = "ts", ts(type = "string"))] pub address: TemplateAddress, pub url: String, /// SHA hash of binary pub binary_sha: Vec, /// Block height in which the template was published + #[cfg_attr(feature = "ts", ts(type = "number"))] pub height: u64, } @@ -148,6 +153,7 @@ pub struct SubmitTransactionRequest { #[derive(Debug, Clone, Serialize, Deserialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct SubmitTransactionResponse { + #[cfg_attr(feature = "ts", ts(type = "string"))] pub transaction_id: TransactionId, /// The result is a _dry run_ transaction. pub dry_run_result: Option, @@ -164,6 +170,7 @@ pub struct DryRunTransactionFinalizeResult { #[derive(Debug, Clone, Serialize, Deserialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct GetTransactionRequest { + #[cfg_attr(feature = "ts", ts(type = "string"))] pub transaction_id: TransactionId, } @@ -176,6 +183,7 @@ pub struct GetTransactionResponse { #[derive(Debug, Clone, Serialize, Deserialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct GetSubstatesByTransactionRequest { + #[cfg_attr(feature = "ts", ts(type = "string"))] pub transaction_id: TransactionId, } @@ -188,6 +196,7 @@ pub struct GetSubstatesByTransactionResponse { #[derive(Debug, Clone, Serialize, Deserialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct GetTransactionResultRequest { + #[cfg_attr(feature = "ts", ts(type = "string"))] pub transaction_id: TransactionId, } @@ -217,6 +226,7 @@ pub struct GetRecentTransactionsResponse { pub struct ListBlocksRequest { /// If provided, `limit` blocks from the specified block back will be returned. Otherwise `limit` blocks from the /// leaf block will be provided. + #[cfg_attr(feature = "ts", ts(type = "string | null"))] pub from_id: Option, pub limit: usize, } @@ -242,6 +252,7 @@ pub struct GetBlocksResponse { #[derive(Debug, Clone, Serialize, Deserialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct GetBlocksCountResponse { + #[cfg_attr(feature = "ts", ts(type = "number"))] pub count: i64, } @@ -279,6 +290,7 @@ pub struct GetNetworkCommitteeResponse { #[derive(Debug, Clone, Serialize, Deserialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct CommitteeShardInfo { + #[cfg_attr(feature = "ts", ts(type = "number"))] pub shard: Shard, pub substate_address_range: RangeInclusive, pub validators: Vec>, @@ -287,6 +299,7 @@ pub struct CommitteeShardInfo { #[derive(Debug, Clone, Serialize, Deserialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct GetShardKey { + #[cfg_attr(feature = "ts", ts(type = "number"))] pub height: u64, #[cfg_attr(feature = "ts", ts(type = "string"))] pub public_key: PublicKey, @@ -315,6 +328,7 @@ pub struct GetSubstateRequest { #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct GetSubstateResponse { pub value: Option, + #[cfg_attr(feature = "ts", ts(type = "string | null"))] pub created_by_tx: Option, pub status: SubstateStatus, } @@ -345,6 +359,7 @@ pub struct AddPeerResponse {} #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct GetEpochManagerStatsResponse { pub current_epoch: Epoch, + #[cfg_attr(feature = "ts", ts(type = "number"))] pub current_block_height: u64, pub is_valid: bool, pub committee_shard: Option, @@ -384,8 +399,11 @@ pub struct ValidatorFee { #[cfg_attr(feature = "ts", ts(type = "string"))] pub validator_public_key: PublicKey, pub epoch: Epoch, + #[cfg_attr(feature = "ts", ts(type = "string"))] pub block_id: BlockId, + #[cfg_attr(feature = "ts", ts(type = "number"))] pub total_fee_due: u64, + #[cfg_attr(feature = "ts", ts(type = "number"))] pub total_transaction_fee: u64, } @@ -409,13 +427,16 @@ impl From for ValidatorFee { #[derive(Debug, Clone, Serialize, Deserialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct GetBlockRequest { + #[cfg_attr(feature = "ts", ts(type = "string"))] pub block_id: BlockId, } #[derive(Debug, Clone, Serialize, Deserialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct GetBlocksRequest { + #[cfg_attr(feature = "ts", ts(type = "number"))] pub limit: u64, + #[cfg_attr(feature = "ts", ts(type = "number"))] pub offset: u64, pub ordering: Option, } diff --git a/clients/wallet_daemon_client/src/types.rs b/clients/wallet_daemon_client/src/types.rs index a17f4ebdf2..bab07f2de4 100644 --- a/clients/wallet_daemon_client/src/types.rs +++ b/clients/wallet_daemon_client/src/types.rs @@ -72,6 +72,7 @@ pub struct CallInstructionRequest { #[serde(default)] pub is_dry_run: bool, #[serde(default)] + #[cfg_attr(feature = "ts", ts(type = "Array"))] pub proof_ids: Vec, #[serde(default)] #[cfg_attr(feature = "ts", ts(type = "number | null"))] @@ -84,12 +85,14 @@ pub struct CallInstructionRequest { #[derive(Debug, Clone, Deserialize, Serialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct TransactionSubmitRequest { + #[cfg_attr(feature = "ts", ts(type = "number | null"))] pub signing_key_index: Option, pub fee_instructions: Vec, pub instructions: Vec, pub inputs: Vec, pub override_inputs: bool, pub is_dry_run: bool, + #[cfg_attr(feature = "ts", ts(type = "Array"))] pub proof_ids: Vec, pub min_epoch: Option, pub max_epoch: Option, @@ -98,6 +101,7 @@ pub struct TransactionSubmitRequest { #[derive(Debug, Clone, Deserialize, Serialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct TransactionSubmitResponse { + #[cfg_attr(feature = "ts", ts(type = "string"))] pub transaction_id: TransactionId, pub inputs: Vec, pub result: Option, @@ -108,6 +112,7 @@ pub struct TransactionSubmitResponse { #[derive(Debug, Clone, Deserialize, Serialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct TransactionGetRequest { + #[cfg_attr(feature = "ts", ts(type = "string"))] pub transaction_id: TransactionId, } @@ -136,12 +141,14 @@ pub struct TransactionGetAllResponse { #[derive(Debug, Clone, Deserialize, Serialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct TransactionGetResultRequest { + #[cfg_attr(feature = "ts", ts(type = "string"))] pub transaction_id: TransactionId, } #[derive(Debug, Clone, Deserialize, Serialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct TransactionGetResultResponse { + #[cfg_attr(feature = "ts", ts(type = "string"))] pub transaction_id: TransactionId, pub status: TransactionStatus, pub result: Option, @@ -152,18 +159,22 @@ pub struct TransactionGetResultResponse { #[derive(Debug, Clone, Deserialize, Serialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct TransactionWaitResultRequest { + #[cfg_attr(feature = "ts", ts(type = "string"))] pub transaction_id: TransactionId, + #[cfg_attr(feature = "ts", ts(type = "number | null"))] pub timeout_secs: Option, } #[derive(Debug, Clone, Deserialize, Serialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct TransactionWaitResultResponse { + #[cfg_attr(feature = "ts", ts(type = "string"))] pub transaction_id: TransactionId, pub result: Option, #[cfg_attr(feature = "ts", ts(type = "Array | null"))] pub json_result: Option>, pub status: TransactionStatus, + #[cfg_attr(feature = "ts", ts(type = "number"))] pub final_fee: Amount, pub timed_out: bool, } @@ -171,6 +182,7 @@ pub struct TransactionWaitResultResponse { #[derive(Debug, Clone, Deserialize, Serialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct TransactionClaimBurnResponse { + #[cfg_attr(feature = "ts", ts(type = "string"))] pub transaction_id: TransactionId, pub inputs: Vec, pub outputs: Vec, @@ -212,6 +224,7 @@ pub struct KeysCreateRequest { #[derive(Debug, Clone, Deserialize, Serialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct KeysCreateResponse { + #[cfg_attr(feature = "ts", ts(type = "number"))] pub id: u64, #[cfg_attr(feature = "ts", ts(type = "string"))] pub public_key: PublicKey, @@ -222,8 +235,10 @@ pub struct KeysCreateResponse { pub struct AccountsCreateRequest { pub account_name: Option, pub custom_access_rules: Option, + #[cfg_attr(feature = "ts", ts(type = "number | null"))] pub max_fee: Option, pub is_default: bool, + #[cfg_attr(feature = "ts", ts(type = "number | null"))] pub key_id: Option, } @@ -243,6 +258,7 @@ pub struct AccountsInvokeRequest { pub account: Option, pub method: String, pub args: Vec, + #[cfg_attr(feature = "ts", ts(type = "number | null"))] pub max_fee: Option, } @@ -273,6 +289,7 @@ pub struct AccountInfo { #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct AccountsListResponse { pub accounts: Vec, + #[cfg_attr(feature = "ts", ts(type = "number"))] pub total: u64, } @@ -298,8 +315,10 @@ pub struct BalanceEntry { pub vault_address: SubstateId, #[serde(with = "serde_with::string")] pub resource_address: ResourceAddress, + #[cfg_attr(feature = "ts", ts(type = "number"))] pub balance: Amount, pub resource_type: ResourceType, + #[cfg_attr(feature = "ts", ts(type = "number"))] pub confidential_balance: Amount, pub token_symbol: Option, } @@ -364,10 +383,12 @@ pub struct AccountSetDefaultResponse {} pub struct TransferRequest { #[serde(deserialize_with = "opt_string_or_struct")] pub account: Option, + #[cfg_attr(feature = "ts", ts(type = "number"))] pub amount: Amount, pub resource_address: ResourceAddress, #[cfg_attr(feature = "ts", ts(type = "string"))] pub destination_public_key: PublicKey, + #[cfg_attr(feature = "ts", ts(type = "number | null"))] pub max_fee: Option, pub dry_run: bool, } @@ -375,8 +396,11 @@ pub struct TransferRequest { #[derive(Debug, Clone, Deserialize, Serialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct TransferResponse { + #[cfg_attr(feature = "ts", ts(type = "string"))] pub transaction_id: TransactionId, + #[cfg_attr(feature = "ts", ts(type = "number"))] pub fee: Amount, + #[cfg_attr(feature = "ts", ts(type = "number"))] pub fee_refunded: Amount, pub result: FinalizeResult, } @@ -384,7 +408,9 @@ pub struct TransferResponse { #[derive(Debug, Clone, Deserialize, Serialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct ProofsGenerateRequest { + #[cfg_attr(feature = "ts", ts(type = "number"))] pub amount: Amount, + #[cfg_attr(feature = "ts", ts(type = "number"))] pub reveal_amount: Amount, #[serde(deserialize_with = "opt_string_or_struct")] pub account: Option, @@ -398,6 +424,7 @@ pub struct ProofsGenerateRequest { #[derive(Debug, Clone, Deserialize, Serialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct ProofsGenerateResponse { + #[cfg_attr(feature = "ts", ts(type = "number"))] pub proof_id: ConfidentialProofId, pub proof: ConfidentialWithdrawProof, } @@ -405,6 +432,7 @@ pub struct ProofsGenerateResponse { #[derive(Debug, Clone, Deserialize, Serialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct ProofsFinalizeRequest { + #[cfg_attr(feature = "ts", ts(type = "number"))] pub proof_id: ConfidentialProofId, } @@ -415,12 +443,14 @@ pub struct ProofsFinalizeResponse {} #[derive(Debug, Clone, Deserialize, Serialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct ProofsCancelRequest { + #[cfg_attr(feature = "ts", ts(type = "number"))] pub proof_id: ConfidentialProofId, } #[derive(Debug, Clone, Deserialize, Serialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct ConfidentialCreateOutputProofRequest { + #[cfg_attr(feature = "ts", ts(type = "number"))] pub amount: Amount, } @@ -435,10 +465,12 @@ pub struct ConfidentialCreateOutputProofResponse { pub struct ConfidentialTransferRequest { #[serde(deserialize_with = "opt_string_or_struct")] pub account: Option, + #[cfg_attr(feature = "ts", ts(type = "number"))] pub amount: Amount, pub resource_address: ResourceAddress, #[cfg_attr(feature = "ts", ts(type = "string"))] pub destination_public_key: PublicKey, + #[cfg_attr(feature = "ts", ts(type = "number | null"))] pub max_fee: Option, pub dry_run: bool, } @@ -446,7 +478,9 @@ pub struct ConfidentialTransferRequest { #[derive(Debug, Clone, Deserialize, Serialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct ConfidentialTransferResponse { + #[cfg_attr(feature = "ts", ts(type = "string"))] pub transaction_id: TransactionId, + #[cfg_attr(feature = "ts", ts(type = "number"))] pub fee: Amount, pub result: FinalizeResult, } @@ -458,6 +492,7 @@ pub struct ClaimBurnRequest { pub account: Option, #[cfg_attr(feature = "ts", ts(type = "string"))] pub claim_proof: serde_json::Value, + #[cfg_attr(feature = "ts", ts(type = "number | null"))] pub max_fee: Option, #[cfg_attr(feature = "ts", ts(type = "number | null"))] pub key_id: Option, @@ -466,7 +501,9 @@ pub struct ClaimBurnRequest { #[derive(Debug, Clone, Deserialize, Serialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct ClaimBurnResponse { + #[cfg_attr(feature = "ts", ts(type = "string"))] pub transaction_id: TransactionId, + #[cfg_attr(feature = "ts", ts(type = "number"))] pub fee: Amount, pub result: FinalizeResult, } @@ -482,17 +519,21 @@ pub struct RevealFundsRequest { #[serde(deserialize_with = "opt_string_or_struct")] pub account: Option, /// Amount to reveal + #[cfg_attr(feature = "ts", ts(type = "number"))] pub amount_to_reveal: Amount, /// Pay fee from revealed funds. If false, previously revealed funds in the account are used. pub pay_fee_from_reveal: bool, /// The amount of fees to add to the transaction. Any fees not charged are refunded. + #[cfg_attr(feature = "ts", ts(type = "number | null"))] pub max_fee: Option, } #[derive(Debug, Clone, Deserialize, Serialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct RevealFundsResponse { + #[cfg_attr(feature = "ts", ts(type = "string"))] pub transaction_id: TransactionId, + #[cfg_attr(feature = "ts", ts(type = "number"))] pub fee: Amount, pub result: FinalizeResult, } @@ -501,7 +542,9 @@ pub struct RevealFundsResponse { #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct AccountsCreateFreeTestCoinsRequest { pub account: Option, + #[cfg_attr(feature = "ts", ts(type = "number"))] pub amount: Amount, + #[cfg_attr(feature = "ts", ts(type = "number | null"))] pub max_fee: Option, #[cfg_attr(feature = "ts", ts(type = "number | null"))] pub key_id: Option, @@ -510,8 +553,11 @@ pub struct AccountsCreateFreeTestCoinsRequest { #[derive(Debug, Clone, Deserialize, Serialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct AccountsCreateFreeTestCoinsResponse { + #[cfg_attr(feature = "ts", ts(type = "string"))] pub transaction_id: TransactionId, + #[cfg_attr(feature = "ts", ts(type = "number"))] pub amount: Amount, + #[cfg_attr(feature = "ts", ts(type = "number"))] pub fee: Amount, pub result: FinalizeResult, #[cfg_attr(feature = "ts", ts(type = "string"))] @@ -589,7 +635,9 @@ pub struct MintAccountNftRequest { pub account: ComponentAddressOrName, #[cfg_attr(feature = "ts", ts(type = "string"))] pub metadata: serde_json::Value, + #[cfg_attr(feature = "ts", ts(type = "number | null"))] pub mint_fee: Option, + #[cfg_attr(feature = "ts", ts(type = "number | null"))] pub create_account_nft_fee: Option, } @@ -599,6 +647,7 @@ pub struct MintAccountNftResponse { pub nft_id: NonFungibleId, pub resource_address: ResourceAddress, pub result: FinalizeResult, + #[cfg_attr(feature = "ts", ts(type = "number"))] pub fee: Amount, } @@ -656,6 +705,7 @@ pub struct GetValidatorFeesRequest { #[derive(Debug, Clone, Deserialize, Serialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct GetValidatorFeesResponse { + #[cfg_attr(feature = "ts", ts(type = "Record"))] pub fee_summary: HashMap, } @@ -664,6 +714,7 @@ pub struct GetValidatorFeesResponse { pub struct ClaimValidatorFeesRequest { #[serde(default, deserialize_with = "opt_string_or_struct")] pub account: Option, + #[cfg_attr(feature = "ts", ts(type = "number | null"))] pub max_fee: Option, #[cfg_attr(feature = "ts", ts(type = "string"))] pub validator_public_key: PublicKey, @@ -674,7 +725,9 @@ pub struct ClaimValidatorFeesRequest { #[derive(Debug, Clone, Deserialize, Serialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct ClaimValidatorFeesResponse { + #[cfg_attr(feature = "ts", ts(type = "string"))] pub transaction_id: TransactionId, + #[cfg_attr(feature = "ts", ts(type = "number"))] pub fee: Amount, pub result: FinalizeResult, } diff --git a/dan_layer/common_types/src/committee.rs b/dan_layer/common_types/src/committee.rs index a9f6fb05f1..a82341e735 100644 --- a/dan_layer/common_types/src/committee.rs +++ b/dan_layer/common_types/src/committee.rs @@ -162,6 +162,7 @@ impl FromIterator> for Committee { pub struct CommitteeShard { num_committees: u32, num_members: u32, + #[cfg_attr(feature = "ts", ts(type = "number"))] shard: Shard, } diff --git a/dan_layer/common_types/src/node_height.rs b/dan_layer/common_types/src/node_height.rs index 4aa915315c..7f2ccb2c66 100644 --- a/dan_layer/common_types/src/node_height.rs +++ b/dan_layer/common_types/src/node_height.rs @@ -12,7 +12,7 @@ use ts_rs::TS; #[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Deserialize, Serialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] -pub struct NodeHeight(pub u64); +pub struct NodeHeight(#[cfg_attr(feature = "ts", ts(type = "number"))] pub u64); impl NodeHeight { pub const fn as_u64(self) -> u64 { diff --git a/dan_layer/common_types/src/shard.rs b/dan_layer/common_types/src/shard.rs index 1cf433e070..3ec608e51c 100644 --- a/dan_layer/common_types/src/shard.rs +++ b/dan_layer/common_types/src/shard.rs @@ -4,8 +4,6 @@ use std::{fmt::Display, ops::RangeInclusive}; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ts")] -use ts_rs::TS; use crate::{ uint::{U256, U256_ONE}, @@ -14,7 +12,6 @@ use crate::{ #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] #[serde(transparent)] -#[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct Shard(u32); impl Shard { diff --git a/dan_layer/engine_types/src/commit_result.rs b/dan_layer/engine_types/src/commit_result.rs index b9b46686a0..1307f7f4d5 100644 --- a/dan_layer/engine_types/src/commit_result.rs +++ b/dan_layer/engine_types/src/commit_result.rs @@ -99,6 +99,7 @@ impl ExecuteResult { #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct FinalizeResult { #[serde(with = "serde_with::hex")] + #[cfg_attr(feature = "ts", ts(type = "string"))] pub transaction_hash: Hash, pub events: Vec, pub logs: Vec, diff --git a/dan_layer/engine_types/src/component.rs b/dan_layer/engine_types/src/component.rs index b44f1d46a3..6adf24c5ee 100644 --- a/dan_layer/engine_types/src/component.rs +++ b/dan_layer/engine_types/src/component.rs @@ -50,6 +50,7 @@ pub fn new_component_address_from_parts(template_address: &TemplateAddress, comp #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct ComponentHeader { #[serde(with = "serde_with::hex")] + #[cfg_attr(feature = "ts", ts(type = "string"))] pub template_address: TemplateAddress, pub module_name: String, #[serde(with = "serde_with::hex")] diff --git a/dan_layer/engine_types/src/confidential/claim.rs b/dan_layer/engine_types/src/confidential/claim.rs index 3d58175f01..25a0ccb20c 100644 --- a/dan_layer/engine_types/src/confidential/claim.rs +++ b/dan_layer/engine_types/src/confidential/claim.rs @@ -13,6 +13,7 @@ use ts_rs::TS; pub struct ConfidentialClaim { #[cfg_attr(feature = "ts", ts(type = "string"))] pub public_key: PublicKey, + #[cfg_attr(feature = "ts", ts(type = "string"))] pub output_address: UnclaimedConfidentialOutputAddress, pub range_proof: Vec, #[cfg_attr(feature = "ts", ts(type = "string"))] diff --git a/dan_layer/engine_types/src/confidential/unclaimed.rs b/dan_layer/engine_types/src/confidential/unclaimed.rs index 5f79c18991..a67d200d00 100644 --- a/dan_layer/engine_types/src/confidential/unclaimed.rs +++ b/dan_layer/engine_types/src/confidential/unclaimed.rs @@ -32,5 +32,6 @@ use ts_rs::TS; pub struct UnclaimedConfidentialOutput { #[cfg_attr(feature = "ts", ts(type = "string"))] pub commitment: Commitment, + #[cfg_attr(feature = "ts", ts(type = "Array"))] pub encrypted_data: EncryptedData, } diff --git a/dan_layer/engine_types/src/confidential/withdraw.rs b/dan_layer/engine_types/src/confidential/withdraw.rs index ff913c80bf..9ac5045329 100644 --- a/dan_layer/engine_types/src/confidential/withdraw.rs +++ b/dan_layer/engine_types/src/confidential/withdraw.rs @@ -30,7 +30,9 @@ pub struct ConfidentialOutput { pub commitment: Commitment, #[cfg_attr(feature = "ts", ts(type = "string"))] pub stealth_public_nonce: PublicKey, + #[cfg_attr(feature = "ts", ts(type = "Array"))] pub encrypted_data: EncryptedData, + #[cfg_attr(feature = "ts", ts(type = "number"))] pub minimum_value_promise: u64, } diff --git a/dan_layer/engine_types/src/fee_claim.rs b/dan_layer/engine_types/src/fee_claim.rs index 6e67a656ae..b10727b272 100644 --- a/dan_layer/engine_types/src/fee_claim.rs +++ b/dan_layer/engine_types/src/fee_claim.rs @@ -51,8 +51,10 @@ impl Display for FeeClaimAddress { #[derive(Debug, Clone, Serialize, Deserialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct FeeClaim { + #[cfg_attr(feature = "ts", ts(type = "number"))] pub epoch: u64, #[cfg_attr(feature = "ts", ts(type = "string"))] pub validator_public_key: PublicKey, + #[cfg_attr(feature = "ts", ts(type = "number"))] pub amount: Amount, } diff --git a/dan_layer/engine_types/src/fees.rs b/dan_layer/engine_types/src/fees.rs index 05cea1b06b..92f0255915 100644 --- a/dan_layer/engine_types/src/fees.rs +++ b/dan_layer/engine_types/src/fees.rs @@ -14,10 +14,13 @@ use crate::resource_container::ResourceContainer; #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct FeeReceipt { /// The total amount of the fee payment(s) + #[cfg_attr(feature = "ts", ts(type = "number"))] pub total_fee_payment: Amount, /// Total fees paid after refunds + #[cfg_attr(feature = "ts", ts(type = "number"))] pub total_fees_paid: Amount, /// Breakdown of fee costs + #[cfg_attr(feature = "ts", ts(type = "Array<[FeeSource, number]>"))] pub cost_breakdown: Vec<(FeeSource, u64)>, } @@ -76,7 +79,9 @@ pub enum FeeSource { #[derive(Debug, Clone, Serialize, Deserialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct FeeCostBreakdown { + #[cfg_attr(feature = "ts", ts(type = "number"))] pub total_fees_charged: Amount, + #[cfg_attr(feature = "ts", ts(type = "Array<[FeeSource, number]>"))] pub breakdown: Vec<(FeeSource, u64)>, } diff --git a/dan_layer/engine_types/src/instruction.rs b/dan_layer/engine_types/src/instruction.rs index fbaef524ed..b7014f61aa 100644 --- a/dan_layer/engine_types/src/instruction.rs +++ b/dan_layer/engine_types/src/instruction.rs @@ -23,6 +23,7 @@ use crate::{ pub enum Instruction { CallFunction { #[serde(with = "serde_with::hex")] + #[cfg_attr(feature = "ts", ts(type = "string"))] template_address: TemplateAddress, function: String, #[serde(deserialize_with = "crate::argument_parser::json_deserialize")] @@ -46,6 +47,7 @@ pub enum Instruction { claim: Box, }, ClaimValidatorFees { + #[cfg_attr(feature = "ts", ts(type = "number"))] epoch: u64, #[cfg_attr(feature = "ts", ts(type = "string"))] validator_public_key: PublicKey, @@ -53,6 +55,7 @@ pub enum Instruction { DropAllProofsInWorkspace, #[cfg(feature = "debugging")] CreateFreeTestCoins { + #[cfg_attr(feature = "ts", ts(type = "number"))] revealed_amount: Amount, output: Option, }, diff --git a/dan_layer/engine_types/src/resource.rs b/dan_layer/engine_types/src/resource.rs index 97520101e7..ade162abdb 100644 --- a/dan_layer/engine_types/src/resource.rs +++ b/dan_layer/engine_types/src/resource.rs @@ -35,6 +35,7 @@ use ts_rs::TS; pub struct Resource { resource_type: ResourceType, owner_rule: OwnerRule, + #[cfg_attr(feature = "ts", ts(type = "Array"))] owner_key: RistrettoPublicKeyBytes, access_rules: ResourceAccessRules, metadata: Metadata, diff --git a/dan_layer/engine_types/src/resource_container.rs b/dan_layer/engine_types/src/resource_container.rs index 48fa4a940c..de95cf64c2 100644 --- a/dan_layer/engine_types/src/resource_container.rs +++ b/dan_layer/engine_types/src/resource_container.rs @@ -37,7 +37,9 @@ use crate::{ pub enum ResourceContainer { Fungible { address: ResourceAddress, + #[cfg_attr(feature = "ts", ts(type = "number"))] amount: Amount, + #[cfg_attr(feature = "ts", ts(type = "number"))] locked_amount: Amount, }, NonFungible { @@ -47,11 +49,13 @@ pub enum ResourceContainer { }, Confidential { address: ResourceAddress, - #[cfg_attr(feature = "ts", ts(skip))] + #[cfg_attr(feature = "ts", ts(type = "Record"))] commitments: BTreeMap, + #[cfg_attr(feature = "ts", ts(type = "number"))] revealed_amount: Amount, - #[cfg_attr(feature = "ts", ts(skip))] + #[cfg_attr(feature = "ts", ts(type = "Record"))] locked_commitments: BTreeMap, + #[cfg_attr(feature = "ts", ts(type = "number"))] locked_revealed_amount: Amount, }, } diff --git a/dan_layer/engine_types/src/substate.rs b/dan_layer/engine_types/src/substate.rs index 6bddf498d1..1a6bb418e9 100644 --- a/dan_layer/engine_types/src/substate.rs +++ b/dan_layer/engine_types/src/substate.rs @@ -98,7 +98,7 @@ pub enum SubstateId { Component(#[serde(with = "serde_with::string")] ComponentAddress), Resource(#[serde(with = "serde_with::string")] ResourceAddress), Vault(#[serde(with = "serde_with::string")] VaultId), - UnclaimedConfidentialOutput(UnclaimedConfidentialOutputAddress), + UnclaimedConfidentialOutput(#[cfg_attr(feature = "ts", ts(type = "string"))] UnclaimedConfidentialOutputAddress), NonFungible(NonFungibleAddress), NonFungibleIndex(NonFungibleIndexAddress), TransactionReceipt(TransactionReceiptAddress), diff --git a/dan_layer/engine_types/src/transaction_receipt.rs b/dan_layer/engine_types/src/transaction_receipt.rs index 9318bcd033..cb617f5de1 100644 --- a/dan_layer/engine_types/src/transaction_receipt.rs +++ b/dan_layer/engine_types/src/transaction_receipt.rs @@ -50,6 +50,7 @@ impl Display for TransactionReceiptAddress { #[derive(Debug, Clone, Serialize, Deserialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct TransactionReceipt { + #[cfg_attr(feature = "ts", ts(type = "string"))] pub transaction_hash: Hash, pub events: Vec, pub logs: Vec, diff --git a/dan_layer/storage/src/consensus_models/block.rs b/dan_layer/storage/src/consensus_models/block.rs index d8bcf91d9b..94f78ed5c9 100644 --- a/dan_layer/storage/src/consensus_models/block.rs +++ b/dan_layer/storage/src/consensus_models/block.rs @@ -53,13 +53,16 @@ const LOG_TARGET: &str = "tari::dan::storage::consensus_models::block"; #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct Block { // Header + #[cfg_attr(feature = "ts", ts(type = "string"))] id: BlockId, + #[cfg_attr(feature = "ts", ts(type = "string"))] parent: BlockId, justify: QuorumCertificate, height: NodeHeight, epoch: Epoch, #[cfg_attr(feature = "ts", ts(type = "string"))] proposed_by: PublicKey, + #[cfg_attr(feature = "ts", ts(type = "number"))] total_leader_fee: u64, // Body @@ -75,6 +78,7 @@ pub struct Block { /// Flag that indicates that the block has been committed. is_committed: bool, /// Counter for each foreign shard for reliable broadcast. + #[cfg_attr(feature = "ts", ts(type = "Array<{shard: string, counter: number}>"))] foreign_indexes: IndexMap, /// Timestamp when was this stored. #[cfg_attr(feature = "ts", ts(type = "string | null"))] @@ -700,12 +704,7 @@ impl Display for Block { #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] #[serde(transparent)] -#[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] -pub struct BlockId( - #[serde(with = "serde_with::hex")] - #[cfg_attr(feature = "ts", ts(type = "string"))] - FixedHash, -); +pub struct BlockId(#[serde(with = "serde_with::hex")] FixedHash); impl BlockId { pub const fn genesis() -> Self { diff --git a/dan_layer/storage/src/consensus_models/command.rs b/dan_layer/storage/src/consensus_models/command.rs index cef3f2396b..4840d35ad4 100644 --- a/dan_layer/storage/src/consensus_models/command.rs +++ b/dan_layer/storage/src/consensus_models/command.rs @@ -103,6 +103,7 @@ impl Extend<(SubstateAddress, ShardEvidence)> for Evidence { #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct ShardEvidence { + #[cfg_attr(feature = "ts", ts(type = "Array"))] pub qc_ids: IndexSet, pub lock: LockFlag, } @@ -128,10 +129,13 @@ impl ShardEvidence { #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct TransactionAtom { + #[cfg_attr(feature = "ts", ts(type = "string"))] pub id: TransactionId, pub decision: Decision, pub evidence: Evidence, + #[cfg_attr(feature = "ts", ts(type = "number"))] pub transaction_fee: u64, + #[cfg_attr(feature = "ts", ts(type = "number"))] pub leader_fee: u64, } diff --git a/dan_layer/storage/src/consensus_models/foreign_proposal.rs b/dan_layer/storage/src/consensus_models/foreign_proposal.rs index e709a0dfc3..60f4fda59c 100644 --- a/dan_layer/storage/src/consensus_models/foreign_proposal.rs +++ b/dan_layer/storage/src/consensus_models/foreign_proposal.rs @@ -49,7 +49,9 @@ impl FromStr for ForeignProposalState { #[derive(Debug, Clone, Eq, PartialEq, Hash, Serialize, Deserialize, PartialOrd, Ord)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct ForeignProposal { + #[cfg_attr(feature = "ts", ts(type = "number"))] pub bucket: Shard, + #[cfg_attr(feature = "ts", ts(type = "string"))] pub block_id: BlockId, pub state: ForeignProposalState, pub proposed_height: Option, diff --git a/dan_layer/storage/src/consensus_models/quorum_certificate.rs b/dan_layer/storage/src/consensus_models/quorum_certificate.rs index c4cfdb9a1b..881a25a388 100644 --- a/dan_layer/storage/src/consensus_models/quorum_certificate.rs +++ b/dan_layer/storage/src/consensus_models/quorum_certificate.rs @@ -35,7 +35,9 @@ const LOG_TARGET: &str = "tari::dan::storage::quorum_certificate"; #[derive(Debug, Clone, Deserialize, Serialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct QuorumCertificate { + #[cfg_attr(feature = "ts", ts(type = "string"))] qc_id: QcId, + #[cfg_attr(feature = "ts", ts(type = "string"))] block_id: BlockId, block_height: NodeHeight, epoch: Epoch, @@ -253,12 +255,7 @@ impl Display for QuorumCertificate { #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] #[serde(transparent)] -#[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] -pub struct QcId( - #[serde(with = "serde_with::hex")] - #[cfg_attr(feature = "ts", ts(type = "string | null"))] - FixedHash, -); +pub struct QcId(#[serde(with = "serde_with::hex")] FixedHash); impl QcId { pub const fn genesis() -> Self { diff --git a/dan_layer/storage/src/consensus_models/substate.rs b/dan_layer/storage/src/consensus_models/substate.rs index 91aafef125..10fb997822 100644 --- a/dan_layer/storage/src/consensus_models/substate.rs +++ b/dan_layer/storage/src/consensus_models/substate.rs @@ -34,8 +34,11 @@ pub struct SubstateRecord { pub substate_value: SubstateValue, #[cfg_attr(feature = "ts", ts(type = "string"))] pub state_hash: FixedHash, + #[cfg_attr(feature = "ts", ts(type = "string"))] pub created_by_transaction: TransactionId, + #[cfg_attr(feature = "ts", ts(type = "string"))] pub created_justify: QcId, + #[cfg_attr(feature = "ts", ts(type = "string"))] pub created_block: BlockId, pub created_height: NodeHeight, pub created_at_epoch: Epoch, @@ -45,8 +48,11 @@ pub struct SubstateRecord { #[derive(Debug, Clone, Serialize, Deserialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct SubstateDestroyed { + #[cfg_attr(feature = "ts", ts(type = "string"))] pub by_transaction: TransactionId, + #[cfg_attr(feature = "ts", ts(type = "string"))] pub justify: QcId, + #[cfg_attr(feature = "ts", ts(type = "string"))] pub by_block: BlockId, pub at_epoch: Epoch, } diff --git a/dan_layer/storage/src/global/models/validator_node.rs b/dan_layer/storage/src/global/models/validator_node.rs index abbcd4413c..75049507f9 100644 --- a/dan_layer/storage/src/global/models/validator_node.rs +++ b/dan_layer/storage/src/global/models/validator_node.rs @@ -16,6 +16,7 @@ pub struct ValidatorNode { pub public_key: PublicKey, pub shard_key: SubstateAddress, pub epoch: Epoch, + #[cfg_attr(feature = "ts", ts(type = "number | null"))] pub committee_shard: Option, #[cfg_attr(feature = "ts", ts(type = "string"))] pub fee_claim_public_key: PublicKey, diff --git a/dan_layer/template_lib/src/auth/access_rules.rs b/dan_layer/template_lib/src/auth/access_rules.rs index 65f1e012ec..67c2a601c5 100644 --- a/dan_layer/template_lib/src/auth/access_rules.rs +++ b/dan_layer/template_lib/src/auth/access_rules.rs @@ -69,7 +69,7 @@ pub enum RuleRequirement { /// Requires execution within a specific component ScopedToComponent(ComponentAddress), /// Requires execution within a specific template - ScopedToTemplate(TemplateAddress), + ScopedToTemplate(#[cfg_attr(feature = "ts", ts(type = "Array"))] TemplateAddress), } impl From for RuleRequirement { @@ -109,7 +109,7 @@ pub enum RequireRule { #[derive(Debug, Clone, Serialize, Deserialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct ComponentAccessRules { - #[cfg_attr(feature = "ts", ts(skip))] + #[cfg_attr(feature = "ts", ts(type = "Record"))] method_access: BTreeMap, default: AccessRule, } diff --git a/dan_layer/template_lib/src/crypto/balance_proof.rs b/dan_layer/template_lib/src/crypto/balance_proof.rs index 65b2ecae45..f919f81b4c 100644 --- a/dan_layer/template_lib/src/crypto/balance_proof.rs +++ b/dan_layer/template_lib/src/crypto/balance_proof.rs @@ -2,8 +2,6 @@ // SPDX-License-Identifier: BSD-3-Clause use serde::{Deserialize, Serialize}; use serde_with::{serde_as, Bytes}; -#[cfg(feature = "ts")] -use ts_rs::TS; use crate::crypto::InvalidByteLengthError; @@ -11,7 +9,6 @@ use crate::crypto::InvalidByteLengthError; #[serde_as] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)] #[serde(transparent)] -#[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct BalanceProofSignature(#[serde_as(as = "Bytes")] [u8; BalanceProofSignature::length()]); impl BalanceProofSignature { diff --git a/dan_layer/template_lib/src/crypto/commitment.rs b/dan_layer/template_lib/src/crypto/commitment.rs index 0fb4eca096..be4b00826c 100644 --- a/dan_layer/template_lib/src/crypto/commitment.rs +++ b/dan_layer/template_lib/src/crypto/commitment.rs @@ -4,8 +4,6 @@ use serde::{Deserialize, Serialize}; use serde_with::{serde_as, Bytes}; use tari_template_abi::rust::fmt::{Display, Formatter}; -#[cfg(feature = "ts")] -use ts_rs::TS; use crate::{crypto::InvalidByteLengthError, Hash}; @@ -13,7 +11,6 @@ use crate::{crypto::InvalidByteLengthError, Hash}; #[serde_as] #[derive(Debug, Clone, Copy, PartialEq, Eq, Ord, PartialOrd, Hash, Default, Serialize, Deserialize)] #[serde(transparent)] -#[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct PedersonCommitmentBytes(#[serde_as(as = "Bytes")] [u8; PedersonCommitmentBytes::length()]); impl PedersonCommitmentBytes { diff --git a/dan_layer/template_lib/src/crypto/ristretto.rs b/dan_layer/template_lib/src/crypto/ristretto.rs index 282023f4f5..95b5d319da 100644 --- a/dan_layer/template_lib/src/crypto/ristretto.rs +++ b/dan_layer/template_lib/src/crypto/ristretto.rs @@ -4,8 +4,6 @@ use serde::{Deserialize, Serialize}; use serde_with::{serde_as, Bytes}; use tari_template_abi::rust::fmt::{Display, Formatter}; -#[cfg(feature = "ts")] -use ts_rs::TS; use crate::{crypto::InvalidByteLengthError, models::NonFungibleAddress, Hash}; @@ -13,12 +11,7 @@ use crate::{crypto::InvalidByteLengthError, models::NonFungibleAddress, Hash}; #[serde_as] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize)] #[serde(transparent)] -#[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] -pub struct RistrettoPublicKeyBytes( - #[serde_as(as = "Bytes")] - #[cfg_attr(feature = "ts", ts(type = "string"))] - [u8; RistrettoPublicKeyBytes::length()], -); +pub struct RistrettoPublicKeyBytes(#[serde_as(as = "Bytes")] [u8; RistrettoPublicKeyBytes::length()]); impl RistrettoPublicKeyBytes { pub const fn length() -> usize { diff --git a/dan_layer/template_lib/src/hash.rs b/dan_layer/template_lib/src/hash.rs index d12281544d..60a513df55 100644 --- a/dan_layer/template_lib/src/hash.rs +++ b/dan_layer/template_lib/src/hash.rs @@ -30,14 +30,11 @@ use std::{ use serde::{Deserialize, Serialize}; use serde_with::{serde_as, Bytes}; -#[cfg(feature = "ts")] -use ts_rs::TS; /// Representation of a 32-byte hash value #[serde_as] #[derive(Debug, Clone, Copy, PartialEq, Eq, Ord, PartialOrd, Hash, Default, Serialize, Deserialize)] #[serde(transparent)] -#[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct Hash(#[serde_as(as = "Bytes")] [u8; 32]); impl Hash { diff --git a/dan_layer/template_lib/src/models/amount.rs b/dan_layer/template_lib/src/models/amount.rs index 3f7de5822d..67c4a81d41 100644 --- a/dan_layer/template_lib/src/models/amount.rs +++ b/dan_layer/template_lib/src/models/amount.rs @@ -27,14 +27,11 @@ use tari_template_abi::rust::{ iter::Sum, num::TryFromIntError, }; -#[cfg(feature = "ts")] -use ts_rs::TS; -/// Represents an integer quantity of any fungible or non-fungible resourcecyni +/// Represents an integer quantity of any fungible or non-fungible resource #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize, Default)] #[serde(transparent)] -#[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] -pub struct Amount(#[cfg_attr(feature = "ts", ts(type = "number"))] pub i64); +pub struct Amount(pub i64); impl Amount { pub const MAX: Amount = Amount(i64::MAX); diff --git a/dan_layer/template_lib/src/models/confidential_proof.rs b/dan_layer/template_lib/src/models/confidential_proof.rs index 2b26f6fd88..0428c75206 100644 --- a/dan_layer/template_lib/src/models/confidential_proof.rs +++ b/dan_layer/template_lib/src/models/confidential_proof.rs @@ -33,11 +33,15 @@ pub struct ConfidentialStatement { pub commitment: [u8; 32], /// Public nonce (R) that was used to generate the commitment mask // #[cfg_attr(feature = "serde", serde(with = "hex::serde"))] + #[cfg_attr(feature = "ts", ts(type = "Array"))] pub sender_public_nonce: RistrettoPublicKeyBytes, /// Commitment value encrypted for the receiver. Without this it would be difficult (not impossible) for the /// receiver to determine the value component of the commitment. + #[cfg_attr(feature = "ts", ts(type = "Array"))] pub encrypted_data: EncryptedData, + #[cfg_attr(feature = "ts", ts(type = "number"))] pub minimum_value_promise: u64, + #[cfg_attr(feature = "ts", ts(type = "number"))] pub revealed_amount: Amount, } @@ -46,9 +50,11 @@ pub struct ConfidentialStatement { #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct ConfidentialWithdrawProof { // #[cfg_attr(feature = "hex", serde(with = "hex::serde"))] + #[cfg_attr(feature = "ts", ts(type = "Array"))] pub inputs: Vec, pub output_proof: ConfidentialOutputProof, /// Balance proof + #[cfg_attr(feature = "ts", ts(type = "Array"))] pub balance_proof: BalanceProofSignature, } @@ -57,7 +63,6 @@ pub struct ConfidentialWithdrawProof { #[serde_as] #[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] #[serde(transparent)] -#[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct EncryptedData(#[serde_as(as = "Bytes")] pub [u8; EncryptedData::size()]); impl EncryptedData { diff --git a/dan_layer/template_lib/src/models/layer_one_commitment.rs b/dan_layer/template_lib/src/models/layer_one_commitment.rs index f64b70fc17..f089679281 100644 --- a/dan_layer/template_lib/src/models/layer_one_commitment.rs +++ b/dan_layer/template_lib/src/models/layer_one_commitment.rs @@ -4,8 +4,6 @@ use std::fmt::{Display, Formatter}; use serde::{Deserialize, Serialize}; -#[cfg(feature = "ts")] -use ts_rs::TS; use crate::{hash::HashParseError, Hash}; @@ -13,8 +11,7 @@ use crate::{hash::HashParseError, Hash}; /// Used when a user wants to claim burned funds from the Minotari network into the Tari network #[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)] #[serde(transparent)] -#[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] -pub struct UnclaimedConfidentialOutputAddress(#[cfg_attr(feature = "ts", ts(type = "string"))] Hash); +pub struct UnclaimedConfidentialOutputAddress(Hash); impl UnclaimedConfidentialOutputAddress { pub const fn new(hash: Hash) -> Self { diff --git a/dan_layer/template_lib/src/models/non_fungible.rs b/dan_layer/template_lib/src/models/non_fungible.rs index d2b2b1e082..35333341e6 100644 --- a/dan_layer/template_lib/src/models/non_fungible.rs +++ b/dan_layer/template_lib/src/models/non_fungible.rs @@ -32,7 +32,7 @@ pub enum NonFungibleId { U256(#[serde_as(as = "Bytes")] [u8; 32]), String(String), Uint32(u32), - Uint64(u64), + Uint64(#[cfg_attr(feature = "ts", ts(type = "number"))] u64), } impl NonFungibleId { diff --git a/dan_layer/transaction/src/transaction.rs b/dan_layer/transaction/src/transaction.rs index 50814d7fd0..0abedaf6d7 100644 --- a/dan_layer/transaction/src/transaction.rs +++ b/dan_layer/transaction/src/transaction.rs @@ -22,7 +22,7 @@ use crate::{builder::TransactionBuilder, transaction_id::TransactionId, Transact #[derive(Debug, Clone, Serialize, Deserialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct Transaction { - #[cfg_attr(feature = "ts", ts(flatten))] + #[cfg_attr(feature = "ts", ts(type = "string"))] id: TransactionId, fee_instructions: Vec, instructions: Vec, diff --git a/dan_layer/transaction/src/transaction_id.rs b/dan_layer/transaction/src/transaction_id.rs index d4100c1d6e..b3d25d5e60 100644 --- a/dan_layer/transaction/src/transaction_id.rs +++ b/dan_layer/transaction/src/transaction_id.rs @@ -10,15 +10,11 @@ use serde::{Deserialize, Serialize}; use tari_common_types::types::FixedHashSizeError; use tari_crypto::tari_utilities::hex::{from_hex, Hex}; use tari_engine_types::serde_with; -#[cfg(feature = "ts")] -use ts_rs::TS; #[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Deserialize, Serialize, Default)] #[serde(transparent)] -#[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct TransactionId { #[serde(with = "serde_with::hex")] - #[cfg_attr(feature = "ts", ts(type = "string"))] id: [u8; 32], }