@spritz-finance/service-client 0.23.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,7 +15,8 @@ export declare function validateTransfer({ userId, transferId, amount, toAddress
15
15
  toAddress: string;
16
16
  }): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<boolean>>;
17
17
  export declare function createBridgeTransfer(userId: string, input: {
18
- amount: number;
18
+ sourceAmount: number;
19
+ referenceId: string;
19
20
  token: string;
20
21
  network: BridgeNetwork;
21
22
  fromAddress: string;
@@ -71,7 +71,7 @@ async function validateTransfer({ userId, transferId, amount, toAddress, }) {
71
71
  }
72
72
  async function createBridgeTransfer(userId, input) {
73
73
  return serviceClient_1.baseClient
74
- .post(`${ONRAMP_ENDPOINT}/user/${userId}/transfer`, input)
74
+ .post(`${ONRAMP_ROUTER_ENDPOINT}/off-ramps/users/${userId}/transfers`, input)
75
75
  .then((res) => res.data);
76
76
  }
77
77
  async function getExternalPayments(paymentIds) {
@@ -1,5 +1,5 @@
1
1
  export * as PayoutsClient from "./payoutsServiceClient";
2
- import { CryptoPayout, CryptoPayoutInput, TreasuryBalances } from "./types";
2
+ import { CryptoPayout, CryptoPayoutInput, ExecuteRainAdminChangeInput, ExecuteRainAdminChangeResult, TreasuryBalances } from "./types";
3
3
  export declare function requestCryptoPayout({ userId, type, network, amountFiat, referenceId, toAddress, tokenSymbol, currencyFiat, fromDispatchWallet, }: CryptoPayoutInput): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<CryptoPayout>>;
4
4
  export declare function getPayoutFromHash({ userId, transactionHash, }: {
5
5
  userId?: string;
@@ -22,4 +22,5 @@ export declare function submit7702Message(input: {
22
22
  to: `0x${string}`;
23
23
  chainId: number;
24
24
  }): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<string>>;
25
+ export declare function executeRainAdminChange(input: ExecuteRainAdminChangeInput): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<ExecuteRainAdminChangeResult>>;
25
26
  export declare function getTreasuryBalances(): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<TreasuryBalances>>;
@@ -38,6 +38,7 @@ exports.requestCryptoPayout = requestCryptoPayout;
38
38
  exports.getPayoutFromHash = getPayoutFromHash;
39
39
  exports.requestWithdrawlSignature = requestWithdrawlSignature;
40
40
  exports.submit7702Message = submit7702Message;
41
+ exports.executeRainAdminChange = executeRainAdminChange;
41
42
  exports.getTreasuryBalances = getTreasuryBalances;
42
43
  exports.PayoutsClient = __importStar(require("./payoutsServiceClient"));
43
44
  const serviceClient_1 = require("../serviceClient");
@@ -75,6 +76,11 @@ async function submit7702Message(input) {
75
76
  .post(`${PAYOUTS_ENDPOINT}/signers/7702`, input)
76
77
  .then((res) => res.data);
77
78
  }
79
+ async function executeRainAdminChange(input) {
80
+ return serviceClient_1.baseClient
81
+ .post(`${PAYOUTS_ENDPOINT}/signers/rain-admin-change`, input)
82
+ .then((res) => res.data);
83
+ }
78
84
  // Served by bridgebot's Hono /api surface; reached through the same gateway
79
85
  // host via the /v2/bridgebot base path (the bare /bridgebot base path maps to
80
86
  // bridgebot's legacy REST API, which does not carry this route).
@@ -32,6 +32,19 @@ export type CryptoPayout = {
32
32
  createdAt: string;
33
33
  updatedAt: string;
34
34
  };
35
+ export type RainAdminAction = "add" | "remove";
36
+ export type ExecuteRainAdminChangeInput = {
37
+ action: RainAdminAction;
38
+ chainId: 10 | 137 | 8453 | 42161 | 43114;
39
+ collateralProxyAddress: `0x${string}`;
40
+ userId: string;
41
+ };
42
+ export type ExecuteRainAdminChangeResult = ExecuteRainAdminChangeInput & {
43
+ sourceSignerAddress: `0x${string}`;
44
+ status: "alreadyApplied" | "confirmed";
45
+ targetSignerAddress: `0x${string}`;
46
+ transactionHash?: `0x${string}`;
47
+ };
35
48
  export type TreasuryWalletBalance = {
36
49
  payoutType: "BRIDGE_TRANSFER" | "RAIN_CARD_DEPOSIT" | "ONRAMP_PURCHASE";
37
50
  network: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spritz-finance/service-client",
3
- "version": "0.23.0",
3
+ "version": "0.25.0",
4
4
  "gitHead": "06f8e96b7b38c34df26a38da329331940675e4f8",
5
5
  "description": "Service client",
6
6
  "license": "ISC",