@uniswap/client-trading 0.5.3 → 0.5.7
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/dist/trading/v1/api_pb.d.ts +72 -27
- package/dist/trading/v1/api_pb.js +84 -13
- package/package.json +1 -1
|
@@ -530,6 +530,23 @@ export declare enum OrderType {
|
|
|
530
530
|
*/
|
|
531
531
|
OrderType_DUTCH_V3 = 4
|
|
532
532
|
}
|
|
533
|
+
/**
|
|
534
|
+
* @generated from enum trading.v1.AllowanceUnit
|
|
535
|
+
*/
|
|
536
|
+
export declare enum AllowanceUnit {
|
|
537
|
+
/**
|
|
538
|
+
* @generated from enum value: ALLOWANCE_UNIT_UNSPECIFIED = 0;
|
|
539
|
+
*/
|
|
540
|
+
UNSPECIFIED = 0,
|
|
541
|
+
/**
|
|
542
|
+
* @generated from enum value: ALLOWANCE_UNIT_FREE_SWAPS = 1;
|
|
543
|
+
*/
|
|
544
|
+
FREE_SWAPS = 1,
|
|
545
|
+
/**
|
|
546
|
+
* @generated from enum value: ALLOWANCE_UNIT_USD_CENT = 2;
|
|
547
|
+
*/
|
|
548
|
+
USD_CENT = 2
|
|
549
|
+
}
|
|
533
550
|
/**
|
|
534
551
|
* @generated from message trading.v1.Encode7702Request
|
|
535
552
|
*/
|
|
@@ -888,13 +905,9 @@ export declare class CheckApproval4337Request extends Message<CheckApproval4337R
|
|
|
888
905
|
*/
|
|
889
906
|
urgencyOverrides?: UrgencyWithOverrides;
|
|
890
907
|
/**
|
|
891
|
-
*
|
|
892
|
-
* to the paymaster for server-side sponsorship. When false a plain approval
|
|
893
|
-
* UserOperation is returned.
|
|
894
|
-
*
|
|
895
|
-
* @generated from field: bool request_gas_sponsorship = 7;
|
|
908
|
+
* @generated from field: optional trading.v1.SponsorshipInfo sponsorship_info = 7;
|
|
896
909
|
*/
|
|
897
|
-
|
|
910
|
+
sponsorshipInfo?: SponsorshipInfo;
|
|
898
911
|
/**
|
|
899
912
|
* @generated from field: optional string token_out = 8;
|
|
900
913
|
*/
|
|
@@ -911,16 +924,6 @@ export declare class CheckApproval4337Request extends Message<CheckApproval4337R
|
|
|
911
924
|
* @generated from field: optional trading.v1.Eip7702Authorization eip7702_auth = 11;
|
|
912
925
|
*/
|
|
913
926
|
eip7702Auth?: Eip7702Authorization;
|
|
914
|
-
/**
|
|
915
|
-
* Paymaster endpoint for the wallet flow (server-side paymaster fill).
|
|
916
|
-
*
|
|
917
|
-
* @generated from field: optional string paymaster_url = 12;
|
|
918
|
-
*/
|
|
919
|
-
paymasterUrl?: string;
|
|
920
|
-
/**
|
|
921
|
-
* @generated from field: google.protobuf.Struct paymaster_service_context = 13;
|
|
922
|
-
*/
|
|
923
|
-
paymasterServiceContext?: Struct;
|
|
924
927
|
constructor(data?: PartialMessage<CheckApproval4337Request>);
|
|
925
928
|
static readonly runtime: typeof proto3;
|
|
926
929
|
static readonly typeName = "trading.v1.CheckApproval4337Request";
|
|
@@ -951,11 +954,9 @@ export declare class CheckApproval4337Response extends Message<CheckApproval4337
|
|
|
951
954
|
*/
|
|
952
955
|
gasSponsorshipRejectionReason?: string;
|
|
953
956
|
/**
|
|
954
|
-
*
|
|
955
|
-
*
|
|
956
|
-
* @generated from field: optional trading.v1.SponsorMetadata sponsor_metadata = 5;
|
|
957
|
+
* @generated from field: optional trading.v1.PaymasterServiceContext paymaster_service_context = 5;
|
|
957
958
|
*/
|
|
958
|
-
|
|
959
|
+
paymasterServiceContext?: PaymasterServiceContext;
|
|
959
960
|
constructor(data?: PartialMessage<CheckApproval4337Response>);
|
|
960
961
|
static readonly runtime: typeof proto3;
|
|
961
962
|
static readonly typeName = "trading.v1.CheckApproval4337Response";
|
|
@@ -1048,13 +1049,6 @@ export declare class Swap5792Request extends Message<Swap5792Request> {
|
|
|
1048
1049
|
* @generated from field: optional bool approval_only = 9;
|
|
1049
1050
|
*/
|
|
1050
1051
|
approvalOnly?: boolean;
|
|
1051
|
-
/**
|
|
1052
|
-
* Explicit opt-in to gas sponsorship for approval-only batches (mirrors
|
|
1053
|
-
* /check_approval_4337). The swap flow still uses sponsorship_info.
|
|
1054
|
-
*
|
|
1055
|
-
* @generated from field: optional bool request_gas_sponsorship = 14;
|
|
1056
|
-
*/
|
|
1057
|
-
requestGasSponsorship?: boolean;
|
|
1058
1052
|
constructor(data?: PartialMessage<Swap5792Request>);
|
|
1059
1053
|
static readonly runtime: typeof proto3;
|
|
1060
1054
|
static readonly typeName = "trading.v1.Swap5792Request";
|
|
@@ -6938,6 +6932,30 @@ export declare class CampaignDetails extends Message<CampaignDetails> {
|
|
|
6938
6932
|
* @generated from field: optional string description = 2;
|
|
6939
6933
|
*/
|
|
6940
6934
|
description?: string;
|
|
6935
|
+
/**
|
|
6936
|
+
* Human-readable headline; `description` is the subheader.
|
|
6937
|
+
*
|
|
6938
|
+
* @generated from field: optional string headline = 3;
|
|
6939
|
+
*/
|
|
6940
|
+
headline?: string;
|
|
6941
|
+
/**
|
|
6942
|
+
* Campaign image asset for the UI thumbnail.
|
|
6943
|
+
*
|
|
6944
|
+
* @generated from field: optional string thumbnail_url = 4;
|
|
6945
|
+
*/
|
|
6946
|
+
thumbnailUrl?: string;
|
|
6947
|
+
/**
|
|
6948
|
+
* Per-wallet caps + utilization, one entry per dimension; empty when no cap.
|
|
6949
|
+
*
|
|
6950
|
+
* @generated from field: repeated trading.v1.CampaignAllowance allowances = 5;
|
|
6951
|
+
*/
|
|
6952
|
+
allowances: CampaignAllowance[];
|
|
6953
|
+
/**
|
|
6954
|
+
* Chains the campaign covers, for the "eligible chains" modal.
|
|
6955
|
+
*
|
|
6956
|
+
* @generated from field: repeated trading.v1.ChainId eligible_chains = 6;
|
|
6957
|
+
*/
|
|
6958
|
+
eligibleChains: ChainId[];
|
|
6941
6959
|
constructor(data?: PartialMessage<CampaignDetails>);
|
|
6942
6960
|
static readonly runtime: typeof proto3;
|
|
6943
6961
|
static readonly typeName = "trading.v1.CampaignDetails";
|
|
@@ -6947,6 +6965,33 @@ export declare class CampaignDetails extends Message<CampaignDetails> {
|
|
|
6947
6965
|
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): CampaignDetails;
|
|
6948
6966
|
static equals(a: CampaignDetails | PlainMessage<CampaignDetails> | undefined, b: CampaignDetails | PlainMessage<CampaignDetails> | undefined): boolean;
|
|
6949
6967
|
}
|
|
6968
|
+
/**
|
|
6969
|
+
* Drives the allowance line, e.g. "5 of 5 free swaps remaining" or "$2 of $10".
|
|
6970
|
+
*
|
|
6971
|
+
* @generated from message trading.v1.CampaignAllowance
|
|
6972
|
+
*/
|
|
6973
|
+
export declare class CampaignAllowance extends Message<CampaignAllowance> {
|
|
6974
|
+
/**
|
|
6975
|
+
* @generated from field: trading.v1.AllowanceUnit unit = 1;
|
|
6976
|
+
*/
|
|
6977
|
+
unit: AllowanceUnit;
|
|
6978
|
+
/**
|
|
6979
|
+
* @generated from field: string total = 2;
|
|
6980
|
+
*/
|
|
6981
|
+
total: string;
|
|
6982
|
+
/**
|
|
6983
|
+
* @generated from field: string remaining = 3;
|
|
6984
|
+
*/
|
|
6985
|
+
remaining: string;
|
|
6986
|
+
constructor(data?: PartialMessage<CampaignAllowance>);
|
|
6987
|
+
static readonly runtime: typeof proto3;
|
|
6988
|
+
static readonly typeName = "trading.v1.CampaignAllowance";
|
|
6989
|
+
static readonly fields: FieldList;
|
|
6990
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): CampaignAllowance;
|
|
6991
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): CampaignAllowance;
|
|
6992
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): CampaignAllowance;
|
|
6993
|
+
static equals(a: CampaignAllowance | PlainMessage<CampaignAllowance> | undefined, b: CampaignAllowance | PlainMessage<CampaignAllowance> | undefined): boolean;
|
|
6994
|
+
}
|
|
6950
6995
|
/**
|
|
6951
6996
|
* @generated from message trading.v1.SponsorshipInfo
|
|
6952
6997
|
*/
|
|
@@ -720,6 +720,30 @@ proto3.util.setEnumType(OrderType, "trading.v1.OrderType", [
|
|
|
720
720
|
{ no: 3, name: "OrderType_PRIORITY" },
|
|
721
721
|
{ no: 4, name: "OrderType_DUTCH_V3" },
|
|
722
722
|
]);
|
|
723
|
+
/**
|
|
724
|
+
* @generated from enum trading.v1.AllowanceUnit
|
|
725
|
+
*/
|
|
726
|
+
export var AllowanceUnit;
|
|
727
|
+
(function (AllowanceUnit) {
|
|
728
|
+
/**
|
|
729
|
+
* @generated from enum value: ALLOWANCE_UNIT_UNSPECIFIED = 0;
|
|
730
|
+
*/
|
|
731
|
+
AllowanceUnit[AllowanceUnit["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
732
|
+
/**
|
|
733
|
+
* @generated from enum value: ALLOWANCE_UNIT_FREE_SWAPS = 1;
|
|
734
|
+
*/
|
|
735
|
+
AllowanceUnit[AllowanceUnit["FREE_SWAPS"] = 1] = "FREE_SWAPS";
|
|
736
|
+
/**
|
|
737
|
+
* @generated from enum value: ALLOWANCE_UNIT_USD_CENT = 2;
|
|
738
|
+
*/
|
|
739
|
+
AllowanceUnit[AllowanceUnit["USD_CENT"] = 2] = "USD_CENT";
|
|
740
|
+
})(AllowanceUnit || (AllowanceUnit = {}));
|
|
741
|
+
// Retrieve enum metadata with: proto3.getEnumType(AllowanceUnit)
|
|
742
|
+
proto3.util.setEnumType(AllowanceUnit, "trading.v1.AllowanceUnit", [
|
|
743
|
+
{ no: 0, name: "ALLOWANCE_UNIT_UNSPECIFIED" },
|
|
744
|
+
{ no: 1, name: "ALLOWANCE_UNIT_FREE_SWAPS" },
|
|
745
|
+
{ no: 2, name: "ALLOWANCE_UNIT_USD_CENT" },
|
|
746
|
+
]);
|
|
723
747
|
/**
|
|
724
748
|
* @generated from message trading.v1.Encode7702Request
|
|
725
749
|
*/
|
|
@@ -1115,14 +1139,6 @@ export class CheckApproval4337Request extends Message {
|
|
|
1115
1139
|
* @generated from field: trading.v1.ChainId chain_id = 4;
|
|
1116
1140
|
*/
|
|
1117
1141
|
this.chainId = ChainId.CHAIN_ID_UNSPECIFIED;
|
|
1118
|
-
/**
|
|
1119
|
-
* Explicit opt-in: when true (and paymaster_url is set) the approval is sent
|
|
1120
|
-
* to the paymaster for server-side sponsorship. When false a plain approval
|
|
1121
|
-
* UserOperation is returned.
|
|
1122
|
-
*
|
|
1123
|
-
* @generated from field: bool request_gas_sponsorship = 7;
|
|
1124
|
-
*/
|
|
1125
|
-
this.requestGasSponsorship = false;
|
|
1126
1142
|
proto3.util.initPartial(data, this);
|
|
1127
1143
|
}
|
|
1128
1144
|
static fromBinary(bytes, options) {
|
|
@@ -1147,13 +1163,11 @@ CheckApproval4337Request.fields = proto3.util.newFieldList(() => [
|
|
|
1147
1163
|
{ no: 4, name: "chain_id", kind: "enum", T: proto3.getEnumType(ChainId) },
|
|
1148
1164
|
{ no: 5, name: "urgency", kind: "enum", T: proto3.getEnumType(Urgency), opt: true },
|
|
1149
1165
|
{ no: 6, name: "urgency_overrides", kind: "message", T: UrgencyWithOverrides, opt: true },
|
|
1150
|
-
{ no: 7, name: "
|
|
1166
|
+
{ no: 7, name: "sponsorship_info", kind: "message", T: SponsorshipInfo, opt: true },
|
|
1151
1167
|
{ no: 8, name: "token_out", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
1152
1168
|
{ no: 9, name: "token_out_chain_id", kind: "enum", T: proto3.getEnumType(ChainId), opt: true },
|
|
1153
1169
|
{ no: 10, name: "wallet_execution_context", kind: "message", T: WalletExecutionContext, opt: true },
|
|
1154
1170
|
{ no: 11, name: "eip7702_auth", kind: "message", T: Eip7702Authorization, opt: true },
|
|
1155
|
-
{ no: 12, name: "paymaster_url", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
1156
|
-
{ no: 13, name: "paymaster_service_context", kind: "message", T: Struct },
|
|
1157
1171
|
]);
|
|
1158
1172
|
/**
|
|
1159
1173
|
* @generated from message trading.v1.CheckApproval4337Response
|
|
@@ -1191,7 +1205,7 @@ CheckApproval4337Response.fields = proto3.util.newFieldList(() => [
|
|
|
1191
1205
|
{ no: 2, name: "user_operation", kind: "message", T: UserOperation, opt: true },
|
|
1192
1206
|
{ no: 3, name: "gas_sponsored", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
|
|
1193
1207
|
{ no: 4, name: "gas_sponsorship_rejection_reason", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
1194
|
-
{ no: 5, name: "
|
|
1208
|
+
{ no: 5, name: "paymaster_service_context", kind: "message", T: PaymasterServiceContext, opt: true },
|
|
1195
1209
|
]);
|
|
1196
1210
|
/**
|
|
1197
1211
|
* @generated from message trading.v1.Swap5792Request
|
|
@@ -1238,7 +1252,6 @@ Swap5792Request.fields = proto3.util.newFieldList(() => [
|
|
|
1238
1252
|
{ no: 7, name: "urgency_overrides", kind: "message", T: UrgencyWithOverrides, opt: true },
|
|
1239
1253
|
{ no: 8, name: "sponsorship_info", kind: "message", T: SponsorshipInfo, opt: true },
|
|
1240
1254
|
{ no: 9, name: "approval_only", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
|
|
1241
|
-
{ no: 14, name: "request_gas_sponsorship", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
|
|
1242
1255
|
]);
|
|
1243
1256
|
/**
|
|
1244
1257
|
* @generated from message trading.v1.Swap5792Response
|
|
@@ -8105,6 +8118,18 @@ SponsorMetadata.fields = proto3.util.newFieldList(() => [
|
|
|
8105
8118
|
export class CampaignDetails extends Message {
|
|
8106
8119
|
constructor(data) {
|
|
8107
8120
|
super();
|
|
8121
|
+
/**
|
|
8122
|
+
* Per-wallet caps + utilization, one entry per dimension; empty when no cap.
|
|
8123
|
+
*
|
|
8124
|
+
* @generated from field: repeated trading.v1.CampaignAllowance allowances = 5;
|
|
8125
|
+
*/
|
|
8126
|
+
this.allowances = [];
|
|
8127
|
+
/**
|
|
8128
|
+
* Chains the campaign covers, for the "eligible chains" modal.
|
|
8129
|
+
*
|
|
8130
|
+
* @generated from field: repeated trading.v1.ChainId eligible_chains = 6;
|
|
8131
|
+
*/
|
|
8132
|
+
this.eligibleChains = [];
|
|
8108
8133
|
proto3.util.initPartial(data, this);
|
|
8109
8134
|
}
|
|
8110
8135
|
static fromBinary(bytes, options) {
|
|
@@ -8125,6 +8150,52 @@ CampaignDetails.typeName = "trading.v1.CampaignDetails";
|
|
|
8125
8150
|
CampaignDetails.fields = proto3.util.newFieldList(() => [
|
|
8126
8151
|
{ no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
8127
8152
|
{ no: 2, name: "description", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
8153
|
+
{ no: 3, name: "headline", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
8154
|
+
{ no: 4, name: "thumbnail_url", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
8155
|
+
{ no: 5, name: "allowances", kind: "message", T: CampaignAllowance, repeated: true },
|
|
8156
|
+
{ no: 6, name: "eligible_chains", kind: "enum", T: proto3.getEnumType(ChainId), repeated: true },
|
|
8157
|
+
]);
|
|
8158
|
+
/**
|
|
8159
|
+
* Drives the allowance line, e.g. "5 of 5 free swaps remaining" or "$2 of $10".
|
|
8160
|
+
*
|
|
8161
|
+
* @generated from message trading.v1.CampaignAllowance
|
|
8162
|
+
*/
|
|
8163
|
+
export class CampaignAllowance extends Message {
|
|
8164
|
+
constructor(data) {
|
|
8165
|
+
super();
|
|
8166
|
+
/**
|
|
8167
|
+
* @generated from field: trading.v1.AllowanceUnit unit = 1;
|
|
8168
|
+
*/
|
|
8169
|
+
this.unit = AllowanceUnit.UNSPECIFIED;
|
|
8170
|
+
/**
|
|
8171
|
+
* @generated from field: string total = 2;
|
|
8172
|
+
*/
|
|
8173
|
+
this.total = "";
|
|
8174
|
+
/**
|
|
8175
|
+
* @generated from field: string remaining = 3;
|
|
8176
|
+
*/
|
|
8177
|
+
this.remaining = "";
|
|
8178
|
+
proto3.util.initPartial(data, this);
|
|
8179
|
+
}
|
|
8180
|
+
static fromBinary(bytes, options) {
|
|
8181
|
+
return new CampaignAllowance().fromBinary(bytes, options);
|
|
8182
|
+
}
|
|
8183
|
+
static fromJson(jsonValue, options) {
|
|
8184
|
+
return new CampaignAllowance().fromJson(jsonValue, options);
|
|
8185
|
+
}
|
|
8186
|
+
static fromJsonString(jsonString, options) {
|
|
8187
|
+
return new CampaignAllowance().fromJsonString(jsonString, options);
|
|
8188
|
+
}
|
|
8189
|
+
static equals(a, b) {
|
|
8190
|
+
return proto3.util.equals(CampaignAllowance, a, b);
|
|
8191
|
+
}
|
|
8192
|
+
}
|
|
8193
|
+
CampaignAllowance.runtime = proto3;
|
|
8194
|
+
CampaignAllowance.typeName = "trading.v1.CampaignAllowance";
|
|
8195
|
+
CampaignAllowance.fields = proto3.util.newFieldList(() => [
|
|
8196
|
+
{ no: 1, name: "unit", kind: "enum", T: proto3.getEnumType(AllowanceUnit) },
|
|
8197
|
+
{ no: 2, name: "total", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
8198
|
+
{ no: 3, name: "remaining", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
8128
8199
|
]);
|
|
8129
8200
|
/**
|
|
8130
8201
|
* @generated from message trading.v1.SponsorshipInfo
|