diff --git a/internal/migrations/erc20-bridge/000-extension.sql b/internal/migrations/erc20-bridge/000-extension.sql new file mode 100644 index 000000000..3e4f82127 --- /dev/null +++ b/internal/migrations/erc20-bridge/000-extension.sql @@ -0,0 +1,5 @@ +-- Only necessary to run on leader and validator nodes. +USE erc20_bridge { + chain: 'sepolia', + escrow: '0x1c6D0d1666E3Ea3896c0A94018B03Ca117C15762', +} AS sepolia_bridge; \ No newline at end of file diff --git a/internal/migrations/erc20-bridge/001-actions.sql b/internal/migrations/erc20-bridge/001-actions.sql new file mode 100644 index 000000000..b80d1313f --- /dev/null +++ b/internal/migrations/erc20-bridge/001-actions.sql @@ -0,0 +1,11 @@ +-- TESTNET +CREATE OR REPLACE ACTION sepolia_wallet_balance($wallet_address TEXT) PUBLIC VIEW RETURNS (balance NUMERIC(78, 0)) { + $balance := sepolia_bridge.balance($wallet_address); + return $balance; +}; + +-- MAINNET +CREATE OR REPLACE ACTION mainnet_wallet_balance($wallet_address TEXT) PUBLIC VIEW RETURNS (balance NUMERIC(78, 0)) { + $balance := mainnet_bridge.balance($wallet_address); + return $balance; +}; \ No newline at end of file