-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #603 from EdgeApp/william/stellar-types
Stellar types
- Loading branch information
Showing
5 changed files
with
82 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* eslint-disable @typescript-eslint/no-extraneous-class */ | ||
|
||
declare module 'stellar-sdk' { | ||
export class Account { | ||
constructor(publicKey: string, accountSequence: number) | ||
} | ||
|
||
export class Asset { | ||
static native: () => Asset | ||
} | ||
|
||
export class Keypair { | ||
static fromRawEd25519Seed: (key: number[]) => Keypair | ||
static fromSecret: (key: string) => Keypair | ||
static fromPublicKey: (key: string) => Keypair | ||
publicKey: () => string | ||
secret: () => string | ||
} | ||
|
||
export class Memo { | ||
static hash: (hex: string) => Memo | ||
static id: (number: string) => Memo | ||
static return: (address: string) => Memo | ||
static text: (text: string) => Memo | ||
} | ||
|
||
export class Operation { | ||
static createAccount: (params: any) => Operation | ||
static payment: (params: any) => Operation | ||
} | ||
|
||
export class Transaction { | ||
sign: (keypair: Keypair) => void | ||
fee: number | ||
} | ||
|
||
export class TransactionBuilder { | ||
constructor(account: Account, options: any) | ||
addMemo: (memo: Memo) => TransactionBuilder | ||
addOperation: (operation: Operation) => TransactionBuilder | ||
setTimeout: (time: number) => TransactionBuilder | ||
build: () => Transaction | ||
} | ||
|
||
export class Server { | ||
constructor(server: string) | ||
serverName: string | ||
} | ||
|
||
interface StellarApi { | ||
Account: typeof Account | ||
Asset: typeof Asset | ||
Keypair: typeof Keypair | ||
Memo: typeof Memo | ||
Network: { | ||
usePublicNetwork: () => void | ||
} | ||
Operation: typeof Operation | ||
Server: typeof Server | ||
TransactionBuilder: typeof TransactionBuilder | ||
} | ||
|
||
const stellarApi: StellarApi | ||
export default stellarApi | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters