Starknet Raw Transaction
A general Starknet transaction is used mainly for invoking non-transfer transactions.
Fordefi can handle any Starknet multi-calls transaction.
To invoke a general transaction using the Fordefi platform, you need to provide the call_data
, which is a list of items. Each items contains:
to
: A contract address to callmethod_name
: The method name of the contract to callmethod_arguments
: A list of arguments to pass to the contract
The following example creates a swap transaction on Avnu. The request should be inside the body, as demonstrated here.
{
"signer_type": "api_signer",
"type": "starknet_transaction",
"details": {
"type": "starknet_contract_call",
"chain": "starknet_mainnet",
"call_data": [
{
"to": "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d",
"method_name": "approve",
"method_arguments": [
"0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f",
"0x5af3107a4000",
"0x0"
]
},
{
"to": "0x04270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f",
"method_name": "multi_route_swap",
"method_arguments": [
"0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d",
"0x5af3107a4000",
"0x0",
"0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
"0x35bed4708",
"0x0",
"0x357a09232",
"0x0",
"0x3f7b74b9a353bf26ae6019f813a87158dd9bcd6d421dd3982c14b8e4cd41ad8",
"0x0",
"0x0",
"0x3",
"0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d",
"0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8",
"0x5dd3d2f4429af886cd1a3b08289dbcea99a294197e9eb43b0e0325b4b",
"0xe8d4a51000",
"0x6",
"0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d",
"0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8",
"0x20c49ba5e353f80000000000000000",
"0x3e8",
"0x0",
"0x2d15ad541c0003c710b4004",
"0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8",
"0xc530f2c0aa4c16a0806365b0898499fba372e5df7a7172dc6fe9ba777e8007",
"0x49ff5b3a7d38e2b50198f408fa8281635b5bc81ee49ab87ac36c8324c214427",
"0xe8d4a51000",
"0x1",
"0x7f232e7857effe04f7351e9bb2f1ebc2589bacca3380ae84efcc22067c1436e",
"0xc530f2c0aa4c16a0806365b0898499fba372e5df7a7172dc6fe9ba777e8007",
"0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
"0x5dd3d2f4429af886cd1a3b08289dbcea99a294197e9eb43b0e0325b4b",
"0xe8d4a51000",
"0x6",
"0xc530f2c0aa4c16a0806365b0898499fba372e5df7a7172dc6fe9ba777e8007",
"0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
"0x28f5c28f5c28f5c28f5c28f5c28f5c2",
"0x4d5a",
"0x0",
"0x5776145eafffffd9f78cfd4aff"
]
}
]
},
"note": "Swapping STRK to ETH",
"vault_id": "8988893a-cf29-4a02-acc7-5bb723c74f47"
}