Skip to content

Commit

Permalink
core: actions: getTaskQueuePaused action
Browse files Browse the repository at this point in the history
  • Loading branch information
akirillo committed Jan 20, 2025
1 parent bedc613 commit dca2653
Show file tree
Hide file tree
Showing 12 changed files with 77 additions and 22 deletions.
6 changes: 6 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @renegade-fi/core

## 0.4.19

### Patch Changes

- add getTaskQueuePaused action

## 0.4.18

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@renegade-fi/core",
"description": "VanillaJS library for Renegade",
"version": "0.4.18",
"version": "0.4.19",
"repository": {
"type": "git",
"url": "https://github.com/renegade-fi/typescript-sdk.git",
Expand Down
20 changes: 20 additions & 0 deletions packages/core/src/actions/getTaskQueuePaused.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { getWalletId } from './getWalletId.js'

import { getRelayerWithAuth } from '../utils/http.js'

import { GET_TASK_QUEUE_PAUSED_ROUTE } from '../constants.js'
import type { RenegadeConfig } from '../createConfig.js'

export type GetTaskQueuePausedReturnType = boolean

export async function getTaskQueuePaused(
config: RenegadeConfig,
): Promise<GetTaskQueuePausedReturnType> {
const { getBaseUrl } = config
const walletId = getWalletId(config)
const res = await getRelayerWithAuth(
config,
getBaseUrl(GET_TASK_QUEUE_PAUSED_ROUTE(walletId)),
)
return res.is_paused
}
3 changes: 3 additions & 0 deletions packages/core/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ export const GET_TASK_STATUS_ROUTE = (task_id: string) => `/tasks/${task_id}`
// Get the task queue of a given wallet
export const GET_TASK_QUEUE_ROUTE = (wallet_id: string) =>
`/task_queue/${wallet_id}`
// Get whether the task queue of a given wallet is paused
export const GET_TASK_QUEUE_PAUSED_ROUTE = (wallet_id: string) =>
`/task_queue/${wallet_id}/is_paused`
/// The route to fetch task history for a wallet
export const TASK_HISTORY_ROUTE = (wallet_id: string) =>
`/wallet/${wallet_id}/task-history`
Expand Down
5 changes: 5 additions & 0 deletions packages/core/src/exports/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ export {
getTaskQueue,
} from '../actions/getTaskQueue.js'

export {
type GetTaskQueuePausedReturnType,
getTaskQueuePaused,
} from '../actions/getTaskQueuePaused.js'

export {
type GetWalletFromRelayerParameters,
type GetWalletFromRelayerReturnType,
Expand Down
36 changes: 18 additions & 18 deletions packages/core/src/utils.d.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@
/* tslint:disable */
/* eslint-disable */
/**
* @param {Function} sign_message
* @returns {Promise<any>}
*/
export function generate_wallet_secrets(sign_message: Function): Promise<any>;
/**
* @param {string} path
* @param {any} headers
* @param {string} body
* @param {string} key
* @returns {string}
*/
export function create_request_signature(path: string, headers: any, body: string, key: string): string;
/**
* @param {string} b64_key
* @returns {string}
*/
export function b64_to_hex_hmac_key(b64_key: string): string;
/**
* @param {string} seed
* @returns {any}
*/
Expand Down Expand Up @@ -158,6 +140,24 @@ export function assemble_external_match(do_gas_estimation: boolean, updated_orde
*/
export function create_external_wallet(wallet_id: string, blinder_seed: string, share_seed: string, pk_root: string, sk_match: string, symmetric_key: string): Promise<any>;
/**
* @param {Function} sign_message
* @returns {Promise<any>}
*/
export function generate_wallet_secrets(sign_message: Function): Promise<any>;
/**
* @param {string} path
* @param {any} headers
* @param {string} body
* @param {string} key
* @returns {string}
*/
export function create_request_signature(path: string, headers: any, body: string, key: string): string;
/**
* @param {string} b64_key
* @returns {string}
*/
export function b64_to_hex_hmac_key(b64_key: string): string;
/**
* @param {string} wallet_id
* @param {string} blinder_seed
* @param {string} share_seed
Expand Down
7 changes: 7 additions & 0 deletions packages/node/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @renegade-fi/node

## 0.4.20

### Patch Changes

- Updated dependencies
- @renegade-fi/core@0.4.19

## 0.4.19

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/node/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@renegade-fi/node",
"description": "Node.js library for Renegade",
"version": "0.4.19",
"version": "0.4.20",
"repository": {
"type": "git",
"url": "https://github.com/renegade-fi/typescript-sdk.git",
Expand Down
7 changes: 7 additions & 0 deletions packages/react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @renegade-fi/react

## 0.4.20

### Patch Changes

- Updated dependencies
- @renegade-fi/core@0.4.19

## 0.4.19

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@renegade-fi/react",
"description": "React library for Renegade",
"version": "0.4.19",
"version": "0.4.20",
"repository": {
"type": "git",
"url": "https://github.com/renegade-fi/typescript-sdk.git",
Expand Down
7 changes: 7 additions & 0 deletions packages/test/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @renegade-fi/test

## 0.3.18

### Patch Changes

- Updated dependencies
- @renegade-fi/core@0.4.19

## 0.3.17

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/test/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@renegade-fi/test",
"version": "0.3.17",
"version": "0.3.18",
"description": "Testing helpers for Renegade",
"private": true,
"files": [
Expand Down

0 comments on commit dca2653

Please sign in to comment.