SDK Implementation Guide
Wiskers App REST API Documentation
Overview
The Wiskers API facilitates interactions with the Wiskers platform, enabling users to manage actions, authenticate, and handle referrals. See Below for the implementation guide.
Base URL
https://beta.wiskers.app/api
Endpoints
Authentication
All requests to the Wiskers App API must be authenticated with a token. This token is obtained by signing in through the /auth/signin
endpoint and then used in subsequent requests.
Signing In and Token Generation
Endpoint:
/auth/signin
Method: POST
Description:
Authenticates the user and generates a token for session management.
signature has to be of this string
Wiskers login for {address}
, with address being replaced by the used address.
Body Parameters:
address
(String): The address of the user's account.signature
(String): Signature obtained from signing a the auth message..refCode
(String, optional): Referral code, if any.
Response:
success
(Boolean): Indicates if the request was successful.jwt
Token to auth all future requests.
Referral Management
Get Referral Stats
Endpoint:
/referrals/getReferralStats
Method: GET
Description: Retrieves statistics and codes related to the user's referrals.
Response:
success
(Boolean): Indicates if the request was successful.ownCode
(String): The user's own referral code.codes
(Array): List of referral codes.
Create Referral Code
Endpoint:
/referrals/createReferralCode
Method: POST
Body:
referralCode
(String): The referral code to create.
Response:
success
(Boolean): Indicates if the code was successfully created.reason
(String, optional): Reason for failure, if applicable.
Action Management
Delete Action
Endpoint:
/actions/deleteAction
Method: POST
Body:
actionHash
(String): The hash of the action to delete.
Response:
success
(Boolean): Indicates if the action was successfully deleted.reason
(String, optional): Reason for failure, if applicable.
Rename Action
Endpoint:
/actions/renameAction
Method: POST
Body:
actionHash
(String): The hash of the action to rename.newName
(String): The new name for the action.
Response:
success
(Boolean): Indicates if the action was successfully renamed.reason
(String, optional): Reason for failure, if applicable.
Set Action State
Endpoint:
/actions/setActionState
Method: POST
Body:
actionHash
(String): The hash of the action.state
(String): The new state of the action.
Response:
success
(Boolean): Indicates if the state was successfully changed.reason
(String, optional): Reason for failure, if applicable.
Reveal Webhook
Endpoint:
/actions/revealWebhook
Method: POST
Description: Reveals the webhook details for a given action.
Response:
success
(Boolean): Indicates if the webhook was successfully revealed.webhook
(String): The webhook URL.
Request Webhook Reveal
Endpoint:
/actions/requestWebhookReveal
Method: POST
Body:
actionHash
(String): The hash of the action.
Response:
success
(Boolean): Indicates if the request was successful.actionHash
(String): The hash of the action.nonce
(String): A nonce for additional security.
Update Action
Endpoint:
/actions/updateAction
Method: POST
Body:
actionHash
(String): The hash of the action.
Response:
success
(Boolean): Indicates if the action was successfully updated.
Create Action
Endpoint:
/actions/createAction
Method: POST
Description:
Creates a new action based on the provided parameters. The action details must adhere to the
IAction
interface structure.
Body Parameters:
action
(IAction
Object):A instance of
IAction
signature
(signature_t
Object):Signature object for verifying the action.
chainId
(Number/String):Identifier for the network.
type
(String):Type of the action (e.g., 'events', 'tradingview').
trigger
(ITrigger
Object):Details about the trigger for the action.
signature_t
:
_v
(BigInt):The recovery byte of the signature.
_r
(Hex):The first 32 bytes of the signature.
_s
(Hex):The second 32 bytes of the signature.
IAction
:
targetContract
(Address):The contract address the action targets.
nonce
(Number):A unique number to prevent replay attacks.
creator
(Address):The address of the action's creator.
assetIn
(Address):The asset address involved in the action.
amountIn
(BigInt):The amount of the asset involved.
runLimit
(BigInt):The run limit of the action.
payload
(Any):Additional payload relevant to the action.
ITrigger
:
method
(String):The method to be triggered, either "events" or "tradingview".
options
(ITriggerOptions
, optional):Additional options for the trigger.
ITriggerOptions
Interface:
contracts
(Address[]):Array of contract addresses involved in the trigger.
unconfirmed
(Boolean):Flag to include unconfirmed transactions.
topic
(String):Event topic, e.g., "Transfer(address,address,uint256)".
inputs
(Object[]):Array of objects representing arguments in the event, each with
indexed
,internalType
,name
, andtype
properties.
values
(Object):Object containing raw values for the inputs, e.g.,
{address: "0x...0"}
.
filter
(Object):Advanced filtering options using logical and comparison operators.
Chaining Filters:
and
Operator:Combines multiple filters where all conditions must be met.
Example:
{ "and": [ { "eq": ["value", "1000"] }, { "gt": ["amount", "500"] } ] }
or
Operator:Combines multiple filters where at least one condition must be met.
Example:
{ "or": [ { "lt": ["value", "1000"] }, { "in": ["address", ["0x123...", "0x456..."]] } ] }
Using Comparison Operators:
eq
(Equal): Checks if a value is equal to the specified value.Example:
{ "eq": ["value", "1000"] }
ne
(Not Equal): Checks if a value is not equal to the specified value.Example:
{ "ne": ["address", "0x...325"] }
lt
(Less Than): Checks if a value is less than the specified number.Example:
{ "lt": ["amount", "50"] }
gt
(Greater Than): Checks if a value is greater than the specified number.Example:
{ "gt": ["price", "500000"] }
lte
(Less Than or Equal): Checks if a value is less than or equal to the specified number.Example:
{ "lte": ["value", "100"] }
gte
(Greater Than or Equal): Checks if a value is greater than or equal to the specified number.Example:
{ "gte": ["value", "100"] }
For further details about applying filters, please check https://docs.moralis.io/streams-api/evm/streams-configuration/filter-streams
Example of ITriggerOptions
:
Payload Encoding:
For
uniswapv2
type actions:Encode with:
For
uniswapv3
type actions:Encode with:
Responses:
Success:
success
: truetype
: Type of the created action (if applicable).actionHash
: Hash of the created action (if applicable).trigger
: Details of the trigger for the created action (if applicable).webhook
: Webhook URL (if applicable for the action type).
Failure:
success
: falseerror
: Specific error message explaining the reason for failure.
Last updated