-
Notifications
You must be signed in to change notification settings - Fork 137
/
Copy pathindex.d.ts
1315 lines (1179 loc) · 38.3 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// TypeScript Version: 2.9
/// <reference types="node" />
import { xdr } from './xdr';
export { xdr };
export class Account {
constructor(accountId: string, sequence: string);
accountId(): string;
sequenceNumber(): string;
incrementSequenceNumber(): void;
}
export class Address {
constructor(address: string);
static fromString(address: string): Address;
static account(buffer: Buffer): Address;
static contract(buffer: Buffer): Address;
static fromScVal(scVal: xdr.ScVal): Address;
static fromScAddress(scAddress: xdr.ScAddress): Address;
toString(): string;
toScVal(): xdr.ScVal;
toScAddress(): xdr.ScAddress;
toBuffer(): Buffer;
}
export class Contract {
constructor(contractId: string);
call(method: string, ...params: xdr.ScVal[]): xdr.Operation<Operation.InvokeHostFunction>;
contractId(): string;
address(): Address;
getFootprint(): xdr.LedgerKey;
toString(): string;
}
export class MuxedAccount {
constructor(account: Account, sequence: string);
static fromAddress(mAddress: string, sequenceNum: string): MuxedAccount;
static parseBaseAddress(mAddress: string): string;
/* Modeled after Account, above */
accountId(): string;
sequenceNumber(): string;
incrementSequenceNumber(): void;
baseAccount(): Account;
id(): string;
setId(id: string): MuxedAccount;
toXDRObject(): xdr.MuxedAccount;
equals(otherMuxedAccount: MuxedAccount): boolean;
}
export namespace AssetType {
type native = 'native';
type credit4 = 'credit_alphanum4';
type credit12 = 'credit_alphanum12';
type liquidityPoolShares = 'liquidity_pool_shares';
}
export type AssetType =
| AssetType.native
| AssetType.credit4
| AssetType.credit12
| AssetType.liquidityPoolShares;
export class Asset {
static native(): Asset;
static fromOperation(xdr: xdr.Asset): Asset;
static compare(assetA: Asset, assetB: Asset): -1 | 0 | 1;
constructor(code: string, issuer?: string);
getCode(): string;
getIssuer(): string;
getAssetType(): AssetType;
isNative(): boolean;
equals(other: Asset): boolean;
toXDRObject(): xdr.Asset;
toChangeTrustXDRObject(): xdr.ChangeTrustAsset;
toTrustLineXDRObject(): xdr.TrustLineAsset;
contractId(networkPassphrase: string): string;
code: string;
issuer: string;
}
export class LiquidityPoolAsset {
constructor(assetA: Asset, assetB: Asset, fee: number);
static fromOperation(xdr: xdr.ChangeTrustAsset): LiquidityPoolAsset;
toXDRObject(): xdr.ChangeTrustAsset;
getLiquidityPoolParameters(): LiquidityPoolParameters;
getAssetType(): AssetType.liquidityPoolShares;
equals(other: LiquidityPoolAsset): boolean;
assetA: Asset;
assetB: Asset;
fee: number;
}
export class LiquidityPoolId {
constructor(liquidityPoolId: string);
static fromOperation(xdr: xdr.TrustLineAsset): LiquidityPoolId;
toXDRObject(): xdr.TrustLineAsset;
getLiquidityPoolId(): string;
equals(other: LiquidityPoolId): boolean;
liquidityPoolId: string;
}
export class Claimant {
readonly destination: string;
readonly predicate: xdr.ClaimPredicate;
constructor(destination: string, predicate?: xdr.ClaimPredicate);
toXDRObject(): xdr.Claimant;
static fromXDR(claimantXdr: xdr.Claimant): Claimant;
static predicateUnconditional(): xdr.ClaimPredicate;
static predicateAnd(left: xdr.ClaimPredicate, right: xdr.ClaimPredicate): xdr.ClaimPredicate;
static predicateOr(left: xdr.ClaimPredicate, right: xdr.ClaimPredicate): xdr.ClaimPredicate;
static predicateNot(predicate: xdr.ClaimPredicate): xdr.ClaimPredicate;
static predicateBeforeAbsoluteTime(absBefore: string): xdr.ClaimPredicate;
static predicateBeforeRelativeTime(seconds: string): xdr.ClaimPredicate;
}
export const FastSigning: boolean;
export type KeypairType = 'ed25519';
export class Keypair {
static fromRawEd25519Seed(secretSeed: Buffer): Keypair;
static fromSecret(secretKey: string): Keypair;
static master(networkPassphrase: string): Keypair;
static fromPublicKey(publicKey: string): Keypair;
static random(): Keypair;
constructor(
keys:
| {
type: KeypairType;
secretKey: string | Buffer;
publicKey?: string | Buffer
}
| {
type: KeypairType;
publicKey: string | Buffer
}
);
readonly type: KeypairType;
publicKey(): string;
secret(): string;
rawPublicKey(): Buffer;
rawSecretKey(): Buffer;
canSign(): boolean;
sign(data: Buffer): Buffer;
signDecorated(data: Buffer): xdr.DecoratedSignature;
signPayloadDecorated(data: Buffer): xdr.DecoratedSignature;
signatureHint(): Buffer;
verify(data: Buffer, signature: Buffer): boolean;
xdrAccountId(): xdr.AccountId;
xdrPublicKey(): xdr.PublicKey;
xdrMuxedAccount(id: string): xdr.MuxedAccount;
}
export const LiquidityPoolFeeV18 = 30;
export function getLiquidityPoolId(liquidityPoolType: LiquidityPoolType, liquidityPoolParameters: LiquidityPoolParameters): Buffer;
export namespace LiquidityPoolParameters {
interface ConstantProduct {
assetA: Asset;
assetB: Asset;
fee: number;
}
}
export type LiquidityPoolParameters =
| LiquidityPoolParameters.ConstantProduct;
export namespace LiquidityPoolType {
type constantProduct = 'constant_product';
}
export type LiquidityPoolType =
| LiquidityPoolType.constantProduct;
export const MemoNone = 'none';
export const MemoID = 'id';
export const MemoText = 'text';
export const MemoHash = 'hash';
export const MemoReturn = 'return';
export namespace MemoType {
type None = typeof MemoNone;
type ID = typeof MemoID;
type Text = typeof MemoText;
type Hash = typeof MemoHash;
type Return = typeof MemoReturn;
}
export type MemoType =
| MemoType.None
| MemoType.ID
| MemoType.Text
| MemoType.Hash
| MemoType.Return;
export type MemoValue = null | string | Buffer;
export class Memo<T extends MemoType = MemoType> {
static fromXDRObject(memo: xdr.Memo): Memo;
static hash(hash: string | Buffer): Memo<MemoType.Hash>;
static id(id: string): Memo<MemoType.ID>;
static none(): Memo<MemoType.None>;
static return(hash: string): Memo<MemoType.Return>;
static text(text: string): Memo<MemoType.Text>;
constructor(type: MemoType.None, value?: null);
constructor(type: MemoType.Hash | MemoType.Return, value: Buffer);
constructor(
type: MemoType.Hash | MemoType.Return | MemoType.ID | MemoType.Text,
value: string
);
constructor(type: T, value: MemoValue);
type: T;
value: T extends MemoType.None
? null
: T extends MemoType.ID
? string
: T extends MemoType.Text
? string | Buffer // github.com/stellar/js-stellar-base/issues/152
: T extends MemoType.Hash
? Buffer
: T extends MemoType.Return
? Buffer
: MemoValue;
toXDRObject(): xdr.Memo;
}
export enum Networks {
PUBLIC = 'Public Global Stellar Network ; September 2015',
TESTNET = 'Test SDF Network ; September 2015',
FUTURENET = 'Test SDF Future Network ; October 2022',
SANDBOX = 'Local Sandbox Stellar Network ; September 2022',
STANDALONE = 'Standalone Network ; February 2017'
}
export const AuthRequiredFlag: 1;
export const AuthRevocableFlag: 2;
export const AuthImmutableFlag: 4;
export const AuthClawbackEnabledFlag: 8;
export namespace AuthFlag {
type immutable = typeof AuthImmutableFlag;
type required = typeof AuthRequiredFlag;
type revocable = typeof AuthRevocableFlag;
type clawbackEnabled = typeof AuthClawbackEnabledFlag;
}
export type AuthFlag =
| AuthFlag.required
| AuthFlag.immutable
| AuthFlag.revocable
| AuthFlag.clawbackEnabled;
export namespace TrustLineFlag {
type deauthorize = 0;
type authorize = 1;
type authorizeToMaintainLiabilities = 2;
}
export type TrustLineFlag =
| TrustLineFlag.deauthorize
| TrustLineFlag.authorize
| TrustLineFlag.authorizeToMaintainLiabilities;
export namespace Signer {
interface Ed25519PublicKey {
ed25519PublicKey: string;
weight: number | undefined;
}
interface Sha256Hash {
sha256Hash: Buffer;
weight: number | undefined;
}
interface PreAuthTx {
preAuthTx: Buffer;
weight: number | undefined;
}
interface Ed25519SignedPayload {
ed25519SignedPayload: string;
weight?: number | string;
}
}
export namespace SignerKeyOptions {
interface Ed25519PublicKey {
ed25519PublicKey: string;
}
interface Sha256Hash {
sha256Hash: Buffer | string;
}
interface PreAuthTx {
preAuthTx: Buffer | string;
}
interface Ed25519SignedPayload {
ed25519SignedPayload: string;
}
}
export type Signer =
| Signer.Ed25519PublicKey
| Signer.Sha256Hash
| Signer.PreAuthTx
| Signer.Ed25519SignedPayload;
export type SignerKeyOptions =
| SignerKeyOptions.Ed25519PublicKey
| SignerKeyOptions.Sha256Hash
| SignerKeyOptions.PreAuthTx
| SignerKeyOptions.Ed25519SignedPayload;
export namespace SignerOptions {
interface Ed25519PublicKey {
ed25519PublicKey: string;
weight?: number | string;
}
interface Sha256Hash {
sha256Hash: Buffer | string;
weight?: number | string;
}
interface PreAuthTx {
preAuthTx: Buffer | string;
weight?: number | string;
}
interface Ed25519SignedPayload {
ed25519SignedPayload: string;
weight?: number | string;
}
}
export type SignerOptions =
| SignerOptions.Ed25519PublicKey
| SignerOptions.Sha256Hash
| SignerOptions.PreAuthTx
| SignerOptions.Ed25519SignedPayload;
export namespace OperationType {
type CreateAccount = 'createAccount';
type Payment = 'payment';
type PathPaymentStrictReceive = 'pathPaymentStrictReceive';
type PathPaymentStrictSend = 'pathPaymentStrictSend';
type CreatePassiveSellOffer = 'createPassiveSellOffer';
type ManageSellOffer = 'manageSellOffer';
type ManageBuyOffer = 'manageBuyOffer';
type SetOptions = 'setOptions';
type ChangeTrust = 'changeTrust';
type AllowTrust = 'allowTrust';
type AccountMerge = 'accountMerge';
type Inflation = 'inflation';
type ManageData = 'manageData';
type BumpSequence = 'bumpSequence';
type CreateClaimableBalance = 'createClaimableBalance';
type ClaimClaimableBalance = 'claimClaimableBalance';
type BeginSponsoringFutureReserves = 'beginSponsoringFutureReserves';
type EndSponsoringFutureReserves = 'endSponsoringFutureReserves';
type RevokeSponsorship = 'revokeSponsorship';
type Clawback = 'clawback';
type ClawbackClaimableBalance = 'clawbackClaimableBalance';
type SetTrustLineFlags = 'setTrustLineFlags';
type LiquidityPoolDeposit = 'liquidityPoolDeposit';
type LiquidityPoolWithdraw = 'liquidityPoolWithdraw';
type InvokeHostFunction = 'invokeHostFunction';
type ExtendFootprintTTL = 'extendFootprintTtl';
type RestoreFootprint = 'restoreFootprint';
}
export type OperationType =
| OperationType.CreateAccount
| OperationType.Payment
| OperationType.PathPaymentStrictReceive
| OperationType.PathPaymentStrictSend
| OperationType.CreatePassiveSellOffer
| OperationType.ManageSellOffer
| OperationType.ManageBuyOffer
| OperationType.SetOptions
| OperationType.ChangeTrust
| OperationType.AllowTrust
| OperationType.AccountMerge
| OperationType.Inflation
| OperationType.ManageData
| OperationType.BumpSequence
| OperationType.CreateClaimableBalance
| OperationType.ClaimClaimableBalance
| OperationType.BeginSponsoringFutureReserves
| OperationType.EndSponsoringFutureReserves
| OperationType.RevokeSponsorship
| OperationType.Clawback
| OperationType.ClawbackClaimableBalance
| OperationType.SetTrustLineFlags
| OperationType.LiquidityPoolDeposit
| OperationType.LiquidityPoolWithdraw
| OperationType.InvokeHostFunction
| OperationType.ExtendFootprintTTL
| OperationType.RestoreFootprint;
export namespace OperationOptions {
interface BaseOptions {
source?: string;
}
interface AccountMerge extends BaseOptions {
destination: string;
}
interface AllowTrust extends BaseOptions {
trustor: string;
assetCode: string;
authorize?: boolean | TrustLineFlag;
}
interface ChangeTrust extends BaseOptions {
asset: Asset | LiquidityPoolAsset;
limit?: string;
}
interface CreateAccount extends BaseOptions {
destination: string;
startingBalance: string;
}
interface CreatePassiveSellOffer extends BaseOptions {
selling: Asset;
buying: Asset;
amount: string;
price: number | string | object /* bignumber.js */;
}
interface ManageSellOffer extends CreatePassiveSellOffer {
offerId?: number | string;
}
interface ManageBuyOffer extends BaseOptions {
selling: Asset;
buying: Asset;
buyAmount: string;
price: number | string | object /* bignumber.js */;
offerId?: number | string;
}
// tslint:disable-next-line
interface Inflation extends BaseOptions {
// tslint:disable-line
}
interface ManageData extends BaseOptions {
name: string;
value: string | Buffer | null;
}
interface PathPaymentStrictReceive extends BaseOptions {
sendAsset: Asset;
sendMax: string;
destination: string;
destAsset: Asset;
destAmount: string;
path?: Asset[];
}
interface PathPaymentStrictSend extends BaseOptions {
sendAsset: Asset;
sendAmount: string;
destination: string;
destAsset: Asset;
destMin: string;
path?: Asset[];
}
interface Payment extends BaseOptions {
amount: string;
asset: Asset;
destination: string;
}
interface SetOptions<T extends SignerOptions = never> extends BaseOptions {
inflationDest?: string;
clearFlags?: AuthFlag;
setFlags?: AuthFlag;
masterWeight?: number | string;
lowThreshold?: number | string;
medThreshold?: number | string;
highThreshold?: number | string;
homeDomain?: string;
signer?: T;
}
interface BumpSequence extends BaseOptions {
bumpTo: string;
}
interface CreateClaimableBalance extends BaseOptions {
asset: Asset;
amount: string;
claimants: Claimant[];
}
interface ClaimClaimableBalance extends BaseOptions {
balanceId: string;
}
interface BeginSponsoringFutureReserves extends BaseOptions {
sponsoredId: string;
}
interface RevokeAccountSponsorship extends BaseOptions {
account: string;
}
interface RevokeTrustlineSponsorship extends BaseOptions {
account: string;
asset: Asset | LiquidityPoolId;
}
interface RevokeOfferSponsorship extends BaseOptions {
seller: string;
offerId: string;
}
interface RevokeDataSponsorship extends BaseOptions {
account: string;
name: string;
}
interface RevokeClaimableBalanceSponsorship extends BaseOptions {
balanceId: string;
}
interface RevokeLiquidityPoolSponsorship extends BaseOptions {
liquidityPoolId: string;
}
interface RevokeSignerSponsorship extends BaseOptions {
account: string;
signer: SignerKeyOptions;
}
interface Clawback extends BaseOptions {
asset: Asset;
amount: string;
from: string;
}
interface ClawbackClaimableBalance extends BaseOptions {
balanceId: string;
}
interface SetTrustLineFlags extends BaseOptions {
trustor: string;
asset: Asset;
flags: {
authorized?: boolean;
authorizedToMaintainLiabilities?: boolean;
clawbackEnabled?: boolean;
};
}
interface LiquidityPoolDeposit extends BaseOptions {
liquidityPoolId: string;
maxAmountA: string;
maxAmountB: string;
minPrice: number | string | object /* bignumber.js */;
maxPrice: number | string | object /* bignumber.js */;
}
interface LiquidityPoolWithdraw extends BaseOptions {
liquidityPoolId: string;
amount: string;
minAmountA: string;
minAmountB: string;
}
interface BaseInvocationOptions extends BaseOptions {
auth?: xdr.SorobanAuthorizationEntry[];
}
interface InvokeHostFunction extends BaseInvocationOptions {
func: xdr.HostFunction;
}
interface InvokeContractFunction extends BaseInvocationOptions {
contract: string;
function: string;
args: xdr.ScVal[];
}
interface CreateCustomContract extends BaseInvocationOptions {
address: Address;
wasmHash: Buffer | Uint8Array;
constructorArgs?: xdr.ScVal[];
salt?: Buffer | Uint8Array;
}
interface CreateStellarAssetContract extends BaseOptions {
asset: Asset | string;
}
interface UploadContractWasm extends BaseOptions {
wasm: Buffer | Uint8Array;
}
interface ExtendFootprintTTL extends BaseOptions {
extendTo: number;
}
type RestoreFootprint = BaseOptions;
}
export type OperationOptions =
| OperationOptions.CreateAccount
| OperationOptions.Payment
| OperationOptions.PathPaymentStrictReceive
| OperationOptions.PathPaymentStrictSend
| OperationOptions.CreatePassiveSellOffer
| OperationOptions.ManageSellOffer
| OperationOptions.ManageBuyOffer
| OperationOptions.SetOptions
| OperationOptions.ChangeTrust
| OperationOptions.AllowTrust
| OperationOptions.AccountMerge
| OperationOptions.Inflation
| OperationOptions.ManageData
| OperationOptions.BumpSequence
| OperationOptions.CreateClaimableBalance
| OperationOptions.ClaimClaimableBalance
| OperationOptions.BeginSponsoringFutureReserves
| OperationOptions.RevokeAccountSponsorship
| OperationOptions.RevokeTrustlineSponsorship
| OperationOptions.RevokeOfferSponsorship
| OperationOptions.RevokeDataSponsorship
| OperationOptions.RevokeClaimableBalanceSponsorship
| OperationOptions.RevokeLiquidityPoolSponsorship
| OperationOptions.RevokeSignerSponsorship
| OperationOptions.Clawback
| OperationOptions.ClawbackClaimableBalance
| OperationOptions.SetTrustLineFlags
| OperationOptions.LiquidityPoolDeposit
| OperationOptions.LiquidityPoolWithdraw
| OperationOptions.InvokeHostFunction
| OperationOptions.ExtendFootprintTTL
| OperationOptions.RestoreFootprint
| OperationOptions.CreateCustomContract
| OperationOptions.CreateStellarAssetContract
| OperationOptions.InvokeContractFunction
| OperationOptions.UploadContractWasm;
export namespace Operation {
interface BaseOperation<T extends OperationType = OperationType> {
type: T;
source?: string;
}
interface AccountMerge extends BaseOperation<OperationType.AccountMerge> {
destination: string;
}
function accountMerge(
options: OperationOptions.AccountMerge
): xdr.Operation<AccountMerge>;
interface AllowTrust extends BaseOperation<OperationType.AllowTrust> {
trustor: string;
assetCode: string;
// this is a boolean or a number so that it can support protocol 12 or 13
authorize: boolean | TrustLineFlag | undefined;
}
function allowTrust(
options: OperationOptions.AllowTrust
): xdr.Operation<AllowTrust>;
interface ChangeTrust extends BaseOperation<OperationType.ChangeTrust> {
line: Asset | LiquidityPoolAsset;
limit: string;
}
function changeTrust(
options: OperationOptions.ChangeTrust
): xdr.Operation<ChangeTrust>;
interface CreateAccount extends BaseOperation<OperationType.CreateAccount> {
destination: string;
startingBalance: string;
}
function createAccount(
options: OperationOptions.CreateAccount
): xdr.Operation<CreateAccount>;
interface CreatePassiveSellOffer
extends BaseOperation<OperationType.CreatePassiveSellOffer> {
selling: Asset;
buying: Asset;
amount: string;
price: string;
}
function createPassiveSellOffer(
options: OperationOptions.CreatePassiveSellOffer
): xdr.Operation<CreatePassiveSellOffer>;
interface Inflation extends BaseOperation<OperationType.Inflation> {}
function inflation(
options: OperationOptions.Inflation
): xdr.Operation<Inflation>;
interface ManageData extends BaseOperation<OperationType.ManageData> {
name: string;
value?: Buffer;
}
function manageData(
options: OperationOptions.ManageData
): xdr.Operation<ManageData>;
interface ManageSellOffer
extends BaseOperation<OperationType.ManageSellOffer> {
selling: Asset;
buying: Asset;
amount: string;
price: string;
offerId: string;
}
function manageSellOffer(
options: OperationOptions.ManageSellOffer
): xdr.Operation<ManageSellOffer>;
interface ManageBuyOffer extends BaseOperation<OperationType.ManageBuyOffer> {
selling: Asset;
buying: Asset;
buyAmount: string;
price: string;
offerId: string;
}
function manageBuyOffer(
options: OperationOptions.ManageBuyOffer
): xdr.Operation<ManageBuyOffer>;
interface PathPaymentStrictReceive
extends BaseOperation<OperationType.PathPaymentStrictReceive> {
sendAsset: Asset;
sendMax: string;
destination: string;
destAsset: Asset;
destAmount: string;
path: Asset[];
}
function pathPaymentStrictReceive(
options: OperationOptions.PathPaymentStrictReceive
): xdr.Operation<PathPaymentStrictReceive>;
interface PathPaymentStrictSend
extends BaseOperation<OperationType.PathPaymentStrictSend> {
sendAsset: Asset;
sendAmount: string;
destination: string;
destAsset: Asset;
destMin: string;
path: Asset[];
}
function pathPaymentStrictSend(
options: OperationOptions.PathPaymentStrictSend
): xdr.Operation<PathPaymentStrictSend>;
interface Payment extends BaseOperation<OperationType.Payment> {
amount: string;
asset: Asset;
destination: string;
}
function payment(options: OperationOptions.Payment): xdr.Operation<Payment>;
interface SetOptions<T extends SignerOptions = SignerOptions>
extends BaseOperation<OperationType.SetOptions> {
inflationDest?: string;
clearFlags?: AuthFlag;
setFlags?: AuthFlag;
masterWeight?: number;
lowThreshold?: number;
medThreshold?: number;
highThreshold?: number;
homeDomain?: string;
signer: T extends { ed25519PublicKey: any }
? Signer.Ed25519PublicKey
: T extends { sha256Hash: any }
? Signer.Sha256Hash
: T extends { preAuthTx: any }
? Signer.PreAuthTx
: T extends { ed25519SignedPayload: any }
? Signer.Ed25519SignedPayload
: never;
}
function setOptions<T extends SignerOptions = never>(
options: OperationOptions.SetOptions<T>
): xdr.Operation<SetOptions<T>>;
interface BumpSequence extends BaseOperation<OperationType.BumpSequence> {
bumpTo: string;
}
function bumpSequence(
options: OperationOptions.BumpSequence
): xdr.Operation<BumpSequence>;
interface CreateClaimableBalance extends BaseOperation<OperationType.CreateClaimableBalance> {
amount: string;
asset: Asset;
claimants: Claimant[];
}
function createClaimableBalance(
options: OperationOptions.CreateClaimableBalance
): xdr.Operation<CreateClaimableBalance>;
interface ClaimClaimableBalance extends BaseOperation<OperationType.ClaimClaimableBalance> {
balanceId: string;
}
function claimClaimableBalance(
options: OperationOptions.ClaimClaimableBalance
): xdr.Operation<ClaimClaimableBalance>;
interface BeginSponsoringFutureReserves extends BaseOperation<OperationType.BeginSponsoringFutureReserves> {
sponsoredId: string;
}
function beginSponsoringFutureReserves(
options: OperationOptions.BeginSponsoringFutureReserves
): xdr.Operation<BeginSponsoringFutureReserves>;
interface EndSponsoringFutureReserves extends BaseOperation<OperationType.EndSponsoringFutureReserves> {
}
function endSponsoringFutureReserves(
options: OperationOptions.BaseOptions
): xdr.Operation<EndSponsoringFutureReserves>;
interface RevokeAccountSponsorship extends BaseOperation<OperationType.RevokeSponsorship> {
account: string;
}
function revokeAccountSponsorship(
options: OperationOptions.RevokeAccountSponsorship
): xdr.Operation<RevokeAccountSponsorship>;
interface RevokeTrustlineSponsorship extends BaseOperation<OperationType.RevokeSponsorship> {
account: string;
asset: Asset | LiquidityPoolId;
}
function revokeTrustlineSponsorship(
options: OperationOptions.RevokeTrustlineSponsorship
): xdr.Operation<RevokeTrustlineSponsorship>;
interface RevokeOfferSponsorship extends BaseOperation<OperationType.RevokeSponsorship> {
seller: string;
offerId: string;
}
function revokeOfferSponsorship(
options: OperationOptions.RevokeOfferSponsorship
): xdr.Operation<RevokeOfferSponsorship>;
interface RevokeDataSponsorship extends BaseOperation<OperationType.RevokeSponsorship> {
account: string;
name: string;
}
function revokeDataSponsorship(
options: OperationOptions.RevokeDataSponsorship
): xdr.Operation<RevokeDataSponsorship>;
interface RevokeClaimableBalanceSponsorship extends BaseOperation<OperationType.RevokeSponsorship> {
balanceId: string;
}
function revokeClaimableBalanceSponsorship(
options: OperationOptions.RevokeClaimableBalanceSponsorship
): xdr.Operation<RevokeClaimableBalanceSponsorship>;
interface RevokeLiquidityPoolSponsorship extends BaseOperation<OperationType.RevokeSponsorship> {
liquidityPoolId: string;
}
function revokeLiquidityPoolSponsorship(
options: OperationOptions.RevokeLiquidityPoolSponsorship
): xdr.Operation<RevokeLiquidityPoolSponsorship>;
interface RevokeSignerSponsorship extends BaseOperation<OperationType.RevokeSponsorship> {
account: string;
signer: SignerKeyOptions;
}
function revokeSignerSponsorship(
options: OperationOptions.RevokeSignerSponsorship
): xdr.Operation<RevokeSignerSponsorship>;
interface Clawback extends BaseOperation<OperationType.Clawback> {
asset: Asset;
amount: string;
from: string;
}
function clawback(
options: OperationOptions.Clawback
): xdr.Operation<Clawback>;
interface ClawbackClaimableBalance extends BaseOperation<OperationType.ClawbackClaimableBalance> {
balanceId: string;
}
function clawbackClaimableBalance(
options: OperationOptions.ClawbackClaimableBalance
): xdr.Operation<ClawbackClaimableBalance>;
interface SetTrustLineFlags extends BaseOperation<OperationType.SetTrustLineFlags> {
trustor: string;
asset: Asset;
flags: {
authorized?: boolean;
authorizedToMaintainLiabilities?: boolean;
clawbackEnabled?: boolean;
};
}
function setTrustLineFlags(
options: OperationOptions.SetTrustLineFlags
): xdr.Operation<SetTrustLineFlags>;
interface LiquidityPoolDeposit extends BaseOperation<OperationType.LiquidityPoolDeposit> {
liquidityPoolId: string;
maxAmountA: string;
maxAmountB: string;
minPrice: string;
maxPrice: string;
}
function liquidityPoolDeposit(
options: OperationOptions.LiquidityPoolDeposit
): xdr.Operation<LiquidityPoolDeposit>;
interface LiquidityPoolWithdraw extends BaseOperation<OperationType.LiquidityPoolWithdraw> {
liquidityPoolId: string;
amount: string;
minAmountA: string;
minAmountB: string;
}
function liquidityPoolWithdraw(
options: OperationOptions.LiquidityPoolWithdraw
): xdr.Operation<LiquidityPoolWithdraw>;
interface InvokeHostFunction extends BaseOperation<OperationType.InvokeHostFunction> {
func: xdr.HostFunction;
auth?: xdr.SorobanAuthorizationEntry[];
}
function invokeHostFunction(
options: OperationOptions.InvokeHostFunction
): xdr.Operation<InvokeHostFunction>;
function extendFootprintTtl(
options: OperationOptions.ExtendFootprintTTL
): xdr.Operation<ExtendFootprintTTL>;
interface ExtendFootprintTTL extends BaseOperation<OperationType.ExtendFootprintTTL> {
extendTo: number;
}
function restoreFootprint(options: OperationOptions.RestoreFootprint):
xdr.Operation<RestoreFootprint>;
interface RestoreFootprint extends BaseOperation<OperationType.RestoreFootprint> {}
function createCustomContract(
opts: OperationOptions.CreateCustomContract
): xdr.Operation<InvokeHostFunction>;
function createStellarAssetContract(
opts: OperationOptions.CreateStellarAssetContract
): xdr.Operation<InvokeHostFunction>;
function invokeContractFunction(
opts: OperationOptions.InvokeContractFunction
): xdr.Operation<InvokeHostFunction>;
function uploadContractWasm(
opts: OperationOptions.UploadContractWasm
): xdr.Operation<InvokeHostFunction>;
function fromXDRObject<T extends Operation = Operation>(
xdrOperation: xdr.Operation<T>
): T;
}
export type Operation =
| Operation.CreateAccount
| Operation.Payment
| Operation.PathPaymentStrictReceive
| Operation.PathPaymentStrictSend
| Operation.CreatePassiveSellOffer
| Operation.ManageSellOffer
| Operation.ManageBuyOffer
| Operation.SetOptions
| Operation.ChangeTrust
| Operation.AllowTrust
| Operation.AccountMerge
| Operation.Inflation
| Operation.ManageData
| Operation.BumpSequence
| Operation.CreateClaimableBalance
| Operation.ClaimClaimableBalance
| Operation.BeginSponsoringFutureReserves
| Operation.EndSponsoringFutureReserves
| Operation.RevokeAccountSponsorship
| Operation.RevokeTrustlineSponsorship
| Operation.RevokeOfferSponsorship
| Operation.RevokeDataSponsorship
| Operation.RevokeClaimableBalanceSponsorship
| Operation.RevokeLiquidityPoolSponsorship
| Operation.RevokeSignerSponsorship
| Operation.Clawback
| Operation.ClawbackClaimableBalance
| Operation.SetTrustLineFlags
| Operation.LiquidityPoolDeposit
| Operation.LiquidityPoolWithdraw
| Operation.InvokeHostFunction
| Operation.ExtendFootprintTTL
| Operation.RestoreFootprint;
export namespace StrKey {
function encodeEd25519PublicKey(data: Buffer): string;
function decodeEd25519PublicKey(address: string): Buffer;
function isValidEd25519PublicKey(Key: string): boolean;
function encodeEd25519SecretSeed(data: Buffer): string;
function decodeEd25519SecretSeed(address: string): Buffer;
function isValidEd25519SecretSeed(seed: string): boolean;
function encodeMed25519PublicKey(data: Buffer): string;
function decodeMed25519PublicKey(address: string): Buffer;
function isValidMed25519PublicKey(publicKey: string): boolean;
function encodeSignedPayload(data: Buffer): string;
function decodeSignedPayload(address: string): Buffer;
function isValidSignedPayload(address: string): boolean;
function encodePreAuthTx(data: Buffer): string;
function decodePreAuthTx(address: string): Buffer;
function encodeSha256Hash(data: Buffer): string;
function decodeSha256Hash(address: string): Buffer;
function encodeContract(data: Buffer): string;
function decodeContract(address: string): Buffer;
function isValidContract(address: string): boolean;
}
export namespace SignerKey {
function decodeAddress(address: string): xdr.SignerKey;
function encodeSignerKey(signerKey: xdr.SignerKey): string;
}
export class TransactionI {