CREATE TABLE IF NOT EXISTS msg_topup_req (
	chain TEXT,
	symbol TEXT,
	timestamp INTEGER,
    to_addr TEXT,
	PRIMARY KEY(to_addr)
);

CREATE TABLE IF NOT EXISTS msg_withdraw_req (
	queueId TEXT,
	chain TEXT,
	symbol TEXT,
	timestamp INTEGER,
	from_addr TEXT,
	to_addr TEXT,
	amount NUMERIC,
	PRIMARY KEY(queueId)
);

CREATE TABLE IF NOT EXISTS msg_pay_req (
	queueId TEXT,
	chain TEXT,
	symbol TEXT,
	timestamp INTEGER,
	from_addr TEXT,
	to_addr TEXT,
	amount NUMERIC,
	orderId TEXT,
	PRIMARY KEY(queueId)
);

CREATE TABLE IF NOT EXISTS msg_topup_resp (
	id INTEGER PRIMARY KEY AUTOINCREMENT,
	chain TEXT,
	symbol TEXT,
	timestamp INTEGER,
	to_addr TEXT,
	amount NUMERIC,
	height INTEGER,
	TxHash TEXT,
    status INTEGER
);

CREATE TABLE IF NOT EXISTS msg_withdraw_resp (
	id INTEGER PRIMARY KEY AUTOINCREMENT,
	queueId TEXT,
	chain TEXT,
	symbol TEXT,
	timestamp INTEGER,
	from_addr TEXT,
	to_addr TEXT,
	amount NUMERIC,
	height INTEGER,
	txHash TEXT,
    status INTEGER
);

CREATE TABLE IF NOT EXISTS msg_pay_resp (
	id INTEGER PRIMARY KEY AUTOINCREMENT,
	queueId TEXT,
	chain TEXT,
	symbol TEXT,
	timestamp INTEGER,
	from_addr TEXT,
	to_addr TEXT,
	amount NUMERIC,
	height INTEGER,
	txHash TEXT,
    orderId TEXT,
    status INTEGER
);