@spritz-finance/service-client 0.3.69 → 0.3.70
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.
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
export * as BridgeClient from './bridgeServiceClient';
|
|
2
2
|
import { BridgeUser } from '../onramp/types';
|
|
3
|
-
import { BridgeExternalAccount, CreateBridgeAccountParams } from './types';
|
|
3
|
+
import { BridgeExternalAccount, BridgeNetwork, BridgeTransfer, BridgeTransferOffRampPaymentRail, CreateBridgeAccountParams } from './types';
|
|
4
4
|
export declare function createBridgeBankAccount(userId: string, accountId: string, input: CreateBridgeAccountParams): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<BridgeExternalAccount>>;
|
|
5
5
|
export declare function getBridgeUser(userId: string): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<BridgeUser>>;
|
|
6
|
+
export declare function createBridgeTransfer(userId: string, input: {
|
|
7
|
+
amount: number;
|
|
8
|
+
token: string;
|
|
9
|
+
network: BridgeNetwork;
|
|
10
|
+
fromAddress: string;
|
|
11
|
+
externalAccountId: string;
|
|
12
|
+
paymentRail: BridgeTransferOffRampPaymentRail;
|
|
13
|
+
}): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<BridgeTransfer>>;
|
|
@@ -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.getBridgeUser = exports.createBridgeBankAccount = exports.BridgeClient = void 0;
|
|
26
|
+
exports.createBridgeTransfer = exports.getBridgeUser = exports.createBridgeBankAccount = exports.BridgeClient = void 0;
|
|
27
27
|
exports.BridgeClient = __importStar(require("./bridgeServiceClient"));
|
|
28
28
|
const serviceClient_1 = require("../serviceClient");
|
|
29
29
|
const ONRAMP_ENDPOINT = '/bridge';
|
|
@@ -39,3 +39,9 @@ async function getBridgeUser(userId) {
|
|
|
39
39
|
.then((res) => res.data);
|
|
40
40
|
}
|
|
41
41
|
exports.getBridgeUser = getBridgeUser;
|
|
42
|
+
async function createBridgeTransfer(userId, input) {
|
|
43
|
+
return serviceClient_1.baseClient
|
|
44
|
+
.post(`${ONRAMP_ENDPOINT}/user/${userId}/transfer`, input)
|
|
45
|
+
.then((res) => res.data);
|
|
46
|
+
}
|
|
47
|
+
exports.createBridgeTransfer = createBridgeTransfer;
|
package/lib/bridge/types.d.ts
CHANGED
|
@@ -34,3 +34,32 @@ export type CreateBridgeAccountParams = {
|
|
|
34
34
|
iban: string;
|
|
35
35
|
bic?: string;
|
|
36
36
|
});
|
|
37
|
+
export declare enum BridgeNetwork {
|
|
38
|
+
ETHEREUM = "ethereum",
|
|
39
|
+
POLYGON = "polygon",
|
|
40
|
+
BASE = "base",
|
|
41
|
+
ARBITRUM = "arbitrum",
|
|
42
|
+
AVALANCHE = "avalanche",
|
|
43
|
+
OPTIMISM = "optimism",
|
|
44
|
+
SOLANA = "solana",
|
|
45
|
+
STELLAR = "stellar",
|
|
46
|
+
TRON = "tron"
|
|
47
|
+
}
|
|
48
|
+
export declare enum BridgeTransferOffRampPaymentRail {
|
|
49
|
+
ACH = "ach",
|
|
50
|
+
ACH_SAME_DAY = "ach_same_day",
|
|
51
|
+
WIRE = "wire",
|
|
52
|
+
SEPA = "sepa"
|
|
53
|
+
}
|
|
54
|
+
export type BridgeTransfer = {
|
|
55
|
+
id: string;
|
|
56
|
+
externalId: number;
|
|
57
|
+
userId: string;
|
|
58
|
+
externalAccountId: string;
|
|
59
|
+
state: string;
|
|
60
|
+
amount: number;
|
|
61
|
+
totalAmount: number;
|
|
62
|
+
feeAmount: number;
|
|
63
|
+
currency: string;
|
|
64
|
+
createdAt: string;
|
|
65
|
+
};
|
package/lib/bridge/types.js
CHANGED
|
@@ -1,2 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BridgeTransferOffRampPaymentRail = exports.BridgeNetwork = void 0;
|
|
4
|
+
var BridgeNetwork;
|
|
5
|
+
(function (BridgeNetwork) {
|
|
6
|
+
BridgeNetwork["ETHEREUM"] = "ethereum";
|
|
7
|
+
BridgeNetwork["POLYGON"] = "polygon";
|
|
8
|
+
BridgeNetwork["BASE"] = "base";
|
|
9
|
+
BridgeNetwork["ARBITRUM"] = "arbitrum";
|
|
10
|
+
BridgeNetwork["AVALANCHE"] = "avalanche";
|
|
11
|
+
BridgeNetwork["OPTIMISM"] = "optimism";
|
|
12
|
+
BridgeNetwork["SOLANA"] = "solana";
|
|
13
|
+
BridgeNetwork["STELLAR"] = "stellar";
|
|
14
|
+
BridgeNetwork["TRON"] = "tron";
|
|
15
|
+
})(BridgeNetwork || (exports.BridgeNetwork = BridgeNetwork = {}));
|
|
16
|
+
var BridgeTransferOffRampPaymentRail;
|
|
17
|
+
(function (BridgeTransferOffRampPaymentRail) {
|
|
18
|
+
BridgeTransferOffRampPaymentRail["ACH"] = "ach";
|
|
19
|
+
BridgeTransferOffRampPaymentRail["ACH_SAME_DAY"] = "ach_same_day";
|
|
20
|
+
BridgeTransferOffRampPaymentRail["WIRE"] = "wire";
|
|
21
|
+
BridgeTransferOffRampPaymentRail["SEPA"] = "sepa";
|
|
22
|
+
})(BridgeTransferOffRampPaymentRail || (exports.BridgeTransferOffRampPaymentRail = BridgeTransferOffRampPaymentRail = {}));
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
export * as Web3Client from './web3ServiceClient';
|
|
2
|
-
import { ExactInQuoteInput, ExactInQuoteResponse, OpsSignerType, TokenBalance, UserOpsSigner, WalletTokenBalanceInput } from './types';
|
|
2
|
+
import { ExactInQuoteInput, ExactInQuoteResponse, OpsSignerType, SignerUsageType, 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
5
|
export declare function getUserOpsSigner(input: {
|
|
6
6
|
userId: string;
|
|
7
7
|
signerType: OpsSignerType;
|
|
8
8
|
}): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<UserOpsSigner>>;
|
|
9
|
+
export declare function getSmartAccountAddress(input: {
|
|
10
|
+
userId: string;
|
|
11
|
+
usageType: SignerUsageType;
|
|
12
|
+
}): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<`0x${string}`>>;
|
|
9
13
|
export declare function createUserOpsSigner(input: {
|
|
10
14
|
userId: string;
|
|
11
15
|
}): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<boolean>>;
|
|
@@ -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.createUserOpsSigner = exports.getUserOpsSigner = exports.getTokenBalances = exports.getExactInQuote = exports.Web3Client = void 0;
|
|
26
|
+
exports.createUserOpsSigner = exports.getSmartAccountAddress = 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';
|
|
@@ -45,6 +45,12 @@ async function getUserOpsSigner(input) {
|
|
|
45
45
|
.then((res) => res.data);
|
|
46
46
|
}
|
|
47
47
|
exports.getUserOpsSigner = getUserOpsSigner;
|
|
48
|
+
async function getSmartAccountAddress(input) {
|
|
49
|
+
return serviceClient_1.baseClient
|
|
50
|
+
.get(`${WEB3_ENDPOINT}/ops-signer/smart-account/${input.userId}?usageType=${input.usageType}`)
|
|
51
|
+
.then((res) => res.data);
|
|
52
|
+
}
|
|
53
|
+
exports.getSmartAccountAddress = getSmartAccountAddress;
|
|
48
54
|
async function createUserOpsSigner(input) {
|
|
49
55
|
return serviceClient_1.baseClient
|
|
50
56
|
.post(`${WEB3_ENDPOINT}/ops-signer/user/${input.userId}`)
|