Search
Search

Transaction: 6KFdu3F...awfD

Status
Succeeded
Transaction Fee
0.00035 
Deposit Value
0 
Gas Used
3 Tgas
Attached Gas
200 Tgas
Created
June 26, 2024 at 5:19:22pm
Hash
6KFdu3Fps1oAxb8bBowZzWYHJRcY1zK37F9T7K8NawfD

Actions

Called method: 'register' in contract: query…tform.near
Arguments:
{ "function_name": "sample_pool", "code": "\n function base64decode(encodedValue) {\n let buff = Buffer.from(encodedValue, \"base64\");\n return JSON.parse(buff.toString(\"utf-8\"));\n }\n\n async function extractData(block) {\n const results = [];\n try {\n const actions = block.actions();\n actions\n .filter(\n (action) =>\n action.receiverId.endsWith(\".pool.near\") ||\n action.receiverId.endsWith(\".poolv1.near\")\n )\n .flatMap((action) =>\n action.operations\n .filter(\n (op) =>\n op.Stake ||\n (op.FunctionCall &&\n (op.FunctionCall.methodName === \"deposit\" ||\n op.FunctionCall.methodName === \"withdraw\"))\n )\n .map((op) => {\n if (op.FunctionCall) {\n try {\n op.FunctionCall.args = base64decode(op.FunctionCall.args);\n } catch (error) {\n console.log(\n \"Failed to decode function call args\",\n op.FunctionCall,\n error\n );\n }\n }\n return { action, operation: op };\n })\n )\n .forEach((result) => results.push(result));\n } catch (error) {\n console.error(\"Error extracting data:\", error);\n }\n\n return results;\n }\n\n try {\n const results = await extractData(block);\n const validators = results\n .filter((result) => result.operation.Stake)\n .map((result) => ({\n public_key: result.operation.Stake.publicKey,\n stake: result.operation.Stake.stake,\n }));\n\n const deposits = results\n .filter(\n (result) =>\n result.operation.FunctionCall &&\n result.operation.FunctionCall.methodName === \"deposit\"\n )\n .map((result) => ({\n receipt_id: result.action.receiptId,\n predecessor_id: result.action.predecessorId,\n receiver_id: result.action.receiverId,\n signer_id: result.action.signerId,\n signer_public_key: result.action.signerPublicKey,\n }));\n\n const withdrawals = results\n .filter(\n (result) =>\n result.operation.FunctionCall &&\n result.operation.FunctionCall.methodName === \"withdraw\"\n )\n .map((result) => ({\n receipt_id: result.action.receiptId,\n predecessor_id: result.action.predecessorId,\n receiver_id: result.action.receiverId,\n signer_id: result.action.signerId,\n signer_public_key: result.action.signerPublicKey,\n }));\n\n const accounts = results\n .filter((result) => result.operation.Stake)\n .map((result) => ({\n account_id: result.action.signerId,\n staked_balance: result.operation.Stake.stake,\n }));\n\n const receipts = results.map((result) => ({\n receipt_id: result.action.receiptId,\n predecessor_id: result.action.predecessorId,\n receiver_id: result.action.receiverId,\n signer_id: result.action.signerId,\n signer_public_key: result.action.signerPublicKey,\n }));\n\n const functionCalls = results\n .filter((result) => result.operation.FunctionCall)\n .map((result) => ({\n receipt_id: result.action.receiptId,\n predecessor_id: result.action.predecessorId,\n receiver_id: result.action.receiverId,\n signer_id: result.action.signerId,\n signer_public_key: result.action.signerPublicKey,\n }));\n\n const operations = results\n .filter((result) => result.operation.Stake)\n .map((result) => ({\n receipt_id: result.action.receiptId,\n public_key: result.operation.Stake.publicKey,\n stake: result.operation.Stake.stake,\n }));\n\n try {\n await context.db.Validators.upsert(validators, [\"public_key\"], [\"stake\"]);\n await context.db.Deposits.upsert(\n deposits,\n [\"receipt_id\"],\n [\"predecessor_id\", \"receiver_id\", \"signer_id\", \"signer_public_key\"]\n );\n await context.db.Withdrawals.upsert(\n withdrawals,\n [\"receipt_id\"],\n [\"predecessor_id\", \"receiver_id\", \"signer_id\", \"signer_public_key\"]\n );\n await context.db.Accounts.upsert(\n accounts,\n [\"account_id\"],\n [\"staked_balance\"]\n );\n await context.db.Receipts.upsert(\n receipts,\n [\"receipt_id\"],\n [\"predecessor_id\", \"receiver_id\", \"signer_id\", \"signer_public_key\"]\n );\n await context.db.FunctionCalls.upsert(\n functionCalls,\n [\"receipt_id\"],\n [\"predecessor_id\", \"receiver_id\", \"signer_id\", \"signer_public_key\"]\n );\n await context.db.Operations.upsert(\n operations,\n [\"receipt_id\", \"public_key\"],\n [\"stake\"]\n );\n console.log(\"Data upserted successfully\");\n } catch (error) {\n console.error(\"Error upserting data:\", error);\n }\n } catch (error) {\n console.error(\"Error calling extractData:\", error);\n }\n", "schema": "CREATE TABLE\n validators (\n id SERIAL PRIMARY KEY,\n public_key VARCHAR NOT NULL,\n stake VARCHAR NOT NULL\n );\n\nCREATE TABLE\n deposits (\n receipt_id VARCHAR PRIMARY KEY,\n predecessor_id VARCHAR NOT NULL,\n receiver_id VARCHAR NOT NULL,\n signer_id VARCHAR NOT NULL,\n signer_public_key VARCHAR NOT NULL\n );\n\nCREATE TABLE\n withdrawals (\n receipt_id VARCHAR PRIMARY KEY,\n predecessor_id VARCHAR NOT NULL,\n receiver_id VARCHAR NOT NULL,\n signer_id VARCHAR NOT NULL,\n signer_public_key VARCHAR NOT NULL\n );\n\nCREATE TABLE\n accounts (\n account_id VARCHAR PRIMARY KEY,\n staked_balance VARCHAR NOT NULL\n );\n\nCREATE TABLE\n receipts (\n receipt_id VARCHAR PRIMARY KEY,\n predecessor_id VARCHAR NOT NULL,\n receiver_id VARCHAR NOT NULL,\n signer_id VARCHAR NOT NULL,\n signer_public_key VARCHAR NOT NULL\n );\n\nCREATE TABLE\n function_calls (\n receipt_id VARCHAR PRIMARY KEY,\n predecessor_id VARCHAR NOT NULL,\n receiver_id VARCHAR NOT NULL,\n signer_id VARCHAR NOT NULL,\n signer_public_key VARCHAR NOT NULL\n );\n\nCREATE TABLE\n operations (\n id SERIAL PRIMARY KEY,\n receipt_id VARCHAR NOT NULL REFERENCES receipts (receipt_id),\n public_key VARCHAR NOT NULL,\n stake VARCHAR NOT NULL\n );\n", "start_block": "LATEST", "rule": { "kind": "ACTION_ANY", "affected_account_id": "social.near", "status": "SUCCESS" } }

Transaction Execution Plan

Convert Transaction To Receipt
Gas Burned:
322 Ggas
Tokens Burned:
0.00003 
Receipt:
Predecessor ID:
Receiver ID:
Gas Burned:
3 Tgas
Tokens Burned:
0.00032 
Called method: 'register' in contract: query…tform.near
Arguments:
{ "function_name": "sample_pool", "code": "\n function base64decode(encodedValue) {\n let buff = Buffer.from(encodedValue, \"base64\");\n return JSON.parse(buff.toString(\"utf-8\"));\n }\n\n async function extractData(block) {\n const results = [];\n try {\n const actions = block.actions();\n actions\n .filter(\n (action) =>\n action.receiverId.endsWith(\".pool.near\") ||\n action.receiverId.endsWith(\".poolv1.near\")\n )\n .flatMap((action) =>\n action.operations\n .filter(\n (op) =>\n op.Stake ||\n (op.FunctionCall &&\n (op.FunctionCall.methodName === \"deposit\" ||\n op.FunctionCall.methodName === \"withdraw\"))\n )\n .map((op) => {\n if (op.FunctionCall) {\n try {\n op.FunctionCall.args = base64decode(op.FunctionCall.args);\n } catch (error) {\n console.log(\n \"Failed to decode function call args\",\n op.FunctionCall,\n error\n );\n }\n }\n return { action, operation: op };\n })\n )\n .forEach((result) => results.push(result));\n } catch (error) {\n console.error(\"Error extracting data:\", error);\n }\n\n return results;\n }\n\n try {\n const results = await extractData(block);\n const validators = results\n .filter((result) => result.operation.Stake)\n .map((result) => ({\n public_key: result.operation.Stake.publicKey,\n stake: result.operation.Stake.stake,\n }));\n\n const deposits = results\n .filter(\n (result) =>\n result.operation.FunctionCall &&\n result.operation.FunctionCall.methodName === \"deposit\"\n )\n .map((result) => ({\n receipt_id: result.action.receiptId,\n predecessor_id: result.action.predecessorId,\n receiver_id: result.action.receiverId,\n signer_id: result.action.signerId,\n signer_public_key: result.action.signerPublicKey,\n }));\n\n const withdrawals = results\n .filter(\n (result) =>\n result.operation.FunctionCall &&\n result.operation.FunctionCall.methodName === \"withdraw\"\n )\n .map((result) => ({\n receipt_id: result.action.receiptId,\n predecessor_id: result.action.predecessorId,\n receiver_id: result.action.receiverId,\n signer_id: result.action.signerId,\n signer_public_key: result.action.signerPublicKey,\n }));\n\n const accounts = results\n .filter((result) => result.operation.Stake)\n .map((result) => ({\n account_id: result.action.signerId,\n staked_balance: result.operation.Stake.stake,\n }));\n\n const receipts = results.map((result) => ({\n receipt_id: result.action.receiptId,\n predecessor_id: result.action.predecessorId,\n receiver_id: result.action.receiverId,\n signer_id: result.action.signerId,\n signer_public_key: result.action.signerPublicKey,\n }));\n\n const functionCalls = results\n .filter((result) => result.operation.FunctionCall)\n .map((result) => ({\n receipt_id: result.action.receiptId,\n predecessor_id: result.action.predecessorId,\n receiver_id: result.action.receiverId,\n signer_id: result.action.signerId,\n signer_public_key: result.action.signerPublicKey,\n }));\n\n const operations = results\n .filter((result) => result.operation.Stake)\n .map((result) => ({\n receipt_id: result.action.receiptId,\n public_key: result.operation.Stake.publicKey,\n stake: result.operation.Stake.stake,\n }));\n\n try {\n await context.db.Validators.upsert(validators, [\"public_key\"], [\"stake\"]);\n await context.db.Deposits.upsert(\n deposits,\n [\"receipt_id\"],\n [\"predecessor_id\", \"receiver_id\", \"signer_id\", \"signer_public_key\"]\n );\n await context.db.Withdrawals.upsert(\n withdrawals,\n [\"receipt_id\"],\n [\"predecessor_id\", \"receiver_id\", \"signer_id\", \"signer_public_key\"]\n );\n await context.db.Accounts.upsert(\n accounts,\n [\"account_id\"],\n [\"staked_balance\"]\n );\n await context.db.Receipts.upsert(\n receipts,\n [\"receipt_id\"],\n [\"predecessor_id\", \"receiver_id\", \"signer_id\", \"signer_public_key\"]\n );\n await context.db.FunctionCalls.upsert(\n functionCalls,\n [\"receipt_id\"],\n [\"predecessor_id\", \"receiver_id\", \"signer_id\", \"signer_public_key\"]\n );\n await context.db.Operations.upsert(\n operations,\n [\"receipt_id\", \"public_key\"],\n [\"stake\"]\n );\n console.log(\"Data upserted successfully\");\n } catch (error) {\n console.error(\"Error upserting data:\", error);\n }\n } catch (error) {\n console.error(\"Error calling extractData:\", error);\n }\n", "schema": "CREATE TABLE\n validators (\n id SERIAL PRIMARY KEY,\n public_key VARCHAR NOT NULL,\n stake VARCHAR NOT NULL\n );\n\nCREATE TABLE\n deposits (\n receipt_id VARCHAR PRIMARY KEY,\n predecessor_id VARCHAR NOT NULL,\n receiver_id VARCHAR NOT NULL,\n signer_id VARCHAR NOT NULL,\n signer_public_key VARCHAR NOT NULL\n );\n\nCREATE TABLE\n withdrawals (\n receipt_id VARCHAR PRIMARY KEY,\n predecessor_id VARCHAR NOT NULL,\n receiver_id VARCHAR NOT NULL,\n signer_id VARCHAR NOT NULL,\n signer_public_key VARCHAR NOT NULL\n );\n\nCREATE TABLE\n accounts (\n account_id VARCHAR PRIMARY KEY,\n staked_balance VARCHAR NOT NULL\n );\n\nCREATE TABLE\n receipts (\n receipt_id VARCHAR PRIMARY KEY,\n predecessor_id VARCHAR NOT NULL,\n receiver_id VARCHAR NOT NULL,\n signer_id VARCHAR NOT NULL,\n signer_public_key VARCHAR NOT NULL\n );\n\nCREATE TABLE\n function_calls (\n receipt_id VARCHAR PRIMARY KEY,\n predecessor_id VARCHAR NOT NULL,\n receiver_id VARCHAR NOT NULL,\n signer_id VARCHAR NOT NULL,\n signer_public_key VARCHAR NOT NULL\n );\n\nCREATE TABLE\n operations (\n id SERIAL PRIMARY KEY,\n receipt_id VARCHAR NOT NULL REFERENCES receipts (receipt_id),\n public_key VARCHAR NOT NULL,\n stake VARCHAR NOT NULL\n );\n", "start_block": "LATEST", "rule": { "kind": "ACTION_ANY", "affected_account_id": "social.near", "status": "SUCCESS" } }
Empty result
Registering function sample_pool for account spencerpark.near
Receipt:
Predecessor ID:
Receiver ID:
Gas Burned:
223 Ggas
Tokens Burned:
0 
Transferred 0.06921  to spencerpark.near
Empty result
No logs