/ bin / drk / money.sql
money.sql
 1  -- Wallet definitions for this contract.
 2  -- We store data that is needed to be able to receive and send tokens.
 3  
 4  -- The keypairs in our wallet
 5  CREATE TABLE IF NOT EXISTS BZHKGQ26bzmBithTQYTJtjo2QdCqpkR9tjSBopT4yf4o_money_keys (
 6  	key_id INTEGER PRIMARY KEY NOT NULL,
 7  	is_default INTEGER NOT NULL,
 8  	public BLOB NOT NULL,
 9  	secret BLOB NOT NULL
10  );
11  
12  -- The coins we have the information to and can spend
13  CREATE TABLE IF NOT EXISTS BZHKGQ26bzmBithTQYTJtjo2QdCqpkR9tjSBopT4yf4o_money_coins (
14  	coin BLOB PRIMARY KEY NOT NULL,
15  	value BLOB NOT NULL,
16  	token_id BLOB NOT NULL,
17  	spend_hook BLOB NOT NULL,
18  	user_data BLOB NOT NULL,
19  	coin_blind BLOB NOT NULL,
20  	value_blind BLOB NOT NULL,
21  	token_blind BLOB NOT NULL,
22  	secret BLOB NOT NULL,
23  	leaf_position BLOB NOT NULL,
24  	memo BLOB,
25  	creation_height INTEGER NOT NULL,
26  	is_spent INTEGER NOT NULL,
27  	spent_height INTEGER,
28  	spent_tx_hash TEXT DEFAULT '-'
29  );
30  
31  -- Arbitrary tokens
32  CREATE TABLE IF NOT EXISTS BZHKGQ26bzmBithTQYTJtjo2QdCqpkR9tjSBopT4yf4o_money_tokens (
33  	token_id BLOB PRIMARY KEY NOT NULL,
34  	mint_authority BLOB NOT NULL,
35  	token_blind BLOB NOT NULL,
36  	is_frozen INTEGER NOT NULL,
37  	freeze_height INTEGER
38  );
39  
40  -- The token aliases in our wallet
41  CREATE TABLE IF NOT EXISTS BZHKGQ26bzmBithTQYTJtjo2QdCqpkR9tjSBopT4yf4o_money_aliases (
42  	alias BLOB PRIMARY KEY NOT NULL,
43  	token_id BLOB NOT NULL
44  );