-
Notifications
You must be signed in to change notification settings - Fork 14
/
scripts.ts
137 lines (123 loc) · 4.01 KB
/
scripts.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import {
Address,
ExecutableScript,
ExecuteScriptParams,
ExecuteScriptResult,
Script,
SignerProvider,
HexString,
} from "@alephium/web3";
import { getContractByCodeHash } from "./contracts";
import { default as AddMainScriptJson } from "../add/AddMain.ral.json";
import { default as CallScript0ScriptJson } from "../test/CallScript0.ral.json";
import { default as CallScript1ScriptJson } from "../test/CallScript1.ral.json";
import { default as DestroyAddScriptJson } from "../add/DestroyAdd.ral.json";
import { default as GreeterMainScriptJson } from "../greeter/GreeterMain.ral.json";
import { default as InsertIntoMapScriptJson } from "../test/InsertIntoMap.ral.json";
import { default as MintNFTTestScriptJson } from "../nft/MintNFTTest.ral.json";
import { default as RemoveFromMapScriptJson } from "../test/RemoveFromMap.ral.json";
import { default as TemplateArrayVarScriptJson } from "../test/TemplateArrayVar.ral.json";
import { default as TestAssertScriptJson } from "../test/TestAssert.ral.json";
import { default as UpdateMapValueScriptJson } from "../test/UpdateMapValue.ral.json";
import { default as UpdateUserAccountScriptJson } from "../test/UpdateUserAccount.ral.json";
import { default as WithdrawNFTCollectionTestScriptJson } from "../nft/WithdrawNFTCollectionTest.ral.json";
import {
AddStruct1,
AddStruct2,
Balances,
MapValue,
TokenBalance,
AllStructs,
} from "./types";
export const AddMain = new ExecutableScript<{
add: HexString;
array: [bigint, bigint];
}>(Script.fromJson(AddMainScriptJson, "", AllStructs), getContractByCodeHash);
export const CallScript0 = new ExecutableScript<
{ mapTest: HexString; key: Address },
MapValue
>(
Script.fromJson(CallScript0ScriptJson, "", AllStructs),
getContractByCodeHash
);
export const CallScript1 = new ExecutableScript<
{ mapTest: HexString; key: Address; userAccount: HexString },
[MapValue, Balances]
>(
Script.fromJson(CallScript1ScriptJson, "", AllStructs),
getContractByCodeHash
);
export const DestroyAdd = new ExecutableScript<{
add: HexString;
caller: Address;
}>(
Script.fromJson(DestroyAddScriptJson, "", AllStructs),
getContractByCodeHash
);
export const GreeterMain = new ExecutableScript<{
greeterContractId: HexString;
}>(
Script.fromJson(GreeterMainScriptJson, "", AllStructs),
getContractByCodeHash
);
export const InsertIntoMap = new ExecutableScript<{
mapTest: HexString;
from: Address;
value: MapValue;
}>(
Script.fromJson(InsertIntoMapScriptJson, "", AllStructs),
getContractByCodeHash
);
export const MintNFTTest = new ExecutableScript<{
nftCollectionContractId: HexString;
uri: HexString;
royalty: boolean;
}>(
Script.fromJson(MintNFTTestScriptJson, "", AllStructs),
getContractByCodeHash
);
export const RemoveFromMap = new ExecutableScript<{
mapTest: HexString;
key: Address;
}>(
Script.fromJson(RemoveFromMapScriptJson, "", AllStructs),
getContractByCodeHash
);
export const TemplateArrayVar = new ExecutableScript<{
address: Address;
numbers0: [[bigint, bigint], [bigint, bigint]];
bytes: HexString;
numbers1: [bigint, bigint, bigint];
}>(
Script.fromJson(TemplateArrayVarScriptJson, "", AllStructs),
getContractByCodeHash
);
export const TestAssert = new ExecutableScript<{ assert: HexString }>(
Script.fromJson(TestAssertScriptJson, "", AllStructs),
getContractByCodeHash
);
export const UpdateMapValue = new ExecutableScript<{
mapTest: HexString;
key: Address;
}>(
Script.fromJson(UpdateMapValueScriptJson, "", AllStructs),
getContractByCodeHash
);
export const UpdateUserAccount = new ExecutableScript<{
account: HexString;
tokens: [TokenBalance, TokenBalance];
address: Address;
}>(
Script.fromJson(UpdateUserAccountScriptJson, "", AllStructs),
getContractByCodeHash
);
export const WithdrawNFTCollectionTest = new ExecutableScript<{
collection: HexString;
amount: bigint;
}>(
Script.fromJson(WithdrawNFTCollectionTestScriptJson, "", AllStructs),
getContractByCodeHash
);