@clarigen/cli 1.0.0-next.18 → 1.0.0-next.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,119 @@
1
+ export type ClarityAbiTypeBuffer = { buffer: { length: number } };
2
+ export type ClarityAbiTypeStringAscii = { 'string-ascii': { length: number } };
3
+ export type ClarityAbiTypeStringUtf8 = { 'string-utf8': { length: number } };
4
+ export type ClarityAbiTypeResponse = { response: { ok: ClarityAbiType; error: ClarityAbiType } };
5
+ export type ClarityAbiTypeOptional = { optional: ClarityAbiType };
6
+ export type ClarityAbiTypeTuple = { tuple: { name: string; type: ClarityAbiType }[] };
7
+ export type ClarityAbiTypeList = { list: { type: ClarityAbiType; length: number } };
8
+
9
+ export type ClarityAbiTypeUInt128 = 'uint128';
10
+ export type ClarityAbiTypeInt128 = 'int128';
11
+ export type ClarityAbiTypeBool = 'bool';
12
+ export type ClarityAbiTypePrincipal = 'principal';
13
+ export type ClarityAbiTypeTraitReference = 'trait_reference';
14
+ export type ClarityAbiTypeNone = 'none';
15
+
16
+ export type ClarityAbiTypePrimitive =
17
+ | ClarityAbiTypeUInt128
18
+ | ClarityAbiTypeInt128
19
+ | ClarityAbiTypeBool
20
+ | ClarityAbiTypePrincipal
21
+ | ClarityAbiTypeTraitReference
22
+ | ClarityAbiTypeNone;
23
+
24
+ export type ClarityAbiType =
25
+ | ClarityAbiTypePrimitive
26
+ | ClarityAbiTypeBuffer
27
+ | ClarityAbiTypeResponse
28
+ | ClarityAbiTypeOptional
29
+ | ClarityAbiTypeTuple
30
+ | ClarityAbiTypeList
31
+ | ClarityAbiTypeStringAscii
32
+ | ClarityAbiTypeStringUtf8
33
+ | ClarityAbiTypeTraitReference;
34
+
35
+ export interface ClarityAbiFunction {
36
+ name: string;
37
+ access: 'private' | 'public' | 'read_only';
38
+ args: {
39
+ name: string;
40
+ type: ClarityAbiType;
41
+ }[];
42
+ outputs: {
43
+ type: ClarityAbiType;
44
+ };
45
+ }
46
+
47
+ export type TypedAbiFunction<T extends any[], R> = ClarityAbiFunction & {
48
+ _t?: T;
49
+ _r?: R;
50
+ };
51
+
52
+ export interface ClarityAbiVariable {
53
+ name: string;
54
+ access: 'variable' | 'constant';
55
+ type: ClarityAbiType;
56
+ }
57
+
58
+ export type TypedAbiVariable<T> = ClarityAbiVariable & {
59
+ defaultValue: T;
60
+ };
61
+
62
+ export interface ClarityAbiMap {
63
+ name: string;
64
+ key: ClarityAbiType;
65
+ value: ClarityAbiType;
66
+ }
67
+
68
+ export type TypedAbiMap<K, V> = ClarityAbiMap & {
69
+ _k?: K;
70
+ _v?: V;
71
+ };
72
+
73
+ export interface ClarityAbiTypeFungibleToken {
74
+ name: string;
75
+ }
76
+
77
+ export interface ClarityAbiTypeNonFungibleToken {
78
+ name: string;
79
+ type: ClarityAbiType;
80
+ }
81
+
82
+ export interface ClarityAbi {
83
+ functions: ClarityAbiFunction[];
84
+ variables: ClarityAbiVariable[];
85
+ maps: ClarityAbiMap[];
86
+ fungible_tokens: ClarityAbiTypeFungibleToken[];
87
+ non_fungible_tokens: ClarityAbiTypeNonFungibleToken[];
88
+ }
89
+
90
+ export type TypedAbi = Readonly<{
91
+ functions: {
92
+ [key: string]: TypedAbiFunction<unknown[], unknown>;
93
+ };
94
+ variables: {
95
+ [key: string]: TypedAbiVariable<unknown>;
96
+ };
97
+ maps: {
98
+ [key: string]: TypedAbiMap<unknown, unknown>;
99
+ };
100
+ constants: {
101
+ [key: string]: any;
102
+ };
103
+ fungible_tokens: Readonly<ClarityAbiTypeFungibleToken[]>;
104
+ non_fungible_tokens: Readonly<ClarityAbiTypeNonFungibleToken[]>;
105
+ contractName: string;
106
+ contractFile?: string;
107
+ }>;
108
+
109
+ export interface ResponseOk<T, E> {
110
+ value: T;
111
+ isOk: true;
112
+ }
113
+
114
+ export interface ResponseErr<T, E> {
115
+ value: E;
116
+ isOk: false;
117
+ }
118
+
119
+ export type Response<Ok, Err> = ResponseOk<Ok, Err> | ResponseErr<Ok, Err>;