mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 14:27:04 +00:00
Merge pull request #26938 from pselden/stellar-sdk-memo
Fix stellar-sdk memo type strings
This commit is contained in:
Vendored
+11
-4
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/stellar/js-stellar-sdk
|
||||
// Definitions by: Carl Foster <https://github.com/carl-foster>
|
||||
// Triston Jones <https://github.com/tristonj>
|
||||
// Paul Selden <https://github.com/pselden>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
@@ -505,16 +506,22 @@ export class Memo {
|
||||
static return(hash: string): Memo;
|
||||
static text(text: string): Memo;
|
||||
|
||||
constructor(type: 'MemoNone')
|
||||
constructor(type: 'MemoID' | 'MemoText', value: string)
|
||||
constructor(type: 'MemoHash' | 'MemoReturn', value: Buffer)
|
||||
constructor(type: 'none');
|
||||
constructor(type: 'id' | 'text' | 'hash' | 'return', value: string)
|
||||
constructor(type: 'hash' | 'return', value: Buffer)
|
||||
|
||||
type: 'MemoNone' | 'MemoID' | 'MemoText' | 'MemoHash' | 'MemoReturn';
|
||||
type: string;
|
||||
value: null | string | Buffer;
|
||||
|
||||
toXDRObject(): xdr.Memo;
|
||||
}
|
||||
|
||||
export const MemoNone = 'none';
|
||||
export const MemoID = 'id';
|
||||
export const MemoText = 'text';
|
||||
export const MemoHash = 'hash';
|
||||
export const MemoReturn = 'return';
|
||||
|
||||
export enum Networks {
|
||||
PUBLIC = 'Public Global Stellar Network ; September 2015',
|
||||
TESTNET = 'Test SDF Network ; September 2015',
|
||||
|
||||
@@ -5,5 +5,6 @@ const destKey = StellarSdk.Keypair.random();
|
||||
const account = new StellarSdk.Account(sourceKey.publicKey(), 1);
|
||||
const transaction = new StellarSdk.TransactionBuilder(account)
|
||||
.addOperation(StellarSdk.Operation.accountMerge({destination: destKey.publicKey()}))
|
||||
.addMemo(new StellarSdk.Memo(StellarSdk.MemoText, "memo"))
|
||||
.build(); // $ExpectType () => Transaction
|
||||
transaction; // $ExpectType Transaction
|
||||
|
||||
Reference in New Issue
Block a user