@riocrypto/common-server 1.0.2625 → 1.0.2627
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,4 +1,4 @@
|
|
|
1
|
-
import { UserType
|
|
1
|
+
import { UserType } from "@riocrypto/common";
|
|
2
2
|
declare class BridgeClient {
|
|
3
3
|
private apiKey;
|
|
4
4
|
private baseUrl;
|
|
@@ -28,14 +28,15 @@ declare class BridgeClient {
|
|
|
28
28
|
}>;
|
|
29
29
|
createTransfer(bridgeCustomerId: string, amountInUSD: string, source: {
|
|
30
30
|
currency: "usdc" | "usdt" | "usd";
|
|
31
|
-
payment_rail: "ach_push" | "wire" | "avalanche_c_c" | "ethereum" | "polygon" | "solana";
|
|
31
|
+
payment_rail: "ach_push" | "wire" | "avalanche_c_c" | "ethereum" | "polygon" | "stellar" | "solana";
|
|
32
32
|
external_account_id?: string;
|
|
33
33
|
from_address?: string;
|
|
34
34
|
}, destination: {
|
|
35
35
|
currency: "usdc" | "usdt" | "usd";
|
|
36
|
-
payment_rail: "ach" | "ach_push" | "wire" | "avalanche_c_c" | "ethereum" | "polygon" | "solana";
|
|
36
|
+
payment_rail: "ach" | "ach_push" | "wire" | "avalanche_c_c" | "ethereum" | "polygon" | "stellar" | "solana";
|
|
37
37
|
external_account_id?: string;
|
|
38
38
|
to_address?: string;
|
|
39
|
+
blockchain_memo?: string;
|
|
39
40
|
wire_message?: string;
|
|
40
41
|
}, developerFee?: string): Promise<{
|
|
41
42
|
id: string;
|
|
@@ -44,24 +45,26 @@ declare class BridgeClient {
|
|
|
44
45
|
developer_fee: string;
|
|
45
46
|
source: {
|
|
46
47
|
currency: "usdc" | "usdt" | "usd";
|
|
47
|
-
payment_rail: "ach_push" | "wire" | "avalanche_c_c" | "ethereum" | "polygon" | "solana";
|
|
48
|
+
payment_rail: "ach_push" | "wire" | "avalanche_c_c" | "ethereum" | "polygon" | "stellar" | "solana";
|
|
48
49
|
external_account_id?: string;
|
|
49
50
|
from_address?: string;
|
|
50
51
|
};
|
|
51
52
|
destination: {
|
|
52
53
|
currency: "usdc" | "usdt" | "usd";
|
|
53
|
-
payment_rail: "ach_push" | "wire" | "avalanche_c_c" | "ethereum" | "polygon" | "solana";
|
|
54
|
+
payment_rail: "ach_push" | "wire" | "avalanche_c_c" | "ethereum" | "polygon" | "stellar" | "solana";
|
|
54
55
|
external_account_id?: string;
|
|
55
56
|
to_address?: string;
|
|
57
|
+
blockchain_memo?: string;
|
|
56
58
|
wire_message?: string;
|
|
57
59
|
};
|
|
58
60
|
state: "awaiting_funds" | "funds_received" | "payment_submitted" | "payment_processed" | "canceled" | "error";
|
|
59
61
|
source_deposit_instructions: {
|
|
60
|
-
payment_rail: "ach_push" | "wire" | "avalanche_c_chain" | "ethereum" | "polygon" | "solana";
|
|
62
|
+
payment_rail: "ach_push" | "wire" | "avalanche_c_chain" | "ethereum" | "polygon" | "stellar" | "solana";
|
|
61
63
|
amount: string;
|
|
62
64
|
currency: "usdc" | "usdt" | "usd";
|
|
63
65
|
from_address?: string;
|
|
64
66
|
to_address?: string;
|
|
67
|
+
blockchain_memo?: string;
|
|
65
68
|
deposit_message?: string;
|
|
66
69
|
bank_name?: string;
|
|
67
70
|
bank_address?: string;
|
|
@@ -78,24 +81,26 @@ declare class BridgeClient {
|
|
|
78
81
|
developer_fee: string;
|
|
79
82
|
source: {
|
|
80
83
|
currency: "usdc" | "usdt" | "usd";
|
|
81
|
-
payment_rail: "ach_push" | "wire" | "avalanche_c_c" | "ethereum" | "polygon";
|
|
84
|
+
payment_rail: "ach_push" | "wire" | "avalanche_c_c" | "ethereum" | "polygon" | "stellar";
|
|
82
85
|
external_account_id?: string;
|
|
83
86
|
from_address?: string;
|
|
84
87
|
};
|
|
85
88
|
destination: {
|
|
86
89
|
currency: "usdc" | "usdt" | "usd";
|
|
87
|
-
payment_rail: "ach_push" | "wire" | "avalanche_c_c" | "ethereum" | "polygon";
|
|
90
|
+
payment_rail: "ach_push" | "wire" | "avalanche_c_c" | "ethereum" | "polygon" | "stellar";
|
|
88
91
|
external_account_id?: string;
|
|
89
92
|
to_address?: string;
|
|
90
93
|
wire_message?: string;
|
|
94
|
+
blockchain_memo?: string;
|
|
91
95
|
};
|
|
92
96
|
state: "awaiting_funds" | "funds_received" | "payment_submitted" | "payment_processed" | "canceled" | "error";
|
|
93
97
|
source_deposit_instructions: {
|
|
94
|
-
payment_rail: "ach_push" | "wire" | "avalanche_c_chain" | "ethereum" | "polygon";
|
|
98
|
+
payment_rail: "ach_push" | "wire" | "avalanche_c_chain" | "ethereum" | "polygon" | "stellar";
|
|
95
99
|
amount: string;
|
|
96
100
|
currency: "usdc" | "usdt" | "usd";
|
|
97
101
|
from_address?: string;
|
|
98
102
|
to_address?: string;
|
|
103
|
+
blockchain_memo?: string;
|
|
99
104
|
deposit_message?: string;
|
|
100
105
|
bank_name?: string;
|
|
101
106
|
bank_address?: string;
|
|
@@ -111,24 +116,26 @@ declare class BridgeClient {
|
|
|
111
116
|
developer_fee: string;
|
|
112
117
|
source: {
|
|
113
118
|
currency: "usdc" | "usdt" | "usd";
|
|
114
|
-
payment_rail: "ach_push" | "wire" | "avalanche_c_c" | "ethereum" | "polygon";
|
|
119
|
+
payment_rail: "ach_push" | "wire" | "avalanche_c_c" | "ethereum" | "polygon" | "stellar";
|
|
115
120
|
external_account_id?: string;
|
|
116
121
|
from_address?: string;
|
|
117
122
|
};
|
|
118
123
|
destination: {
|
|
119
124
|
currency: "usdc" | "usdt" | "usd";
|
|
120
|
-
payment_rail: "ach_push" | "wire" | "avalanche_c_c" | "ethereum" | "polygon";
|
|
125
|
+
payment_rail: "ach_push" | "wire" | "avalanche_c_c" | "ethereum" | "polygon" | "stellar";
|
|
121
126
|
external_account_id?: string;
|
|
122
127
|
to_address?: string;
|
|
123
128
|
wire_message?: string;
|
|
129
|
+
blockchain_memo?: string;
|
|
124
130
|
};
|
|
125
131
|
state: "awaiting_funds" | "funds_received" | "payment_submitted" | "payment_processed" | "canceled" | "error";
|
|
126
132
|
source_deposit_instructions: {
|
|
127
|
-
payment_rail: "ach_push" | "wire" | "avalanche_c_chain" | "ethereum" | "polygon";
|
|
133
|
+
payment_rail: "ach_push" | "wire" | "avalanche_c_chain" | "ethereum" | "polygon" | "stellar";
|
|
128
134
|
amount: string;
|
|
129
135
|
currency: "usdc" | "usdt" | "usd";
|
|
130
136
|
from_address?: string;
|
|
131
137
|
to_address?: string;
|
|
138
|
+
blockchain_memo?: string;
|
|
132
139
|
deposit_message?: string;
|
|
133
140
|
bank_name?: string;
|
|
134
141
|
bank_address?: string;
|
|
@@ -137,34 +144,6 @@ declare class BridgeClient {
|
|
|
137
144
|
bank_beneficiary_name?: string;
|
|
138
145
|
};
|
|
139
146
|
}[]>;
|
|
140
|
-
createLiquidationAddress(bridgeCustomerId: string, currency: "usdc", chain: "avalanche_c_c" | "ethereum" | "polygon", externalAccountId: string): Promise<{
|
|
141
|
-
id: string;
|
|
142
|
-
currency: "usdc";
|
|
143
|
-
chain: "avalanche_c_c" | "ethereum" | "polygon";
|
|
144
|
-
external_account_id: string;
|
|
145
|
-
address: string;
|
|
146
|
-
}>;
|
|
147
|
-
getLiquidationAddresses(bridgeCustomerId: string, crypto: Crypto): Promise<{
|
|
148
|
-
id: string;
|
|
149
|
-
currency: "usdc";
|
|
150
|
-
chain: "avalanche_c_c" | "ethereum" | "polygon";
|
|
151
|
-
external_account_id: string;
|
|
152
|
-
address: string;
|
|
153
|
-
}[]>;
|
|
154
|
-
getLiquidationAddress(bridgeCustomerId: string, bridgeLiquidationAddressId: string): Promise<{
|
|
155
|
-
id: string;
|
|
156
|
-
currency: "usdc";
|
|
157
|
-
chain: "avalanche_c_c" | "ethereum" | "polygon";
|
|
158
|
-
external_account_id: string;
|
|
159
|
-
address: string;
|
|
160
|
-
}>;
|
|
161
|
-
getLiquidationAddressDrains(bridgeCustomerId: string, liquidationAddressId: string): Promise<{
|
|
162
|
-
id: string;
|
|
163
|
-
amount: string;
|
|
164
|
-
currency: string;
|
|
165
|
-
state: "funds_received" | "complete";
|
|
166
|
-
created_at: string;
|
|
167
|
-
}[]>;
|
|
168
147
|
createPlaidLinkToken(bridgeCustomerId: string): Promise<{
|
|
169
148
|
link_token: string;
|
|
170
149
|
link_token_expires_at: string;
|
|
@@ -114,56 +114,6 @@ class BridgeClient {
|
|
|
114
114
|
return data.data;
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
|
-
createLiquidationAddress(bridgeCustomerId, currency, chain, externalAccountId) {
|
|
118
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
119
|
-
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local, common_1.RioEnv.Test].includes(process.env.RIO_ENV)) {
|
|
120
|
-
throw new Error("Bridge liquidation addresses are disabled in sandbox mode.");
|
|
121
|
-
}
|
|
122
|
-
const { data } = yield this.axiosClient.post(`${this.baseUrl}/v0/customers/${bridgeCustomerId}/liquidation_addresses`, {
|
|
123
|
-
currency,
|
|
124
|
-
chain,
|
|
125
|
-
external_account_id: externalAccountId,
|
|
126
|
-
}, {
|
|
127
|
-
headers: {
|
|
128
|
-
"Api-Key": this.apiKey,
|
|
129
|
-
"Idempotency-Key": (0, uuid_1.v4)(),
|
|
130
|
-
},
|
|
131
|
-
});
|
|
132
|
-
return data;
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
getLiquidationAddresses(bridgeCustomerId, crypto) {
|
|
136
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
137
|
-
const { data } = yield this.axiosClient.get(`${this.baseUrl}/v0/customers/${bridgeCustomerId}/liquidation_addresses/`, {
|
|
138
|
-
headers: {
|
|
139
|
-
"Api-Key": this.apiKey,
|
|
140
|
-
},
|
|
141
|
-
});
|
|
142
|
-
let chainFilter = crypto === common_1.Crypto.USDC ? "ethereum" : "polygon";
|
|
143
|
-
const filteredAddresses = data.filter((address) => address.chain === chainFilter);
|
|
144
|
-
return filteredAddresses || [];
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
getLiquidationAddress(bridgeCustomerId, bridgeLiquidationAddressId) {
|
|
148
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
149
|
-
const { data } = yield this.axiosClient.get(`${this.baseUrl}/v0/customers/${bridgeCustomerId}/liquidation_addresses/${bridgeLiquidationAddressId}`, {
|
|
150
|
-
headers: {
|
|
151
|
-
"Api-Key": this.apiKey,
|
|
152
|
-
},
|
|
153
|
-
});
|
|
154
|
-
return data;
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
getLiquidationAddressDrains(bridgeCustomerId, liquidationAddressId) {
|
|
158
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
159
|
-
const response = yield this.axiosClient.get(`${this.baseUrl}/v0/customers/${bridgeCustomerId}/liquidation_addresses/${liquidationAddressId}/drains`, {
|
|
160
|
-
headers: {
|
|
161
|
-
"Api-Key": this.apiKey,
|
|
162
|
-
},
|
|
163
|
-
});
|
|
164
|
-
return response.data || [];
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
117
|
createPlaidLinkToken(bridgeCustomerId) {
|
|
168
118
|
return __awaiter(this, void 0, void 0, function* () {
|
|
169
119
|
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local, common_1.RioEnv.Test].includes(process.env.RIO_ENV)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2627",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@google-cloud/secret-manager": "^5.3.0",
|
|
29
29
|
"@google-cloud/storage": "^6.9.5",
|
|
30
30
|
"@hyperdx/node-opentelemetry": "^0.7.0",
|
|
31
|
-
"@riocrypto/common": "^1.0.
|
|
31
|
+
"@riocrypto/common": "^1.0.2426",
|
|
32
32
|
"@types/express": "^4.17.13",
|
|
33
33
|
"axios": "^1.7.4",
|
|
34
34
|
"crypto-js": "^4.2.0",
|