forked from chainorders/concordium-rwa
-
Notifications
You must be signed in to change notification settings - Fork 1
/
rwaComplianceModuleAllowedNationalities.ts
120 lines (120 loc) · 5.14 KB
/
rwaComplianceModuleAllowedNationalities.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
import {
ContractName,
EntrypointName,
ModuleReference,
} from "@concordium/web-sdk";
import { InitMethod, ReceiveMethod } from "./GenericContract";
export const CONTRACT_NAME = "rwa_compliance_module_allowed_nationalities";
export type initRequest = {
nationalities: Array<string>;
identity_registry: { index: number; subindex: number };
};
export const initRequestSchemaBase64 =
"FAACAAAADQAAAG5hdGlvbmFsaXRpZXMQAhYCEQAAAGlkZW50aXR5X3JlZ2lzdHJ5DA==";
export const initErrorSchemaBase64 =
"FQcAAAAKAAAAUGFyc2VFcnJvcgIIAAAATG9nRXJyb3ICDQAAAEludmFsaWRNb2R1bGUCEQAAAENhbGxDb250cmFjdEVycm9yAgwAAABVbmF1dGhvcml6ZWQCEgAAAEFnZW50QWxyZWFkeUV4aXN0cwINAAAAQWdlbnROb3RGb3VuZAI=";
export type BurnedError =
| { ParseError: Record<string, never> }
| { LogError: Record<string, never> }
| { InvalidModule: Record<string, never> }
| { CallContractError: Record<string, never> }
| { Unauthorized: Record<string, never> }
| { AgentAlreadyExists: Record<string, never> }
| { AgentNotFound: Record<string, never> };
export const burnedErrorSchemaBase64 =
"FQcAAAAKAAAAUGFyc2VFcnJvcgIIAAAATG9nRXJyb3ICDQAAAEludmFsaWRNb2R1bGUCEQAAAENhbGxDb250cmFjdEVycm9yAgwAAABVbmF1dGhvcml6ZWQCEgAAAEFnZW50QWxyZWFkeUV4aXN0cwINAAAAQWdlbnROb3RGb3VuZAI=";
export type CanTransferError =
| { ParseError: Record<string, never> }
| { LogError: Record<string, never> }
| { InvalidModule: Record<string, never> }
| { CallContractError: Record<string, never> }
| { Unauthorized: Record<string, never> }
| { AgentAlreadyExists: Record<string, never> }
| { AgentNotFound: Record<string, never> };
export const canTransferErrorSchemaBase64 =
"FQcAAAAKAAAAUGFyc2VFcnJvcgIIAAAATG9nRXJyb3ICDQAAAEludmFsaWRNb2R1bGUCEQAAAENhbGxDb250cmFjdEVycm9yAgwAAABVbmF1dGhvcml6ZWQCEgAAAEFnZW50QWxyZWFkeUV4aXN0cwINAAAAQWdlbnROb3RGb3VuZAI=";
export type CanTransferRequest = {
token_id: { token_id: string; contract: { index: number; subindex: number } };
to:
| { Account: [string] }
| { Contract: [{ index: number; subindex: number }] };
amount: string;
};
export const canTransferRequestSchemaBase64 =
"FAADAAAACAAAAHRva2VuX2lkFAACAAAACAAAAHRva2VuX2lkHQAIAAAAY29udHJhY3QMAgAAAHRvFQIAAAAHAAAAQWNjb3VudAEBAAAACwgAAABDb250cmFjdAEBAAAADAYAAABhbW91bnQbJQAAAA==";
export type CanTransferResponse = boolean;
export const canTransferResponseSchemaBase64 = "AQ==";
export type MintedError =
| { ParseError: Record<string, never> }
| { LogError: Record<string, never> }
| { InvalidModule: Record<string, never> }
| { CallContractError: Record<string, never> }
| { Unauthorized: Record<string, never> }
| { AgentAlreadyExists: Record<string, never> }
| { AgentNotFound: Record<string, never> };
export const mintedErrorSchemaBase64 =
"FQcAAAAKAAAAUGFyc2VFcnJvcgIIAAAATG9nRXJyb3ICDQAAAEludmFsaWRNb2R1bGUCEQAAAENhbGxDb250cmFjdEVycm9yAgwAAABVbmF1dGhvcml6ZWQCEgAAAEFnZW50QWxyZWFkeUV4aXN0cwINAAAAQWdlbnROb3RGb3VuZAI=";
export type TransferredError =
| { ParseError: Record<string, never> }
| { LogError: Record<string, never> }
| { InvalidModule: Record<string, never> }
| { CallContractError: Record<string, never> }
| { Unauthorized: Record<string, never> }
| { AgentAlreadyExists: Record<string, never> }
| { AgentNotFound: Record<string, never> };
export const transferredErrorSchemaBase64 =
"FQcAAAAKAAAAUGFyc2VFcnJvcgIIAAAATG9nRXJyb3ICDQAAAEludmFsaWRNb2R1bGUCEQAAAENhbGxDb250cmFjdEVycm9yAgwAAABVbmF1dGhvcml6ZWQCEgAAAEFnZW50QWxyZWFkeUV4aXN0cwINAAAAQWdlbnROb3RGb3VuZAI=";
export const ENTRYPOINTS: Record<string, EntrypointName.Type> = {
burned: EntrypointName.fromString("burned"),
canTransfer: EntrypointName.fromString("canTransfer"),
minted: EntrypointName.fromString("minted"),
transferred: EntrypointName.fromString("transferred"),
};
export const ENTRYPOINT_DISPLAY_NAMES: Record<string, string> = {
burned: "Burned",
canTransfer: "Can Transfer",
minted: "Minted",
transferred: "Transferred",
};
export const rwaComplianceModuleAllowedNationalities = {
init: new InitMethod<initRequest>(
ModuleReference.fromHexString(
"3ed1d2653d674b56c2be13a9aac06bc9cb6ae3f08ea2ee2da508306631e918e0",
),
ContractName.fromString("rwa_compliance_module_allowed_nationalities"),
initRequestSchemaBase64,
),
burned: new ReceiveMethod<never, never, BurnedError>(
ContractName.fromString("rwa_compliance_module_allowed_nationalities"),
EntrypointName.fromString("burned"),
undefined,
undefined,
burnedErrorSchemaBase64,
),
canTransfer: new ReceiveMethod<
CanTransferRequest,
CanTransferResponse,
CanTransferError
>(
ContractName.fromString("rwa_compliance_module_allowed_nationalities"),
EntrypointName.fromString("canTransfer"),
canTransferRequestSchemaBase64,
canTransferResponseSchemaBase64,
canTransferErrorSchemaBase64,
),
minted: new ReceiveMethod<never, never, MintedError>(
ContractName.fromString("rwa_compliance_module_allowed_nationalities"),
EntrypointName.fromString("minted"),
undefined,
undefined,
mintedErrorSchemaBase64,
),
transferred: new ReceiveMethod<never, never, TransferredError>(
ContractName.fromString("rwa_compliance_module_allowed_nationalities"),
EntrypointName.fromString("transferred"),
undefined,
undefined,
transferredErrorSchemaBase64,
),
};
export default rwaComplianceModuleAllowedNationalities;