@odatano/contract-m402-vault 0.0.0-stage → 0.1.0
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/LICENSE +178 -0
- package/NOTICE +9 -0
- package/README.md +42 -2
- package/contract.json +25 -0
- package/managed/m402-vault/compiler/contract-info.json +345 -0
- package/managed/m402-vault/contract/index.d.ts +126 -0
- package/managed/m402-vault/contract/index.js +2164 -0
- package/managed/m402-vault/contract/index.js.map +8 -0
- package/managed/m402-vault/keys/deposit.verifier +0 -0
- package/managed/m402-vault/keys/manifest.json +69 -0
- package/managed/m402-vault/keys/pay.verifier +0 -0
- package/managed/m402-vault/keys/redeem.verifier +0 -0
- package/managed/m402-vault/keys/registerService.verifier +0 -0
- package/managed/m402-vault/keys/withdraw.verifier +0 -0
- package/managed/m402-vault/zkir/deposit.bzkir +0 -0
- package/managed/m402-vault/zkir/deposit.zkir +334 -0
- package/managed/m402-vault/zkir/pay.bzkir +0 -0
- package/managed/m402-vault/zkir/pay.zkir +283 -0
- package/managed/m402-vault/zkir/redeem.bzkir +0 -0
- package/managed/m402-vault/zkir/redeem.zkir +211 -0
- package/managed/m402-vault/zkir/registerService.bzkir +0 -0
- package/managed/m402-vault/zkir/registerService.zkir +128 -0
- package/managed/m402-vault/zkir/withdraw.bzkir +0 -0
- package/managed/m402-vault/zkir/withdraw.zkir +263 -0
- package/package.json +48 -5
- package/src/m402-vault.compact +137 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import type * as __compactRuntime from '@midnight-ntwrk/compact-runtime';
|
|
2
|
+
|
|
3
|
+
export type Witnesses<PS> = {
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export type ImpureCircuits<PS> = {
|
|
7
|
+
registerService(context: __compactRuntime.CircuitContext<PS>,
|
|
8
|
+
salt_0: Uint8Array,
|
|
9
|
+
price_0: bigint,
|
|
10
|
+
owner_0: Uint8Array): __compactRuntime.CircuitResults<PS, []>;
|
|
11
|
+
deposit(context: __compactRuntime.CircuitContext<PS>,
|
|
12
|
+
amount_0: bigint,
|
|
13
|
+
nonceSeed_0: Uint8Array): __compactRuntime.CircuitResults<PS, []>;
|
|
14
|
+
pay(context: __compactRuntime.CircuitContext<PS>,
|
|
15
|
+
serviceId_0: Uint8Array,
|
|
16
|
+
credit_0: { nonce: Uint8Array, color: Uint8Array, value: bigint },
|
|
17
|
+
receiptSecret_0: Uint8Array): __compactRuntime.CircuitResults<PS, []>;
|
|
18
|
+
redeem(context: __compactRuntime.CircuitContext<PS>,
|
|
19
|
+
recipient_0: Uint8Array,
|
|
20
|
+
credit_0: { nonce: Uint8Array, color: Uint8Array, value: bigint }): __compactRuntime.CircuitResults<PS, []>;
|
|
21
|
+
withdraw(context: __compactRuntime.CircuitContext<PS>,
|
|
22
|
+
serviceId_0: Uint8Array,
|
|
23
|
+
amount_0: bigint): __compactRuntime.CircuitResults<PS, []>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type ProvableCircuits<PS> = {
|
|
27
|
+
registerService(context: __compactRuntime.CircuitContext<PS>,
|
|
28
|
+
salt_0: Uint8Array,
|
|
29
|
+
price_0: bigint,
|
|
30
|
+
owner_0: Uint8Array): __compactRuntime.CircuitResults<PS, []>;
|
|
31
|
+
deposit(context: __compactRuntime.CircuitContext<PS>,
|
|
32
|
+
amount_0: bigint,
|
|
33
|
+
nonceSeed_0: Uint8Array): __compactRuntime.CircuitResults<PS, []>;
|
|
34
|
+
pay(context: __compactRuntime.CircuitContext<PS>,
|
|
35
|
+
serviceId_0: Uint8Array,
|
|
36
|
+
credit_0: { nonce: Uint8Array, color: Uint8Array, value: bigint },
|
|
37
|
+
receiptSecret_0: Uint8Array): __compactRuntime.CircuitResults<PS, []>;
|
|
38
|
+
redeem(context: __compactRuntime.CircuitContext<PS>,
|
|
39
|
+
recipient_0: Uint8Array,
|
|
40
|
+
credit_0: { nonce: Uint8Array, color: Uint8Array, value: bigint }): __compactRuntime.CircuitResults<PS, []>;
|
|
41
|
+
withdraw(context: __compactRuntime.CircuitContext<PS>,
|
|
42
|
+
serviceId_0: Uint8Array,
|
|
43
|
+
amount_0: bigint): __compactRuntime.CircuitResults<PS, []>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export type PureCircuits = {
|
|
47
|
+
creditColor(self_0: { bytes: Uint8Array }): Uint8Array;
|
|
48
|
+
deriveReceipt(secret_0: Uint8Array, serviceId_0: Uint8Array): Uint8Array;
|
|
49
|
+
deriveServiceId(owner_0: Uint8Array, salt_0: Uint8Array, price_0: bigint): Uint8Array;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export type Circuits<PS> = {
|
|
53
|
+
creditColor(context: __compactRuntime.CircuitContext<PS>,
|
|
54
|
+
self_0: { bytes: Uint8Array }): __compactRuntime.CircuitResults<PS, Uint8Array>;
|
|
55
|
+
deriveReceipt(context: __compactRuntime.CircuitContext<PS>,
|
|
56
|
+
secret_0: Uint8Array,
|
|
57
|
+
serviceId_0: Uint8Array): __compactRuntime.CircuitResults<PS, Uint8Array>;
|
|
58
|
+
deriveServiceId(context: __compactRuntime.CircuitContext<PS>,
|
|
59
|
+
owner_0: Uint8Array,
|
|
60
|
+
salt_0: Uint8Array,
|
|
61
|
+
price_0: bigint): __compactRuntime.CircuitResults<PS, Uint8Array>;
|
|
62
|
+
registerService(context: __compactRuntime.CircuitContext<PS>,
|
|
63
|
+
salt_0: Uint8Array,
|
|
64
|
+
price_0: bigint,
|
|
65
|
+
owner_0: Uint8Array): __compactRuntime.CircuitResults<PS, []>;
|
|
66
|
+
deposit(context: __compactRuntime.CircuitContext<PS>,
|
|
67
|
+
amount_0: bigint,
|
|
68
|
+
nonceSeed_0: Uint8Array): __compactRuntime.CircuitResults<PS, []>;
|
|
69
|
+
pay(context: __compactRuntime.CircuitContext<PS>,
|
|
70
|
+
serviceId_0: Uint8Array,
|
|
71
|
+
credit_0: { nonce: Uint8Array, color: Uint8Array, value: bigint },
|
|
72
|
+
receiptSecret_0: Uint8Array): __compactRuntime.CircuitResults<PS, []>;
|
|
73
|
+
redeem(context: __compactRuntime.CircuitContext<PS>,
|
|
74
|
+
recipient_0: Uint8Array,
|
|
75
|
+
credit_0: { nonce: Uint8Array, color: Uint8Array, value: bigint }): __compactRuntime.CircuitResults<PS, []>;
|
|
76
|
+
withdraw(context: __compactRuntime.CircuitContext<PS>,
|
|
77
|
+
serviceId_0: Uint8Array,
|
|
78
|
+
amount_0: bigint): __compactRuntime.CircuitResults<PS, []>;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export type Ledger = {
|
|
82
|
+
servicePrice: {
|
|
83
|
+
isEmpty(): boolean;
|
|
84
|
+
size(): bigint;
|
|
85
|
+
member(key_0: Uint8Array): boolean;
|
|
86
|
+
lookup(key_0: Uint8Array): bigint;
|
|
87
|
+
[Symbol.iterator](): Iterator<[Uint8Array, bigint]>
|
|
88
|
+
};
|
|
89
|
+
serviceOwner: {
|
|
90
|
+
isEmpty(): boolean;
|
|
91
|
+
size(): bigint;
|
|
92
|
+
member(key_0: Uint8Array): boolean;
|
|
93
|
+
lookup(key_0: Uint8Array): Uint8Array;
|
|
94
|
+
[Symbol.iterator](): Iterator<[Uint8Array, Uint8Array]>
|
|
95
|
+
};
|
|
96
|
+
receipts: {
|
|
97
|
+
isEmpty(): boolean;
|
|
98
|
+
size(): bigint;
|
|
99
|
+
member(elem_0: Uint8Array): boolean;
|
|
100
|
+
[Symbol.iterator](): Iterator<Uint8Array>
|
|
101
|
+
};
|
|
102
|
+
merchantBalance: {
|
|
103
|
+
isEmpty(): boolean;
|
|
104
|
+
size(): bigint;
|
|
105
|
+
member(key_0: Uint8Array): boolean;
|
|
106
|
+
lookup(key_0: Uint8Array): bigint;
|
|
107
|
+
[Symbol.iterator](): Iterator<[Uint8Array, bigint]>
|
|
108
|
+
};
|
|
109
|
+
readonly mintCounter: bigint;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export type ContractReferenceLocations = any;
|
|
113
|
+
|
|
114
|
+
export declare const contractReferenceLocations : ContractReferenceLocations;
|
|
115
|
+
|
|
116
|
+
export declare class Contract<PS = any, W extends Witnesses<PS> = Witnesses<PS>> {
|
|
117
|
+
witnesses: W;
|
|
118
|
+
circuits: Circuits<PS>;
|
|
119
|
+
impureCircuits: ImpureCircuits<PS>;
|
|
120
|
+
provableCircuits: ProvableCircuits<PS>;
|
|
121
|
+
constructor(witnesses: W);
|
|
122
|
+
initialState(context: __compactRuntime.ConstructorContext<PS>): __compactRuntime.ConstructorResult<PS>;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export declare function ledger(state: __compactRuntime.StateValue | __compactRuntime.ChargedState): Ledger;
|
|
126
|
+
export declare const pureCircuits: PureCircuits;
|