-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: decrease circular deps in tx package
- Loading branch information
Showing
31 changed files
with
194 additions
and
219 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
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
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 |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import { Address } from '../common'; | ||
import { LengthPrefixedString } from '../postcondition-types'; | ||
import { ClarityValue } from './clarityValue'; | ||
import { ClarityType } from './constants'; | ||
|
||
export type BooleanCV = TrueCV | FalseCV; | ||
|
||
export interface TrueCV { | ||
type: ClarityType.BoolTrue; | ||
} | ||
|
||
export interface FalseCV { | ||
type: ClarityType.BoolFalse; | ||
} | ||
|
||
export interface BufferCV { | ||
readonly type: ClarityType.Buffer; | ||
readonly buffer: Uint8Array; | ||
} | ||
|
||
export interface IntCV { | ||
readonly type: ClarityType.Int; | ||
readonly value: bigint; | ||
} | ||
|
||
export interface UIntCV { | ||
readonly type: ClarityType.UInt; | ||
readonly value: bigint; | ||
} | ||
|
||
export interface ListCV<T extends ClarityValue = ClarityValue> { | ||
type: ClarityType.List; | ||
list: T[]; | ||
} | ||
|
||
export type OptionalCV<T extends ClarityValue = ClarityValue> = NoneCV | SomeCV<T>; | ||
|
||
export interface NoneCV { | ||
readonly type: ClarityType.OptionalNone; | ||
} | ||
|
||
export interface SomeCV<T extends ClarityValue = ClarityValue> { | ||
readonly type: ClarityType.OptionalSome; | ||
readonly value: T; | ||
} | ||
|
||
export type PrincipalCV = StandardPrincipalCV | ContractPrincipalCV; | ||
|
||
export interface StandardPrincipalCV { | ||
readonly type: ClarityType.PrincipalStandard; | ||
readonly address: Address; | ||
} | ||
|
||
export interface ContractPrincipalCV { | ||
readonly type: ClarityType.PrincipalContract; | ||
readonly address: Address; | ||
readonly contractName: LengthPrefixedString; | ||
} | ||
|
||
export type ResponseCV = ResponseErrorCV | ResponseOkCV; | ||
|
||
export interface ResponseErrorCV<T extends ClarityValue = ClarityValue> { | ||
readonly type: ClarityType.ResponseErr; | ||
readonly value: T; | ||
} | ||
|
||
export interface ResponseOkCV<T extends ClarityValue = ClarityValue> { | ||
readonly type: ClarityType.ResponseOk; | ||
readonly value: T; | ||
} | ||
|
||
export interface StringAsciiCV { | ||
readonly type: ClarityType.StringASCII; | ||
readonly data: string; | ||
} | ||
|
||
export interface StringUtf8CV { | ||
readonly type: ClarityType.StringUTF8; | ||
readonly data: string; | ||
} | ||
|
||
export type TupleData<T extends ClarityValue = ClarityValue> = { [key: string]: T }; | ||
|
||
export interface TupleCV<T extends TupleData = TupleData> { | ||
type: ClarityType.Tuple; | ||
data: T; | ||
} |
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
Oops, something went wrong.