ENDLESS Sign And Submit Transaction
Sign Message Example
typescript
import { Web3Kit, ChainType } from "@web3jskit/dapp";
interface ISignMessageRes {
signature: string;
}
function signMessage(message: string, display?: "utf8" | "hex") {
const web3Kit = new Web3Kit();
const serRes = (await web3Kit.request({
chainType: ChainType.ENDLESS,
methodName: "signAndSubmitTransaction",
params: {
function,
functionArguments,
typeArguments
}
}));
}
Request Parameters
typescript
{
chainType: ChainType.ENDLESS,
methodName: "signAndSubmitTransaction",
params: {
function, //string, function name,such as 0x1::endless_account::transfer_coins
functionArguments, //Array<string>, function arguments,
typeArguments
},
}
Return Value
typescript
{
hash: "",
sender: "",
sequence_number: "",
max_gas_amount: "",
gas_unit_price: "",
expiration_timestamp_secs: "",
payload: {
function: "",
type_arguments: [],
arguments: [ "", "", "" ],
type: ""
},
signature: {
public_key: "",
signature: "",
type: ""
}
}