Skip to content

Commit

Permalink
feat: update @link
Browse files Browse the repository at this point in the history
  • Loading branch information
few-sw committed Nov 17, 2023
1 parent c1a7998 commit 278e912
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 29 deletions.
4 changes: 2 additions & 2 deletions packages/accounts/src/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export interface SignAndSendTransactionOptions {

/**
* Options used to initiate a function call (especially a change function call)
* @see {@link account!Account#viewFunction | viewFunction} to initiate a view 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 */
Expand Down Expand Up @@ -266,7 +266,7 @@ export class Account {
accessKeyByPublicKeyCache: { [key: string]: AccessKeyView } = {};

/**
* Finds the {@link providers/provider!AccessKeyView | AccessKeyView} associated with the accounts {@link utils/key_pair!PublicKey | PublicKey} stored in the {@link key_stores/keystore!KeyStore | KeyStore}.
* Finds the {@link AccessKeyView} associated with the accounts {@link PublicKey} stored in the {@link key_stores/keystore!KeyStore}.
*
* @todo Find matching access key based on transaction (i.e. receiverId and actions)
*
Expand Down
4 changes: 2 additions & 2 deletions packages/accounts/src/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ export interface ContractMethods {
/**
* Methods that change state. These methods cost gas and require a signed transaction.
*
* @see {@link account!Account.functionCall}
* @see {@link Account#functionCall}
*/
changeMethods: string[];

/**
* View methods do not require a signed transaction.
*
* @see {@link account!Account#viewFunction}
* @see {@link Account#viewFunction}
*/
viewMethods: string[];

Expand Down
6 changes: 3 additions & 3 deletions packages/keystores/src/keystore.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { KeyPair } from '@near-js/crypto';

/**
* KeyStores are passed to {@link near!Near | Near} via {@link near!NearConfig | NearConfig}
* and are used by the {@link signer!InMemorySigner | InMemorySigner} to sign transactions.
* KeyStores are passed to {@link Near} via {@link NearConfig}
* and are used by the {@link InMemorySigner | InMemorySigner} to sign transactions.
*
* @see {@link near-api-js!connect | connect}
* @see {@link connect }
*/
export abstract class KeyStore {
abstract setKey(networkId: string, accountId: string, keyPair: KeyPair): Promise<void>;
Expand Down
6 changes: 3 additions & 3 deletions packages/near-api-js/src/browser-connect.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/**
* Connect to NEAR using the provided configuration.
*
* {@link browserConnect!ConnectConfig.networkId | ConnectConfig.networkId} and {@link browserConnect!ConnectConfig.nodeUrl | ConnectConfig.nodeUrl} are required.
* {@link ConnectConfig#networkId} and {@link ConnectConfig#nodeUrl} are required.
*
* To sign transactions you can also pass: {@link browserConnect!ConnectConfig.keyStore | ConnectConfig.keyStore}
* To sign transactions you can also pass: {@link ConnectConfig#keyStore}
*
* Both are passed they are prioritize in that order.
*
* @see {@link browserConnect!ConnectConfig | ConnectConfig}
* @see {@link ConnectConfig}
* @example
* ```js
* async function initNear() {
Expand Down
12 changes: 6 additions & 6 deletions packages/near-api-js/src/connect.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/**
* Connect to NEAR using the provided configuration.
*
* {@link Connect!ConnectConfig.networkId | ConnectConfig.networkId} and {@link Connect!ConnectConfig.nodeUrl | ConnectConfig.nodeUrl} are required.
* {@link ConnectConfig#networkId} and {@link ConnectConfig#nodeUrl} are required.
*
* To sign transactions you can also pass:
* 1. {@link Connect!ConnectConfig.keyStore | ConnectConfig.keyStore}
* 2. {@link Connect!ConnectConfig.keyPath | ConnectConfig.keyPath}
* 3. {@link Connect!ConnectConfig.deps.keyStore | ConnectConfig.deps.keyStore} (deprecated, only for use in legacy applications)
* 1. {@link ConnectConfig#keyStore}
* 2. {@link ConnectConfig#keyPath}
* 3. {@link ConnectConfig#deps.keyStore} (deprecated, only for use in legacy applications)
*
* If all three are passed they are prioritize in that order.
*
* @see {@link Connect!ConnectConfig | ConnectConfig}
* @see {@link ConnectConfig}
* @example
* ```js
* async function initNear() {
Expand All @@ -29,7 +29,7 @@ import { logWarning } from './utils';

export interface ConnectConfig extends NearConfig {
/**
* Initialize an {@link key_stores/in_memory_key_store!InMemoryKeyStore | InMemoryKeyStore} by reading the file at keyPath.
* Initialize an {@link InMemoryKeyStore} by reading the file at keyPath.
*/
keyPath?: string;
}
Expand Down
6 changes: 3 additions & 3 deletions packages/providers/src/json-rpc-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @description
* This module contains the {@link JsonRpcProvider} client class
* which can be used to interact with the [NEAR RPC API](https://docs.near.org/api/rpc/introduction).
* @see {@link providers/provider!provider | provider} for a list of request and response types
* @see {@link provider} for a list of request and response types
*/
import {
baseEncode,
Expand Down Expand Up @@ -139,7 +139,7 @@ export class JsonRpcProvider extends Provider {
}

/**
* Query the RPC by passing an {@link providers/provider!RpcQueryRequest | RpcQueryRequest}
* Query the RPC by passing an {@link RpcQueryRequest}
* @see [https://docs.near.org/api/rpc/contracts](https://docs.near.org/api/rpc/contracts)
*
* @typeParam T the shape of the returned query response
Expand Down Expand Up @@ -167,7 +167,7 @@ export class JsonRpcProvider extends Provider {
* pass block_id OR finality as blockQuery, not both
* @see [https://docs.near.org/api/rpc/block-chunk](https://docs.near.org/api/rpc/block-chunk)
*
* @param blockQuery {@link providers/provider!BlockReference | BlockReference} (passing a {@link providers/provider!BlockId | BlockId} is deprecated)
* @param blockQuery {@link BlockReference} (passing a {@link BlockId} is deprecated)
*/
async block(blockQuery: BlockId | BlockReference): Promise<BlockResult> {
const { finality } = blockQuery as any;
Expand Down
12 changes: 6 additions & 6 deletions packages/wallet-account/src/near.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@ import { Signer } from '@near-js/signers';
import BN from 'bn.js';

export interface NearConfig {
/** Holds {@link utils/key_pair!KeyPair | KeyPair} for signing transactions */
/** Holds {@link utils/key_pair!KeyPair} for signing transactions */
keyStore?: KeyStore;

/** @hidden */
signer?: Signer;

/**
* [NEAR Contract Helper](https://github.com/near/near-contract-helper) url used to create accounts if no master account is provided
* @see {@link UrlAccountCreator | UrlAccountCreator}
* @see {@link UrlAccountCreator}
*/
helperUrl?: string;

/**
* The balance transferred from the {@link masterAccount} to a created account
* The balance transferred from the {@link NearConfig#masterAccount} to a created account
* @see {@link LocalAccountCreator}
*/
initialBalance?: string;
Expand All @@ -51,13 +51,13 @@ export interface NearConfig {

/**
* NEAR RPC API url. used to make JSON RPC calls to interact with NEAR.
* @see {@link providers/json-rpc-provider!JsonRpcProvider | JsonRpcProvider}
* @see {@link JsonRpcProvider}
*/
nodeUrl: string;

/**
* NEAR RPC API headers. Can be used to pass API KEY and other parameters.
* @see {@link providers/json-rpc-provider!JsonRpcProvider | JsonRpcProvider}
* @see {@link JsonRpcProvider}
*/
headers?: { [key: string]: string | number };

Expand Down Expand Up @@ -123,7 +123,7 @@ export class Near {
* Create an account using the {@link AccountCreator}. Either:
* * using a masterAccount with {@link LocalAccountCreator}
* * using the helperUrl with {@link UrlAccountCreator}
* @see {@link NearConfig#masterAccount | masterAccount} and {@link NearConfig#helperUrl | helperUrl}
* @see {@link NearConfig#masterAccount} and {@link NearConfig#helperUrl}
*
* @param accountId
* @param publicKey
Expand Down
8 changes: 4 additions & 4 deletions packages/wallet-account/src/wallet_account.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* The classes in this module are used in conjunction with the {@link key_stores/browser_local_storage_key_store!BrowserLocalStorageKeyStore | BrowserLocalStorageKeyStore}.
* The classes in this module are used in conjunction with the {@link BrowserLocalStorageKeyStore}.
* This module exposes two classes:
* * {@link WalletConnection} which redirects users to [NEAR Wallet](https://wallet.near.org/) for key management.
* * {@link ConnectedWalletAccount} is an {@link account!Account | Account} implementation that uses {@link WalletConnection} to get keys
Expand Down Expand Up @@ -48,7 +48,7 @@ interface RequestSignTransactionsOptions {
}

/**
* This class is used in conjunction with the {@link key_stores/browser_local_storage_key_store!BrowserLocalStorageKeyStore}.
* This class is used in conjunction with the {@link BrowserLocalStorageKeyStore}.
* It redirects users to [NEAR Wallet](https://wallet.near.org) for key management.
* This class is not intended for use outside the browser. Without `window` (i.e. in server contexts), it will instantiate but will throw a clear error when used.
*
Expand Down Expand Up @@ -288,7 +288,7 @@ export class WalletConnection {
}

/**
* {@link account!Account | Account} implementation which redirects to wallet using {@link WalletConnection} when no local key is available.
* {@link Account} implementation which redirects to wallet using {@link WalletConnection} when no local key is available.
*/
export class ConnectedWalletAccount extends Account {
walletConnection: WalletConnection;
Expand All @@ -302,7 +302,7 @@ export class ConnectedWalletAccount extends Account {

/**
* Sign a transaction by redirecting to the NEAR Wallet
* @see {@link WalletConnection.requestSignTransactions}
* @see {@link WalletConnection#requestSignTransactions}
*/
async signAndSendTransaction({ receiverId, actions, walletMeta, walletCallbackUrl = window.location.href }: SignAndSendTransactionOptions): Promise<FinalExecutionOutcome> {
const localKey = await this.connection.signer.getPublicKey(this.accountId, this.connection.networkId);
Expand Down

0 comments on commit 278e912

Please sign in to comment.