Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

strategy:
matrix:
node-version: [16.x, 20.x]
node-version: [18.x, 20.x]

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:

strategy:
matrix:
node-version: [16.x, 20.x]
node-version: [18.x, 20.x]

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -102,9 +102,10 @@ jobs:
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
run: yarn install

- run: npm i -g @transia/hooks-cli
- run: npm i -g @xahau/hooks-cli
- run: yarn run build
- run: hooks-cli compile-c contracts-c build
- run: hooks-cli compile-c contracts-c/toolbox build
- run: hooks-cli compile-c contracts-c/txns build
- run: yarn run test:integration-c
env:
HOOKS_COMPILE_HOST: https://hook-buildbox.xrpl.org
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Here is an example of setting a hook using the `setHooksV3` function:
```ts
import {
SetHookFlags
} from '@transia/xrpl'
} from 'xahau'
import {
setHooksV3,
createHookPayload,
Expand Down Expand Up @@ -99,7 +99,7 @@ Here is an example of deleting a single hook for the hook in position 2 using th
```ts
import {
SetHookFlags
} from '@transia/xrpl'
} from 'xahau'
import {
SetHookParams,
createHookPayload,
Expand Down Expand Up @@ -416,7 +416,7 @@ The `getHookExecutionsFromMeta` function is used to retrieve hook executions fro
Here is an example of using the `getHookExecutionsFromMeta` function:

```ts
import { TransactionMetadata } from '@transia/xrpl'
import { TransactionMetadata } from 'xahau'
import {
serverUrl,
setupClient,
Expand Down Expand Up @@ -473,7 +473,7 @@ The `getHookEmittedTxsFromMeta` function is used to retrieve hook emitted transa
Here is an example of using the `getHookEmittedTxsFromMeta` function:

```ts
import { TransactionMetadata } from '@transia/xrpl'
import { TransactionMetadata } from 'xahau'
import {
serverUrl,
setupClient,
Expand Down
3 changes: 0 additions & 3 deletions contracts-c/toolbox/base.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/**
*
*/
#include "hookapi.h"

int64_t hook(uint32_t reserved) {
Expand Down
51 changes: 51 additions & 0 deletions contracts-c/utils/hook/error.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// For documentation please see: https://xrpl-hooks.readme.io/reference/
// Generated using generate_error.sh
#ifndef HOOK_ERROR_CODES
#define SUCCESS 0
#define OUT_OF_BOUNDS -1
#define INTERNAL_ERROR -2
#define TOO_BIG -3
#define TOO_SMALL -4
#define DOESNT_EXIST -5
#define NO_FREE_SLOTS -6
#define INVALID_ARGUMENT -7
#define ALREADY_SET -8
#define PREREQUISITE_NOT_MET -9
#define FEE_TOO_LARGE -10
#define EMISSION_FAILURE -11
#define TOO_MANY_NONCES -12
#define TOO_MANY_EMITTED_TXN -13
#define NOT_IMPLEMENTED -14
#define INVALID_ACCOUNT -15
#define GUARD_VIOLATION -16
#define INVALID_FIELD -17
#define PARSE_ERROR -18
#define RC_ROLLBACK -19
#define RC_ACCEPT -20
#define NO_SUCH_KEYLET -21
#define NOT_AN_ARRAY -22
#define NOT_AN_OBJECT -23
#define INVALID_FLOAT -10024
#define DIVISION_BY_ZERO -25
#define MANTISSA_OVERSIZED -26
#define MANTISSA_UNDERSIZED -27
#define EXPONENT_OVERSIZED -28
#define EXPONENT_UNDERSIZED -29
#define XFL_OVERFLOW -30
#define NOT_IOU_AMOUNT -31
#define NOT_AN_AMOUNT -32
#define CANT_RETURN_NEGATIVE -33
#define NOT_AUTHORIZED -34
#define PREVIOUS_FAILURE_PREVENTS_RETRY -35
#define TOO_MANY_PARAMS -36
#define INVALID_TXN -37
#define RESERVE_INSUFFICIENT -38
#define COMPLEX_NOT_SUPPORTED -39
#define DOES_NOT_MATCH -40
#define INVALID_KEY -41
#define NOT_A_STRING -42
#define MEM_OVERLAP -43
#define TOO_MANY_STATE_MODIFICATIONS -44
#define TOO_MANY_NAMESPACES -45
#define HOOK_ERROR_CODES
#endif //HOOK_ERROR_CODES
Loading
Loading