forked from toncenter/tonweb
-
Notifications
You must be signed in to change notification settings - Fork 1
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 toncenter#37 from slavafomin/types
Updated type declarations
- Loading branch information
Showing
22 changed files
with
143 additions
and
60 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
.idea/ | ||
/.idea/ | ||
/coverage/ | ||
/node_modules/ | ||
/test-reports/ | ||
.DS_Store | ||
node_modules | ||
*.iml | ||
*.iml |
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
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 |
---|---|---|
@@ -1,9 +1,38 @@ | ||
import BN from 'bn.js'; | ||
import { Cell } from '../../../boc/cell'; | ||
import { HttpProvider } from '../../../providers/http-provider'; | ||
import { Address } from '../../../utils/address'; | ||
import { Contract, ContractMethods, ContractOptions } from '../../contract'; | ||
export interface JettonMinterOptions extends ContractOptions { | ||
wc?: 0; | ||
adminAddress: Address; | ||
jettonContentUri: string; | ||
jettonWalletCodeHex: string; | ||
} | ||
export interface JettonMinterMethods extends ContractMethods { | ||
} | ||
export interface MintBodyParams { | ||
tokenAmount: BN; | ||
destination: Address; | ||
amount: BN; | ||
queryId?: number; | ||
} | ||
export interface JettonData { | ||
totalSupply: BN; | ||
isMutable: boolean; | ||
jettonContentUri: string; | ||
tokenWalletCode: Cell; | ||
adminAddress?: Address; | ||
} | ||
/** | ||
* ATTENTION: this is a DRAFT, there will be changes. | ||
*/ | ||
export declare class JettonMinter extends Contract<JettonMinterOptions, JettonMinterMethods> { | ||
constructor(provider: HttpProvider, options: JettonMinterOptions); | ||
createMintBody(params: MintBodyParams): Cell; | ||
getJettonData(): Promise<JettonData>; | ||
/** | ||
* Returns cell that contains jetton minter data. | ||
*/ | ||
protected createDataCell(): Cell; | ||
} |
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 |
---|---|---|
@@ -1,9 +1,45 @@ | ||
import BN from 'bn.js'; | ||
import { Cell } from '../../../boc/cell'; | ||
import { HttpProvider } from '../../../providers/http-provider'; | ||
import { Address } from '../../../utils/address'; | ||
import { Contract, ContractMethods, ContractOptions } from '../../contract'; | ||
export interface JettonWalletOptions extends ContractOptions { | ||
wc?: 0; | ||
} | ||
export interface JettonWalletMethods extends ContractMethods { | ||
} | ||
export interface WalletData { | ||
balance: BN; | ||
ownerAddress: Address; | ||
jettonMinterAddress: Address; | ||
tokenWalletCode: Cell; | ||
} | ||
export interface TransferBodyParams { | ||
queryId?: number; | ||
tokenAmount: BN; | ||
toAddress: Address; | ||
responseAddress: Address; | ||
forwardAmount: BN; | ||
forwardPayload: Uint8Array; | ||
} | ||
export interface BurnBodyParams { | ||
queryId?: number; | ||
tokenAmount: BN; | ||
responseAddress: Address; | ||
} | ||
/** | ||
* ATTENTION: this is a DRAFT, there will be changes. | ||
*/ | ||
export declare class JettonWallet extends Contract<JettonWalletOptions, JettonWalletMethods> { | ||
static codeHex: string; | ||
constructor(provider: HttpProvider, options: JettonWalletOptions); | ||
getData(): Promise<WalletData>; | ||
/** | ||
* @todo: should it be async? | ||
*/ | ||
createTransferBody(params: TransferBodyParams): Promise<Cell>; | ||
/** | ||
* @todo: should it be async? | ||
*/ | ||
createBurnBody(params: BurnBodyParams): Promise<Cell>; | ||
} |
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
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,7 @@ | ||
import { Cell } from '../../../boc/cell'; | ||
/** | ||
* Writes current timestamp to the specified signing message, | ||
* or the placeholder value if the specified `seqno` value | ||
* is equal to zero. | ||
*/ | ||
export declare function writeTimestampToSigningMessage(message: Cell, seqno: number): void; |
5 changes: 2 additions & 3 deletions
5
dist/types/contract/wallet/simple/simple-wallet-contract-r1.d.ts
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 |
---|---|---|
@@ -1,10 +1,9 @@ | ||
import { HttpProvider } from '../../../providers/http-provider'; | ||
import { ContractOptions } from '../../contract'; | ||
import { WalletContract } from '../wallet-contract'; | ||
import { WalletContract, WalletContractOptions } from '../wallet-contract'; | ||
/** | ||
* Attention: no seqno get-method in this wallet. | ||
*/ | ||
export declare class SimpleWalletContractR1 extends WalletContract { | ||
constructor(provider: HttpProvider, options: ContractOptions); | ||
constructor(provider: HttpProvider, options: WalletContractOptions); | ||
getName(): string; | ||
} |
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
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
14 changes: 10 additions & 4 deletions
14
dist/types/utils/Address.d.ts → dist/types/utils/address.d.ts
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 |
---|---|---|
@@ -1,15 +1,21 @@ | ||
import { Workchain } from './workchain'; | ||
export declare type AddressType = (Address | string); | ||
export declare class Address { | ||
static isValid(anyForm: AddressType): boolean; | ||
wc: number; | ||
wc: Workchain; | ||
hashPart: Uint8Array; | ||
isTestOnly: boolean; | ||
isUserFriendly: boolean; | ||
isBounceable: boolean; | ||
isUrlSafe: boolean; | ||
constructor(address: AddressType); | ||
toString(isUserFriendly?: boolean, isUrlSafe?: boolean, isBounceable?: boolean, isTestOnly?: boolean): string; | ||
/** | ||
* @param anyForm {string | Address} | ||
* Copies the address data from the specified Address | ||
* instance to this instance. | ||
*/ | ||
constructor(anyForm: AddressType); | ||
toString(isUserFriendly?: boolean, isUrlSafe?: boolean, isBounceable?: boolean, isTestOnly?: boolean): string; | ||
private initFromInstance; | ||
private initFromString; | ||
private parseFriendlyAddress; | ||
private checkWorkchainOrThrow; | ||
} |
Oops, something went wrong.