-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: transparent bindings and bigints (#919)
Description --- Handle the `#[serde(transparent)]` structs, and also fix the bigint. i64 and u64 were exported as bigint, instead of number. The number can hold anything in range(inclusive) from -(2^53-1)...(2^53-1). Anything above or below can be hold but it's not safe to be precise. Motivation and Context --- Some of the structures are `#[serde(transparent)]` this is not recognized by the ts-rs crate. If the structure is "real struct" (e.g. struct A{b:u64} and not a struct A(u64), then we can call #[ts(flatten)] but you have to call it on every instance. And it will rewrite the variable e.g. ``` struct A{ #[ts(flatten)] b:B } struct B { c:u8 } ``` Will be exported as ``` export interface A { c : number; // instead of b : number } ``` So I have decided instead of flatten define the types by hand How Has This Been Tested? --- What process can a PR reviewer use to test or verify this change? --- Breaking Changes --- - [x] None - [ ] Requires data directory to be deleted - [ ] Other - Please specify
- Loading branch information
Showing
130 changed files
with
285 additions
and
316 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 { Arg } from "./Arg"; | ||
import type { ComponentAddressOrName } from "./ComponentAddressOrName"; | ||
|
||
export interface AccountsInvokeRequest { | ||
account: ComponentAddressOrName | null; | ||
method: string; | ||
args: Array<Arg>; | ||
max_fee: Amount | null; | ||
max_fee: number | null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
// 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"; | ||
|
||
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; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,24 @@ | ||
// 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; | ||
network: 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<Command>; | ||
is_dummy: boolean; | ||
is_processed: boolean; | ||
is_committed: boolean; | ||
foreign_indexes: Record<Shard, bigint>; | ||
foreign_indexes: Array<{ shard: string; counter: number }>; | ||
stored_at: string | null; | ||
signature: { public_nonce: string; signature: string } | null; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<TAddr> { | ||
shard: Shard; | ||
shard: number; | ||
substate_address_range: { start: SubstateAddress; end: SubstateAddress }; | ||
validators: Array<ValidatorNode<TAddr>>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<number>; | ||
minimum_value_promise: number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<number>; | ||
sender_public_nonce: RistrettoPublicKeyBytes; | ||
encrypted_data: EncryptedData; | ||
minimum_value_promise: bigint; | ||
revealed_amount: Amount; | ||
sender_public_nonce: Array<number>; | ||
encrypted_data: Array<number>; | ||
minimum_value_promise: number; | ||
revealed_amount: number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
Oops, something went wrong.