@mistcash/config 0.1.0-beta → 0.2.0-beta.1

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/package.json CHANGED
@@ -1,27 +1,36 @@
1
1
  {
2
2
  "name": "@mistcash/config",
3
- "version": "0.1.0-beta",
3
+ "version": "0.2.0-beta.1",
4
+ "license": "MIT",
4
5
  "publishConfig": {
5
6
  "access": "public"
6
7
  },
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/mistcash/sdk.git"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/mistcash/sdk/issues"
14
+ },
15
+ "homepage": "https://github.com/mistcash/sdk#readme",
7
16
  "description": "MIST SDK config",
8
17
  "main": "dist/index.js",
9
18
  "module": "dist/index.mjs",
10
19
  "types": "dist/index.d.ts",
20
+ "scripts": {
21
+ "build": "tsup src/index.ts --format cjs,esm --dts",
22
+ "dev": "tsup src/index.ts --format cjs,esm --dts --watch",
23
+ "test": "jest",
24
+ "test:watch": "jest --watch",
25
+ "clean": "rm -rf dist"
26
+ },
11
27
  "dependencies": {
12
- "starknet": "^7.6.4"
28
+ "starknet": "^8.0.0"
13
29
  },
14
30
  "devDependencies": {
15
31
  "@types/jest": "^29.5.0",
16
32
  "jest": "^29.5.0",
17
33
  "tsup": "^8.0.0",
18
34
  "typescript": "^5.0.0"
19
- },
20
- "scripts": {
21
- "build": "tsup src/index.ts --format cjs,esm --dts",
22
- "dev": "tsup src/index.ts --format cjs,esm --dts --watch",
23
- "test": "jest",
24
- "test:watch": "jest --watch",
25
- "clean": "rm -rf dist"
26
35
  }
27
36
  }
package/src/circuit.ts ADDED
@@ -0,0 +1,19 @@
1
+ import circuit from "./withdraw.json";
2
+
3
+ // Types generated from ABI
4
+ export interface Asset {
5
+ amount: string; // field
6
+ addr: string; // field
7
+ }
8
+
9
+ export interface WitnessData {
10
+ claiming_key: string; // private field
11
+ recipient: string; // public field
12
+ asset: Asset; // public struct
13
+ proof: string[]; // private array of 20 fields
14
+ root: string; // public field
15
+ new_tx_secret: string; // private field
16
+ new_tx_amount: string; // private field
17
+ }
18
+
19
+ export const withdrawCircuit = circuit;
package/src/contracts.ts CHANGED
@@ -125,7 +125,39 @@ export const CHAMBER_ABI = [
125
125
  },
126
126
  {
127
127
  "type": "function",
128
- "name": "withdraw",
128
+ "name": "seek_and_hide_no_zk",
129
+ "inputs": [
130
+ {
131
+ "name": "claiming_key",
132
+ "type": "core::integer::u256"
133
+ },
134
+ {
135
+ "name": "recipient",
136
+ "type": "core::starknet::contract_address::ContractAddress"
137
+ },
138
+ {
139
+ "name": "asset",
140
+ "type": "contracts::multi_asset::Asset"
141
+ },
142
+ {
143
+ "name": "proof",
144
+ "type": "core::array::Span::<core::integer::u256>"
145
+ },
146
+ {
147
+ "name": "new_tx_secret",
148
+ "type": "core::integer::u256"
149
+ },
150
+ {
151
+ "name": "new_tx_amount",
152
+ "type": "core::integer::u256"
153
+ }
154
+ ],
155
+ "outputs": [],
156
+ "state_mutability": "external"
157
+ },
158
+ {
159
+ "type": "function",
160
+ "name": "handle_zkp",
129
161
  "inputs": [
130
162
  {
131
163
  "name": "proof",
@@ -259,6 +291,25 @@ export const CHAMBER_ABI = [
259
291
  ],
260
292
  "state_mutability": "view"
261
293
  },
294
+ {
295
+ "type": "function",
296
+ "name": "setVerifierAddress",
297
+ "inputs": [
298
+ {
299
+ "name": "verifier",
300
+ "type": "verifier_contracts::honk_verifier::IUltraStarknetZKHonkVerifierDispatcher"
301
+ }
302
+ ],
303
+ "outputs": [],
304
+ "state_mutability": "external"
305
+ },
306
+ {
307
+ "type": "function",
308
+ "name": "recalculate_merkle_root",
309
+ "inputs": [],
310
+ "outputs": [],
311
+ "state_mutability": "external"
312
+ },
262
313
  {
263
314
  "type": "event",
264
315
  "name": "openzeppelin_access::ownable::ownable::OwnableComponent::OwnershipTransferred",
package/src/index.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './contracts';
2
+ export * from './circuit';
2
3
  export * from './tokens';
package/src/tokens.ts CHANGED
@@ -9,7 +9,7 @@ export interface Token {
9
9
 
10
10
  export const tokensData: Token[] = [
11
11
  {
12
- id: '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7',
12
+ id: '0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7',
13
13
  name: 'ETH',
14
14
  decimals: 18,
15
15
  icon: `<svg viewBox="10 10 180 180" xmlns="http://www.w3.org/2000/svg" id="fi_14446160" > <path d="m99.99 127.24-33.6-19.85 33.6 47.36 33.63-47.36z" fill="#fff" > </path><path d="m133.6 101.02-33.61 19.86-33.61-19.86 33.61-55.77z" fill="#fff"></path > <g fill="#c1ccf7"> <path d="m133.6 101.02-33.61-15.28v-40.49z"> </path><path d="m133.62 107.39-33.63 47.36v-27.51z"></path > <path d="m99.99 85.74v35.14l-33.6-19.86z"> </path></g > <path d="m133.6 101.02-33.61 19.86v-35.14z" fill="#8198ee" > </path></svg >`,
@@ -17,7 +17,7 @@ export const tokensData: Token[] = [
17
17
  textColor: 'white'
18
18
  },
19
19
  {
20
- id: '0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d',
20
+ id: '0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d',
21
21
  name: 'STRK',
22
22
  decimals: 18,
23
23
  icon: `<svg xmlns="http://www.w3.org/2000/svg" width="158" height="158" viewBox="0 0 158 158" fill="none" > <path d="M2 78.9988C2 121.525 36.4731 155.998 78.9988 155.998C121.525 155.998 156 121.524 156 78.9988C156 36.4732 121.525 2 78.9988 2C36.4731 2 2 36.4731 2 78.9988Z" fill="#0C0C4F" stroke="#EC796B" strokeWidth="4" /> <path fillRule="evenodd" clipRule="evenodd" d="M44.1542 60.3876L46.1043 54.3628C46.5007 53.1374 47.4678 52.1839 48.6977 51.8079L54.752 49.9461C55.59 49.6901 55.5968 48.5078 54.7656 48.2383L48.7385 46.2881C47.5154 45.8918 46.5618 44.9246 46.1836 43.6947L44.324 37.6405C44.0681 36.8047 42.8858 36.7956 42.6162 37.6291L40.6661 43.654C40.2697 44.877 39.3026 45.8306 38.0727 46.2089L32.0184 48.0684C31.1804 48.3266 31.1713 49.5067 32.0048 49.7762L38.0319 51.7263C39.255 52.1227 40.2086 53.0921 40.5868 54.322L42.4464 60.374C42.7023 61.212 43.8846 61.2211 44.1542 60.3876Z" fill="#FAFAFA" /> <path fillRule="evenodd" clipRule="evenodd" d="M139.848 56.881C137.352 54.09 133.457 52.5186 129.67 51.8742C125.853 51.2553 121.85 51.3127 118.082 51.9822C110.457 53.272 103.53 56.4292 97.4881 60.3241C94.3506 62.2356 91.675 64.4474 88.903 66.7C87.5674 67.8392 86.3497 69.0524 85.0815 70.2482L81.6163 73.696C77.851 77.6317 74.1398 81.2165 70.549 84.1878C66.9437 87.1454 63.573 89.3917 60.2512 90.9604C56.9315 92.5372 53.3794 93.4645 48.7495 93.6129C44.1603 93.7748 38.7307 92.9465 32.9229 91.5794C27.0839 90.2183 20.9523 88.2782 14.1004 86.6088C16.4912 93.2414 20.0914 99.1027 24.7137 104.461C29.3902 109.726 35.2297 114.524 42.7314 117.68C50.1247 120.906 59.4157 122.064 68.1031 120.317C76.8135 118.64 84.4573 114.61 90.6359 109.948C96.8304 105.239 101.842 99.8748 106.067 94.298C107.233 92.7572 107.85 91.8949 108.694 90.6906L111.027 87.2351C112.648 85.0977 114.124 82.6641 115.728 80.5464C118.874 76.1112 121.976 71.6811 125.58 67.5997C127.394 65.5296 129.307 63.5495 131.565 61.6466C132.691 60.7178 133.908 59.8088 135.256 58.99C136.624 58.1068 138.069 57.4155 139.848 56.881Z" fill="#EC796B" /> <path fillRule="evenodd" clipRule="evenodd" d="M139.848 56.8808C137.167 50.1148 132.182 44.4194 125.491 40.2167C118.841 36.0601 109.605 33.9389 100.452 35.7471C95.9307 36.6216 91.5501 38.3052 87.7059 40.5472C83.8791 42.7803 80.4499 45.4685 77.4812 48.3524C75.9992 49.7992 74.654 51.3084 73.3176 52.8262L69.8538 57.2423L64.5039 64.3512C57.6836 73.4976 50.3391 84.2166 38.2863 87.3927C26.454 90.5108 21.3221 87.7493 14.1004 86.6085C15.4209 90.0176 17.0565 93.3284 19.2739 96.2409C21.45 99.2124 24.0204 102.003 27.216 104.396C28.8309 105.545 30.5359 106.679 32.4295 107.641C34.3146 108.57 36.3474 109.388 38.5172 110.003C42.8332 111.186 47.6923 111.601 52.397 110.964C57.1039 110.336 61.6029 108.845 65.5355 106.864C69.4971 104.901 72.9481 102.511 76.0296 99.9891C82.1551 94.9021 86.9197 89.2815 90.9444 83.6C92.9688 80.7594 94.8064 77.8652 96.5059 74.9702L98.5062 71.5236C99.1177 70.5161 99.7362 69.5024 100.364 68.5584C102.899 64.7654 105.378 61.7241 108.389 59.4413C111.358 57.0995 115.493 55.3693 121.018 54.9674C126.52 54.5606 132.872 55.312 139.848 56.8808Z" fill="#FAFAFA" /> <path fillRule="evenodd" clipRule="evenodd" d="M110.081 113.097C110.081 118.067 114.112 122.097 119.081 122.097C124.051 122.097 128.076 118.067 128.076 113.097C128.076 108.128 124.051 104.097 119.081 104.097C114.112 104.097 110.081 108.128 110.081 113.097Z" fill="#EC796B" /> </svg>`,
@@ -25,7 +25,7 @@ export const tokensData: Token[] = [
25
25
  textColor: 'white'
26
26
  },
27
27
  {
28
- id: '0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8',
28
+ id: '0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8',
29
29
  name: 'USDC',
30
30
  decimals: 6,
31
31
  icon: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 2000" > <path d="M1000 2000c554 0 1000-446 1000-1000S1554 0 1000 0 0 446 0 1000s446 1000 1000 1000z" fill="#2775ca" /> <path d="M1275 1158c0-146-87-196-262-216-125-17-150-50-150-109s41-96 125-96c75 0 116 25 137 88 4 12 17 21 29 21h67c17 0 29-13 29-29v-5c-17-91-92-162-187-170V542c0-17-13-30-34-34h-62c-17 0-29 13-34 34v95c-125 17-204 101-204 205 0 137 84 191 259 212 116 21 154 46 154 113s-59 112-138 112c-108 0-146-46-158-108-4-17-17-25-29-25h-71c-17 0-29 12-29 29v4c16 104 83 179 221 200v100c0 17 12 29 33 34h62c17 0 30-13 34-34v-100c125-21 208-108 208-221z" fill="#fff" /> <path d="M788 1596a620 620 0 0 1-371-800 616 616 0 0 1 371-371c16-8 25-21 25-42v-58c0-17-9-29-25-33-5 0-13 0-17 4a749 749 0 0 0 0 1429c17 8 33 0 37-17 5-4 5-8 5-16v-59c0-12-13-29-25-37zm441-1300c-16-9-33 0-37 16-4 5-4 9-4 17v58c0 17 12 34 25 42a620 620 0 0 1 370 800 616 616 0 0 1-371 371c-16 8-24 21-24 42v58c0 17 8 29 25 33 4 0 12 0 16-4a749 749 0 0 0 488-942 756 756 0 0 0-488-491z" fill="#fff" /> </svg>`,
@@ -33,7 +33,7 @@ export const tokensData: Token[] = [
33
33
  textColor: 'white'
34
34
  },
35
35
  {
36
- id: '0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8',
36
+ id: '0x68f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8',
37
37
  name: 'USDT',
38
38
  decimals: 6,
39
39
  icon: `<svg viewBox="10 10 180 180" xmlns="http://www.w3.org/2000/svg" > <circle cx="100" cy="100" fill="#59af99" r="90" /> <path d="M110.4 87.7V75.9h26.8V57.2H62.8V76h27v11.8C67 88.7 50 93.3 50 98.7s17 10 39.5 11v39h20.8v-39c22.6-1 39.5-5.6 39.5-11s-16.9-10-39.5-11zM100 106.2c-24.4 0-44.3-3.7-44.3-8.3 0-3.9 14.5-7.2 33.9-8v13.3l10.4.2 10.4-.2V89.8c19.4 1 33.8 4.2 33.8 8.1 0 4.6-19.8 8.3-44.2 8.3z" fill="#fff" /> </svg>`,
@@ -41,7 +41,7 @@ export const tokensData: Token[] = [
41
41
  textColor: 'white'
42
42
  },
43
43
  {
44
- id: '0x00da114221cb83fa859dbdb4c44beeaa0bb37c7537ad5ae66fe5e0efd20e6eb3',
44
+ id: '0xda114221cb83fa859dbdb4c44beeaa0bb37c7537ad5ae66fe5e0efd20e6eb3',
45
45
  name: 'DAI',
46
46
  decimals: 18,
47
47
  icon: `<svg viewBox="10 10 180 180" xmlns="http://www.w3.org/2000/svg" > <path d="M106.3 105.5h28.9c.6 0 .8 0 .9-.9a48.3 48.3 0 0 0 0-8.8c0-.6-.3-.8-.9-.8H77.8c-.7 0-1 0-1 1v8.4c0 1 0 1 1.2 1zM132.9 85a.7.7 0 0 0 0-.7 19.7 19.7 0 0 0-1.7-3 25.1 25.1 0 0 0-3.6-4.4 10 10 0 0 0-2.1-2.1 33.6 33.6 0 0 0-14.3-7.2 36 36 0 0 0-8-1H77.7c-.7 0-.8.4-.8 1v16.9c0 .7 0 .9 1 .9h54.4s.5 0 .5-.4zm0 30.2a8.8 8.8 0 0 0-2.4 0H77.8c-.7 0-1 0-1 1v16.3c0 .8 0 1 1 1h24.3a10.8 10.8 0 0 0 3.5 0A35.7 35.7 0 0 0 116 131a16.2 16.2 0 0 0 3.4-1.6h.4a31.1 31.1 0 0 0 13.1-13.1s.3-.7 0-.9zm-65.5 27v-26.4c0-.6 0-.7-.8-.7H56c-.6 0-.8 0-.8-.7v-9h11c.5 0 .7 0 .7-.8v-9c0-.6 0-.7-.7-.7H56c-.6 0-.8 0-.8-.8V86c0-.6 0-.7.8-.7h10.4c.7 0 .9 0 .9-1V58.8c0-.8 0-1 1-1h35.6a60 60 0 0 1 7.6.9 47.2 47.2 0 0 1 15 5.4 41.7 41.7 0 0 1 8.3 6.5 51.8 51.8 0 0 1 5 6.3 39.6 39.6 0 0 1 3.8 7.3 1.3 1.3 0 0 0 1.4 1h8.5c1.1 0 1.1 0 1.2 1V94c0 .8-.4 1-1 1H147c-.7 0-.8 0-.8.8a57.2 57.2 0 0 1 0 8.7c0 .8 0 .9 1 .9h7.4c.4.4 0 .8 0 1.3a8 8 0 0 1 0 1.6v5.5c0 .8 0 1-1 1h-9a1.2 1.2 0 0 0-1.3 1 37.5 37.5 0 0 1-10 14.4 58.7 58.7 0 0 1-5 4.2q-2.8 1.6-5.8 3a51.8 51.8 0 0 1-11.2 3.7 59.7 59.7 0 0 1-10.9.8H67.7z" fill="#fefefd" /> </svg>`,
@@ -52,6 +52,7 @@ export const tokensData: Token[] = [
52
52
 
53
53
  export const tokensMap: { [key: string]: Token } = {};
54
54
 
55
- tokensData.forEach(token => {
56
- tokensMap[token.id] = token;
55
+ tokensData.forEach((token, i) => {
56
+ tokensData[i].id = '0x' + BigInt(token.id).toString(16);
57
+ tokensMap['0x' + BigInt(token.id).toString(16)] = token;
57
58
  });