@spritz-finance/service-client 0.3.64 → 0.3.67
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.
package/lib/web3/types.d.ts
CHANGED
|
@@ -28,3 +28,29 @@ export type TokenBalance = {
|
|
|
28
28
|
balanceUSD: number;
|
|
29
29
|
tokenImageUrl: string;
|
|
30
30
|
};
|
|
31
|
+
export declare enum SignerUsageType {
|
|
32
|
+
BRIDGE_TRANSFER = 0,
|
|
33
|
+
RAIN_TRANSFER = 1
|
|
34
|
+
}
|
|
35
|
+
export declare enum OpsSignerType {
|
|
36
|
+
Evm = "ADDRESS_FORMAT_ETHEREUM",
|
|
37
|
+
Solana = "ADDRESS_FORMAT_SOLANA",
|
|
38
|
+
Bitcoin = "ADDRESS_FORMAT_BITCOIN_MAINNET_P2WPKH",
|
|
39
|
+
Tron = "ADDRESS_FORMAT_TRON",
|
|
40
|
+
Sui = "ADDRESS_FORMAT_SUI"
|
|
41
|
+
}
|
|
42
|
+
export type UserOpsSigner = {
|
|
43
|
+
id: string;
|
|
44
|
+
userId: string;
|
|
45
|
+
curve: string;
|
|
46
|
+
pathFormat: string;
|
|
47
|
+
seedIndex: number;
|
|
48
|
+
path: string;
|
|
49
|
+
addressFormat: OpsSignerType;
|
|
50
|
+
smartAccountConfig?: {
|
|
51
|
+
kernelVersion: string;
|
|
52
|
+
entryPointVersion: string;
|
|
53
|
+
};
|
|
54
|
+
address: string;
|
|
55
|
+
createdAt: string;
|
|
56
|
+
};
|
package/lib/web3/types.js
CHANGED
|
@@ -1,2 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OpsSignerType = exports.SignerUsageType = void 0;
|
|
4
|
+
var SignerUsageType;
|
|
5
|
+
(function (SignerUsageType) {
|
|
6
|
+
SignerUsageType[SignerUsageType["BRIDGE_TRANSFER"] = 0] = "BRIDGE_TRANSFER";
|
|
7
|
+
SignerUsageType[SignerUsageType["RAIN_TRANSFER"] = 1] = "RAIN_TRANSFER";
|
|
8
|
+
})(SignerUsageType || (exports.SignerUsageType = SignerUsageType = {}));
|
|
9
|
+
var OpsSignerType;
|
|
10
|
+
(function (OpsSignerType) {
|
|
11
|
+
OpsSignerType["Evm"] = "ADDRESS_FORMAT_ETHEREUM";
|
|
12
|
+
OpsSignerType["Solana"] = "ADDRESS_FORMAT_SOLANA";
|
|
13
|
+
OpsSignerType["Bitcoin"] = "ADDRESS_FORMAT_BITCOIN_MAINNET_P2WPKH";
|
|
14
|
+
OpsSignerType["Tron"] = "ADDRESS_FORMAT_TRON";
|
|
15
|
+
OpsSignerType["Sui"] = "ADDRESS_FORMAT_SUI";
|
|
16
|
+
})(OpsSignerType || (exports.OpsSignerType = OpsSignerType = {}));
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export * as Web3Client from './web3ServiceClient';
|
|
2
|
-
import { ExactInQuoteInput, ExactInQuoteResponse, TokenBalance, WalletTokenBalanceInput } from './types';
|
|
2
|
+
import { ExactInQuoteInput, ExactInQuoteResponse, OpsSignerType, TokenBalance, UserOpsSigner, WalletTokenBalanceInput } from './types';
|
|
3
3
|
export declare function getExactInQuote(input: ExactInQuoteInput): Promise<ExactInQuoteResponse>;
|
|
4
4
|
export declare function getTokenBalances(input: WalletTokenBalanceInput): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<TokenBalance[]>>;
|
|
5
|
+
export declare function getUserOpsSigner(input: {
|
|
6
|
+
userId: string;
|
|
7
|
+
signerType: OpsSignerType;
|
|
8
|
+
}): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<UserOpsSigner>>;
|
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.getTokenBalances = exports.getExactInQuote = exports.Web3Client = void 0;
|
|
26
|
+
exports.getUserOpsSigner = exports.getTokenBalances = exports.getExactInQuote = exports.Web3Client = void 0;
|
|
27
27
|
exports.Web3Client = __importStar(require("./web3ServiceClient"));
|
|
28
28
|
const serviceClient_1 = require("../serviceClient");
|
|
29
29
|
const WEB3_ENDPOINT = '/web3';
|
|
@@ -39,3 +39,9 @@ async function getTokenBalances(input) {
|
|
|
39
39
|
.then((res) => res.data);
|
|
40
40
|
}
|
|
41
41
|
exports.getTokenBalances = getTokenBalances;
|
|
42
|
+
async function getUserOpsSigner(input) {
|
|
43
|
+
return serviceClient_1.baseClient
|
|
44
|
+
.get(`${WEB3_ENDPOINT}/ops-signer/user/${input.userId}?signerType=${input.signerType}`)
|
|
45
|
+
.then((res) => res.data);
|
|
46
|
+
}
|
|
47
|
+
exports.getUserOpsSigner = getUserOpsSigner;
|