A web application may also request Adena to create a signed transaction via the adena.SignTx method. Upon receiving the request, Adena will prompt the user to sign the transaction.
If the user proceeds to sign the transaction, Adena will return the encoded transaction data on the console.
Code
adena.SignTx({ messages: [ { type:"string", value: object },// you may add additional messages within the brackets... ], gasFee: number, gasWanted: number, memo?: string})
Params
Key
Type
Description
message.type
string
"/bank.MsgSend" for transfers
"/vm.m_call" for contract calls
"/vm.m_addpkg" for adding packages
"/vm.m_run" for simulating transactions
awaitadena.SignTx({ messages: [{ type:"/vm.m_addpkg", value: { creator:"g1ffzxha57dh0qgv9ma5v393ur0zexfvp6lsjpae",// your Adena address deposit:"1ugnot",// amount of ugnot to deposit in the package (enter a blank or an amount above 1 ugnot) package: { name:"hello",// package name path:"gno.land/r/demo/hello",// package path (cannot be a duplicate from existing paths on Gnoland) files: [ // a list of files to deploy { name:"hello.gno",// file name body: "package hello\n\nfunc Hello() string {\n\treturn \"Hello() called\"\n}\n\nfunc Render() string {\n\treturn \"Render() called\"\n}", //file contents
} ] } } }], gasFee:1, gasWanted:2000000});