diff --git a/pkg/assets/default_assets.go b/pkg/assets/default_assets.go
index b8743ee9b..9f433de79 100644
--- a/pkg/assets/default_assets.go
+++ b/pkg/assets/default_assets.go
@@ -53,15 +53,30 @@ func (s *AssetsStore) InitDefault() error {
return err
}
- if _, err := os.Stat(defaultAssetsJSONPath); os.IsNotExist(err) {
- if err := s.createFileDefault(defaultAssetsJSONPath); err != nil {
+ // if the file does not exist, create the default assets JSON file
+ _, err = os.Stat(defaultAssetsJSONPath)
+ if os.IsNotExist(err) {
+ // Create the default assets JSON file
+ return s.createFileDefault(defaultAssetsJSONPath)
+ }
+
+ // if the file exists, read the content and compare it with the default assets
+ if err == nil {
+ // read the content of the default assets JSON file
+ content, err := os.ReadFile(defaultAssetsJSONPath)
+ if err != nil {
return err
}
- }
-
+ // if the content is different, overwrite the default assets JSON file
+ if string(content) != assetsJSON {
+ if err := s.createFileDefault(defaultAssetsJSONPath); err != nil {
+ return err
+ }
+ }
+ }
- return nil
+ return err
}
// getDefaultJSONPath returns the path to the default assets JSON file.
@@ -71,7 +86,14 @@ func getDefaultJSONPath(assetsJSONDir string) (string, error) {
// createFileDefault creates the default assets JSON file with the default assets.
func (s *AssetsStore) createFileDefault(path string) error {
- if err := os.WriteFile(path, []byte(`[
+ if err := os.WriteFile(path, []byte(assetsJSON), permissionUrwGrOr); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+const assetsJSON = `[
{
"address": "AS12k8viVmqPtRuXzCm6rKXjLgpQWqbuMjc37YHhB452KSUUb9FgL",
"name": "Sepolia USDC",
@@ -149,9 +171,4 @@ func (s *AssetsStore) createFileDefault(path string) error {
"decimals": 18,
"MEXCSymbol": "USD"
}
-]`), permissionUrwGrOr); err != nil {
- return err
- }
-
- return nil
-}
+]`
diff --git a/wails-frontend/package-lock.json b/wails-frontend/package-lock.json
index 561ff47de..2ce75be7f 100644
--- a/wails-frontend/package-lock.json
+++ b/wails-frontend/package-lock.json
@@ -1957,12 +1957,12 @@
}
},
"node_modules/@massalabs/massa-web3": {
- "version": "4.0.2-dev.20240410152026",
- "resolved": "https://registry.npmjs.org/@massalabs/massa-web3/-/massa-web3-4.0.2-dev.20240410152026.tgz",
- "integrity": "sha512-SGsXbxICvdwOnRThh2MSswvzA/k5OfrlJSujZBgNA2CoATXGBar11YcDEIgVttHRRqQSJG39EQcMOs3eRC0irA==",
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/@massalabs/massa-web3/-/massa-web3-4.0.3.tgz",
+ "integrity": "sha512-W1TtxMrTiqLfUgvIqO641M/2do6Z2Kvvq44JYhiUbteXI5S+VvCJ+HaRtIZ23r9k2wTSlSikE6j6U5bkKDMABA==",
"dependencies": {
"@massalabs/wallet-provider": "^2.0.0",
- "@massalabs/web3-utils": "^1.4.9",
+ "@massalabs/web3-utils": "^1.4.11",
"@noble/ed25519": "^1.7.3",
"@noble/hashes": "^1.2.0",
"@types/ws": "^8.5.4",
@@ -2022,14 +2022,13 @@
}
},
"node_modules/@massalabs/react-ui-kit": {
- "version": "0.0.5-dev.20240517003813",
- "resolved": "https://registry.npmjs.org/@massalabs/react-ui-kit/-/react-ui-kit-0.0.5-dev.20240517003813.tgz",
- "integrity": "sha512-i0KfrxIBsF6qe4z4nTjAu/qrsFsut1/Bv3XIdPUsgpDvhG9hAONg2gIEbHbjDm3sNa66Bn+/NnEVzf4EUr33Sg==",
+ "version": "0.0.5-dev.20240531154425",
+ "resolved": "https://registry.npmjs.org/@massalabs/react-ui-kit/-/react-ui-kit-0.0.5-dev.20240531154425.tgz",
+ "integrity": "sha512-SGvMCN88fmcrz2ZprYtNGs2QrDqOU3kgFoduU9zcZc2GwnNslxKW2U8qC7X3ee0HaRs68RQZ3fy/NcjYQ/xs9Q==",
"dependencies": {
"@headlessui/react": "^1.7.15",
"copy-to-clipboard": "^3.3.3",
"currency.js": "^2.0.4",
- "dot-object": "^2.1.5",
"minidenticons": "^4.2.1",
"react": "^18.2.0",
"react-currency-input-field": "^3.6.11",
@@ -2043,8 +2042,10 @@
"zustand": "^4.5.2"
},
"peerDependencies": {
- "@massalabs/massa-web3": "^4.0.2-dev",
- "@massalabs/wallet-provider": "^2.0.1-dev"
+ "@massalabs/massa-web3": "^4.0.3-dev",
+ "@massalabs/wallet-provider": "^2.0.1-dev",
+ "@types/dot-object": "^2.1.6",
+ "dot-object": "^2.1.5"
}
},
"node_modules/@massalabs/react-ui-kit/node_modules/abitype": {
@@ -2129,9 +2130,9 @@
}
},
"node_modules/@massalabs/web3-utils": {
- "version": "1.4.9",
- "resolved": "https://registry.npmjs.org/@massalabs/web3-utils/-/web3-utils-1.4.9.tgz",
- "integrity": "sha512-8G91gs6HqpPpR860QDUOzugr81WJTGkBgXQS1gq/oXqt16fPkw2xlsq4c2CFHDjRF9/ftE/JaybiNZ4ilcbEyg==",
+ "version": "1.4.11",
+ "resolved": "https://registry.npmjs.org/@massalabs/web3-utils/-/web3-utils-1.4.11.tgz",
+ "integrity": "sha512-9iUoSc9OZxrvx8UbDor934z0cetenEU3PlDqTa9Hsh3EuZJ9jalcEU8Q9Z+hjLn2S9Ojmqu2ldcOAxVzYeNCbw==",
"dependencies": {
"bignumber.js": "^9.1.2",
"buffer": "^6.0.3",
@@ -3008,10 +3009,9 @@
}
},
"node_modules/@types/dot-object": {
- "version": "2.1.2",
- "resolved": "https://registry.npmjs.org/@types/dot-object/-/dot-object-2.1.2.tgz",
- "integrity": "sha512-mARrpJofLNe6yhlukeBcznBe8ssZo5ZJ/CJWc3JKmG9L9151s0OHK+mealnkqSgO6cSn1219vND2wgL67Cuqiw==",
- "dev": true
+ "version": "2.1.6",
+ "resolved": "https://registry.npmjs.org/@types/dot-object/-/dot-object-2.1.6.tgz",
+ "integrity": "sha512-G1e4SNPOuO72ZXv7wz/W2x29CzQtpxko3G9hBiHqGg/AvFIKoArCs2nbc/WPXnnUkO+1dmvX9WQCyj5gIlAzZg=="
},
"node_modules/@types/estree": {
"version": "1.0.1",
diff --git a/web-frontend/package-lock.json b/web-frontend/package-lock.json
index e6e77d2c3..869a0c0f8 100644
--- a/web-frontend/package-lock.json
+++ b/web-frontend/package-lock.json
@@ -3280,12 +3280,12 @@
}
},
"node_modules/@massalabs/massa-web3": {
- "version": "4.0.2-dev.20240410152026",
- "resolved": "https://registry.npmjs.org/@massalabs/massa-web3/-/massa-web3-4.0.2-dev.20240410152026.tgz",
- "integrity": "sha512-SGsXbxICvdwOnRThh2MSswvzA/k5OfrlJSujZBgNA2CoATXGBar11YcDEIgVttHRRqQSJG39EQcMOs3eRC0irA==",
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/@massalabs/massa-web3/-/massa-web3-4.0.3.tgz",
+ "integrity": "sha512-W1TtxMrTiqLfUgvIqO641M/2do6Z2Kvvq44JYhiUbteXI5S+VvCJ+HaRtIZ23r9k2wTSlSikE6j6U5bkKDMABA==",
"dependencies": {
"@massalabs/wallet-provider": "^2.0.0",
- "@massalabs/web3-utils": "^1.4.9",
+ "@massalabs/web3-utils": "^1.4.11",
"@noble/ed25519": "^1.7.3",
"@noble/hashes": "^1.2.0",
"@types/ws": "^8.5.4",
@@ -3353,14 +3353,13 @@
}
},
"node_modules/@massalabs/react-ui-kit": {
- "version": "0.0.5-dev.20240522140200",
- "resolved": "https://registry.npmjs.org/@massalabs/react-ui-kit/-/react-ui-kit-0.0.5-dev.20240522140200.tgz",
- "integrity": "sha512-NQF2P4nOMiWxzHhxkxb8hbIGjcG3xiXLlvTSFSAICWBvRl6BI3q69jrazjD33de6bwHF3C6B3/xUyoKFDvPV1A==",
+ "version": "0.0.5-dev.20240531154425",
+ "resolved": "https://registry.npmjs.org/@massalabs/react-ui-kit/-/react-ui-kit-0.0.5-dev.20240531154425.tgz",
+ "integrity": "sha512-SGvMCN88fmcrz2ZprYtNGs2QrDqOU3kgFoduU9zcZc2GwnNslxKW2U8qC7X3ee0HaRs68RQZ3fy/NcjYQ/xs9Q==",
"dependencies": {
"@headlessui/react": "^1.7.15",
"copy-to-clipboard": "^3.3.3",
"currency.js": "^2.0.4",
- "dot-object": "^2.1.5",
"minidenticons": "^4.2.1",
"react": "^18.2.0",
"react-currency-input-field": "^3.6.11",
@@ -3374,8 +3373,10 @@
"zustand": "^4.5.2"
},
"peerDependencies": {
- "@massalabs/massa-web3": "^4.0.2-dev",
- "@massalabs/wallet-provider": "^2.0.1-dev"
+ "@massalabs/massa-web3": "^4.0.3-dev",
+ "@massalabs/wallet-provider": "^2.0.1-dev",
+ "@types/dot-object": "^2.1.6",
+ "dot-object": "^2.1.5"
}
},
"node_modules/@massalabs/wallet-provider": {
@@ -3406,9 +3407,9 @@
}
},
"node_modules/@massalabs/web3-utils": {
- "version": "1.4.9",
- "resolved": "https://registry.npmjs.org/@massalabs/web3-utils/-/web3-utils-1.4.9.tgz",
- "integrity": "sha512-8G91gs6HqpPpR860QDUOzugr81WJTGkBgXQS1gq/oXqt16fPkw2xlsq4c2CFHDjRF9/ftE/JaybiNZ4ilcbEyg==",
+ "version": "1.4.11",
+ "resolved": "https://registry.npmjs.org/@massalabs/web3-utils/-/web3-utils-1.4.11.tgz",
+ "integrity": "sha512-9iUoSc9OZxrvx8UbDor934z0cetenEU3PlDqTa9Hsh3EuZJ9jalcEU8Q9Z+hjLn2S9Ojmqu2ldcOAxVzYeNCbw==",
"dependencies": {
"bignumber.js": "^9.1.2",
"buffer": "^6.0.3",
@@ -4053,10 +4054,9 @@
}
},
"node_modules/@types/dot-object": {
- "version": "2.1.2",
- "resolved": "https://registry.npmjs.org/@types/dot-object/-/dot-object-2.1.2.tgz",
- "integrity": "sha512-mARrpJofLNe6yhlukeBcznBe8ssZo5ZJ/CJWc3JKmG9L9151s0OHK+mealnkqSgO6cSn1219vND2wgL67Cuqiw==",
- "dev": true
+ "version": "2.1.6",
+ "resolved": "https://registry.npmjs.org/@types/dot-object/-/dot-object-2.1.6.tgz",
+ "integrity": "sha512-G1e4SNPOuO72ZXv7wz/W2x29CzQtpxko3G9hBiHqGg/AvFIKoArCs2nbc/WPXnnUkO+1dmvX9WQCyj5gIlAzZg=="
},
"node_modules/@types/eslint": {
"version": "8.37.0",
diff --git a/web-frontend/src/custom/smart-contract/useFTTransfer.tsx b/web-frontend/src/custom/smart-contract/useFTTransfer.tsx
index 555bf44c1..a39dde7da 100644
--- a/web-frontend/src/custom/smart-contract/useFTTransfer.tsx
+++ b/web-frontend/src/custom/smart-contract/useFTTransfer.tsx
@@ -206,7 +206,10 @@ function useWriteSmartContract(client?: Client, isMainnet?: boolean) {
/>
));
- logSmartContractEvents(client, operationId);
+ logSmartContractEvents(
+ client as unknown as import('/Users/nathanmassa/dev/Ui-Kit/node_modules/@massalabs/massa-web3/dist/esm/web3/Client').Client,
+ operationId,
+ );
} else {
toast.error((t) => (