@stellar/stellar-sdk 13.0.0-beta.1 → 13.0.0-rc.2
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 +63 -0
- package/dist/stellar-sdk-minimal.js +585 -253
- package/dist/stellar-sdk-minimal.min.js +1 -1
- package/dist/stellar-sdk-no-axios.js +602 -256
- package/dist/stellar-sdk-no-axios.min.js +1 -1
- package/dist/stellar-sdk-no-eventsource.js +585 -253
- package/dist/stellar-sdk-no-eventsource.min.js +1 -1
- package/dist/stellar-sdk.js +602 -256
- package/dist/stellar-sdk.min.js +1 -1
- package/lib/contract/assembled_transaction.d.ts +75 -3
- package/lib/contract/assembled_transaction.js +124 -35
- 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/sent_transaction.d.ts +2 -3
- package/lib/contract/sent_transaction.js +4 -4
- 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 -15
- package/lib/horizon/server_api.js +5 -0
- package/lib/horizon/types/assets.d.ts +0 -2
- 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/index.d.ts +0 -4
- package/lib/index.js +1 -4
- package/lib/minimal/contract/assembled_transaction.d.ts +75 -3
- package/lib/minimal/contract/assembled_transaction.js +124 -35
- 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/sent_transaction.d.ts +2 -3
- package/lib/minimal/contract/sent_transaction.js +4 -4
- 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 -15
- package/lib/minimal/horizon/server_api.js +5 -0
- package/lib/minimal/horizon/types/assets.d.ts +0 -2
- 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/index.d.ts +0 -4
- package/lib/minimal/index.js +1 -4
- package/lib/minimal/rpc/api.d.ts +12 -9
- package/lib/minimal/rpc/axios.js +1 -1
- package/lib/minimal/rpc/index.d.ts +1 -1
- package/lib/minimal/rpc/index.js +14 -0
- package/lib/minimal/rpc/parsers.d.ts +1 -1
- package/lib/minimal/rpc/parsers.js +3 -3
- package/lib/minimal/rpc/server.d.ts +41 -3
- package/lib/minimal/rpc/server.js +203 -149
- package/lib/minimal/stellartoml/index.d.ts +1 -0
- package/lib/minimal/stellartoml/index.js +2 -0
- package/lib/minimal/utils.d.ts +1 -0
- package/lib/minimal/utils.js +7 -0
- package/lib/no-axios/contract/assembled_transaction.d.ts +75 -3
- package/lib/no-axios/contract/assembled_transaction.js +124 -35
- 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/sent_transaction.d.ts +2 -3
- package/lib/no-axios/contract/sent_transaction.js +4 -4
- 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 -15
- package/lib/no-axios/horizon/server_api.js +5 -0
- package/lib/no-axios/horizon/types/assets.d.ts +0 -2
- 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/index.d.ts +0 -4
- package/lib/no-axios/index.js +1 -4
- package/lib/no-axios/rpc/api.d.ts +12 -9
- package/lib/no-axios/rpc/axios.js +1 -1
- package/lib/no-axios/rpc/index.d.ts +1 -1
- package/lib/no-axios/rpc/index.js +14 -0
- package/lib/no-axios/rpc/parsers.d.ts +1 -1
- package/lib/no-axios/rpc/parsers.js +3 -3
- package/lib/no-axios/rpc/server.d.ts +41 -3
- package/lib/no-axios/rpc/server.js +203 -149
- package/lib/no-axios/stellartoml/index.d.ts +1 -0
- package/lib/no-axios/stellartoml/index.js +2 -0
- package/lib/no-axios/utils.d.ts +1 -0
- package/lib/no-axios/utils.js +7 -0
- package/lib/no-eventsource/contract/assembled_transaction.d.ts +75 -3
- package/lib/no-eventsource/contract/assembled_transaction.js +124 -35
- 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/sent_transaction.d.ts +2 -3
- package/lib/no-eventsource/contract/sent_transaction.js +4 -4
- 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 -15
- package/lib/no-eventsource/horizon/server_api.js +5 -0
- package/lib/no-eventsource/horizon/types/assets.d.ts +0 -2
- 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/index.d.ts +0 -4
- package/lib/no-eventsource/index.js +1 -4
- package/lib/no-eventsource/rpc/api.d.ts +12 -9
- package/lib/no-eventsource/rpc/axios.js +1 -1
- package/lib/no-eventsource/rpc/index.d.ts +1 -1
- package/lib/no-eventsource/rpc/index.js +14 -0
- package/lib/no-eventsource/rpc/parsers.d.ts +1 -1
- package/lib/no-eventsource/rpc/parsers.js +3 -3
- package/lib/no-eventsource/rpc/server.d.ts +41 -3
- package/lib/no-eventsource/rpc/server.js +203 -149
- package/lib/no-eventsource/stellartoml/index.d.ts +1 -0
- package/lib/no-eventsource/stellartoml/index.js +2 -0
- package/lib/no-eventsource/utils.d.ts +1 -0
- package/lib/no-eventsource/utils.js +7 -0
- package/lib/rpc/api.d.ts +12 -9
- package/lib/rpc/axios.js +1 -1
- package/lib/rpc/index.d.ts +1 -1
- package/lib/rpc/index.js +14 -0
- package/lib/rpc/parsers.d.ts +1 -1
- package/lib/rpc/parsers.js +3 -3
- package/lib/rpc/server.d.ts +41 -3
- package/lib/rpc/server.js +203 -149
- package/lib/stellartoml/index.d.ts +1 -0
- package/lib/stellartoml/index.js +2 -0
- package/lib/utils.d.ts +1 -0
- package/lib/utils.js +7 -0
- package/package.json +16 -16
|
@@ -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
|
}
|
|
@@ -16,10 +16,6 @@ export * as Horizon from './horizon';
|
|
|
16
16
|
* import { Server } from '@stellar/stellar-sdk/rpc';
|
|
17
17
|
*/
|
|
18
18
|
export * as rpc from './rpc';
|
|
19
|
-
/**
|
|
20
|
-
* @deprecated Use `rpc` instead
|
|
21
|
-
*/
|
|
22
|
-
export * as SorobanRpc from './rpc';
|
|
23
19
|
/**
|
|
24
20
|
* Tools for interacting with smart contracts, such as `Client`, `Spec`, and
|
|
25
21
|
* `AssembledTransaction`. You can import these from the `/contract`
|
|
@@ -13,7 +13,6 @@ var _exportNames = {
|
|
|
13
13
|
Friendbot: true,
|
|
14
14
|
Horizon: true,
|
|
15
15
|
rpc: true,
|
|
16
|
-
SorobanRpc: true,
|
|
17
16
|
contract: true
|
|
18
17
|
};
|
|
19
18
|
Object.defineProperty(exports, "Config", {
|
|
@@ -22,7 +21,7 @@ Object.defineProperty(exports, "Config", {
|
|
|
22
21
|
return _config.Config;
|
|
23
22
|
}
|
|
24
23
|
});
|
|
25
|
-
exports.StellarToml = exports.
|
|
24
|
+
exports.StellarToml = exports.Horizon = exports.Friendbot = exports.Federation = void 0;
|
|
26
25
|
Object.defineProperty(exports, "Utils", {
|
|
27
26
|
enumerable: true,
|
|
28
27
|
get: function get() {
|
|
@@ -55,9 +54,7 @@ exports.Friendbot = _Friendbot;
|
|
|
55
54
|
var _Horizon = _interopRequireWildcard(require("./horizon"));
|
|
56
55
|
exports.Horizon = _Horizon;
|
|
57
56
|
var _rpc = _interopRequireWildcard(require("./rpc"));
|
|
58
|
-
var _SorobanRpc = _rpc;
|
|
59
57
|
exports.rpc = _rpc;
|
|
60
|
-
exports.SorobanRpc = _rpc;
|
|
61
58
|
var _contract = _interopRequireWildcard(require("./contract"));
|
|
62
59
|
exports.contract = _contract;
|
|
63
60
|
var _stellarBase = require("@stellar/stellar-base");
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { Contract, SorobanDataBuilder, xdr } from '@stellar/stellar-base';
|
|
2
2
|
export declare namespace Api {
|
|
3
|
-
export interface Cost {
|
|
4
|
-
cpuInsns: string;
|
|
5
|
-
memBytes: string;
|
|
6
|
-
}
|
|
7
3
|
export interface GetHealthResponse {
|
|
8
4
|
status: 'healthy';
|
|
9
5
|
}
|
|
@@ -56,6 +52,7 @@ export declare namespace Api {
|
|
|
56
52
|
export type GetTransactionResponse = GetSuccessfulTransactionResponse | GetFailedTransactionResponse | GetMissingTransactionResponse;
|
|
57
53
|
interface GetAnyTransactionResponse {
|
|
58
54
|
status: GetTransactionStatus;
|
|
55
|
+
txHash: string;
|
|
59
56
|
latestLedger: number;
|
|
60
57
|
latestLedgerCloseTime: number;
|
|
61
58
|
oldestLedger: number;
|
|
@@ -93,13 +90,14 @@ export declare namespace Api {
|
|
|
93
90
|
latestLedgerCloseTime: number;
|
|
94
91
|
oldestLedger: number;
|
|
95
92
|
oldestLedgerCloseTime: number;
|
|
93
|
+
txHash: string;
|
|
96
94
|
applicationOrder?: number;
|
|
97
95
|
feeBump?: boolean;
|
|
96
|
+
ledger?: number;
|
|
97
|
+
createdAt?: number;
|
|
98
98
|
envelopeXdr?: string;
|
|
99
99
|
resultXdr?: string;
|
|
100
100
|
resultMetaXdr?: string;
|
|
101
|
-
ledger?: number;
|
|
102
|
-
createdAt?: number;
|
|
103
101
|
diagnosticEventsXdr?: string[];
|
|
104
102
|
}
|
|
105
103
|
export interface GetTransactionsRequest {
|
|
@@ -113,6 +111,7 @@ export declare namespace Api {
|
|
|
113
111
|
createdAt: number;
|
|
114
112
|
applicationOrder: number;
|
|
115
113
|
feeBump: boolean;
|
|
114
|
+
txHash: string;
|
|
116
115
|
envelopeXdr?: string;
|
|
117
116
|
resultXdr?: string;
|
|
118
117
|
resultMetaXdr?: string;
|
|
@@ -124,6 +123,7 @@ export declare namespace Api {
|
|
|
124
123
|
createdAt: number;
|
|
125
124
|
applicationOrder: number;
|
|
126
125
|
feeBump: boolean;
|
|
126
|
+
txHash: string;
|
|
127
127
|
envelopeXdr: xdr.TransactionEnvelope;
|
|
128
128
|
resultXdr: xdr.TransactionResult;
|
|
129
129
|
resultMetaXdr: xdr.TransactionMeta;
|
|
@@ -170,6 +170,7 @@ export declare namespace Api {
|
|
|
170
170
|
type: EventType;
|
|
171
171
|
ledger: number;
|
|
172
172
|
ledgerClosedAt: string;
|
|
173
|
+
cursor: string;
|
|
173
174
|
pagingToken: string;
|
|
174
175
|
inSuccessfulContractCall: boolean;
|
|
175
176
|
txHash: string;
|
|
@@ -255,7 +256,6 @@ export declare namespace Api {
|
|
|
255
256
|
export interface SimulateTransactionSuccessResponse extends BaseSimulateTransactionResponse {
|
|
256
257
|
transactionData: SorobanDataBuilder;
|
|
257
258
|
minResourceFee: string;
|
|
258
|
-
cost: Cost;
|
|
259
259
|
/** present only for invocation simulation */
|
|
260
260
|
result?: SimulateHostFunctionResult;
|
|
261
261
|
/** State Difference information */
|
|
@@ -304,7 +304,6 @@ export declare namespace Api {
|
|
|
304
304
|
* invokeHostFunctionOperation is supported per transaction.
|
|
305
305
|
* */
|
|
306
306
|
results?: RawSimulateHostFunctionResult[];
|
|
307
|
-
cost?: Cost;
|
|
308
307
|
/** Present if succeeded but has expired ledger entries */
|
|
309
308
|
restorePreamble?: {
|
|
310
309
|
minResourceFee: string;
|
|
@@ -315,8 +314,12 @@ export declare namespace Api {
|
|
|
315
314
|
}
|
|
316
315
|
export interface GetVersionInfoResponse {
|
|
317
316
|
version: string;
|
|
317
|
+
commitHash: string;
|
|
318
|
+
buildTimestamp: string;
|
|
319
|
+
captiveCoreVersion: string;
|
|
320
|
+
protocolVersion: number;
|
|
318
321
|
commit_hash: string;
|
|
319
|
-
|
|
322
|
+
build_timestamp: string;
|
|
320
323
|
captive_core_version: string;
|
|
321
324
|
protocol_version: number;
|
|
322
325
|
}
|
|
@@ -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-rc.2";
|
|
9
9
|
var AxiosClient = exports.AxiosClient = (0, _httpClient.create)({
|
|
10
10
|
headers: {
|
|
11
11
|
'X-Client-Name': 'js-soroban-client',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @module rpc */
|
|
2
2
|
export * from "./api";
|
|
3
|
-
export { RpcServer as Server, Durability } from "./server";
|
|
3
|
+
export { RpcServer as Server, BasicSleepStrategy, LinearSleepStrategy, Durability } from "./server";
|
|
4
4
|
export { default as AxiosClient } from "./axios";
|
|
5
5
|
export { parseRawSimulation, parseRawEvents } from "./parsers";
|
|
6
6
|
export * from "./transaction";
|
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
var _exportNames = {
|
|
7
7
|
Server: true,
|
|
8
|
+
BasicSleepStrategy: true,
|
|
9
|
+
LinearSleepStrategy: true,
|
|
8
10
|
Durability: true,
|
|
9
11
|
AxiosClient: true,
|
|
10
12
|
parseRawSimulation: true,
|
|
@@ -16,12 +18,24 @@ Object.defineProperty(exports, "AxiosClient", {
|
|
|
16
18
|
return _axios.default;
|
|
17
19
|
}
|
|
18
20
|
});
|
|
21
|
+
Object.defineProperty(exports, "BasicSleepStrategy", {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function get() {
|
|
24
|
+
return _server.BasicSleepStrategy;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
19
27
|
Object.defineProperty(exports, "Durability", {
|
|
20
28
|
enumerable: true,
|
|
21
29
|
get: function get() {
|
|
22
30
|
return _server.Durability;
|
|
23
31
|
}
|
|
24
32
|
});
|
|
33
|
+
Object.defineProperty(exports, "LinearSleepStrategy", {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
get: function get() {
|
|
36
|
+
return _server.LinearSleepStrategy;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
25
39
|
Object.defineProperty(exports, "Server", {
|
|
26
40
|
enumerable: true,
|
|
27
41
|
get: function get() {
|
|
@@ -8,7 +8,7 @@ import { Api } from './api';
|
|
|
8
8
|
* @returns {Api.SendTransactionResponse} transaction response parsed from the Soroban RPC server's response
|
|
9
9
|
*/
|
|
10
10
|
export declare function parseRawSendTransaction(raw: Api.RawSendTransactionResponse): Api.SendTransactionResponse;
|
|
11
|
-
export declare function parseTransactionInfo(raw: Api.RawTransactionInfo | Api.RawGetTransactionResponse): Omit<Api.TransactionInfo, 'status'>;
|
|
11
|
+
export declare function parseTransactionInfo(raw: Api.RawTransactionInfo | Api.RawGetTransactionResponse): Omit<Api.TransactionInfo, 'status' | 'txHash'>;
|
|
12
12
|
export declare function parseRawTransactions(r: Api.RawTransactionInfo): Api.TransactionInfo;
|
|
13
13
|
/**
|
|
14
14
|
* Parse and return the retrieved events, if any, from a raw response from a Soroban RPC server.
|
|
@@ -57,7 +57,8 @@ function parseTransactionInfo(raw) {
|
|
|
57
57
|
}
|
|
58
58
|
function parseRawTransactions(r) {
|
|
59
59
|
return _objectSpread({
|
|
60
|
-
status: r.status
|
|
60
|
+
status: r.status,
|
|
61
|
+
txHash: r.txHash
|
|
61
62
|
}, parseTransactionInfo(r));
|
|
62
63
|
}
|
|
63
64
|
function parseRawEvents(raw) {
|
|
@@ -100,8 +101,7 @@ function parseSuccessful(sim, partial) {
|
|
|
100
101
|
var _sim$results$length, _sim$results, _sim$stateChanges$len, _sim$stateChanges, _sim$stateChanges2;
|
|
101
102
|
var success = _objectSpread(_objectSpread(_objectSpread({}, partial), {}, {
|
|
102
103
|
transactionData: new _stellarBase.SorobanDataBuilder(sim.transactionData),
|
|
103
|
-
minResourceFee: sim.minResourceFee
|
|
104
|
-
cost: sim.cost
|
|
104
|
+
minResourceFee: sim.minResourceFee
|
|
105
105
|
}, ((_sim$results$length = (_sim$results = sim.results) === null || _sim$results === void 0 ? void 0 : _sim$results.length) !== null && _sim$results$length !== void 0 ? _sim$results$length : 0 > 0) && {
|
|
106
106
|
result: sim.results.map(function (row) {
|
|
107
107
|
var _row$auth;
|
|
@@ -48,6 +48,10 @@ export declare namespace RpcServer {
|
|
|
48
48
|
cursor?: string;
|
|
49
49
|
limit?: number;
|
|
50
50
|
}
|
|
51
|
+
interface PollingOptions {
|
|
52
|
+
attempts?: number;
|
|
53
|
+
sleepStrategy?: SleepStrategy;
|
|
54
|
+
}
|
|
51
55
|
interface ResourceLeeway {
|
|
52
56
|
cpuInstructions: number;
|
|
53
57
|
}
|
|
@@ -57,6 +61,13 @@ export declare namespace RpcServer {
|
|
|
57
61
|
headers?: Record<string, string>;
|
|
58
62
|
}
|
|
59
63
|
}
|
|
64
|
+
export declare const BasicSleepStrategy: SleepStrategy;
|
|
65
|
+
export declare const LinearSleepStrategy: SleepStrategy;
|
|
66
|
+
/**
|
|
67
|
+
* A function that returns the number of *milliseconds* to sleep
|
|
68
|
+
* on a given `iter`ation.
|
|
69
|
+
*/
|
|
70
|
+
export type SleepStrategy = (iter: number) => number;
|
|
60
71
|
/**
|
|
61
72
|
* Handles the network connection to a Soroban RPC instance, exposing an
|
|
62
73
|
* interface for requests to that instance.
|
|
@@ -220,6 +231,32 @@ export declare class RpcServer {
|
|
|
220
231
|
*/
|
|
221
232
|
getLedgerEntries(...keys: xdr.LedgerKey[]): Promise<Api.GetLedgerEntriesResponse>;
|
|
222
233
|
_getLedgerEntries(...keys: xdr.LedgerKey[]): Promise<Api.RawGetLedgerEntriesResponse>;
|
|
234
|
+
/**
|
|
235
|
+
* Poll for a particular transaction with certain parameters.
|
|
236
|
+
*
|
|
237
|
+
* After submitting a transaction, clients can use this to poll for
|
|
238
|
+
* transaction completion and return a definitive state of success or failure.
|
|
239
|
+
*
|
|
240
|
+
* @param {string} hash the transaction you're polling for
|
|
241
|
+
* @param {number} [opts.attempts] (optional) the number of attempts to make
|
|
242
|
+
* before returning the last-seen status. By default or on invalid inputs,
|
|
243
|
+
* try 5 times.
|
|
244
|
+
* @param {SleepStrategy} [opts.sleepStrategy] (optional) the amount of time
|
|
245
|
+
* to wait for between each attempt. By default, sleep for 1 second between
|
|
246
|
+
* each attempt.
|
|
247
|
+
*
|
|
248
|
+
* @return {Promise<Api.GetTransactionsResponse>} the response after a "found"
|
|
249
|
+
* response (which may be success or failure) or the last response obtained
|
|
250
|
+
* after polling the maximum number of specified attempts.
|
|
251
|
+
*
|
|
252
|
+
* @example
|
|
253
|
+
* const h = "c4515e3bdc0897f21cc5dbec8c82cf0a936d4741cb74a8e158eb51b9fb00411a";
|
|
254
|
+
* const txStatus = await server.pollTransaction(h, {
|
|
255
|
+
* attempts: 100, // I'm a maniac
|
|
256
|
+
* sleepStrategy: rpc.LinearSleepStrategy
|
|
257
|
+
* }); // this will take 5,050 seconds to complete
|
|
258
|
+
*/
|
|
259
|
+
pollTransaction(hash: string, opts?: RpcServer.PollingOptions): Promise<Api.GetTransactionResponse>;
|
|
223
260
|
/**
|
|
224
261
|
* Fetch the details of a submitted transaction.
|
|
225
262
|
*
|
|
@@ -227,10 +264,11 @@ export declare class RpcServer {
|
|
|
227
264
|
* transaction has completed.
|
|
228
265
|
*
|
|
229
266
|
* @param {string} hash Hex-encoded hash of the transaction to check
|
|
230
|
-
* @returns {Promise<Api.GetTransactionResponse>} The status,
|
|
231
|
-
*
|
|
267
|
+
* @returns {Promise<Api.GetTransactionResponse>} The status, result, and
|
|
268
|
+
* other details about the transaction
|
|
232
269
|
*
|
|
233
|
-
* @see
|
|
270
|
+
* @see
|
|
271
|
+
* {@link https://developers.stellar.org/docs/data/rpc/api-reference/methods/getTransaction | getTransaction docs}
|
|
234
272
|
*
|
|
235
273
|
* @example
|
|
236
274
|
* const transactionHash = "c4515e3bdc0897f21cc5dbec8c82cf0a936d4741cb74a8e158eb51b9fb00411a";
|