money.sql 1.3 KB

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