@d9-network/spec 1.2.2 → 1.2.4
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.
- package/node_modules/@polkadot-api/descriptors/dist/chunk-7P6ASYW6.mjs +9 -0
- package/node_modules/@polkadot-api/descriptors/dist/common-types.d.ts +3371 -0
- package/node_modules/@polkadot-api/descriptors/dist/common.d.ts +1 -0
- package/node_modules/@polkadot-api/descriptors/dist/contracts/burnManager.d.ts +183 -0
- package/node_modules/@polkadot-api/descriptors/dist/contracts/burnMining.d.ts +184 -0
- package/node_modules/@polkadot-api/descriptors/dist/contracts/crossChainTransfer.d.ts +249 -0
- package/node_modules/@polkadot-api/descriptors/dist/contracts/index.d.ts +8 -0
- package/node_modules/@polkadot-api/descriptors/dist/contracts/marketMaker.d.ts +209 -0
- package/node_modules/@polkadot-api/descriptors/dist/contracts/merchantMining.d.ts +263 -0
- package/node_modules/@polkadot-api/descriptors/dist/contracts/miningPool.d.ts +159 -0
- package/node_modules/@polkadot-api/descriptors/dist/contracts/nodeReward.d.ts +172 -0
- package/node_modules/@polkadot-api/descriptors/dist/contracts/usdt.d.ts +145 -0
- package/node_modules/@polkadot-api/descriptors/dist/d9.d.ts +3346 -0
- package/node_modules/@polkadot-api/descriptors/dist/d9_metadata-EHIEZLL5.mjs +8 -0
- package/node_modules/@polkadot-api/descriptors/dist/d9_metadata.d.ts +2 -0
- package/node_modules/@polkadot-api/descriptors/dist/descriptors-JQ4ZJQ4V.mjs +29 -0
- package/node_modules/@polkadot-api/descriptors/dist/descriptors.d.ts +1 -0
- package/node_modules/@polkadot-api/descriptors/dist/index.d.ts +11 -0
- package/node_modules/@polkadot-api/descriptors/dist/index.js +200 -0
- package/node_modules/@polkadot-api/descriptors/dist/index.mjs +115 -0
- package/node_modules/@polkadot-api/descriptors/dist/metadataTypes-32V7BYUB.mjs +8 -0
- package/node_modules/@polkadot-api/descriptors/dist/metadataTypes.d.ts +2 -0
- package/node_modules/@polkadot-api/descriptors/generated.json +1 -0
- package/node_modules/@polkadot-api/descriptors/package.json +24 -0
- package/package.json +5 -2
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import type { SS58String, ResultPayload, FixedSizeBinary, Enum, FixedSizeArray, Binary } from 'polkadot-api';
|
|
2
|
+
import type { InkDescriptors } from 'polkadot-api/ink';
|
|
3
|
+
type AnonymousEnum<T extends {}> = T & {
|
|
4
|
+
__anonymous: true;
|
|
5
|
+
};
|
|
6
|
+
type MyTuple<T> = [T, ...T[]];
|
|
7
|
+
type SeparateUndefined<T> = undefined extends T ? undefined | Exclude<T, undefined> : T;
|
|
8
|
+
type Anonymize<T> = SeparateUndefined<T extends FixedSizeBinary<infer L> ? number extends L ? Binary : FixedSizeBinary<L> : T extends string | number | bigint | boolean | void | undefined | null | symbol | Uint8Array | Enum<any> ? T : T extends AnonymousEnum<infer V> ? Enum<V> : T extends MyTuple<any> ? {
|
|
9
|
+
[K in keyof T]: T[K];
|
|
10
|
+
} : T extends [] ? [] : T extends FixedSizeArray<infer L, infer T> ? number extends L ? Array<T> : FixedSizeArray<L, T> : {
|
|
11
|
+
[K in keyof T & string]: T[K];
|
|
12
|
+
}>;
|
|
13
|
+
type T0 = ResultPayload<undefined, Anonymize<T1>>;
|
|
14
|
+
type T1 = Enum<{
|
|
15
|
+
"CouldNotReadInput": undefined;
|
|
16
|
+
}>;
|
|
17
|
+
type T2 = FixedSizeArray<2, bigint>;
|
|
18
|
+
type T3 = ResultPayload<ResultPayload<undefined, Anonymize<T4>>, Anonymize<T1>>;
|
|
19
|
+
type T4 = Enum<{
|
|
20
|
+
"D9orUSDTProvidedLiquidityAtZero": undefined;
|
|
21
|
+
"ConversionAmountTooLow": undefined;
|
|
22
|
+
"CouldntTransferUSDTFromUser": undefined;
|
|
23
|
+
"InsufficientLiquidity": Anonymize<T5>;
|
|
24
|
+
"InsufficientAllowance": undefined;
|
|
25
|
+
"MarketMakerHasInsufficientFunds": Anonymize<T5>;
|
|
26
|
+
"InsufficientLiquidityProvided": undefined;
|
|
27
|
+
"USDTBalanceInsufficient": undefined;
|
|
28
|
+
"LiquidityProviderNotFound": undefined;
|
|
29
|
+
"LiquidityAddedBeyondTolerance": FixedSizeArray<2, bigint>;
|
|
30
|
+
"InsufficientLPTokens": undefined;
|
|
31
|
+
"InsufficientContractLPTokens": undefined;
|
|
32
|
+
"DivisionByZero": undefined;
|
|
33
|
+
"MultiplicationError": undefined;
|
|
34
|
+
"USDTTooSmall": undefined;
|
|
35
|
+
"USDTTooMuch": undefined;
|
|
36
|
+
"LiquidityTooLow": undefined;
|
|
37
|
+
}>;
|
|
38
|
+
type T5 = Enum<{
|
|
39
|
+
"D9": undefined;
|
|
40
|
+
"USDT": undefined;
|
|
41
|
+
}>;
|
|
42
|
+
type T6 = ResultPayload<ResultPayload<bigint, Anonymize<T4>>, Anonymize<T1>>;
|
|
43
|
+
type T7 = FixedSizeArray<2, Anonymize<T5>>;
|
|
44
|
+
type StorageDescriptor = {
|
|
45
|
+
"liquidity_providers": {
|
|
46
|
+
"key": undefined;
|
|
47
|
+
"value": bigint;
|
|
48
|
+
};
|
|
49
|
+
"": {
|
|
50
|
+
"key": undefined;
|
|
51
|
+
"value": {
|
|
52
|
+
"usdt_contract": SS58String;
|
|
53
|
+
"fee_percent": number;
|
|
54
|
+
"fee_total": bigint;
|
|
55
|
+
"liquidity_tolerance_percent": number;
|
|
56
|
+
"total_lp_tokens": bigint;
|
|
57
|
+
"admin": SS58String;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
type MessagesDescriptor = {
|
|
62
|
+
"change_admin": {
|
|
63
|
+
"message": {
|
|
64
|
+
"new_admin": SS58String;
|
|
65
|
+
};
|
|
66
|
+
"response": Anonymize<T0>;
|
|
67
|
+
"mutates": true;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* get pool balances (d9, usdt)
|
|
71
|
+
*/
|
|
72
|
+
"get_currency_reserves": {
|
|
73
|
+
"message": {};
|
|
74
|
+
"response": ResultPayload<Anonymize<T2>, Anonymize<T1>>;
|
|
75
|
+
};
|
|
76
|
+
"get_liquidity_provider": {
|
|
77
|
+
"message": {
|
|
78
|
+
"account_id": SS58String;
|
|
79
|
+
};
|
|
80
|
+
"response": ResultPayload<(bigint) | undefined, Anonymize<T1>>;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* add liquidity by adding tokens to the reserves
|
|
84
|
+
*/
|
|
85
|
+
"add_liquidity": {
|
|
86
|
+
"message": {
|
|
87
|
+
"usdt_liquidity": bigint;
|
|
88
|
+
};
|
|
89
|
+
"response": Anonymize<T3>;
|
|
90
|
+
"payable": true;
|
|
91
|
+
"mutates": true;
|
|
92
|
+
};
|
|
93
|
+
"remove_liquidity": {
|
|
94
|
+
"message": {};
|
|
95
|
+
"response": Anonymize<T3>;
|
|
96
|
+
"mutates": true;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Modifies the code which is used to execute calls to this contract address (`AccountId`).
|
|
100
|
+
*
|
|
101
|
+
* We use this to upgrade the contract logic. We don't do any authorization here, any caller
|
|
102
|
+
* can execute this method. In a production contract you would do some authorization here.
|
|
103
|
+
*/
|
|
104
|
+
"set_code": {
|
|
105
|
+
"message": {
|
|
106
|
+
"code_hash": FixedSizeBinary<32>;
|
|
107
|
+
};
|
|
108
|
+
"response": Anonymize<T0>;
|
|
109
|
+
"mutates": true;
|
|
110
|
+
};
|
|
111
|
+
"check_new_liquidity": {
|
|
112
|
+
"message": {
|
|
113
|
+
"usdt_liquidity": bigint;
|
|
114
|
+
"d9_liquidity": bigint;
|
|
115
|
+
};
|
|
116
|
+
"response": Anonymize<T3>;
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* sell usdt
|
|
120
|
+
*/
|
|
121
|
+
"get_d9": {
|
|
122
|
+
"message": {
|
|
123
|
+
"usdt": bigint;
|
|
124
|
+
};
|
|
125
|
+
"response": Anonymize<T6>;
|
|
126
|
+
"mutates": true;
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* sell d9
|
|
130
|
+
*/
|
|
131
|
+
"get_usdt": {
|
|
132
|
+
"message": {};
|
|
133
|
+
"response": Anonymize<T6>;
|
|
134
|
+
"payable": true;
|
|
135
|
+
"mutates": true;
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* calculate lp tokens based on usdt liquidity
|
|
139
|
+
*/
|
|
140
|
+
"calc_new_lp_tokens": {
|
|
141
|
+
"message": {
|
|
142
|
+
"d9_liquidity": bigint;
|
|
143
|
+
"usdt_liquidity": bigint;
|
|
144
|
+
};
|
|
145
|
+
"response": ResultPayload<bigint, Anonymize<T1>>;
|
|
146
|
+
"mutates": true;
|
|
147
|
+
};
|
|
148
|
+
/**
|
|
149
|
+
* amount of currency B from A, if A => B
|
|
150
|
+
*/
|
|
151
|
+
"calculate_exchange": {
|
|
152
|
+
"message": {
|
|
153
|
+
"direction": Anonymize<T7>;
|
|
154
|
+
"amount_0": bigint;
|
|
155
|
+
};
|
|
156
|
+
"response": Anonymize<T6>;
|
|
157
|
+
};
|
|
158
|
+
"estimate_exchange": {
|
|
159
|
+
"message": {
|
|
160
|
+
"direction": Anonymize<T7>;
|
|
161
|
+
"amount_0": bigint;
|
|
162
|
+
};
|
|
163
|
+
"response": ResultPayload<ResultPayload<Anonymize<T2>, Anonymize<T4>>, Anonymize<T1>>;
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* check if usdt balance is sufficient for swap
|
|
167
|
+
*/
|
|
168
|
+
"check_usdt_balance": {
|
|
169
|
+
"message": {
|
|
170
|
+
"account_id": SS58String;
|
|
171
|
+
"amount": bigint;
|
|
172
|
+
};
|
|
173
|
+
"response": Anonymize<T3>;
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
type ConstructorsDescriptor = {
|
|
177
|
+
"new": {
|
|
178
|
+
"message": {
|
|
179
|
+
"usdt_contract": SS58String;
|
|
180
|
+
"fee_percent": number;
|
|
181
|
+
"liquidity_tolerance_percent": number;
|
|
182
|
+
};
|
|
183
|
+
"response": Anonymize<T0>;
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
type EventDescriptor = Enum<{
|
|
187
|
+
"LiquidityAdded": {
|
|
188
|
+
"account_id": SS58String;
|
|
189
|
+
"usdt": bigint;
|
|
190
|
+
"d9": bigint;
|
|
191
|
+
};
|
|
192
|
+
"LiquidityRemoved": {
|
|
193
|
+
"account_id": SS58String;
|
|
194
|
+
"usdt": bigint;
|
|
195
|
+
"d9": bigint;
|
|
196
|
+
};
|
|
197
|
+
"D9ToUSDTConversion": {
|
|
198
|
+
"account_id": SS58String;
|
|
199
|
+
"usdt": bigint;
|
|
200
|
+
"d9": bigint;
|
|
201
|
+
};
|
|
202
|
+
"USDTToD9Conversion": {
|
|
203
|
+
"account_id": SS58String;
|
|
204
|
+
"usdt": bigint;
|
|
205
|
+
"d9": bigint;
|
|
206
|
+
};
|
|
207
|
+
}>;
|
|
208
|
+
export declare const descriptor: InkDescriptors<StorageDescriptor, MessagesDescriptor, ConstructorsDescriptor, EventDescriptor>;
|
|
209
|
+
export {};
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import type { Enum, SS58String, ResultPayload, FixedSizeArray, FixedSizeBinary, Binary } from 'polkadot-api';
|
|
2
|
+
import type { InkDescriptors } from 'polkadot-api/ink';
|
|
3
|
+
type AnonymousEnum<T extends {}> = T & {
|
|
4
|
+
__anonymous: true;
|
|
5
|
+
};
|
|
6
|
+
type MyTuple<T> = [T, ...T[]];
|
|
7
|
+
type SeparateUndefined<T> = undefined extends T ? undefined | Exclude<T, undefined> : T;
|
|
8
|
+
type Anonymize<T> = SeparateUndefined<T extends FixedSizeBinary<infer L> ? number extends L ? Binary : FixedSizeBinary<L> : T extends string | number | bigint | boolean | void | undefined | null | symbol | Uint8Array | Enum<any> ? T : T extends AnonymousEnum<infer V> ? Enum<V> : T extends MyTuple<any> ? {
|
|
9
|
+
[K in keyof T]: T[K];
|
|
10
|
+
} : T extends [] ? [] : T extends FixedSizeArray<infer L, infer T> ? number extends L ? Array<T> : FixedSizeArray<L, T> : {
|
|
11
|
+
[K in keyof T & string]: T[K];
|
|
12
|
+
}>;
|
|
13
|
+
type T0 = ResultPayload<undefined, Anonymize<T1>>;
|
|
14
|
+
type T1 = Enum<{
|
|
15
|
+
"CouldNotReadInput": undefined;
|
|
16
|
+
}>;
|
|
17
|
+
type T2 = ResultPayload<ResultPayload<bigint, Anonymize<T3>>, Anonymize<T1>>;
|
|
18
|
+
type T3 = Enum<{
|
|
19
|
+
"InsufficientPayment": undefined;
|
|
20
|
+
"InsufficientAllowance": undefined;
|
|
21
|
+
"NoMerchantAccountFound": undefined;
|
|
22
|
+
"MerchantAccountExpired": undefined;
|
|
23
|
+
"NoAccountFound": undefined;
|
|
24
|
+
"NothingToRedeem": undefined;
|
|
25
|
+
"TransferringToMainContract": undefined;
|
|
26
|
+
"TransferringToUSDTToMerchant": undefined;
|
|
27
|
+
"UserUSDTBalanceInsufficient": undefined;
|
|
28
|
+
"D9TransferFailed": undefined;
|
|
29
|
+
"USDTTransferFailed": undefined;
|
|
30
|
+
"OnlyAdmin": undefined;
|
|
31
|
+
"GrantingAllowanceFailed": undefined;
|
|
32
|
+
"AMMConversionFailed": undefined;
|
|
33
|
+
"ReceivingUSDTFromUser": undefined;
|
|
34
|
+
"ConvertingToD9": undefined;
|
|
35
|
+
"SendUSDTToMerchant": undefined;
|
|
36
|
+
"SendingD9ToMiningPool": undefined;
|
|
37
|
+
"SendingUSDTToAMM": undefined;
|
|
38
|
+
"GettingUSDTFromAMM": undefined;
|
|
39
|
+
"RedeemD9TransferFailed": undefined;
|
|
40
|
+
"SomeEnvironmentError": undefined;
|
|
41
|
+
"CalledContractTrapped": undefined;
|
|
42
|
+
"CalledContractReverted": undefined;
|
|
43
|
+
"NotCallable": undefined;
|
|
44
|
+
"SomeDecodeError": undefined;
|
|
45
|
+
"SomeOffChainError": undefined;
|
|
46
|
+
"CalleeTrapped": undefined;
|
|
47
|
+
"CalleeReverted": undefined;
|
|
48
|
+
"KeyNotFound": undefined;
|
|
49
|
+
"_BelowSubsistenceThreshold": undefined;
|
|
50
|
+
"TransferFailed": undefined;
|
|
51
|
+
"_EndowmentTooLow": undefined;
|
|
52
|
+
"CodeNotFound": undefined;
|
|
53
|
+
"Unknown": undefined;
|
|
54
|
+
"LoggingDisabled": undefined;
|
|
55
|
+
"CallRuntimeFailed": undefined;
|
|
56
|
+
"EcdsaRecoveryFailed": undefined;
|
|
57
|
+
"ErrorGettingEstimate": undefined;
|
|
58
|
+
"CrossContractCallErrorGettingEstimate": undefined;
|
|
59
|
+
}>;
|
|
60
|
+
type T4 = ResultPayload<ResultPayload<{
|
|
61
|
+
"merchant": bigint;
|
|
62
|
+
"consumer": bigint;
|
|
63
|
+
}, Anonymize<T3>>, Anonymize<T1>>;
|
|
64
|
+
type T5 = ResultPayload<ResultPayload<undefined, Anonymize<T3>>, Anonymize<T1>>;
|
|
65
|
+
type StorageDescriptor = {
|
|
66
|
+
"merchant_expiry": {
|
|
67
|
+
"key": undefined;
|
|
68
|
+
"value": bigint;
|
|
69
|
+
};
|
|
70
|
+
"accounts": {
|
|
71
|
+
"key": undefined;
|
|
72
|
+
"value": {
|
|
73
|
+
"green_points": bigint;
|
|
74
|
+
"relationship_factors": {
|
|
75
|
+
"0": bigint;
|
|
76
|
+
"1": bigint;
|
|
77
|
+
};
|
|
78
|
+
"last_conversion": Enum<{
|
|
79
|
+
"None": undefined;
|
|
80
|
+
"Some": {
|
|
81
|
+
"0": bigint;
|
|
82
|
+
};
|
|
83
|
+
}>;
|
|
84
|
+
"redeemed_usdt": bigint;
|
|
85
|
+
"redeemed_d9": bigint;
|
|
86
|
+
"created_at": bigint;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
"": {
|
|
90
|
+
"key": undefined;
|
|
91
|
+
"value": {
|
|
92
|
+
"subscription_fee": bigint;
|
|
93
|
+
"usdt_contract": SS58String;
|
|
94
|
+
"amm_contract": SS58String;
|
|
95
|
+
"mining_pool": SS58String;
|
|
96
|
+
"milliseconds_day": bigint;
|
|
97
|
+
"admin": SS58String;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
type MessagesDescriptor = {
|
|
102
|
+
/**
|
|
103
|
+
* create merchant account subscription
|
|
104
|
+
*/
|
|
105
|
+
"subscribe": {
|
|
106
|
+
"message": {
|
|
107
|
+
"usdt_amount": bigint;
|
|
108
|
+
};
|
|
109
|
+
"response": Anonymize<T2>;
|
|
110
|
+
"mutates": true;
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* withdraw a certain amount of d9 that has been converted into red points
|
|
114
|
+
*/
|
|
115
|
+
"redeem_d9": {
|
|
116
|
+
"message": {};
|
|
117
|
+
"response": ResultPayload<ResultPayload<bigint, Anonymize<T3>>, Anonymize<T1>>;
|
|
118
|
+
"mutates": true;
|
|
119
|
+
};
|
|
120
|
+
"give_green_points_d9": {
|
|
121
|
+
"message": {
|
|
122
|
+
"consumer_id": SS58String;
|
|
123
|
+
};
|
|
124
|
+
"response": Anonymize<T4>;
|
|
125
|
+
"payable": true;
|
|
126
|
+
"mutates": true;
|
|
127
|
+
};
|
|
128
|
+
"give_green_points_usdt": {
|
|
129
|
+
"message": {
|
|
130
|
+
"consumer_id": SS58String;
|
|
131
|
+
"usdt_payment": bigint;
|
|
132
|
+
};
|
|
133
|
+
"response": Anonymize<T4>;
|
|
134
|
+
"mutates": true;
|
|
135
|
+
};
|
|
136
|
+
"send_usdt_payment_to_merchant": {
|
|
137
|
+
"message": {
|
|
138
|
+
"merchant_id": SS58String;
|
|
139
|
+
"usdt_amount": bigint;
|
|
140
|
+
};
|
|
141
|
+
"response": Anonymize<T4>;
|
|
142
|
+
"payable": true;
|
|
143
|
+
"mutates": true;
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* a customer pays a merchant using d9
|
|
147
|
+
*/
|
|
148
|
+
"send_d9_payment_to_merchant": {
|
|
149
|
+
"message": {
|
|
150
|
+
"merchant_id": SS58String;
|
|
151
|
+
};
|
|
152
|
+
"response": Anonymize<T4>;
|
|
153
|
+
"payable": true;
|
|
154
|
+
"mutates": true;
|
|
155
|
+
};
|
|
156
|
+
"get_expiry": {
|
|
157
|
+
"message": {
|
|
158
|
+
"account_id": SS58String;
|
|
159
|
+
};
|
|
160
|
+
"response": Anonymize<T2>;
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* get account details
|
|
164
|
+
*/
|
|
165
|
+
"get_account": {
|
|
166
|
+
"message": {
|
|
167
|
+
"account_id": SS58String;
|
|
168
|
+
};
|
|
169
|
+
"response": ResultPayload<({
|
|
170
|
+
"green_points": bigint;
|
|
171
|
+
"relationship_factors": FixedSizeArray<2, bigint>;
|
|
172
|
+
"last_conversion"?: (bigint) | undefined;
|
|
173
|
+
"redeemed_usdt": bigint;
|
|
174
|
+
"redeemed_d9": bigint;
|
|
175
|
+
"created_at": bigint;
|
|
176
|
+
}) | undefined, Anonymize<T1>>;
|
|
177
|
+
};
|
|
178
|
+
"change_amm_contract": {
|
|
179
|
+
"message": {
|
|
180
|
+
"new_amm_contract": SS58String;
|
|
181
|
+
};
|
|
182
|
+
"response": Anonymize<T5>;
|
|
183
|
+
"mutates": true;
|
|
184
|
+
};
|
|
185
|
+
"change_mining_pool": {
|
|
186
|
+
"message": {
|
|
187
|
+
"new_mining_pool": SS58String;
|
|
188
|
+
};
|
|
189
|
+
"response": Anonymize<T5>;
|
|
190
|
+
"mutates": true;
|
|
191
|
+
};
|
|
192
|
+
/**
|
|
193
|
+
* Modifies the code which is used to execute calls to this contract address (`AccountId`).
|
|
194
|
+
*
|
|
195
|
+
* We use this to upgrade the contract logic. We don't do any authorization here, any caller
|
|
196
|
+
* can execute this method. In a production contract you would do some authorization here.
|
|
197
|
+
*/
|
|
198
|
+
"set_code": {
|
|
199
|
+
"message": {
|
|
200
|
+
"code_hash": FixedSizeBinary<32>;
|
|
201
|
+
};
|
|
202
|
+
"response": Anonymize<T0>;
|
|
203
|
+
"mutates": true;
|
|
204
|
+
};
|
|
205
|
+
"change_admin": {
|
|
206
|
+
"message": {
|
|
207
|
+
"new_admin": SS58String;
|
|
208
|
+
};
|
|
209
|
+
"response": Anonymize<T5>;
|
|
210
|
+
"mutates": true;
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
type ConstructorsDescriptor = {
|
|
214
|
+
/**
|
|
215
|
+
* Constructor that initializes the `bool` value to the given `init_value`.
|
|
216
|
+
*/
|
|
217
|
+
"new": {
|
|
218
|
+
"message": {
|
|
219
|
+
"amm_contract": SS58String;
|
|
220
|
+
"mining_pool": SS58String;
|
|
221
|
+
"usdt_contract": SS58String;
|
|
222
|
+
};
|
|
223
|
+
"response": Anonymize<T0>;
|
|
224
|
+
};
|
|
225
|
+
};
|
|
226
|
+
type EventDescriptor = Enum<{
|
|
227
|
+
"SubscriptionExtended": {
|
|
228
|
+
"account_id": SS58String;
|
|
229
|
+
"usdt": bigint;
|
|
230
|
+
"expiry": bigint;
|
|
231
|
+
};
|
|
232
|
+
"D9Redeemed": {
|
|
233
|
+
"account_id": SS58String;
|
|
234
|
+
"redeemed_d9": bigint;
|
|
235
|
+
};
|
|
236
|
+
"GreenPointsTransaction": {
|
|
237
|
+
"merchant": {
|
|
238
|
+
"account_id": SS58String;
|
|
239
|
+
"green_points": bigint;
|
|
240
|
+
};
|
|
241
|
+
"consumer": {
|
|
242
|
+
"account_id": SS58String;
|
|
243
|
+
"green_points": bigint;
|
|
244
|
+
};
|
|
245
|
+
};
|
|
246
|
+
"D9MerchantPaymentSent": {
|
|
247
|
+
"merchant": SS58String;
|
|
248
|
+
"consumer": SS58String;
|
|
249
|
+
"amount": bigint;
|
|
250
|
+
};
|
|
251
|
+
"USDTMerchantPaymentSent": {
|
|
252
|
+
"merchant": SS58String;
|
|
253
|
+
"consumer": SS58String;
|
|
254
|
+
"amount": bigint;
|
|
255
|
+
};
|
|
256
|
+
"GivePointsUSDT": {
|
|
257
|
+
"consumer": SS58String;
|
|
258
|
+
"merchant": SS58String;
|
|
259
|
+
"amount": bigint;
|
|
260
|
+
};
|
|
261
|
+
}>;
|
|
262
|
+
export declare const descriptor: InkDescriptors<StorageDescriptor, MessagesDescriptor, ConstructorsDescriptor, EventDescriptor>;
|
|
263
|
+
export {};
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import type { SS58String, FixedSizeBinary, Enum, ResultPayload, Binary, FixedSizeArray } from 'polkadot-api';
|
|
2
|
+
import type { InkDescriptors } from 'polkadot-api/ink';
|
|
3
|
+
type AnonymousEnum<T extends {}> = T & {
|
|
4
|
+
__anonymous: true;
|
|
5
|
+
};
|
|
6
|
+
type MyTuple<T> = [T, ...T[]];
|
|
7
|
+
type SeparateUndefined<T> = undefined extends T ? undefined | Exclude<T, undefined> : T;
|
|
8
|
+
type Anonymize<T> = SeparateUndefined<T extends FixedSizeBinary<infer L> ? number extends L ? Binary : FixedSizeBinary<L> : T extends string | number | bigint | boolean | void | undefined | null | symbol | Uint8Array | Enum<any> ? T : T extends AnonymousEnum<infer V> ? Enum<V> : T extends MyTuple<any> ? {
|
|
9
|
+
[K in keyof T]: T[K];
|
|
10
|
+
} : T extends [] ? [] : T extends FixedSizeArray<infer L, infer T> ? number extends L ? Array<T> : FixedSizeArray<L, T> : {
|
|
11
|
+
[K in keyof T & string]: T[K];
|
|
12
|
+
}>;
|
|
13
|
+
type T0 = ResultPayload<undefined, Anonymize<T1>>;
|
|
14
|
+
type T1 = Enum<{
|
|
15
|
+
"CouldNotReadInput": undefined;
|
|
16
|
+
}>;
|
|
17
|
+
type T2 = ResultPayload<bigint, Anonymize<T1>>;
|
|
18
|
+
type T3 = ResultPayload<ResultPayload<undefined, Anonymize<T4>>, Anonymize<T1>>;
|
|
19
|
+
type T4 = Enum<{
|
|
20
|
+
"OnlyCallableBy": SS58String;
|
|
21
|
+
"FailedToGetExchangeAmount": undefined;
|
|
22
|
+
"FailedToTransferD9ToUser": undefined;
|
|
23
|
+
"SessionPoolNotReady": undefined;
|
|
24
|
+
}>;
|
|
25
|
+
type T5 = ResultPayload<ResultPayload<bigint, Anonymize<T4>>, Anonymize<T1>>;
|
|
26
|
+
type StorageDescriptor = {
|
|
27
|
+
"volume_at_index": {
|
|
28
|
+
"key": undefined;
|
|
29
|
+
"value": bigint;
|
|
30
|
+
};
|
|
31
|
+
"": {
|
|
32
|
+
"key": undefined;
|
|
33
|
+
"value": {
|
|
34
|
+
"admin": SS58String;
|
|
35
|
+
"main_contract": SS58String;
|
|
36
|
+
"merchant_contract": SS58String;
|
|
37
|
+
"node_reward_contract": SS58String;
|
|
38
|
+
"amm_contract": SS58String;
|
|
39
|
+
"merchant_volume": bigint;
|
|
40
|
+
"last_session": number;
|
|
41
|
+
"accumulative_reward_pool": bigint;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
type MessagesDescriptor = {
|
|
46
|
+
"get_accumulative_reward_pool": {
|
|
47
|
+
"message": {};
|
|
48
|
+
"response": Anonymize<T2>;
|
|
49
|
+
};
|
|
50
|
+
"pay_node_reward": {
|
|
51
|
+
"message": {
|
|
52
|
+
"account_id": SS58String;
|
|
53
|
+
"amount": bigint;
|
|
54
|
+
};
|
|
55
|
+
"response": Anonymize<T3>;
|
|
56
|
+
"mutates": true;
|
|
57
|
+
};
|
|
58
|
+
"get_merchant_volume": {
|
|
59
|
+
"message": {};
|
|
60
|
+
"response": Anonymize<T2>;
|
|
61
|
+
};
|
|
62
|
+
"get_session_volume": {
|
|
63
|
+
"message": {
|
|
64
|
+
"session_index": number;
|
|
65
|
+
};
|
|
66
|
+
"response": Anonymize<T2>;
|
|
67
|
+
};
|
|
68
|
+
"update_pool_and_retrieve": {
|
|
69
|
+
"message": {
|
|
70
|
+
"session_index": number;
|
|
71
|
+
};
|
|
72
|
+
"response": Anonymize<T5>;
|
|
73
|
+
"mutates": true;
|
|
74
|
+
};
|
|
75
|
+
"deduct_from_reward_pool": {
|
|
76
|
+
"message": {
|
|
77
|
+
"amount": bigint;
|
|
78
|
+
};
|
|
79
|
+
"response": Anonymize<T3>;
|
|
80
|
+
"mutates": true;
|
|
81
|
+
};
|
|
82
|
+
"get_total_volume": {
|
|
83
|
+
"message": {};
|
|
84
|
+
"response": Anonymize<T2>;
|
|
85
|
+
};
|
|
86
|
+
"process_merchant_payment": {
|
|
87
|
+
"message": {};
|
|
88
|
+
"response": Anonymize<T3>;
|
|
89
|
+
"payable": true;
|
|
90
|
+
"mutates": true;
|
|
91
|
+
};
|
|
92
|
+
"merchant_user_redeem_d9": {
|
|
93
|
+
"message": {
|
|
94
|
+
"user_account": SS58String;
|
|
95
|
+
"redeemable_usdt": bigint;
|
|
96
|
+
};
|
|
97
|
+
"response": Anonymize<T5>;
|
|
98
|
+
};
|
|
99
|
+
"change_merchant_contract": {
|
|
100
|
+
"message": {
|
|
101
|
+
"merchant_contract": SS58String;
|
|
102
|
+
};
|
|
103
|
+
"response": Anonymize<T3>;
|
|
104
|
+
"mutates": true;
|
|
105
|
+
};
|
|
106
|
+
"send_to": {
|
|
107
|
+
"message": {
|
|
108
|
+
"to": SS58String;
|
|
109
|
+
"amount": bigint;
|
|
110
|
+
};
|
|
111
|
+
"response": Anonymize<T3>;
|
|
112
|
+
"mutates": true;
|
|
113
|
+
};
|
|
114
|
+
"change_node_reward_contract": {
|
|
115
|
+
"message": {
|
|
116
|
+
"node_reward_contract": SS58String;
|
|
117
|
+
};
|
|
118
|
+
"response": Anonymize<T3>;
|
|
119
|
+
"mutates": true;
|
|
120
|
+
};
|
|
121
|
+
"change_amm_contract": {
|
|
122
|
+
"message": {
|
|
123
|
+
"amm_contract": SS58String;
|
|
124
|
+
};
|
|
125
|
+
"response": Anonymize<T3>;
|
|
126
|
+
"mutates": true;
|
|
127
|
+
};
|
|
128
|
+
"change_main_contract": {
|
|
129
|
+
"message": {
|
|
130
|
+
"main_contract": SS58String;
|
|
131
|
+
};
|
|
132
|
+
"response": Anonymize<T3>;
|
|
133
|
+
"mutates": true;
|
|
134
|
+
};
|
|
135
|
+
"set_code": {
|
|
136
|
+
"message": {
|
|
137
|
+
"code_hash": FixedSizeBinary<32>;
|
|
138
|
+
};
|
|
139
|
+
"response": Anonymize<T0>;
|
|
140
|
+
"mutates": true;
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
type ConstructorsDescriptor = {
|
|
144
|
+
/**
|
|
145
|
+
* Constructor that initializes the `bool` value to the given `init_value`.
|
|
146
|
+
*/
|
|
147
|
+
"new": {
|
|
148
|
+
"message": {
|
|
149
|
+
"main_contract": SS58String;
|
|
150
|
+
"merchant_contract": SS58String;
|
|
151
|
+
"node_reward_contract": SS58String;
|
|
152
|
+
"amm_contract": SS58String;
|
|
153
|
+
};
|
|
154
|
+
"response": Anonymize<T0>;
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
type EventDescriptor = Enum<{}>;
|
|
158
|
+
export declare const descriptor: InkDescriptors<StorageDescriptor, MessagesDescriptor, ConstructorsDescriptor, EventDescriptor>;
|
|
159
|
+
export {};
|