@stellar/stellar-sdk 13.0.0-rc.1 → 13.0.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/CHANGELOG.md +127 -2
- package/dist/stellar-sdk-minimal.js +385 -99
- package/dist/stellar-sdk-minimal.min.js +1 -1
- package/dist/stellar-sdk-no-axios.js +402 -102
- package/dist/stellar-sdk-no-axios.min.js +1 -1
- package/dist/stellar-sdk-no-eventsource.js +385 -99
- package/dist/stellar-sdk-no-eventsource.min.js +1 -1
- package/dist/stellar-sdk.js +402 -102
- package/dist/stellar-sdk.min.js +1 -1
- package/lib/contract/assembled_transaction.d.ts +75 -3
- package/lib/contract/assembled_transaction.js +123 -34
- package/lib/contract/basic_node_signer.d.ts +3 -2
- package/lib/contract/basic_node_signer.js +16 -8
- package/lib/contract/client.d.ts +13 -1
- package/lib/contract/client.js +159 -48
- package/lib/contract/types.d.ts +72 -8
- package/lib/contract/types.js +1 -0
- package/lib/horizon/call_builder.d.ts +1 -1
- package/lib/horizon/horizon_axios_client.js +1 -1
- package/lib/horizon/server_api.d.ts +1 -0
- package/lib/horizon/server_api.js +5 -0
- package/lib/horizon/types/effects.d.ts +51 -51
- package/lib/horizon/types/trade.d.ts +3 -2
- package/lib/http-client/types.d.ts +1 -0
- package/lib/minimal/contract/assembled_transaction.d.ts +75 -3
- package/lib/minimal/contract/assembled_transaction.js +123 -34
- package/lib/minimal/contract/basic_node_signer.d.ts +3 -2
- package/lib/minimal/contract/basic_node_signer.js +16 -8
- package/lib/minimal/contract/client.d.ts +13 -1
- package/lib/minimal/contract/client.js +159 -48
- package/lib/minimal/contract/types.d.ts +72 -8
- package/lib/minimal/contract/types.js +1 -0
- package/lib/minimal/horizon/call_builder.d.ts +1 -1
- package/lib/minimal/horizon/horizon_axios_client.js +1 -1
- package/lib/minimal/horizon/server_api.d.ts +1 -0
- package/lib/minimal/horizon/server_api.js +5 -0
- package/lib/minimal/horizon/types/effects.d.ts +51 -51
- package/lib/minimal/horizon/types/trade.d.ts +3 -2
- package/lib/minimal/http-client/types.d.ts +1 -0
- package/lib/minimal/rpc/axios.js +1 -1
- package/lib/minimal/stellartoml/index.d.ts +1 -0
- package/lib/minimal/stellartoml/index.js +2 -0
- package/lib/no-axios/contract/assembled_transaction.d.ts +75 -3
- package/lib/no-axios/contract/assembled_transaction.js +123 -34
- package/lib/no-axios/contract/basic_node_signer.d.ts +3 -2
- package/lib/no-axios/contract/basic_node_signer.js +16 -8
- package/lib/no-axios/contract/client.d.ts +13 -1
- package/lib/no-axios/contract/client.js +159 -48
- package/lib/no-axios/contract/types.d.ts +72 -8
- package/lib/no-axios/contract/types.js +1 -0
- package/lib/no-axios/horizon/call_builder.d.ts +1 -1
- package/lib/no-axios/horizon/horizon_axios_client.js +1 -1
- package/lib/no-axios/horizon/server_api.d.ts +1 -0
- package/lib/no-axios/horizon/server_api.js +5 -0
- package/lib/no-axios/horizon/types/effects.d.ts +51 -51
- package/lib/no-axios/horizon/types/trade.d.ts +3 -2
- package/lib/no-axios/http-client/types.d.ts +1 -0
- package/lib/no-axios/rpc/axios.js +1 -1
- package/lib/no-axios/stellartoml/index.d.ts +1 -0
- package/lib/no-axios/stellartoml/index.js +2 -0
- package/lib/no-eventsource/contract/assembled_transaction.d.ts +75 -3
- package/lib/no-eventsource/contract/assembled_transaction.js +123 -34
- package/lib/no-eventsource/contract/basic_node_signer.d.ts +3 -2
- package/lib/no-eventsource/contract/basic_node_signer.js +16 -8
- package/lib/no-eventsource/contract/client.d.ts +13 -1
- package/lib/no-eventsource/contract/client.js +159 -48
- package/lib/no-eventsource/contract/types.d.ts +72 -8
- package/lib/no-eventsource/contract/types.js +1 -0
- package/lib/no-eventsource/horizon/call_builder.d.ts +1 -1
- package/lib/no-eventsource/horizon/horizon_axios_client.js +1 -1
- package/lib/no-eventsource/horizon/server_api.d.ts +1 -0
- package/lib/no-eventsource/horizon/server_api.js +5 -0
- package/lib/no-eventsource/horizon/types/effects.d.ts +51 -51
- package/lib/no-eventsource/horizon/types/trade.d.ts +3 -2
- package/lib/no-eventsource/http-client/types.d.ts +1 -0
- package/lib/no-eventsource/rpc/axios.js +1 -1
- package/lib/no-eventsource/stellartoml/index.d.ts +1 -0
- package/lib/no-eventsource/stellartoml/index.js +2 -0
- package/lib/rpc/axios.js +1 -1
- package/lib/stellartoml/index.d.ts +1 -0
- package/lib/stellartoml/index.js +2 -0
- package/package.json +2 -2
|
@@ -55,86 +55,86 @@ export declare enum EffectType {
|
|
|
55
55
|
contract_credited = 96,
|
|
56
56
|
contract_debited = 97
|
|
57
57
|
}
|
|
58
|
-
export interface BaseEffectRecord extends HorizonApi.BaseResponse {
|
|
58
|
+
export interface BaseEffectRecord<T extends string = string> extends HorizonApi.BaseResponse {
|
|
59
59
|
id: string;
|
|
60
60
|
account: string;
|
|
61
61
|
paging_token: string;
|
|
62
62
|
type_i: EffectType;
|
|
63
|
-
type:
|
|
63
|
+
type: T;
|
|
64
64
|
created_at: string;
|
|
65
65
|
}
|
|
66
|
-
export interface AccountCreated extends BaseEffectRecord {
|
|
66
|
+
export interface AccountCreated extends BaseEffectRecord<'account_created'> {
|
|
67
67
|
type_i: EffectType.account_created;
|
|
68
68
|
starting_balance: string;
|
|
69
69
|
}
|
|
70
|
-
export interface AccountCredited extends BaseEffectRecord
|
|
70
|
+
export interface AccountCredited extends BaseEffectRecord<'account_credited'>, OfferAsset {
|
|
71
71
|
type_i: EffectType.account_credited;
|
|
72
72
|
amount: string;
|
|
73
73
|
}
|
|
74
|
-
export interface AccountDebited extends BaseEffectRecord {
|
|
74
|
+
export interface AccountDebited extends BaseEffectRecord<'account_debited'>, OfferAsset {
|
|
75
75
|
type_i: EffectType.account_debited;
|
|
76
76
|
amount: string;
|
|
77
77
|
}
|
|
78
|
-
export interface AccountThresholdsUpdated extends BaseEffectRecord {
|
|
78
|
+
export interface AccountThresholdsUpdated extends BaseEffectRecord<'account_thresholds_updated'> {
|
|
79
79
|
type_i: EffectType.account_thresholds_updated;
|
|
80
80
|
low_threshold: number;
|
|
81
81
|
med_threshold: number;
|
|
82
82
|
high_threshold: number;
|
|
83
83
|
}
|
|
84
|
-
export interface AccountHomeDomainUpdated extends BaseEffectRecord {
|
|
84
|
+
export interface AccountHomeDomainUpdated extends BaseEffectRecord<'account_home_domain_updated'> {
|
|
85
85
|
type_i: EffectType.account_home_domain_updated;
|
|
86
86
|
home_domain: string;
|
|
87
87
|
}
|
|
88
|
-
export interface AccountFlagsUpdated extends BaseEffectRecord {
|
|
88
|
+
export interface AccountFlagsUpdated extends BaseEffectRecord<'account_flags_updated'> {
|
|
89
89
|
type_i: EffectType.account_flags_updated;
|
|
90
90
|
auth_required_flag: boolean;
|
|
91
91
|
auth_revokable_flag: boolean;
|
|
92
92
|
}
|
|
93
|
-
interface DataEvents extends BaseEffectRecord {
|
|
93
|
+
interface DataEvents<T extends string> extends BaseEffectRecord<T> {
|
|
94
94
|
name: boolean;
|
|
95
95
|
value: boolean;
|
|
96
96
|
}
|
|
97
|
-
export interface DataCreated extends DataEvents {
|
|
97
|
+
export interface DataCreated extends DataEvents<'data_created'> {
|
|
98
98
|
type_i: EffectType.data_created;
|
|
99
99
|
}
|
|
100
|
-
export interface DataUpdated extends DataEvents {
|
|
100
|
+
export interface DataUpdated extends DataEvents<'data_updated'> {
|
|
101
101
|
type_i: EffectType.data_updated;
|
|
102
102
|
}
|
|
103
|
-
export interface DataRemoved extends DataEvents {
|
|
103
|
+
export interface DataRemoved extends DataEvents<'data_removed'> {
|
|
104
104
|
type_i: EffectType.data_removed;
|
|
105
105
|
}
|
|
106
|
-
export interface SequenceBumped extends BaseEffectRecord {
|
|
106
|
+
export interface SequenceBumped extends BaseEffectRecord<'sequence_bumped'> {
|
|
107
107
|
type_i: EffectType.sequence_bumped;
|
|
108
108
|
new_seq: number | string;
|
|
109
109
|
}
|
|
110
|
-
interface SignerEvents extends BaseEffectRecord {
|
|
110
|
+
interface SignerEvents<T extends string> extends BaseEffectRecord<T> {
|
|
111
111
|
weight: number;
|
|
112
112
|
key: string;
|
|
113
113
|
public_key: string;
|
|
114
114
|
}
|
|
115
|
-
export interface SignerCreated extends SignerEvents {
|
|
115
|
+
export interface SignerCreated extends SignerEvents<'signer_created'> {
|
|
116
116
|
type_i: EffectType.signer_created;
|
|
117
117
|
}
|
|
118
|
-
export interface SignerRemoved extends SignerEvents {
|
|
118
|
+
export interface SignerRemoved extends SignerEvents<'signer_removed'> {
|
|
119
119
|
type_i: EffectType.signer_removed;
|
|
120
120
|
}
|
|
121
|
-
export interface SignerUpdated extends SignerEvents {
|
|
121
|
+
export interface SignerUpdated extends SignerEvents<'signer_updated'> {
|
|
122
122
|
type_i: EffectType.signer_updated;
|
|
123
123
|
}
|
|
124
|
-
interface TrustlineEvents extends BaseEffectRecord
|
|
124
|
+
interface TrustlineEvents<T extends string> extends BaseEffectRecord<T>, OfferAsset {
|
|
125
125
|
limit: string;
|
|
126
126
|
liquidity_pool_id?: string;
|
|
127
127
|
}
|
|
128
|
-
export interface TrustlineCreated extends TrustlineEvents {
|
|
128
|
+
export interface TrustlineCreated extends TrustlineEvents<'trustline_created'> {
|
|
129
129
|
type_i: EffectType.trustline_created;
|
|
130
130
|
}
|
|
131
|
-
export interface TrustlineRemoved extends TrustlineEvents {
|
|
131
|
+
export interface TrustlineRemoved extends TrustlineEvents<'trustline_removed'> {
|
|
132
132
|
type_i: EffectType.trustline_removed;
|
|
133
133
|
}
|
|
134
|
-
export interface TrustlineUpdated extends TrustlineEvents {
|
|
134
|
+
export interface TrustlineUpdated extends TrustlineEvents<'trustline_updated'> {
|
|
135
135
|
type_i: EffectType.trustline_updated;
|
|
136
136
|
}
|
|
137
|
-
export interface TrustlineAuthorized extends BaseEffectRecord {
|
|
137
|
+
export interface TrustlineAuthorized extends BaseEffectRecord<'trustline_authorized'> {
|
|
138
138
|
type_i: EffectType.trustline_authorized;
|
|
139
139
|
asset_type: OfferAsset["asset_type"];
|
|
140
140
|
asset_code: OfferAsset["asset_code"];
|
|
@@ -146,7 +146,7 @@ export interface TrustlineDeauthorized extends Omit<TrustlineAuthorized, "type_i
|
|
|
146
146
|
export interface TrustlineAuthorizedToMaintainLiabilities extends Omit<TrustlineAuthorized, "type_i"> {
|
|
147
147
|
type_i: EffectType.trustline_authorized_to_maintain_liabilities;
|
|
148
148
|
}
|
|
149
|
-
export interface ClaimableBalanceCreated extends BaseEffectRecord {
|
|
149
|
+
export interface ClaimableBalanceCreated extends BaseEffectRecord<'claimable_balance_created'> {
|
|
150
150
|
type_i: EffectType.claimable_balance_created;
|
|
151
151
|
amount: string;
|
|
152
152
|
balance_type_i: string;
|
|
@@ -163,64 +163,64 @@ interface SponsershipFields {
|
|
|
163
163
|
new_sponsor: string;
|
|
164
164
|
former_sponsor: string;
|
|
165
165
|
}
|
|
166
|
-
interface AccountSponsorshipEvents extends BaseEffectRecord
|
|
166
|
+
interface AccountSponsorshipEvents<T extends string> extends BaseEffectRecord<T>, SponsershipFields {
|
|
167
167
|
}
|
|
168
|
-
export type AccountSponsorshipCreated = Omit<AccountSponsorshipEvents
|
|
168
|
+
export type AccountSponsorshipCreated = Omit<AccountSponsorshipEvents<'account_sponsorship_created'>, "new_sponsor" | "former_sponsor"> & {
|
|
169
169
|
type_i: EffectType.account_sponsorship_created;
|
|
170
170
|
};
|
|
171
|
-
export type AccountSponsorshipUpdated = Omit<AccountSponsorshipEvents
|
|
171
|
+
export type AccountSponsorshipUpdated = Omit<AccountSponsorshipEvents<'account_sponsorship_updated'>, "sponsor"> & {
|
|
172
172
|
type_i: EffectType.account_sponsorship_updated;
|
|
173
173
|
};
|
|
174
|
-
export type AccountSponsorshipRemoved = Omit<AccountSponsorshipEvents
|
|
174
|
+
export type AccountSponsorshipRemoved = Omit<AccountSponsorshipEvents<'account_sponsorship_removed'>, "new_sponsor" | "sponsor"> & {
|
|
175
175
|
type_i: EffectType.account_sponsorship_removed;
|
|
176
176
|
};
|
|
177
|
-
interface TrustlineSponsorshipEvents extends BaseEffectRecord
|
|
177
|
+
interface TrustlineSponsorshipEvents<T extends string> extends BaseEffectRecord<T>, SponsershipFields {
|
|
178
178
|
asset?: string;
|
|
179
179
|
liquidity_pool_id?: string;
|
|
180
180
|
}
|
|
181
|
-
export type TrustlineSponsorshipCreated = Omit<TrustlineSponsorshipEvents
|
|
181
|
+
export type TrustlineSponsorshipCreated = Omit<TrustlineSponsorshipEvents<'trustline_sponsorship_created'>, "new_sponsor" | "former_sponsor"> & {
|
|
182
182
|
type_i: EffectType.trustline_sponsorship_created;
|
|
183
183
|
};
|
|
184
|
-
export type TrustlineSponsorshipUpdated = Omit<TrustlineSponsorshipEvents
|
|
184
|
+
export type TrustlineSponsorshipUpdated = Omit<TrustlineSponsorshipEvents<'trustline_sponsorship_updated'>, "sponsor"> & {
|
|
185
185
|
type_i: EffectType.trustline_sponsorship_updated;
|
|
186
186
|
};
|
|
187
|
-
export type TrustlineSponsorshipRemoved = Omit<TrustlineSponsorshipEvents
|
|
187
|
+
export type TrustlineSponsorshipRemoved = Omit<TrustlineSponsorshipEvents<'trustline_sponsorship_removed'>, "new_sponsor" | "sponsor"> & {
|
|
188
188
|
type_i: EffectType.trustline_sponsorship_removed;
|
|
189
189
|
};
|
|
190
|
-
interface DataSponsorshipEvents extends BaseEffectRecord
|
|
190
|
+
interface DataSponsorshipEvents<T extends string> extends BaseEffectRecord<T>, SponsershipFields {
|
|
191
191
|
data_name: string;
|
|
192
192
|
}
|
|
193
|
-
export type DateSponsorshipCreated = Omit<DataSponsorshipEvents
|
|
193
|
+
export type DateSponsorshipCreated = Omit<DataSponsorshipEvents<'data_sponsorship_created'>, "new_sponsor" | "former_sponsor"> & {
|
|
194
194
|
type_i: EffectType.data_sponsorship_created;
|
|
195
195
|
};
|
|
196
|
-
export type DateSponsorshipUpdated = Omit<DataSponsorshipEvents
|
|
196
|
+
export type DateSponsorshipUpdated = Omit<DataSponsorshipEvents<'data_sponsorship_updated'>, "sponsor"> & {
|
|
197
197
|
type_i: EffectType.data_sponsorship_updated;
|
|
198
198
|
};
|
|
199
|
-
export type DateSponsorshipRemoved = Omit<DataSponsorshipEvents
|
|
199
|
+
export type DateSponsorshipRemoved = Omit<DataSponsorshipEvents<'data_sponsorship_removed'>, "new_sponsor" | "sponsor"> & {
|
|
200
200
|
type_i: EffectType.data_sponsorship_removed;
|
|
201
201
|
};
|
|
202
|
-
interface ClaimableBalanceSponsorshipEvents extends BaseEffectRecord
|
|
202
|
+
interface ClaimableBalanceSponsorshipEvents<T extends string> extends BaseEffectRecord<T>, SponsershipFields {
|
|
203
203
|
balance_type_i: string;
|
|
204
204
|
}
|
|
205
|
-
export type ClaimableBalanceSponsorshipCreated = Omit<ClaimableBalanceSponsorshipEvents
|
|
205
|
+
export type ClaimableBalanceSponsorshipCreated = Omit<ClaimableBalanceSponsorshipEvents<'claimable_balance_sponsorship_created'>, "new_sponsor" | "former_sponsor"> & {
|
|
206
206
|
type_i: EffectType.claimable_balance_sponsorship_created;
|
|
207
207
|
};
|
|
208
|
-
export type ClaimableBalanceSponsorshipUpdated = Omit<ClaimableBalanceSponsorshipEvents
|
|
208
|
+
export type ClaimableBalanceSponsorshipUpdated = Omit<ClaimableBalanceSponsorshipEvents<'claimable_balance_sponsorship_updated'>, "sponsor"> & {
|
|
209
209
|
type_i: EffectType.claimable_balance_sponsorship_updated;
|
|
210
210
|
};
|
|
211
|
-
export type ClaimableBalanceSponsorshipRemoved = Omit<ClaimableBalanceSponsorshipEvents
|
|
211
|
+
export type ClaimableBalanceSponsorshipRemoved = Omit<ClaimableBalanceSponsorshipEvents<'claimable_balance_sponsorship_removed'>, "new_sponsor" | "sponsor"> & {
|
|
212
212
|
type_i: EffectType.claimable_balance_sponsorship_removed;
|
|
213
213
|
};
|
|
214
|
-
interface SignerSponsorshipEvents extends BaseEffectRecord
|
|
214
|
+
interface SignerSponsorshipEvents<T extends string> extends BaseEffectRecord<T>, SponsershipFields {
|
|
215
215
|
signer: string;
|
|
216
216
|
}
|
|
217
|
-
export type SignerSponsorshipCreated = Omit<SignerSponsorshipEvents
|
|
217
|
+
export type SignerSponsorshipCreated = Omit<SignerSponsorshipEvents<'signer_sponsorship_created'>, "new_sponsor" | "former_sponsor"> & {
|
|
218
218
|
type_i: EffectType.signer_sponsorship_created;
|
|
219
219
|
};
|
|
220
|
-
export type SignerSponsorshipUpdated = Omit<SignerSponsorshipEvents
|
|
220
|
+
export type SignerSponsorshipUpdated = Omit<SignerSponsorshipEvents<'signer_sponsorship_updated'>, "sponsor"> & {
|
|
221
221
|
type_i: EffectType.signer_sponsorship_updated;
|
|
222
222
|
};
|
|
223
|
-
export type SignerSponsorshipRemoved = Omit<SignerSponsorshipEvents
|
|
223
|
+
export type SignerSponsorshipRemoved = Omit<SignerSponsorshipEvents<'signer_sponsorship_removed'>, "new_sponsor" | "sponsor"> & {
|
|
224
224
|
type_i: EffectType.signer_sponsorship_removed;
|
|
225
225
|
};
|
|
226
226
|
export interface ClaimableBalanceClawedBack extends HorizonApi.BaseResponse {
|
|
@@ -234,33 +234,33 @@ export interface LiquidityPoolEffectRecord extends HorizonApi.BaseResponse {
|
|
|
234
234
|
total_shares: string;
|
|
235
235
|
reserves: HorizonApi.Reserve[];
|
|
236
236
|
}
|
|
237
|
-
export interface LiquidityPoolDeposited extends BaseEffectRecord {
|
|
237
|
+
export interface LiquidityPoolDeposited extends BaseEffectRecord<'liquidity_pool_deposited'> {
|
|
238
238
|
type_i: EffectType.liquidity_pool_deposited;
|
|
239
239
|
liquidity_pool: LiquidityPoolEffectRecord;
|
|
240
240
|
reserves_deposited: HorizonApi.Reserve[];
|
|
241
241
|
shares_received: string;
|
|
242
242
|
}
|
|
243
|
-
export interface LiquidityPoolWithdrew extends BaseEffectRecord {
|
|
243
|
+
export interface LiquidityPoolWithdrew extends BaseEffectRecord<'liquidity_pool_withdrew'> {
|
|
244
244
|
type_i: EffectType.liquidity_pool_withdrew;
|
|
245
245
|
liquidity_pool: LiquidityPoolEffectRecord;
|
|
246
246
|
reserves_received: HorizonApi.Reserve[];
|
|
247
247
|
shares_redeemed: string;
|
|
248
248
|
}
|
|
249
|
-
export interface LiquidityPoolTrade extends BaseEffectRecord {
|
|
249
|
+
export interface LiquidityPoolTrade extends BaseEffectRecord<'liquidity_pool_trade'> {
|
|
250
250
|
type_i: EffectType.liquidity_pool_trade;
|
|
251
251
|
liquidity_pool: LiquidityPoolEffectRecord;
|
|
252
252
|
sold: HorizonApi.Reserve;
|
|
253
253
|
bought: HorizonApi.Reserve;
|
|
254
254
|
}
|
|
255
|
-
export interface LiquidityPoolCreated extends BaseEffectRecord {
|
|
255
|
+
export interface LiquidityPoolCreated extends BaseEffectRecord<'liquidity_pool_created'> {
|
|
256
256
|
type_i: EffectType.liquidity_pool_created;
|
|
257
257
|
liquidity_pool: LiquidityPoolEffectRecord;
|
|
258
258
|
}
|
|
259
|
-
export interface LiquidityPoolRemoved extends BaseEffectRecord {
|
|
259
|
+
export interface LiquidityPoolRemoved extends BaseEffectRecord<'liquidity_pool_removed'> {
|
|
260
260
|
type_i: EffectType.liquidity_pool_removed;
|
|
261
261
|
liquidity_pool_id: string;
|
|
262
262
|
}
|
|
263
|
-
export interface LiquidityPoolRevoked extends BaseEffectRecord {
|
|
263
|
+
export interface LiquidityPoolRevoked extends BaseEffectRecord<'liquidity_pool_revoked'> {
|
|
264
264
|
type_i: EffectType.liquidity_pool_revoked;
|
|
265
265
|
liquidity_pool: LiquidityPoolEffectRecord;
|
|
266
266
|
reserves_revoked: [
|
|
@@ -272,12 +272,12 @@ export interface LiquidityPoolRevoked extends BaseEffectRecord {
|
|
|
272
272
|
];
|
|
273
273
|
shares_revoked: string;
|
|
274
274
|
}
|
|
275
|
-
export interface ContractCredited extends BaseEffectRecord
|
|
275
|
+
export interface ContractCredited extends BaseEffectRecord<'contract_credited'>, OfferAsset {
|
|
276
276
|
type_i: EffectType.contract_credited;
|
|
277
277
|
contract: string;
|
|
278
278
|
amount: string;
|
|
279
279
|
}
|
|
280
|
-
export interface ContractDebited extends BaseEffectRecord
|
|
280
|
+
export interface ContractDebited extends BaseEffectRecord<'contract_debited'>, OfferAsset {
|
|
281
281
|
type_i: EffectType.contract_debited;
|
|
282
282
|
contract: string;
|
|
283
283
|
amount: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { BaseEffectRecord } from "./effects";
|
|
2
|
-
export interface Trade extends BaseEffectRecord {
|
|
1
|
+
import { BaseEffectRecord, EffectType } from "./effects";
|
|
2
|
+
export interface Trade extends BaseEffectRecord<'trade'> {
|
|
3
|
+
type_i: EffectType.trade;
|
|
3
4
|
seller: string;
|
|
4
5
|
offer_id: number | string;
|
|
5
6
|
bought_amount: string;
|
|
@@ -27,6 +27,7 @@ export interface HttpClientRequestConfig<D = any> {
|
|
|
27
27
|
headers?: HeadersInit;
|
|
28
28
|
params?: Record<string, any>;
|
|
29
29
|
maxContentLength?: number;
|
|
30
|
+
maxRedirects?: number;
|
|
30
31
|
cancelToken?: CancelToken;
|
|
31
32
|
adapter?: (config: HttpClientRequestConfig) => Promise<HttpClientResponse>;
|
|
32
33
|
}
|
package/lib/minimal/rpc/axios.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.version = exports.default = exports.AxiosClient = void 0;
|
|
7
7
|
var _httpClient = require("../http-client");
|
|
8
|
-
var version = exports.version = "13.0.0
|
|
8
|
+
var version = exports.version = "13.0.0";
|
|
9
9
|
var AxiosClient = exports.AxiosClient = (0, _httpClient.create)({
|
|
10
10
|
headers: {
|
|
11
11
|
'X-Client-Name': 'js-soroban-client',
|
|
@@ -27,6 +27,7 @@ var Resolver = exports.Resolver = function () {
|
|
|
27
27
|
key: "resolve",
|
|
28
28
|
value: (function () {
|
|
29
29
|
var _resolve = _asyncToGenerator(_regeneratorRuntime().mark(function _callee(domain) {
|
|
30
|
+
var _opts$allowedRedirect;
|
|
30
31
|
var opts,
|
|
31
32
|
allowHttp,
|
|
32
33
|
timeout,
|
|
@@ -40,6 +41,7 @@ var Resolver = exports.Resolver = function () {
|
|
|
40
41
|
timeout = typeof opts.timeout === "undefined" ? _config.Config.getTimeout() : opts.timeout;
|
|
41
42
|
protocol = allowHttp ? "http" : "https";
|
|
42
43
|
return _context.abrupt("return", _httpClient.httpClient.get("".concat(protocol, "://").concat(domain, "/.well-known/stellar.toml"), {
|
|
44
|
+
maxRedirects: (_opts$allowedRedirect = opts.allowedRedirects) !== null && _opts$allowedRedirect !== void 0 ? _opts$allowedRedirect : 0,
|
|
43
45
|
maxContentLength: STELLAR_TOML_MAX_SIZE,
|
|
44
46
|
cancelToken: timeout ? new CancelToken(function (cancel) {
|
|
45
47
|
return setTimeout(function () {
|
|
@@ -359,6 +359,56 @@ export declare class AssembledTransaction<T> {
|
|
|
359
359
|
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
360
360
|
stackTraceLimit: number;
|
|
361
361
|
};
|
|
362
|
+
SimulationFailed: {
|
|
363
|
+
new (message?: string): {
|
|
364
|
+
name: string;
|
|
365
|
+
message: string;
|
|
366
|
+
stack?: string;
|
|
367
|
+
};
|
|
368
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
369
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
370
|
+
stackTraceLimit: number;
|
|
371
|
+
};
|
|
372
|
+
InternalWalletError: {
|
|
373
|
+
new (message?: string): {
|
|
374
|
+
name: string;
|
|
375
|
+
message: string;
|
|
376
|
+
stack?: string;
|
|
377
|
+
};
|
|
378
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
379
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
380
|
+
stackTraceLimit: number;
|
|
381
|
+
};
|
|
382
|
+
ExternalServiceError: {
|
|
383
|
+
new (message?: string): {
|
|
384
|
+
name: string;
|
|
385
|
+
message: string;
|
|
386
|
+
stack?: string;
|
|
387
|
+
};
|
|
388
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
389
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
390
|
+
stackTraceLimit: number;
|
|
391
|
+
};
|
|
392
|
+
InvalidClientRequest: {
|
|
393
|
+
new (message?: string): {
|
|
394
|
+
name: string;
|
|
395
|
+
message: string;
|
|
396
|
+
stack?: string;
|
|
397
|
+
};
|
|
398
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
399
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
400
|
+
stackTraceLimit: number;
|
|
401
|
+
};
|
|
402
|
+
UserRejected: {
|
|
403
|
+
new (message?: string): {
|
|
404
|
+
name: string;
|
|
405
|
+
message: string;
|
|
406
|
+
stack?: string;
|
|
407
|
+
};
|
|
408
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
409
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
410
|
+
stackTraceLimit: number;
|
|
411
|
+
};
|
|
362
412
|
};
|
|
363
413
|
/**
|
|
364
414
|
* Serialize the AssembledTransaction to a JSON string. This is useful for
|
|
@@ -383,10 +433,11 @@ export declare class AssembledTransaction<T> {
|
|
|
383
433
|
* Deserialize the AssembledTransaction from a base64-encoded XDR string.
|
|
384
434
|
*/
|
|
385
435
|
static fromXDR<T>(options: Omit<AssembledTransactionOptions<T>, "args" | "method" | "parseResultXdr">, encodedXDR: string, spec: Spec): AssembledTransaction<T>;
|
|
436
|
+
private handleWalletError;
|
|
386
437
|
private constructor();
|
|
387
438
|
/**
|
|
388
|
-
* Construct a new AssembledTransaction. This is the
|
|
389
|
-
* AssembledTransaction; the
|
|
439
|
+
* Construct a new AssembledTransaction. This is the main way to create a new
|
|
440
|
+
* AssembledTransaction; the constructor is private.
|
|
390
441
|
*
|
|
391
442
|
* This is an asynchronous constructor for two reasons:
|
|
392
443
|
*
|
|
@@ -397,6 +448,9 @@ export declare class AssembledTransaction<T> {
|
|
|
397
448
|
* If you don't want to simulate the transaction, you can set `simulate` to
|
|
398
449
|
* `false` in the options.
|
|
399
450
|
*
|
|
451
|
+
* If you need to create an operation other than `invokeHostFunction`, you
|
|
452
|
+
* can use {@link AssembledTransaction.buildWithOp} instead.
|
|
453
|
+
*
|
|
400
454
|
* @example
|
|
401
455
|
* const tx = await AssembledTransaction.build({
|
|
402
456
|
* ...,
|
|
@@ -404,6 +458,24 @@ export declare class AssembledTransaction<T> {
|
|
|
404
458
|
* })
|
|
405
459
|
*/
|
|
406
460
|
static build<T>(options: AssembledTransactionOptions<T>): Promise<AssembledTransaction<T>>;
|
|
461
|
+
/**
|
|
462
|
+
* Construct a new AssembledTransaction, specifying an Operation other than
|
|
463
|
+
* `invokeHostFunction` (the default used by {@link AssembledTransaction.build}).
|
|
464
|
+
*
|
|
465
|
+
* Note: `AssembledTransaction` currently assumes these operations can be
|
|
466
|
+
* simulated. This is not true for classic operations; only for those used by
|
|
467
|
+
* Soroban Smart Contracts like `invokeHostFunction` and `createCustomContract`.
|
|
468
|
+
*
|
|
469
|
+
* @example
|
|
470
|
+
* const tx = await AssembledTransaction.buildWithOp(
|
|
471
|
+
* Operation.createCustomContract({ ... });
|
|
472
|
+
* {
|
|
473
|
+
* ...,
|
|
474
|
+
* simulate: false,
|
|
475
|
+
* }
|
|
476
|
+
* )
|
|
477
|
+
*/
|
|
478
|
+
static buildWithOp<T>(operation: xdr.Operation, options: AssembledTransactionOptions<T>): Promise<AssembledTransaction<T>>;
|
|
407
479
|
private static buildFootprintRestoreTransaction;
|
|
408
480
|
simulate: ({ restore }?: {
|
|
409
481
|
restore?: boolean;
|
|
@@ -511,7 +583,7 @@ export declare class AssembledTransaction<T> {
|
|
|
511
583
|
* If you have a pro use-case and need to override the default `authorizeEntry` function, rather than using the one in @stellar/stellar-base, you can do that! Your function needs to take at least the first argument, `entry: xdr.SorobanAuthorizationEntry`, and return a `Promise<xdr.SorobanAuthorizationEntry>`.
|
|
512
584
|
*
|
|
513
585
|
* Note that you if you pass this, then `signAuthEntry` will be ignored.
|
|
514
|
-
|
|
586
|
+
*/
|
|
515
587
|
authorizeEntry?: typeof stellarBaseAuthorizeEntry;
|
|
516
588
|
}) => Promise<void>;
|
|
517
589
|
/**
|