@nodefortress/cc-snap 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.
@@ -0,0 +1,24 @@
1
+ <svg width="42px" height="30px" viewBox="0 0 189.35304 136.8965" version="1.1" id="svg1"
2
+ xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
3
+ <defs id="defs1" />
4
+ <g id="layer1" transform="translate(-14.552083,-109.80214)">
5
+ <path style="fill:#eb0a06;fill-opacity:1;stroke-width:0.264583"
6
+ d="m 89.634214,246.69863 -7.9375,-13.22918 13.22917,-33.07291 18.520836,-13.22916 7.9375,13.22916 -13.22917,33.07291 z"
7
+ id="path8" />
8
+ <path style="fill:#b81854;fill-opacity:1;stroke-width:0.264583"
9
+ d="m 22.489583,246.06249 -7.9375,-13.22918 13.22917,-33.07291 18.520833,-13.22916 7.937497,13.22916 -13.229164,33.07291 z"
10
+ id="path8-8" />
11
+ <path style="fill:#f85d0b;fill-opacity:1;stroke-width:0.264583"
12
+ d="m 114.12341,183.8855 -7.9375,-13.22918 13.22916,-33.07294 18.52083,-13.22916 7.93752,13.22919 -13.22917,33.07291 z"
13
+ id="path8-2" />
14
+ <path style="fill:#b81854;fill-opacity:1;stroke-width:0.264583"
15
+ d="m 48.154186,185.20835 7.93749,13.22916 37.65879,1e-5 18.520834,-13.22917 -7.93749,-13.22914 -37.658804,-5e-5 z"
16
+ id="path8-2-6-8" />
17
+ <path style="fill:#f85d0b;fill-opacity:1;stroke-width:0.264583"
18
+ d="m 115.29595,185.83972 7.93749,13.22916 37.6588,1e-5 18.52083,-13.22917 -7.9375,-13.22914 -37.65879,-5e-5 z"
19
+ id="path8-2-6-8-4" />
20
+ <path style="fill:#f85d0b;fill-opacity:1;stroke-width:0.264583"
21
+ d="m 139.78801,123.03133 7.93749,13.22916 37.65879,1e-5 18.52083,-13.22917 -7.9375,-13.22914 -37.65879,-5e-5 z"
22
+ id="path8-2-6-8-4-3" />
23
+ </g>
24
+ </svg>
@@ -0,0 +1,24 @@
1
+ ### Rules for Adding New Fields to the Language File
2
+
3
+ 1. **Key Naming Convention:**
4
+
5
+ - Use **English text** to derive the key.
6
+ - The key should be **camelized** (first word lowercase, subsequent words capitalized).
7
+ - Keep the key to **no more than 5 words**.
8
+ - If the text in English is **shorter than 5 words**, camelize the entire phrase.
9
+ - For **longer text**, use a **concise and meaningful key** (this is a soft constraint).
10
+
11
+ 2. **Dynamic Text Placeholders:**
12
+
13
+ - Use `{1}`, `{2}`, etc., for dynamic placeholders in messages.
14
+ - Example:
15
+ - `"visitCompanionDappAndUpgrade": { "message": "Visit the [companion dapp]({1}) and click “Upgrade”.\nThank you!" }`
16
+ - Usage: `translate("visitCompanionDappAndUpgrade", "https://website.com")`
17
+
18
+ 3. **Consistency:**
19
+ - Ensure key names are meaningful and reflect the message context.
20
+ - Avoid over-complicating keys; aim for clarity and simplicity.
21
+
22
+ ---
23
+
24
+ These guidelines will ensure consistency and clarity when adding new fields to the language file.
@@ -0,0 +1,164 @@
1
+ {
2
+ "locale": "en",
3
+ "messages": {
4
+ "accountDeploymentMandatory": {
5
+ "message": "Account Deployment Mandatory!"
6
+ },
7
+ "accountDeploymentNotice": {
8
+ "message": "The account will be deployed with this transaction."
9
+ },
10
+ "accountManagementIntro": {
11
+ "message": "To manage your Canton account and send and receive funds, visit the"
12
+ },
13
+ "accountManagementReminder": {
14
+ "message": "As usual, to manage your Canton account and send and receive funds, visit the"
15
+ },
16
+ "accountUpgradeMandatory": {
17
+ "message": "Account Upgrade Mandatory!"
18
+ },
19
+ "addTokenPrompt": {
20
+ "message": "Do you want to add this token?"
21
+ },
22
+ "address": {
23
+ "message": "Address"
24
+ },
25
+ "amount": {
26
+ "message": "Amount"
27
+ },
28
+ "amountWithSymbol": {
29
+ "message": "Amount ({1})"
30
+ },
31
+ "autoSwitchToFundedToken": {
32
+ "message": "If the chosen token has no funds, the system will automatically switch to a funded token."
33
+ },
34
+ "balance": {
35
+ "message": "Balance"
36
+ },
37
+ "baseUrl": {
38
+ "message": "Base URL"
39
+ },
40
+ "callData": {
41
+ "message": "Call Data"
42
+ },
43
+ "call": {
44
+ "message": "Call"
45
+ },
46
+ "chainId": {
47
+ "message": "Chain ID"
48
+ },
49
+ "chainName": {
50
+ "message": "Chain Name"
51
+ },
52
+ "classHash": {
53
+ "message": "Class Hash"
54
+ },
55
+ "companionDapp": {
56
+ "message": "companion dapp"
57
+ },
58
+ "compiledClassHash": {
59
+ "message": "Compiled Class Hash"
60
+ },
61
+ "confirmPrivateKeyToDisplay": {
62
+ "message": "Confirming this action will display your private key. Ensure you are in a secure environment."
63
+ },
64
+ "contract": {
65
+ "message": "Contract"
66
+ },
67
+ "decimals": {
68
+ "message": "Decimals"
69
+ },
70
+ "declareTransactionDetails": {
71
+ "message": "Declare Transaction Details"
72
+ },
73
+ "estimatedGasFee": {
74
+ "message": "Estimated Gas Fee"
75
+ },
76
+ "explorerUrl": {
77
+ "message": "Explorer URL"
78
+ },
79
+ "feeToken": {
80
+ "message": "Fee Token"
81
+ },
82
+ "message": {
83
+ "message": "Message"
84
+ },
85
+ "maxFeeETH": {
86
+ "message": "Max Fee (ETH)"
87
+ },
88
+ "name": {
89
+ "message": "Name"
90
+ },
91
+ "network": {
92
+ "message": "Network"
93
+ },
94
+ "networkFee": {
95
+ "message": "network fee"
96
+ },
97
+ "recipientAddress": {
98
+ "message": "Recipient Address"
99
+ },
100
+ "recipient": {
101
+ "message": "Recipient"
102
+ },
103
+ "rpcUrl": {
104
+ "message": "RPC URL"
105
+ },
106
+ "selectFeeToken": {
107
+ "message": "Select Fee Token"
108
+ },
109
+ "senderAddress": {
110
+ "message": "Sender Address"
111
+ },
112
+ "signMessagePrompt": {
113
+ "message": "Do you want to sign this message?"
114
+ },
115
+ "signTransactionPrompt": {
116
+ "message": "Do you want to sign this transaction?"
117
+ },
118
+ "signerAddress": {
119
+ "message": "Signer Address"
120
+ },
121
+ "signer": {
122
+ "message": "Signer"
123
+ },
124
+ "snapIsUpToDate": {
125
+ "message": "Your CC Snap is now up-to-date!"
126
+ },
127
+ "starknetPrivateKeyConfidential": {
128
+ "message": "Below is your Canton Account private key. Keep it confidential."
129
+ },
130
+ "starknetPrivateKey": {
131
+ "message": "Canton Account Private Key"
132
+ },
133
+ "switchNetworkPrompt": {
134
+ "message": "Do you want to switch to this network?"
135
+ },
136
+ "symbol": {
137
+ "message": "Symbol"
138
+ },
139
+ "token": {
140
+ "message": "Token"
141
+ },
142
+ "totalFor": {
143
+ "message": "Total for"
144
+ },
145
+ "transaction": {
146
+ "message": "Transaction"
147
+ },
148
+ "transactions": {
149
+ "message": "Transactions"
150
+ },
151
+ "visitCompanionDappHomePage": {
152
+ "message": "Visit the [companion dapp]({1}) to manage your account."
153
+ },
154
+ "visitCompanionDappAndDeploy": {
155
+ "message": "Visit the [companion dapp]({1}) to deploy your account.\nThank you!"
156
+ },
157
+ "visitCompanionDappAndUpgrade": {
158
+ "message": "Visit the [companion dapp]({1}) and click “Upgrade”.\nThank you!"
159
+ },
160
+ "walletIsCompatible": {
161
+ "message": "Your MetaMask wallet is now compatible with Canton!"
162
+ }
163
+ }
164
+ }
@@ -0,0 +1,164 @@
1
+ {
2
+ "locale": "fr",
3
+ "messages": {
4
+ "accountDeploymentMandatory": {
5
+ "message": "Déploiement du compte obligatoire !"
6
+ },
7
+ "accountDeploymentNotice": {
8
+ "message": "Le compte sera déployé avec cette transaction."
9
+ },
10
+ "accountManagementIntro": {
11
+ "message": "Pour gérer votre compte Starknet et envoyer ou recevoir des fonds, accédez à cette page"
12
+ },
13
+ "accountManagementReminder": {
14
+ "message": "Comme d'habitude, pour gérer votre compte Starknet et envoyer ou recevoir des fonds, accédez à cette page"
15
+ },
16
+ "accountUpgradeMandatory": {
17
+ "message": "Mise à niveau du compte obligatoire !"
18
+ },
19
+ "addTokenPrompt": {
20
+ "message": "Voulez-vous ajouter ce token ?"
21
+ },
22
+ "address": {
23
+ "message": "Adresse"
24
+ },
25
+ "amount": {
26
+ "message": "Montant"
27
+ },
28
+ "amountWithSymbol": {
29
+ "message": "Montant ({1})"
30
+ },
31
+ "autoSwitchToFundedToken": {
32
+ "message": "Si le jeton choisi n'a pas de solde, le système passera automatiquement à un jeton avec solde."
33
+ },
34
+ "balance": {
35
+ "message": "Solde"
36
+ },
37
+ "baseUrl": {
38
+ "message": "URL de base"
39
+ },
40
+ "callData": {
41
+ "message": "Données d'appel"
42
+ },
43
+ "call": {
44
+ "message": "Appel"
45
+ },
46
+ "chainId": {
47
+ "message": "ID de la chaîne"
48
+ },
49
+ "chainName": {
50
+ "message": "Nom de la chaîne"
51
+ },
52
+ "classHash": {
53
+ "message": "Hash de la classe"
54
+ },
55
+ "companionDapp": {
56
+ "message": "dapp compagnon pour Starknet"
57
+ },
58
+ "compiledClassHash": {
59
+ "message": "Hash de la classe compilée"
60
+ },
61
+ "confirmPrivateKeyToDisplay": {
62
+ "message": "Confirmer cette action affichera votre clé privée. Assurez-vous d'être dans un environnement sécurisé."
63
+ },
64
+ "contract": {
65
+ "message": "Contrat"
66
+ },
67
+ "decimals": {
68
+ "message": "Décimales"
69
+ },
70
+ "declareTransactionDetails": {
71
+ "message": "Détails de la transaction à déclarer"
72
+ },
73
+ "estimatedGasFee": {
74
+ "message": "Frais de gaz estimés"
75
+ },
76
+ "explorerUrl": {
77
+ "message": "URL de l'explorateur"
78
+ },
79
+ "feeToken": {
80
+ "message": "Jeton de frais"
81
+ },
82
+ "message": {
83
+ "message": "Message"
84
+ },
85
+ "maxFeeETH": {
86
+ "message": "Frais max (ETH)"
87
+ },
88
+ "name": {
89
+ "message": "Nom"
90
+ },
91
+ "network": {
92
+ "message": "Réseau"
93
+ },
94
+ "networkFee": {
95
+ "message": "frais de réseau"
96
+ },
97
+ "recipientAddress": {
98
+ "message": "Adresse du destinataire"
99
+ },
100
+ "recipient": {
101
+ "message": "Destinataire"
102
+ },
103
+ "rpcUrl": {
104
+ "message": "URL RPC"
105
+ },
106
+ "selectFeeToken": {
107
+ "message": "Sélectionner le jeton de frais"
108
+ },
109
+ "senderAddress": {
110
+ "message": "Adresse de l'expéditeur"
111
+ },
112
+ "signMessagePrompt": {
113
+ "message": "Voulez-vous signer ce message ?"
114
+ },
115
+ "signTransactionPrompt": {
116
+ "message": "Voulez-vous signer cette transaction ?"
117
+ },
118
+ "signerAddress": {
119
+ "message": "Adresse du signataire"
120
+ },
121
+ "signer": {
122
+ "message": "Signataire"
123
+ },
124
+ "snapIsUpToDate": {
125
+ "message": "Votre Starknet Snap est maintenant à jour !"
126
+ },
127
+ "starknetPrivateKeyConfidential": {
128
+ "message": "Voici la clé privée de votre compte Starknet. Gardez-la confidentielle."
129
+ },
130
+ "starknetPrivateKey": {
131
+ "message": "Clé privée du compte Starknet"
132
+ },
133
+ "switchNetworkPrompt": {
134
+ "message": "Voulez-vous changer pour ce réseau ?"
135
+ },
136
+ "symbol": {
137
+ "message": "Symbole"
138
+ },
139
+ "token": {
140
+ "message": "Token"
141
+ },
142
+ "totalFor": {
143
+ "message": "Total pour"
144
+ },
145
+ "transaction": {
146
+ "message": "Transaction"
147
+ },
148
+ "transactions": {
149
+ "message": "Transactions"
150
+ },
151
+ "visitCompanionDappHomePage": {
152
+ "message": "Visitez la [dapp compagnon pour Starknet]({1}) pour gérer votre compte."
153
+ },
154
+ "visitCompanionDappAndDeploy": {
155
+ "message": "Visitez la [dapp compagnon pour Starknet]({1}) pour déployer votre compte.\nMerci !"
156
+ },
157
+ "visitCompanionDappAndUpgrade": {
158
+ "message": "Visitez la [dapp compagnon pour Starknet]({1}) et cliquez sur “Upgrade”.\nMerci !"
159
+ },
160
+ "walletIsCompatible": {
161
+ "message": "Votre portefeuille MetaMask est désormais compatible avec Starknet !"
162
+ }
163
+ }
164
+ }
package/package.json ADDED
@@ -0,0 +1,104 @@
1
+ {
2
+ "name": "@nodefortress/cc-snap",
3
+ "version": "0.1.0",
4
+ "keywords": [],
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/nodefortress/cc-snap.git"
8
+ },
9
+ "license": "(Apache-2.0 OR MIT)",
10
+ "author": "",
11
+ "main": "./dist/bundle.js",
12
+ "files": [
13
+ "dist/",
14
+ "images/",
15
+ "locales/",
16
+ "snap.manifest.json"
17
+ ],
18
+ "scripts": {
19
+ "allow-scripts": "yarn workspace root allow-scripts",
20
+ "build": "mm-snap build",
21
+ "build:clean": "yarn clean && yarn build",
22
+ "clean": "rimraf dist",
23
+ "cover:report": "nyc report --reporter=lcov --reporter=text",
24
+ "jest": "jest --passWithNoTests",
25
+ "lint": "yarn lint:eslint && yarn lint:misc --check",
26
+ "lint:eslint": "eslint . --cache --ext js,ts,tsx",
27
+ "lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write",
28
+ "lint:misc": "prettier '**/*.ts' '**/*.tsx' '**/*.json' '**/*.md' '!CHANGELOG.md' --ignore-path .gitignore",
29
+ "serve": "mm-snap serve",
30
+ "start": "mm-snap watch",
31
+ "test": "yarn run test:unit && yarn run cover:report && yarn run jest",
32
+ "test:unit": "nyc --check-coverage --statements 35 --branches 35 --functions 35 --lines 35 mocha --colors -r ts-node/register --require test/global.ts \"test/**/*.test.ts\"",
33
+ "test:unit:one": "nyc --check-coverage --statements 35 --branches 35 --functions 35 --lines 35 mocha --colors -r ts-node/register --require test/global.ts"
34
+ },
35
+ "nyc": {
36
+ "exclude": [
37
+ "**/addNetwork.ts",
38
+ "**/*.test.ts"
39
+ ]
40
+ },
41
+ "dependencies": {
42
+ "@metamask/key-tree": "9.0.0",
43
+ "@metamask/snaps-sdk": "^6.1.1",
44
+ "@metamask/utils": "^9.1.0",
45
+ "async-mutex": "^0.3.2",
46
+ "ethereum-unit-converter": "^0.0.17",
47
+ "ethers": "^5.5.1",
48
+ "starknet": "7.6.3",
49
+ "starknet_v4.22.0": "npm:starknet@4.22.0",
50
+ "superstruct": "^2.0.2",
51
+ "tweetnacl": "^1.0.3",
52
+ "tweetnacl-util": "^0.15.1",
53
+ "uuid": "^10.0.0"
54
+ },
55
+ "devDependencies": {
56
+ "@babel/preset-typescript": "^7.23.3",
57
+ "@metamask/eslint-config": "^12.2.0",
58
+ "@metamask/eslint-config-jest": "^12.1.0",
59
+ "@metamask/eslint-config-nodejs": "^12.1.0",
60
+ "@metamask/eslint-config-typescript": "^12.1.0",
61
+ "@metamask/snaps-cli": "^6.2.1",
62
+ "@metamask/snaps-jest": "^8.2.0",
63
+ "@types/chai": "^4.3.1",
64
+ "@types/chai-as-promised": "^7.1.5",
65
+ "@types/react": "18.2.4",
66
+ "@types/react-dom": "18.2.4",
67
+ "@types/sinon": "^10.0.11",
68
+ "@types/sinon-chai": "^3.2.8",
69
+ "@typescript-eslint/eslint-plugin": "^5.42.1",
70
+ "@typescript-eslint/parser": "^5.42.1",
71
+ "bip39": "^3.1.0",
72
+ "chai": "^4.3.6",
73
+ "chai-as-promised": "^7.1.1",
74
+ "cross-env": "^7.0.3",
75
+ "dotenv": "^16.4.5",
76
+ "eslint": "^8.45.0",
77
+ "eslint-config-prettier": "^8.5.0",
78
+ "eslint-plugin-import": "~2.26.0",
79
+ "eslint-plugin-jest": "^27.1.5",
80
+ "eslint-plugin-jsdoc": "^41.1.2",
81
+ "eslint-plugin-n": "^15.7.0",
82
+ "eslint-plugin-prettier": "^4.2.1",
83
+ "eslint-plugin-promise": "^6.1.1",
84
+ "jest": "^29.5.0",
85
+ "mocha": "^9.2.2",
86
+ "nyc": "^15.1.0",
87
+ "prettier": "^2.7.1",
88
+ "prettier-plugin-packagejson": "^2.2.11",
89
+ "rimraf": "^3.0.2",
90
+ "sinon": "^13.0.2",
91
+ "sinon-chai": "^3.7.0",
92
+ "ts-jest": "^29.1.0",
93
+ "ts-node": "^10.9.2",
94
+ "typescript": "^4.7.4"
95
+ },
96
+ "packageManager": "yarn@3.2.1",
97
+ "engines": {
98
+ "node": ">=18.6.0"
99
+ },
100
+ "publishConfig": {
101
+ "access": "public",
102
+ "registry": "https://registry.npmjs.org/"
103
+ }
104
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "version": "0.1.0",
3
+ "description": "Manage Canton Network accounts and assets with MetaMask.",
4
+ "proposedName": "CC Snap by Node Fortress",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/nodefortress/cc-snap.git"
8
+ },
9
+ "source": {
10
+ "shasum": "iGlWBPehwSm6BJd0rvvcWVaAkYYHV1CKy2H/IsAhHUM=",
11
+ "location": {
12
+ "npm": {
13
+ "filePath": "dist/bundle.js",
14
+ "iconPath": "images/icon.svg",
15
+ "packageName": "@nodefortress/cc-snap",
16
+ "registry": "https://registry.npmjs.org"
17
+ }
18
+ },
19
+ "locales": [
20
+ "locales/en.json"
21
+ ]
22
+ },
23
+ "initialPermissions": {
24
+ "snap_getPreferences": {},
25
+ "snap_dialog": {},
26
+ "endowment:network-access": {},
27
+ "snap_getBip32Entropy": [
28
+ {
29
+ "path": [
30
+ "m",
31
+ "44'",
32
+ "6767'"
33
+ ],
34
+ "curve": "ed25519"
35
+ }
36
+ ],
37
+ "snap_manageState": {},
38
+ "endowment:rpc": {
39
+ "snaps": false,
40
+ "dapps": true
41
+ },
42
+ "endowment:lifecycle-hooks": {},
43
+ "endowment:page-home": {}
44
+ },
45
+ "manifestVersion": "0.1"
46
+ }