File tree Expand file tree Collapse file tree 3 files changed +3
-9
lines changed Expand file tree Collapse file tree 3 files changed +3
-9
lines changed Original file line number Diff line number Diff line change 28
28
"truncate-eth-address" : " ^1.0.2"
29
29
},
30
30
"devDependencies" : {
31
- "@rollup/plugin-inject" : " ^5.0.5" ,
32
31
"@types/node" : " ^20.14.2" ,
33
32
"@types/react" : " ^18.2.66" ,
34
33
"@types/react-dom" : " ^18.2.22" ,
Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ import { hexlify, ethers } from "ethers";
19
19
import { ADD_SUB_CONTRACT } from "@/config/snap" ;
20
20
21
21
import { AbiCoder } from "ethers" ;
22
- import { Buffer } from "buffer" ;
23
22
24
23
const defaultMessage = [
25
24
< >
@@ -58,7 +57,9 @@ export const ChatBox = () => {
58
57
return ;
59
58
}
60
59
61
- const txData = hexlify ( Buffer . from ( inputMessage , "utf8" ) ) ;
60
+ const funcSelector = FunctionFragment . getSelector ( "do_it" , [ "string" ] ) ;
61
+ const encodedParams = abiCoder . encode ( [ "string" ] , [ inputMessage ] ) ;
62
+ const txData = hexlify ( concat ( [ funcSelector , encodedParams ] ) ) ;
62
63
63
64
const transactionDetails = {
64
65
payload : {
Original file line number Diff line number Diff line change 1
1
import { defineConfig } from 'vite'
2
2
import react from '@vitejs/plugin-react'
3
3
import path from 'path'
4
- import inject from "@rollup/plugin-inject" ;
5
4
// https://vitejs.dev/config/
6
5
export default defineConfig ( {
7
6
resolve : {
8
7
alias : {
9
8
"@" : path . resolve ( __dirname , "src" ) ,
10
9
} ,
11
10
} ,
12
- build : {
13
- rollupOptions : {
14
- plugins : [ inject ( { Buffer : [ 'Buffer' , 'Buffer' ] } ) ] ,
15
- } ,
16
- } ,
17
11
server : {
18
12
port : 8000
19
13
} ,
You can’t perform that action at this time.
0 commit comments