-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: extend Contract class first parameter
- Loading branch information
Showing
10 changed files
with
242 additions
and
127 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@near-js/accounts": minor | ||
--- | ||
|
||
Extend Contract class to accept Connection object |
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,50 @@ | ||
import { BlockReference } from "@near-js/types"; | ||
import type { Connection } from "./connection"; | ||
|
||
export interface IntoConnection { | ||
getConnection(): Connection; | ||
} | ||
|
||
/** | ||
* Options used to initiate a function call (especially a change function call) | ||
* @see {@link Account#viewFunction | viewFunction} to initiate a view function call | ||
*/ | ||
export interface FunctionCallOptions { | ||
/** The NEAR account id where the contract is deployed */ | ||
contractId: string; | ||
/** The name of the method to invoke */ | ||
methodName: string; | ||
/** | ||
* named arguments to pass the method `{ messageText: 'my message' }` | ||
*/ | ||
args?: object; | ||
/** max amount of gas that method call can use */ | ||
gas?: bigint; | ||
/** amount of NEAR (in yoctoNEAR) to send together with the call */ | ||
attachedDeposit?: bigint; | ||
/** | ||
* Convert input arguments into bytes array. | ||
*/ | ||
stringify?: (input: any) => Buffer; | ||
/** | ||
* Is contract from JS SDK, automatically encodes args from JS SDK to binary. | ||
*/ | ||
jsContract?: boolean; | ||
} | ||
|
||
export interface ChangeFunctionCallOptions extends FunctionCallOptions { | ||
/** | ||
* Metadata to send the NEAR Wallet if using it to sign transactions. | ||
* @see RequestSignTransactionsOptions | ||
*/ | ||
walletMeta?: string; | ||
/** | ||
* Callback url to send the NEAR Wallet if using it to sign transactions. | ||
* @see RequestSignTransactionsOptions | ||
*/ | ||
walletCallbackUrl?: string; | ||
} | ||
export interface ViewFunctionCallOptions extends FunctionCallOptions { | ||
parse?: (response: Uint8Array) => any; | ||
blockQuery?: BlockReference; | ||
} |
Oops, something went wrong.