@riocrypto/common-server 1.0.2625 → 1.0.2626
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,12 +28,12 @@ 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
39
|
wire_message?: string;
|
|
@@ -44,24 +44,25 @@ declare class BridgeClient {
|
|
|
44
44
|
developer_fee: string;
|
|
45
45
|
source: {
|
|
46
46
|
currency: "usdc" | "usdt" | "usd";
|
|
47
|
-
payment_rail: "ach_push" | "wire" | "avalanche_c_c" | "ethereum" | "polygon" | "solana";
|
|
47
|
+
payment_rail: "ach_push" | "wire" | "avalanche_c_c" | "ethereum" | "polygon" | "stellar" | "solana";
|
|
48
48
|
external_account_id?: string;
|
|
49
49
|
from_address?: string;
|
|
50
50
|
};
|
|
51
51
|
destination: {
|
|
52
52
|
currency: "usdc" | "usdt" | "usd";
|
|
53
|
-
payment_rail: "ach_push" | "wire" | "avalanche_c_c" | "ethereum" | "polygon" | "solana";
|
|
53
|
+
payment_rail: "ach_push" | "wire" | "avalanche_c_c" | "ethereum" | "polygon" | "stellar" | "solana";
|
|
54
54
|
external_account_id?: string;
|
|
55
55
|
to_address?: string;
|
|
56
56
|
wire_message?: string;
|
|
57
57
|
};
|
|
58
58
|
state: "awaiting_funds" | "funds_received" | "payment_submitted" | "payment_processed" | "canceled" | "error";
|
|
59
59
|
source_deposit_instructions: {
|
|
60
|
-
payment_rail: "ach_push" | "wire" | "avalanche_c_chain" | "ethereum" | "polygon" | "solana";
|
|
60
|
+
payment_rail: "ach_push" | "wire" | "avalanche_c_chain" | "ethereum" | "polygon" | "stellar" | "solana";
|
|
61
61
|
amount: string;
|
|
62
62
|
currency: "usdc" | "usdt" | "usd";
|
|
63
63
|
from_address?: string;
|
|
64
64
|
to_address?: string;
|
|
65
|
+
blockchain_memo?: string;
|
|
65
66
|
deposit_message?: string;
|
|
66
67
|
bank_name?: string;
|
|
67
68
|
bank_address?: string;
|
|
@@ -78,24 +79,25 @@ declare class BridgeClient {
|
|
|
78
79
|
developer_fee: string;
|
|
79
80
|
source: {
|
|
80
81
|
currency: "usdc" | "usdt" | "usd";
|
|
81
|
-
payment_rail: "ach_push" | "wire" | "avalanche_c_c" | "ethereum" | "polygon";
|
|
82
|
+
payment_rail: "ach_push" | "wire" | "avalanche_c_c" | "ethereum" | "polygon" | "stellar";
|
|
82
83
|
external_account_id?: string;
|
|
83
84
|
from_address?: string;
|
|
84
85
|
};
|
|
85
86
|
destination: {
|
|
86
87
|
currency: "usdc" | "usdt" | "usd";
|
|
87
|
-
payment_rail: "ach_push" | "wire" | "avalanche_c_c" | "ethereum" | "polygon";
|
|
88
|
+
payment_rail: "ach_push" | "wire" | "avalanche_c_c" | "ethereum" | "polygon" | "stellar";
|
|
88
89
|
external_account_id?: string;
|
|
89
90
|
to_address?: string;
|
|
90
91
|
wire_message?: string;
|
|
91
92
|
};
|
|
92
93
|
state: "awaiting_funds" | "funds_received" | "payment_submitted" | "payment_processed" | "canceled" | "error";
|
|
93
94
|
source_deposit_instructions: {
|
|
94
|
-
payment_rail: "ach_push" | "wire" | "avalanche_c_chain" | "ethereum" | "polygon";
|
|
95
|
+
payment_rail: "ach_push" | "wire" | "avalanche_c_chain" | "ethereum" | "polygon" | "stellar";
|
|
95
96
|
amount: string;
|
|
96
97
|
currency: "usdc" | "usdt" | "usd";
|
|
97
98
|
from_address?: string;
|
|
98
99
|
to_address?: string;
|
|
100
|
+
blockchain_memo?: string;
|
|
99
101
|
deposit_message?: string;
|
|
100
102
|
bank_name?: string;
|
|
101
103
|
bank_address?: string;
|
|
@@ -111,24 +113,25 @@ declare class BridgeClient {
|
|
|
111
113
|
developer_fee: string;
|
|
112
114
|
source: {
|
|
113
115
|
currency: "usdc" | "usdt" | "usd";
|
|
114
|
-
payment_rail: "ach_push" | "wire" | "avalanche_c_c" | "ethereum" | "polygon";
|
|
116
|
+
payment_rail: "ach_push" | "wire" | "avalanche_c_c" | "ethereum" | "polygon" | "stellar";
|
|
115
117
|
external_account_id?: string;
|
|
116
118
|
from_address?: string;
|
|
117
119
|
};
|
|
118
120
|
destination: {
|
|
119
121
|
currency: "usdc" | "usdt" | "usd";
|
|
120
|
-
payment_rail: "ach_push" | "wire" | "avalanche_c_c" | "ethereum" | "polygon";
|
|
122
|
+
payment_rail: "ach_push" | "wire" | "avalanche_c_c" | "ethereum" | "polygon" | "stellar";
|
|
121
123
|
external_account_id?: string;
|
|
122
124
|
to_address?: string;
|
|
123
125
|
wire_message?: string;
|
|
124
126
|
};
|
|
125
127
|
state: "awaiting_funds" | "funds_received" | "payment_submitted" | "payment_processed" | "canceled" | "error";
|
|
126
128
|
source_deposit_instructions: {
|
|
127
|
-
payment_rail: "ach_push" | "wire" | "avalanche_c_chain" | "ethereum" | "polygon";
|
|
129
|
+
payment_rail: "ach_push" | "wire" | "avalanche_c_chain" | "ethereum" | "polygon" | "stellar";
|
|
128
130
|
amount: string;
|
|
129
131
|
currency: "usdc" | "usdt" | "usd";
|
|
130
132
|
from_address?: string;
|
|
131
133
|
to_address?: string;
|
|
134
|
+
blockchain_memo?: string;
|
|
132
135
|
deposit_message?: string;
|
|
133
136
|
bank_name?: string;
|
|
134
137
|
bank_address?: string;
|
|
@@ -137,34 +140,6 @@ declare class BridgeClient {
|
|
|
137
140
|
bank_beneficiary_name?: string;
|
|
138
141
|
};
|
|
139
142
|
}[]>;
|
|
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
143
|
createPlaidLinkToken(bridgeCustomerId: string): Promise<{
|
|
169
144
|
link_token: string;
|
|
170
145
|
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.2626",
|
|
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.2425",
|
|
32
32
|
"@types/express": "^4.17.13",
|
|
33
33
|
"axios": "^1.7.4",
|
|
34
34
|
"crypto-js": "^4.2.0",
|