Skip to content

Commit

Permalink
Add documentation about tricky runtime method search
Browse files Browse the repository at this point in the history
  • Loading branch information
csillag committed Jan 22, 2025
1 parent bdc4107 commit 2d15e22
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/app/components/RuntimeTransactionMethod/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,31 @@ export const getRuntimeTransactionMethodFilteringParam = (
case 'any':
return {}
case 'accounts.Transfer':
// Searching for transfers is tricky, because there are some
// transactions which are in fact evm.Calls, but are still
// considered to be transfers based on some heuristics.
// The Nexus API provides a special value in order to allow searching
// for them. Their documentation says:
//
// 'native_transfers': Returns transactions "likely to be native transfers".
// These include accounts.Transfer transactions and evm.Calls with an empty 'body' field.
//
// For more details, see the API spec at
// https://github.com/oasisprotocol/nexus/blob/main/api/spec/v1.yaml
return { method: 'native_transfers' }
case 'evm.Call':
// Searching for contract calls is tricky, because some of them
// should be classified as transfers. (See above.)
// The Nexus API provides a special value for excluding these
// from the search. Their documentation says:
//
// 'evm.Call_no_native': Returns EVM calls that are "not likely to be native transfers".
//
// For more details, see the API spec at
// https://github.com/oasisprotocol/nexus/blob/main/api/spec/v1.yaml
return { method: 'evm.Call_no_native' }
default:
// For other (normal) methods, we can simply pass on the wanted method name.
return { method }
}
}

0 comments on commit 2d15e22

Please sign in to comment.