@mayanfinance/blink-sdk 0.1.9 → 0.2.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.
- package/README.md +13 -0
- package/dist/client.d.ts +2 -0
- package/dist/client.js +4 -1
- package/dist/contracts.d.ts +40 -0
- package/dist/contracts.js +160 -0
- package/dist/deposit.d.ts +7 -5
- package/dist/deposit.js +95 -64
- package/dist/gen/blink/signer/v1/signer_pb.d.ts +763 -0
- package/dist/gen/blink/signer/v1/signer_pb.js +182 -0
- package/dist/gen/blink/v1/admin_pb.d.ts +590 -20
- package/dist/gen/blink/v1/admin_pb.js +132 -37
- package/dist/gen/blink/v1/api_pb.d.ts +119 -8
- package/dist/gen/blink/v1/api_pb.js +32 -12
- package/dist/gen/blink/v1/partner_pb.d.ts +118 -0
- package/dist/gen/blink/v1/partner_pb.js +46 -21
- package/dist/gen/hular/v1/admin_pb.d.ts +1220 -0
- package/dist/gen/hular/v1/admin_pb.js +219 -0
- package/dist/gen/hular/v1/api_pb.d.ts +1755 -0
- package/dist/gen/hular/v1/api_pb.js +284 -0
- package/dist/gen/hular/v1/partner_pb.d.ts +1020 -0
- package/dist/gen/hular/v1/partner_pb.js +247 -0
- package/dist/gen/hular/v1/ratelimit_pb.d.ts +10 -0
- package/dist/gen/hular/v1/ratelimit_pb.js +13 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/order.d.ts +9 -5
- package/dist/order.js +34 -26
- package/dist/sui.d.ts +10 -21
- package/dist/sui.js +55 -168
- package/dist/svm.d.ts +2 -4
- package/dist/svm.js +187 -203
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
// @generated by protoc-gen-es v2.14.0 with parameter "target=ts,import_extension=js"
|
|
2
|
+
// @generated from file hular/v1/partner.proto (package hular.v1, syntax proto3)
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
import { enumDesc, fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2";
|
|
5
|
+
import { file_google_api_annotations } from "../../google/api/annotations_pb.js";
|
|
6
|
+
import { file_hular_v1_api } from "./api_pb.js";
|
|
7
|
+
import { file_hular_v1_ratelimit } from "./ratelimit_pb.js";
|
|
8
|
+
/**
|
|
9
|
+
* Describes the file hular/v1/partner.proto.
|
|
10
|
+
*/
|
|
11
|
+
export const file_hular_v1_partner = /*@__PURE__*/ fileDesc("ChZodWxhci92MS9wYXJ0bmVyLnByb3RvEghodWxhci52MSIaChhHZXRQYXJ0bmVyRnVuZGluZ1JlcXVlc3QidAoMRnVuZGluZ1Rva2VuEg0KBWNoYWluGAEgASgJEhUKCGNoYWluX2lkGAIgASgESACIAQESDwoHYWRkcmVzcxgDIAEoCRIOCgZzeW1ib2wYBCABKAkSEAoIZGVjaW1hbHMYBSABKA1CCwoJX2NoYWluX2lkImIKFVBhcnRuZXJGdW5kaW5nQmFsYW5jZRIlCgV0b2tlbhgBIAEoCzIWLmh1bGFyLnYxLkZ1bmRpbmdUb2tlbhIOCgZhbW91bnQYAiABKAkSEgoKdXNkX21pY3JvcxgDIAEoCSLSAQoOUGFydG5lckZ1bmRpbmcSGgoSYmFsYW5jZV91c2RfbWljcm9zGAEgASgJEg0KBWNoYWluGAIgASgJEhUKCGNoYWluX2lkGAMgASgESACIAQESFgoOcm91dGVyX2FkZHJlc3MYBCABKAkSJgoGdG9rZW5zGAUgAygLMhYuaHVsYXIudjEuRnVuZGluZ1Rva2VuEjEKCGJhbGFuY2VzGAYgAygLMh8uaHVsYXIudjEuUGFydG5lckZ1bmRpbmdCYWxhbmNlQgsKCV9jaGFpbl9pZCI7ChpCdWlsZFBhcnRuZXJGdW5kaW5nUmVxdWVzdBINCgV0b2tlbhgBIAEoCRIOCgZhbW91bnQYAiABKAkikgEKEFBhcnRuZXJGdW5kaW5nVHgSEgoKZnVuZGluZ19pZBgBIAEoCRINCgVjaGFpbhgCIAEoCR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VyUmVkZW1wdGlvbhInLmh1bGFyLnYxLkJ1aWxkVm91Y2hlclJlZGVtcHRpb25SZXF1ZXN0Gh0uaHVsYXIudjEuVm91Y2hlclJlZGVtcHRpb25UeCIuoLsYHoLT5JMCJDoBKiIfL3YxL3BhcnRuZXIvdm91Y2hlcnMvcmVkZW1wdGlvbhJyChFHZXRQYXJ0bmVyRnVuZGluZxIiLmh1bGFyLnYxLkdldFBhcnRuZXJGdW5kaW5nUmVxdWVzdBoYLmh1bGFyLnYxLlBhcnRuZXJGdW5kaW5nIh+guxgFgtPkkwIVEhMvdjEvcGFydG5lci9mdW5kaW5nEn4KE0J1aWxkUGFydG5lckZ1bmRpbmcSJC5odWxhci52MS5CdWlsZFBhcnRuZXJGdW5kaW5nUmVxdWVzdBoaLmh1bGFyLnYxLlBhcnRuZXJGdW5kaW5nVHgiJaC7GB6C0+STAhs6ASoiFi92MS9wYXJ0bmVyL2Z1bmRpbmcvdHgSlQEKGkxpc3RQYXJ0bmVyRnVuZGluZ0FjdGl2aXR5EicuaHVsYXIudjEuUGFydG5lckZ1bmRpbmdBY3Rpdml0eVJlcXVlc3QaJC5odWxhci52MS5QYXJ0bmVyRnVuZGluZ0FjdGl2aXR5UGFnZSIooLsYBYLT5JMCHhIcL3YxL3BhcnRuZXIvZnVuZGluZy9hY3Rpdml0eWIGcHJvdG8z", [file_google_api_annotations, file_hular_v1_api, file_hular_v1_ratelimit]);
|
|
12
|
+
/**
|
|
13
|
+
* Describes the message hular.v1.GetPartnerFundingRequest.
|
|
14
|
+
* Use `create(GetPartnerFundingRequestSchema)` to create a new message.
|
|
15
|
+
*/
|
|
16
|
+
export const GetPartnerFundingRequestSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 0);
|
|
17
|
+
/**
|
|
18
|
+
* Describes the message hular.v1.FundingToken.
|
|
19
|
+
* Use `create(FundingTokenSchema)` to create a new message.
|
|
20
|
+
*/
|
|
21
|
+
export const FundingTokenSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 1);
|
|
22
|
+
/**
|
|
23
|
+
* Describes the message hular.v1.PartnerFundingBalance.
|
|
24
|
+
* Use `create(PartnerFundingBalanceSchema)` to create a new message.
|
|
25
|
+
*/
|
|
26
|
+
export const PartnerFundingBalanceSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 2);
|
|
27
|
+
/**
|
|
28
|
+
* Describes the message hular.v1.PartnerFunding.
|
|
29
|
+
* Use `create(PartnerFundingSchema)` to create a new message.
|
|
30
|
+
*/
|
|
31
|
+
export const PartnerFundingSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 3);
|
|
32
|
+
/**
|
|
33
|
+
* Describes the message hular.v1.BuildPartnerFundingRequest.
|
|
34
|
+
* Use `create(BuildPartnerFundingRequestSchema)` to create a new message.
|
|
35
|
+
*/
|
|
36
|
+
export const BuildPartnerFundingRequestSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 4);
|
|
37
|
+
/**
|
|
38
|
+
* Describes the message hular.v1.PartnerFundingTx.
|
|
39
|
+
* Use `create(PartnerFundingTxSchema)` to create a new message.
|
|
40
|
+
*/
|
|
41
|
+
export const PartnerFundingTxSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 5);
|
|
42
|
+
/**
|
|
43
|
+
* Describes the message hular.v1.PartnerFundingActivityRequest.
|
|
44
|
+
* Use `create(PartnerFundingActivityRequestSchema)` to create a new message.
|
|
45
|
+
*/
|
|
46
|
+
export const PartnerFundingActivityRequestSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 6);
|
|
47
|
+
/**
|
|
48
|
+
* Describes the message hular.v1.PartnerFundingEntry.
|
|
49
|
+
* Use `create(PartnerFundingEntrySchema)` to create a new message.
|
|
50
|
+
*/
|
|
51
|
+
export const PartnerFundingEntrySchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 7);
|
|
52
|
+
/**
|
|
53
|
+
* Describes the message hular.v1.PartnerFundingActivityPage.
|
|
54
|
+
* Use `create(PartnerFundingActivityPageSchema)` to create a new message.
|
|
55
|
+
*/
|
|
56
|
+
export const PartnerFundingActivityPageSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 8);
|
|
57
|
+
/**
|
|
58
|
+
* Describes the message hular.v1.ListPartnerOrdersRequest.
|
|
59
|
+
* Use `create(ListPartnerOrdersRequestSchema)` to create a new message.
|
|
60
|
+
*/
|
|
61
|
+
export const ListPartnerOrdersRequestSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 9);
|
|
62
|
+
/**
|
|
63
|
+
* Describes the message hular.v1.PartnerOrder.
|
|
64
|
+
* Use `create(PartnerOrderSchema)` to create a new message.
|
|
65
|
+
*/
|
|
66
|
+
export const PartnerOrderSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 10);
|
|
67
|
+
/**
|
|
68
|
+
* Describes the message hular.v1.PartnerOrdersPage.
|
|
69
|
+
* Use `create(PartnerOrdersPageSchema)` to create a new message.
|
|
70
|
+
*/
|
|
71
|
+
export const PartnerOrdersPageSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 11);
|
|
72
|
+
/**
|
|
73
|
+
* Describes the message hular.v1.PartnerReferralsRequest.
|
|
74
|
+
* Use `create(PartnerReferralsRequestSchema)` to create a new message.
|
|
75
|
+
*/
|
|
76
|
+
export const PartnerReferralsRequestSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 12);
|
|
77
|
+
/**
|
|
78
|
+
* Describes the message hular.v1.PartnerReferralGroup.
|
|
79
|
+
* Use `create(PartnerReferralGroupSchema)` to create a new message.
|
|
80
|
+
*/
|
|
81
|
+
export const PartnerReferralGroupSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 13);
|
|
82
|
+
/**
|
|
83
|
+
* Describes the message hular.v1.PartnerReferralsPage.
|
|
84
|
+
* Use `create(PartnerReferralsPageSchema)` to create a new message.
|
|
85
|
+
*/
|
|
86
|
+
export const PartnerReferralsPageSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 14);
|
|
87
|
+
/**
|
|
88
|
+
* Describes the message hular.v1.PartnerVouchersRequest.
|
|
89
|
+
* Use `create(PartnerVouchersRequestSchema)` to create a new message.
|
|
90
|
+
*/
|
|
91
|
+
export const PartnerVouchersRequestSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 15);
|
|
92
|
+
/**
|
|
93
|
+
* Describes the message hular.v1.ClaimPartnerReferrerRequest.
|
|
94
|
+
* Use `create(ClaimPartnerReferrerRequestSchema)` to create a new message.
|
|
95
|
+
*/
|
|
96
|
+
export const ClaimPartnerReferrerRequestSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 16);
|
|
97
|
+
/**
|
|
98
|
+
* Describes the message hular.v1.BuildVoucherRedemptionRequest.
|
|
99
|
+
* Use `create(BuildVoucherRedemptionRequestSchema)` to create a new message.
|
|
100
|
+
*/
|
|
101
|
+
export const BuildVoucherRedemptionRequestSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 17);
|
|
102
|
+
/**
|
|
103
|
+
* Describes the message hular.v1.VoucherRedemptionTx.
|
|
104
|
+
* Use `create(VoucherRedemptionTxSchema)` to create a new message.
|
|
105
|
+
*/
|
|
106
|
+
export const VoucherRedemptionTxSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 18);
|
|
107
|
+
/**
|
|
108
|
+
* Describes the message hular.v1.RequestLoginCodeRequest.
|
|
109
|
+
* Use `create(RequestLoginCodeRequestSchema)` to create a new message.
|
|
110
|
+
*/
|
|
111
|
+
export const RequestLoginCodeRequestSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 19);
|
|
112
|
+
/**
|
|
113
|
+
* Describes the message hular.v1.RequestLoginCodeResponse.
|
|
114
|
+
* Use `create(RequestLoginCodeResponseSchema)` to create a new message.
|
|
115
|
+
*/
|
|
116
|
+
export const RequestLoginCodeResponseSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 20);
|
|
117
|
+
/**
|
|
118
|
+
* Describes the message hular.v1.VerifyLoginCodeRequest.
|
|
119
|
+
* Use `create(VerifyLoginCodeRequestSchema)` to create a new message.
|
|
120
|
+
*/
|
|
121
|
+
export const VerifyLoginCodeRequestSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 21);
|
|
122
|
+
/**
|
|
123
|
+
* Describes the message hular.v1.PartnerSession.
|
|
124
|
+
* Use `create(PartnerSessionSchema)` to create a new message.
|
|
125
|
+
*/
|
|
126
|
+
export const PartnerSessionSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 22);
|
|
127
|
+
/**
|
|
128
|
+
* Describes the message hular.v1.LogoutRequest.
|
|
129
|
+
* Use `create(LogoutRequestSchema)` to create a new message.
|
|
130
|
+
*/
|
|
131
|
+
export const LogoutRequestSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 23);
|
|
132
|
+
/**
|
|
133
|
+
* Describes the message hular.v1.LogoutResponse.
|
|
134
|
+
* Use `create(LogoutResponseSchema)` to create a new message.
|
|
135
|
+
*/
|
|
136
|
+
export const LogoutResponseSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 24);
|
|
137
|
+
/**
|
|
138
|
+
* Describes the message hular.v1.GetPartnerRequest.
|
|
139
|
+
* Use `create(GetPartnerRequestSchema)` to create a new message.
|
|
140
|
+
*/
|
|
141
|
+
export const GetPartnerRequestSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 25);
|
|
142
|
+
/**
|
|
143
|
+
* Describes the message hular.v1.Partner.
|
|
144
|
+
* Use `create(PartnerSchema)` to create a new message.
|
|
145
|
+
*/
|
|
146
|
+
export const PartnerSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 26);
|
|
147
|
+
/**
|
|
148
|
+
* Describes the message hular.v1.PartnerApiKey.
|
|
149
|
+
* Use `create(PartnerApiKeySchema)` to create a new message.
|
|
150
|
+
*/
|
|
151
|
+
export const PartnerApiKeySchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 27);
|
|
152
|
+
/**
|
|
153
|
+
* Describes the message hular.v1.ListPartnerSessionsRequest.
|
|
154
|
+
* Use `create(ListPartnerSessionsRequestSchema)` to create a new message.
|
|
155
|
+
*/
|
|
156
|
+
export const ListPartnerSessionsRequestSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 28);
|
|
157
|
+
/**
|
|
158
|
+
* Describes the message hular.v1.SessionIp.
|
|
159
|
+
* Use `create(SessionIpSchema)` to create a new message.
|
|
160
|
+
*/
|
|
161
|
+
export const SessionIpSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 29);
|
|
162
|
+
/**
|
|
163
|
+
* Describes the message hular.v1.PartnerSessionInfo.
|
|
164
|
+
* Use `create(PartnerSessionInfoSchema)` to create a new message.
|
|
165
|
+
*/
|
|
166
|
+
export const PartnerSessionInfoSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 30);
|
|
167
|
+
/**
|
|
168
|
+
* Describes the message hular.v1.PartnerSessionsPage.
|
|
169
|
+
* Use `create(PartnerSessionsPageSchema)` to create a new message.
|
|
170
|
+
*/
|
|
171
|
+
export const PartnerSessionsPageSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 31);
|
|
172
|
+
/**
|
|
173
|
+
* Describes the message hular.v1.RevokePartnerSessionRequest.
|
|
174
|
+
* Use `create(RevokePartnerSessionRequestSchema)` to create a new message.
|
|
175
|
+
*/
|
|
176
|
+
export const RevokePartnerSessionRequestSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 32);
|
|
177
|
+
/**
|
|
178
|
+
* Describes the message hular.v1.RevokePartnerSessionResponse.
|
|
179
|
+
* Use `create(RevokePartnerSessionResponseSchema)` to create a new message.
|
|
180
|
+
*/
|
|
181
|
+
export const RevokePartnerSessionResponseSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 33);
|
|
182
|
+
/**
|
|
183
|
+
* Describes the message hular.v1.PartnerApiStatsRequest.
|
|
184
|
+
* Use `create(PartnerApiStatsRequestSchema)` to create a new message.
|
|
185
|
+
*/
|
|
186
|
+
export const PartnerApiStatsRequestSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 34);
|
|
187
|
+
/**
|
|
188
|
+
* Describes the message hular.v1.StatsPoint.
|
|
189
|
+
* Use `create(StatsPointSchema)` to create a new message.
|
|
190
|
+
*/
|
|
191
|
+
export const StatsPointSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 35);
|
|
192
|
+
/**
|
|
193
|
+
* Describes the message hular.v1.RequestSeries.
|
|
194
|
+
* Use `create(RequestSeriesSchema)` to create a new message.
|
|
195
|
+
*/
|
|
196
|
+
export const RequestSeriesSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 36);
|
|
197
|
+
/**
|
|
198
|
+
* Describes the message hular.v1.PointsSeries.
|
|
199
|
+
* Use `create(PointsSeriesSchema)` to create a new message.
|
|
200
|
+
*/
|
|
201
|
+
export const PointsSeriesSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 37);
|
|
202
|
+
/**
|
|
203
|
+
* Describes the message hular.v1.PartnerApiStats.
|
|
204
|
+
* Use `create(PartnerApiStatsSchema)` to create a new message.
|
|
205
|
+
*/
|
|
206
|
+
export const PartnerApiStatsSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 38);
|
|
207
|
+
/**
|
|
208
|
+
* Describes the message hular.v1.CreatePartnerApiKeyRequest.
|
|
209
|
+
* Use `create(CreatePartnerApiKeyRequestSchema)` to create a new message.
|
|
210
|
+
*/
|
|
211
|
+
export const CreatePartnerApiKeyRequestSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 39);
|
|
212
|
+
/**
|
|
213
|
+
* Describes the message hular.v1.RevokePartnerApiKeyRequest.
|
|
214
|
+
* Use `create(RevokePartnerApiKeyRequestSchema)` to create a new message.
|
|
215
|
+
*/
|
|
216
|
+
export const RevokePartnerApiKeyRequestSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 40);
|
|
217
|
+
/**
|
|
218
|
+
* Describes the message hular.v1.RevokePartnerApiKeyResponse.
|
|
219
|
+
* Use `create(RevokePartnerApiKeyResponseSchema)` to create a new message.
|
|
220
|
+
*/
|
|
221
|
+
export const RevokePartnerApiKeyResponseSchema = /*@__PURE__*/ messageDesc(file_hular_v1_partner, 41);
|
|
222
|
+
/**
|
|
223
|
+
* @generated from enum hular.v1.LoginPanel
|
|
224
|
+
*/
|
|
225
|
+
export var LoginPanel;
|
|
226
|
+
(function (LoginPanel) {
|
|
227
|
+
/**
|
|
228
|
+
* @generated from enum value: LOGIN_PANEL_UNSPECIFIED = 0;
|
|
229
|
+
*/
|
|
230
|
+
LoginPanel[LoginPanel["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
231
|
+
/**
|
|
232
|
+
* @generated from enum value: LOGIN_PANEL_PARTNER = 1;
|
|
233
|
+
*/
|
|
234
|
+
LoginPanel[LoginPanel["PARTNER"] = 1] = "PARTNER";
|
|
235
|
+
/**
|
|
236
|
+
* @generated from enum value: LOGIN_PANEL_ADMIN = 2;
|
|
237
|
+
*/
|
|
238
|
+
LoginPanel[LoginPanel["ADMIN"] = 2] = "ADMIN";
|
|
239
|
+
})(LoginPanel || (LoginPanel = {}));
|
|
240
|
+
/**
|
|
241
|
+
* Describes the enum hular.v1.LoginPanel.
|
|
242
|
+
*/
|
|
243
|
+
export const LoginPanelSchema = /*@__PURE__*/ enumDesc(file_hular_v1_partner, 0);
|
|
244
|
+
/**
|
|
245
|
+
* @generated from service hular.v1.PartnerApi
|
|
246
|
+
*/
|
|
247
|
+
export const PartnerApi = /*@__PURE__*/ serviceDesc(file_hular_v1_partner, 0);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { GenExtension, GenFile } from "@bufbuild/protobuf/codegenv2";
|
|
2
|
+
import type { MethodOptions } from "@bufbuild/protobuf/wkt";
|
|
3
|
+
/**
|
|
4
|
+
* Describes the file hular/v1/ratelimit.proto.
|
|
5
|
+
*/
|
|
6
|
+
export declare const file_hular_v1_ratelimit: GenFile;
|
|
7
|
+
/**
|
|
8
|
+
* @generated from extension: uint32 rate_cost = 50100;
|
|
9
|
+
*/
|
|
10
|
+
export declare const rate_cost: GenExtension<MethodOptions, number>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// @generated by protoc-gen-es v2.14.0 with parameter "target=ts,import_extension=js"
|
|
2
|
+
// @generated from file hular/v1/ratelimit.proto (package hular.v1, syntax proto3)
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
import { extDesc, fileDesc } from "@bufbuild/protobuf/codegenv2";
|
|
5
|
+
import { file_google_protobuf_descriptor } from "@bufbuild/protobuf/wkt";
|
|
6
|
+
/**
|
|
7
|
+
* Describes the file hular/v1/ratelimit.proto.
|
|
8
|
+
*/
|
|
9
|
+
export const file_hular_v1_ratelimit = /*@__PURE__*/ fileDesc("ChhodWxhci92MS9yYXRlbGltaXQucHJvdG8SCGh1bGFyLnYxOj0KCXJhdGVfY29zdBIeLmdvb2dsZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zGLSHAyABKA1SCHJhdGVDb3N0YgZwcm90bzM", [file_google_protobuf_descriptor]);
|
|
10
|
+
/**
|
|
11
|
+
* @generated from extension: uint32 rate_cost = 50100;
|
|
12
|
+
*/
|
|
13
|
+
export const rate_cost = /*@__PURE__*/ extDesc(file_hular_v1_ratelimit, 0);
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from "./gen/blink/v1/admin_pb.js";
|
|
|
3
3
|
export * from "./gen/blink/v1/partner_pb.js";
|
|
4
4
|
export * from "./amount.js";
|
|
5
5
|
export * from "./client.js";
|
|
6
|
+
export * from "./contracts.js";
|
|
6
7
|
export * from "./deposit.js";
|
|
7
8
|
export * from "./evm.js";
|
|
8
9
|
export * from "./hash.js";
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export * from "./gen/blink/v1/admin_pb.js";
|
|
|
3
3
|
export * from "./gen/blink/v1/partner_pb.js";
|
|
4
4
|
export * from "./amount.js";
|
|
5
5
|
export * from "./client.js";
|
|
6
|
+
export * from "./contracts.js";
|
|
6
7
|
export * from "./deposit.js";
|
|
7
8
|
export * from "./evm.js";
|
|
8
9
|
export * from "./hash.js";
|
package/dist/order.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type JsonValue } from "@bufbuild/protobuf";
|
|
2
2
|
import type { Transaction } from "@mysten/sui/transactions";
|
|
3
3
|
import { type EvmDepositCall, type EvmDepositSignature } from "./evm.js";
|
|
4
|
-
import
|
|
4
|
+
import type { ContractRegistry } from "./contracts.js";
|
|
5
|
+
import { type CrossChainQuote, type OrderParams, type QuoteResponse, type SameChainSwapQuote, type SwapInstructions } from "./gen/blink/v1/api_pb.js";
|
|
5
6
|
import { type SuiDepositCall } from "./sui.js";
|
|
6
7
|
import { type SvmDepositInstructions } from "./svm.js";
|
|
7
8
|
export type Quote = CrossChainQuote | SameChainSwapQuote;
|
|
@@ -19,7 +20,6 @@ export declare const explorerAddressUrl: (template: string | undefined, address:
|
|
|
19
20
|
export interface BlinkOrder {
|
|
20
21
|
quote: CrossChainQuote;
|
|
21
22
|
swap?: SwapInstructions;
|
|
22
|
-
chain?: ChainStatus;
|
|
23
23
|
}
|
|
24
24
|
export declare const isSourceSwap: (params: OrderParams) => boolean;
|
|
25
25
|
export declare const decodeCrossChainQuote: (json: JsonValue) => CrossChainQuote;
|
|
@@ -37,6 +37,10 @@ export interface OrderExpectation {
|
|
|
37
37
|
referrers?: ReferrerEntry[];
|
|
38
38
|
}
|
|
39
39
|
export declare const assertOrderMatches: (quote: CrossChainQuote, expected: OrderExpectation) => void;
|
|
40
|
-
export declare const evmOrderDepositCall: (order: BlinkOrder, signature?: EvmDepositSignature) => EvmDepositCall
|
|
41
|
-
export declare const svmOrderDepositInstructions: (order: BlinkOrder, rpcUrl: string, owner: string, computeUnitPriceMicroLamports: bigint) => Promise<SvmDepositInstructions>;
|
|
42
|
-
export
|
|
40
|
+
export declare const evmOrderDepositCall: (order: BlinkOrder, registry: ContractRegistry, signature?: EvmDepositSignature) => Promise<EvmDepositCall>;
|
|
41
|
+
export declare const svmOrderDepositInstructions: (order: BlinkOrder, registry: ContractRegistry, rpcUrl: string, owner: string, computeUnitPriceMicroLamports: bigint) => Promise<SvmDepositInstructions>;
|
|
42
|
+
export interface SuiSourceSwapTerms {
|
|
43
|
+
swapExecutor: string;
|
|
44
|
+
expiresAtMs: bigint;
|
|
45
|
+
}
|
|
46
|
+
export declare const suiOrderDepositCall: (order: BlinkOrder, registry: ContractRegistry, tx: Transaction, payment: SuiDepositCall["payment"], sourceSwap?: SuiSourceSwapTerms) => Promise<void>;
|
package/dist/order.js
CHANGED
|
@@ -2,7 +2,7 @@ import { fromJson } from "@bufbuild/protobuf";
|
|
|
2
2
|
import { buildEvmDepositCall, } from "./evm.js";
|
|
3
3
|
import { QuoteResponseSchema, } from "./gen/blink/v1/api_pb.js";
|
|
4
4
|
import { verifyQuote } from "./hash.js";
|
|
5
|
-
import { addSuiDepositCall,
|
|
5
|
+
import { addSuiDepositCall, addSuiSourceSwapOpenCall, } from "./sui.js";
|
|
6
6
|
import { buildSvmDepositInstructions, buildSvmSwapDepositInstructions, } from "./svm.js";
|
|
7
7
|
export const quoteOf = (response) => response.quote.value;
|
|
8
8
|
export const isSameChainSwap = (response) => response.quote.case === "sameChainSwap";
|
|
@@ -30,9 +30,7 @@ const OUTCOMES = {
|
|
|
30
30
|
fulfilled: "fulfilled",
|
|
31
31
|
refunded: "refunded",
|
|
32
32
|
refund_skipped: "failed",
|
|
33
|
-
|
|
34
|
-
refund_failed: "failed",
|
|
35
|
-
unsupported_deposit: "failed",
|
|
33
|
+
support: "failed",
|
|
36
34
|
};
|
|
37
35
|
export const orderOutcome = (state) => OUTCOMES[state] ?? "pending";
|
|
38
36
|
export const isTerminalState = (state) => state in OUTCOMES;
|
|
@@ -89,17 +87,28 @@ export const assertOrderMatches = (quote, expected) => {
|
|
|
89
87
|
throw new Error("order referrers do not match the requested referrers");
|
|
90
88
|
}
|
|
91
89
|
};
|
|
92
|
-
export const evmOrderDepositCall = (order, signature) =>
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
|
|
90
|
+
export const evmOrderDepositCall = async (order, registry, signature) => {
|
|
91
|
+
const params = paramsOf(order.quote);
|
|
92
|
+
const guardianSetIndex = order.quote.guardianSetIndex;
|
|
93
|
+
await registry.assertRegistered(params.srcChain, params.routerAddress, guardianSetIndex);
|
|
94
|
+
if (order.swap) {
|
|
95
|
+
await registry.assertRegistered(params.srcChain, order.swap.routerAddress, guardianSetIndex);
|
|
96
|
+
}
|
|
97
|
+
const { router } = await registry.contracts(params.srcChain, guardianSetIndex);
|
|
98
|
+
return buildEvmDepositCall({
|
|
99
|
+
quoteHash: order.quote.quoteHash,
|
|
100
|
+
params,
|
|
101
|
+
swap: order.swap,
|
|
102
|
+
directTransfer: order.quote.directTransfer,
|
|
103
|
+
router,
|
|
104
|
+
}, signature);
|
|
105
|
+
};
|
|
106
|
+
export const svmOrderDepositInstructions = async (order, registry, rpcUrl, owner, computeUnitPriceMicroLamports) => {
|
|
100
107
|
const params = paramsOf(order.quote);
|
|
101
108
|
const amount = BigInt(params.amountIn);
|
|
109
|
+
const guardianSetIndex = order.quote.guardianSetIndex;
|
|
102
110
|
if (!isSourceSwap(params)) {
|
|
111
|
+
await registry.assertRegistered(params.srcChain, params.routerAddress, guardianSetIndex);
|
|
103
112
|
return {
|
|
104
113
|
instructions: await buildSvmDepositInstructions({
|
|
105
114
|
rpcUrl,
|
|
@@ -117,13 +126,10 @@ export const svmOrderDepositInstructions = async (order, rpcUrl, owner, computeU
|
|
|
117
126
|
if (!swap || swap.payload.case !== "svm") {
|
|
118
127
|
throw new Error("expected svm swap instructions");
|
|
119
128
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
throw new Error("svm deposits are unavailable");
|
|
123
|
-
}
|
|
129
|
+
await registry.assertRegistered(params.srcChain, swap.routerAddress, guardianSetIndex);
|
|
130
|
+
const { swapPrograms } = await registry.contracts(params.srcChain, guardianSetIndex);
|
|
124
131
|
return buildSvmSwapDepositInstructions({
|
|
125
132
|
rpcUrl,
|
|
126
|
-
chain: params.srcChain,
|
|
127
133
|
programId: swap.routerAddress,
|
|
128
134
|
owner,
|
|
129
135
|
srcToken: params.srcToken,
|
|
@@ -133,34 +139,36 @@ export const svmOrderDepositInstructions = async (order, rpcUrl, owner, computeU
|
|
|
133
139
|
quoteHash: order.quote.quoteHash,
|
|
134
140
|
swap: swap.payload.value,
|
|
135
141
|
computeUnitPriceMicroLamports,
|
|
136
|
-
|
|
142
|
+
swapPrograms,
|
|
137
143
|
});
|
|
138
144
|
};
|
|
139
|
-
export const suiOrderDepositCall = (order, tx, payment) => {
|
|
145
|
+
export const suiOrderDepositCall = async (order, registry, tx, payment, sourceSwap) => {
|
|
140
146
|
const params = paramsOf(order.quote);
|
|
141
|
-
const
|
|
147
|
+
const guardianSetIndex = order.quote.guardianSetIndex;
|
|
148
|
+
await registry.assertRegistered(params.srcChain, params.routerAddress, guardianSetIndex);
|
|
149
|
+
const { escrow } = await registry.contracts(params.srcChain, guardianSetIndex);
|
|
142
150
|
if (!escrow) {
|
|
143
151
|
throw new Error("sui deposits are unavailable");
|
|
144
152
|
}
|
|
145
153
|
if (isSourceSwap(params)) {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
throw new Error("expected sui swap instructions");
|
|
154
|
+
if (!sourceSwap) {
|
|
155
|
+
throw new Error("sui source swaps need the chain's swap executor and an expiry from suiSourceSwapExpiry");
|
|
149
156
|
}
|
|
150
157
|
const sender = tx.getData().sender;
|
|
151
158
|
if (!sender) {
|
|
152
|
-
throw new Error("sui
|
|
159
|
+
throw new Error("sui source swaps need the transaction sender set");
|
|
153
160
|
}
|
|
154
|
-
|
|
161
|
+
addSuiSourceSwapOpenCall(tx, {
|
|
155
162
|
packageId: params.routerAddress,
|
|
156
163
|
escrowObject: escrow,
|
|
164
|
+
swapExecutor: sourceSwap.swapExecutor,
|
|
157
165
|
sender,
|
|
158
166
|
srcToken: params.srcToken,
|
|
159
167
|
bridgeToken: params.bridgeTokenSrc,
|
|
160
168
|
amountIn: BigInt(params.amountIn),
|
|
161
169
|
minBridgeOut: BigInt(params.minBridgeOut),
|
|
162
170
|
quoteHash: order.quote.quoteHash,
|
|
163
|
-
|
|
171
|
+
expiresAtMs: sourceSwap.expiresAtMs,
|
|
164
172
|
payment,
|
|
165
173
|
});
|
|
166
174
|
return;
|
package/dist/sui.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { bcs } from "@mysten/sui/bcs";
|
|
2
1
|
import { Transaction, type TransactionObjectArgument } from "@mysten/sui/transactions";
|
|
3
|
-
import type { SuiSwapInstructions } from "./gen/blink/v1/api_pb.js";
|
|
4
2
|
export declare const SUI_COIN_TYPE = "0x2::sui::SUI";
|
|
5
3
|
export declare const isNativeSuiToken: (address: string) => boolean;
|
|
6
4
|
export declare const suiBalance: (rpcUrl: string, coinType: string, owner: string) => Promise<bigint>;
|
|
@@ -23,44 +21,35 @@ export interface SuiDepositCall {
|
|
|
23
21
|
export declare const addSuiDepositCall: (tx: Transaction, call: SuiDepositCall) => void;
|
|
24
22
|
export declare const buildSuiDeposit: (request: SuiDepositRequest) => Promise<Transaction>;
|
|
25
23
|
export declare const sponsorSuiTransaction: (rpcUrl: string, transaction: Transaction, sponsor: string, maxGasBudget: bigint) => Promise<Transaction>;
|
|
26
|
-
export
|
|
27
|
-
export
|
|
28
|
-
export interface SuiSwapFragmentRules {
|
|
29
|
-
sender: string;
|
|
30
|
-
srcToken: string;
|
|
31
|
-
}
|
|
32
|
-
export declare const suiSwapFragmentOf: (swap: SuiSwapInstructions) => {
|
|
33
|
-
fragment: SuiSwapFragment;
|
|
34
|
-
coinOut: SuiFragmentArgument;
|
|
35
|
-
};
|
|
36
|
-
export declare const checkSuiSwapFragment: (fragment: SuiSwapFragment, coinOut: SuiFragmentArgument, rules: SuiSwapFragmentRules) => void;
|
|
37
|
-
export declare const appendSwapFragment: (tx: Transaction, fragment: SuiSwapFragment, payment: TransactionObjectArgument, coinOut: SuiFragmentArgument) => TransactionObjectArgument;
|
|
38
|
-
export interface SuiSwapDepositCall {
|
|
24
|
+
export declare const suiSourceSwapExpiry: (rpcUrl: string) => Promise<bigint>;
|
|
25
|
+
export interface SuiSourceSwapOpenCall {
|
|
39
26
|
packageId: string;
|
|
40
27
|
escrowObject: string;
|
|
28
|
+
swapExecutor: string;
|
|
41
29
|
sender: string;
|
|
42
30
|
srcToken: string;
|
|
43
31
|
bridgeToken: string;
|
|
44
32
|
amountIn: bigint;
|
|
45
33
|
minBridgeOut: bigint;
|
|
46
34
|
quoteHash: string;
|
|
47
|
-
|
|
48
|
-
payment
|
|
35
|
+
expiresAtMs: bigint;
|
|
36
|
+
payment?: TransactionObjectArgument;
|
|
49
37
|
}
|
|
50
|
-
export declare const
|
|
51
|
-
export interface
|
|
38
|
+
export declare const addSuiSourceSwapOpenCall: (tx: Transaction, call: SuiSourceSwapOpenCall) => void;
|
|
39
|
+
export interface SuiSourceSwapOpenRequest {
|
|
52
40
|
rpcUrl: string;
|
|
53
41
|
packageId: string;
|
|
54
42
|
escrowObject: string;
|
|
43
|
+
swapExecutor: string;
|
|
55
44
|
owner: string;
|
|
56
45
|
srcToken: string;
|
|
57
46
|
bridgeToken: string;
|
|
58
47
|
amountIn: bigint;
|
|
59
48
|
minBridgeOut: bigint;
|
|
60
49
|
quoteHash: string;
|
|
61
|
-
|
|
50
|
+
gasless: boolean;
|
|
62
51
|
}
|
|
63
|
-
export declare const
|
|
52
|
+
export declare const buildSuiSourceSwapOpen: (request: SuiSourceSwapOpenRequest) => Promise<Transaction>;
|
|
64
53
|
export interface SuiVoucherRedemptionRequest {
|
|
65
54
|
packageId: string;
|
|
66
55
|
escrowObject: string;
|