@odatano/contract-m402-vault 0.0.0-stage → 0.2.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 +346 -0
- package/managed/m402-vault/compiler/contract-manifest.json +139 -0
- package/managed/m402-vault/contract/index.d.ts +125 -0
- package/managed/m402-vault/contract/index.js +2216 -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 +126 -0
- package/managed/m402-vault/zkir/pay.bzkir +0 -0
- package/managed/m402-vault/zkir/pay.zkir +107 -0
- package/managed/m402-vault/zkir/redeem.bzkir +0 -0
- package/managed/m402-vault/zkir/redeem.zkir +87 -0
- package/managed/m402-vault/zkir/registerService.bzkir +0 -0
- package/managed/m402-vault/zkir/registerService.zkir +56 -0
- package/managed/m402-vault/zkir/withdraw.bzkir +0 -0
- package/managed/m402-vault/zkir/withdraw.zkir +86 -0
- package/package.json +48 -5
- package/src/m402-vault.compact +137 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
{
|
|
2
|
+
"manifest-version": "1",
|
|
3
|
+
"compiler-version": "0.36.0",
|
|
4
|
+
"compiler-commit": "b5d9e4dfc532fe47011c4f6296e254f4853eb469",
|
|
5
|
+
"language-version": "0.28.0",
|
|
6
|
+
"runtime-version": "0.21.0",
|
|
7
|
+
"compiler": {
|
|
8
|
+
"type": "directory",
|
|
9
|
+
"contract-info.json": {
|
|
10
|
+
"type": "file",
|
|
11
|
+
"size": 7046,
|
|
12
|
+
"hash": "f59e3e947b6abac4ed5b323f668f5bbce4c10a93e8e95b0a55e1b904599cdc41"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"contract": {
|
|
16
|
+
"type": "directory",
|
|
17
|
+
"index.d.ts": {
|
|
18
|
+
"type": "file",
|
|
19
|
+
"size": 5701,
|
|
20
|
+
"hash": "a48289e508dae49606f9372293571481715a26755400c2f74cf03917828ab8af"
|
|
21
|
+
},
|
|
22
|
+
"index.js": {
|
|
23
|
+
"type": "file",
|
|
24
|
+
"size": 158292,
|
|
25
|
+
"hash": "0f3c3e46517c1d61db4ca906205b7c3b827be520dacf143aac4593494272b3d8"
|
|
26
|
+
},
|
|
27
|
+
"index.js.map": {
|
|
28
|
+
"type": "file",
|
|
29
|
+
"size": 6310,
|
|
30
|
+
"hash": "08338cb124de3a1bdc21d7af1222a940f5af116e9c4eb96d443988147c9f9f7a"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"zkir": {
|
|
34
|
+
"type": "directory",
|
|
35
|
+
"deposit.bzkir": {
|
|
36
|
+
"type": "file",
|
|
37
|
+
"size": 3331,
|
|
38
|
+
"hash": "c6e5dc6d41e7ddeb96bfda38a3541547550dd6df0c8eb94f32480dd0d0dc2b5b"
|
|
39
|
+
},
|
|
40
|
+
"deposit.zkir": {
|
|
41
|
+
"type": "file",
|
|
42
|
+
"size": 10992,
|
|
43
|
+
"hash": "501dbf52b092edec017f9f6d703cb1861c83beac8c24441d445e95709fc1a459"
|
|
44
|
+
},
|
|
45
|
+
"pay.bzkir": {
|
|
46
|
+
"type": "file",
|
|
47
|
+
"size": 2727,
|
|
48
|
+
"hash": "97bb250228801e0201a6972cf95ace913acc46a3f8d1f12cc1a3e4a55c3e29d5"
|
|
49
|
+
},
|
|
50
|
+
"pay.zkir": {
|
|
51
|
+
"type": "file",
|
|
52
|
+
"size": 8936,
|
|
53
|
+
"hash": "31c5dc65f0e9667cc380ad02de30a2e34268a5e08ed7968fe7a8d3770c3d9201"
|
|
54
|
+
},
|
|
55
|
+
"redeem.bzkir": {
|
|
56
|
+
"type": "file",
|
|
57
|
+
"size": 2105,
|
|
58
|
+
"hash": "dee45be565f8df2ccd11fbfa1eedfe52d60ba3e8b0246ae86e66cc6559e245d7"
|
|
59
|
+
},
|
|
60
|
+
"redeem.zkir": {
|
|
61
|
+
"type": "file",
|
|
62
|
+
"size": 6714,
|
|
63
|
+
"hash": "1a62067da0e555260d6137919b6826513cafba9a1f66f9b179a5664f54d0ea72"
|
|
64
|
+
},
|
|
65
|
+
"registerService.bzkir": {
|
|
66
|
+
"type": "file",
|
|
67
|
+
"size": 1181,
|
|
68
|
+
"hash": "1673773856c602c25845c5c670d32f83989afc09901126990159960582d125f0"
|
|
69
|
+
},
|
|
70
|
+
"registerService.zkir": {
|
|
71
|
+
"type": "file",
|
|
72
|
+
"size": 3998,
|
|
73
|
+
"hash": "ea5340718d9949d9025fc59e4b088d94e49a48e75860488a7bb7d1dcab911873"
|
|
74
|
+
},
|
|
75
|
+
"withdraw.bzkir": {
|
|
76
|
+
"type": "file",
|
|
77
|
+
"size": 1938,
|
|
78
|
+
"hash": "93f2f14077a37a3adab242263a7bc03a923bfdc9024550bcdd4cd3867cefc6df"
|
|
79
|
+
},
|
|
80
|
+
"withdraw.zkir": {
|
|
81
|
+
"type": "file",
|
|
82
|
+
"size": 5864,
|
|
83
|
+
"hash": "1efb8d29b0cab8c702c6c45f07616d0793eb451be480155710920a5d3b0e0702"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"keys": {
|
|
87
|
+
"type": "directory",
|
|
88
|
+
"deposit.prover": {
|
|
89
|
+
"type": "file",
|
|
90
|
+
"size": 45096467,
|
|
91
|
+
"hash": "bca2ad3af05f78dd3712d090834f2338ba0905eacc4779aa8658003106727105"
|
|
92
|
+
},
|
|
93
|
+
"deposit.verifier": {
|
|
94
|
+
"type": "file",
|
|
95
|
+
"size": 2121,
|
|
96
|
+
"hash": "3967aa980c22fa7db0111c36ab0580752d1c27d242cbef9461fea2b2c0562566"
|
|
97
|
+
},
|
|
98
|
+
"pay.prover": {
|
|
99
|
+
"type": "file",
|
|
100
|
+
"size": 22551479,
|
|
101
|
+
"hash": "4e8f69ab82df340affba2fbf1902812fba60f23e91cbfe2d055bf8d229f42a17"
|
|
102
|
+
},
|
|
103
|
+
"pay.verifier": {
|
|
104
|
+
"type": "file",
|
|
105
|
+
"size": 2121,
|
|
106
|
+
"hash": "44146e9d3102fc60deb47d61cc44029424f841c589322d9944b866b9e8d44a34"
|
|
107
|
+
},
|
|
108
|
+
"redeem.prover": {
|
|
109
|
+
"type": "file",
|
|
110
|
+
"size": 22550857,
|
|
111
|
+
"hash": "52b9e5d5cd97303e18d16c921a0d62c76a4f99fda04a415e8d8bc9d675b5eccc"
|
|
112
|
+
},
|
|
113
|
+
"redeem.verifier": {
|
|
114
|
+
"type": "file",
|
|
115
|
+
"size": 2121,
|
|
116
|
+
"hash": "13b94ab51c5988bbfd64c2aabd243da27a3ffffe298aa7041ef957480d2fb915"
|
|
117
|
+
},
|
|
118
|
+
"registerService.prover": {
|
|
119
|
+
"type": "file",
|
|
120
|
+
"size": 11277741,
|
|
121
|
+
"hash": "cc451a10c478a0f792a0d5208be652f25edbf24757d9cc7b7b8f3486bc115fba"
|
|
122
|
+
},
|
|
123
|
+
"registerService.verifier": {
|
|
124
|
+
"type": "file",
|
|
125
|
+
"size": 2121,
|
|
126
|
+
"hash": "dece03cc1c292c0d305f9bd23485399c71336c88d74765f1ab1e53ced6905ff8"
|
|
127
|
+
},
|
|
128
|
+
"withdraw.prover": {
|
|
129
|
+
"type": "file",
|
|
130
|
+
"size": 447074,
|
|
131
|
+
"hash": "df53c55573b8ed08ac9efbe9d251ed632395f344d9dd90681863b170c904f9c7"
|
|
132
|
+
},
|
|
133
|
+
"withdraw.verifier": {
|
|
134
|
+
"type": "file",
|
|
135
|
+
"size": 1353,
|
|
136
|
+
"hash": "a61392d20dae6d8fa2d7faac960b0213b92264c267fbdef1ad3b4415794d12d8"
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
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): Promise<__compactRuntime.CircuitResults<PS, []>>;
|
|
11
|
+
deposit(context: __compactRuntime.CircuitContext<PS>,
|
|
12
|
+
amount_0: bigint,
|
|
13
|
+
nonceSeed_0: Uint8Array): Promise<__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): Promise<__compactRuntime.CircuitResults<PS, []>>;
|
|
18
|
+
redeem(context: __compactRuntime.CircuitContext<PS>,
|
|
19
|
+
recipient_0: Uint8Array,
|
|
20
|
+
credit_0: { nonce: Uint8Array, color: Uint8Array, value: bigint }): Promise<__compactRuntime.CircuitResults<PS, []>>;
|
|
21
|
+
withdraw(context: __compactRuntime.CircuitContext<PS>,
|
|
22
|
+
serviceId_0: Uint8Array,
|
|
23
|
+
amount_0: bigint): Promise<__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): Promise<__compactRuntime.CircuitResults<PS, []>>;
|
|
31
|
+
deposit(context: __compactRuntime.CircuitContext<PS>,
|
|
32
|
+
amount_0: bigint,
|
|
33
|
+
nonceSeed_0: Uint8Array): Promise<__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): Promise<__compactRuntime.CircuitResults<PS, []>>;
|
|
38
|
+
redeem(context: __compactRuntime.CircuitContext<PS>,
|
|
39
|
+
recipient_0: Uint8Array,
|
|
40
|
+
credit_0: { nonce: Uint8Array, color: Uint8Array, value: bigint }): Promise<__compactRuntime.CircuitResults<PS, []>>;
|
|
41
|
+
withdraw(context: __compactRuntime.CircuitContext<PS>,
|
|
42
|
+
serviceId_0: Uint8Array,
|
|
43
|
+
amount_0: bigint): Promise<__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 }): Promise<__compactRuntime.CircuitResults<PS, Uint8Array>>;
|
|
55
|
+
deriveReceipt(context: __compactRuntime.CircuitContext<PS>,
|
|
56
|
+
secret_0: Uint8Array,
|
|
57
|
+
serviceId_0: Uint8Array): Promise<__compactRuntime.CircuitResults<PS, Uint8Array>>;
|
|
58
|
+
deriveServiceId(context: __compactRuntime.CircuitContext<PS>,
|
|
59
|
+
owner_0: Uint8Array,
|
|
60
|
+
salt_0: Uint8Array,
|
|
61
|
+
price_0: bigint): Promise<__compactRuntime.CircuitResults<PS, Uint8Array>>;
|
|
62
|
+
registerService(context: __compactRuntime.CircuitContext<PS>,
|
|
63
|
+
salt_0: Uint8Array,
|
|
64
|
+
price_0: bigint,
|
|
65
|
+
owner_0: Uint8Array): Promise<__compactRuntime.CircuitResults<PS, []>>;
|
|
66
|
+
deposit(context: __compactRuntime.CircuitContext<PS>,
|
|
67
|
+
amount_0: bigint,
|
|
68
|
+
nonceSeed_0: Uint8Array): Promise<__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): Promise<__compactRuntime.CircuitResults<PS, []>>;
|
|
73
|
+
redeem(context: __compactRuntime.CircuitContext<PS>,
|
|
74
|
+
recipient_0: Uint8Array,
|
|
75
|
+
credit_0: { nonce: Uint8Array, color: Uint8Array, value: bigint }): Promise<__compactRuntime.CircuitResults<PS, []>>;
|
|
76
|
+
withdraw(context: __compactRuntime.CircuitContext<PS>,
|
|
77
|
+
serviceId_0: Uint8Array,
|
|
78
|
+
amount_0: bigint): Promise<__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 declare class Contract<PS = any, W extends Witnesses<PS> = Witnesses<PS>> {
|
|
113
|
+
witnesses: W;
|
|
114
|
+
circuits: Circuits<PS>;
|
|
115
|
+
impureCircuits: ImpureCircuits<PS>;
|
|
116
|
+
provableCircuits: ProvableCircuits<PS>;
|
|
117
|
+
constructor(witnesses: W);
|
|
118
|
+
initialState(context: __compactRuntime.ConstructorContext<PS>): Promise<__compactRuntime.ConstructorResult<PS>>;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export declare function ledger(state: __compactRuntime.StateValue | __compactRuntime.ChargedState): Ledger;
|
|
122
|
+
export declare const pureCircuits: PureCircuits;
|
|
123
|
+
export declare const expectedVk: Record<string, string>;
|
|
124
|
+
export declare const circuitSignatures: __compactRuntime.CircuitSignatures;
|
|
125
|
+
export declare const declaredInterfaces: __compactRuntime.DeclaredInterfaces;
|