Skip to content

Commit

Permalink
fix: inline action creation methods to ensure signatures are emitted …
Browse files Browse the repository at this point in the history
…correctly in the typedef
  • Loading branch information
andy-haynes committed Mar 23, 2023
1 parent 4150e0e commit e98d2f2
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions packages/near-api-js/src/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,18 @@ export {
SignedTransaction,
Transaction,
} from '@near-js/transactions';
import { actionCreators } from '@near-js/transactions';

export const addKey = actionCreators.addKey;
export const createAccount = actionCreators.createAccount;
export const deleteAccount = actionCreators.deleteAccount;
export const deleteKey = actionCreators.deleteKey;
export const deployContract = actionCreators.deployContract;
export const fullAccessKey = actionCreators.fullAccessKey;
export const functionCall = actionCreators.functionCall;
export const functionCallAccessKey = actionCreators.functionCallAccessKey;
export const stake = actionCreators.stake;
export const transfer = actionCreators.transfer;
import { PublicKey } from '@near-js/crypto';
import { AccessKey, actionCreators, stringifyJsonOrBytes } from '@near-js/transactions';
import BN from 'bn.js';

export const addKey = (publicKey: PublicKey, accessKey: AccessKey) => actionCreators.addKey(publicKey, accessKey);
export const createAccount = () => actionCreators.createAccount();
export const deleteAccount = (beneficiaryId: string) => actionCreators.deleteAccount(beneficiaryId);
export const deleteKey = (publicKey: PublicKey) => actionCreators.deleteKey(publicKey);
export const deployContract = (code: Uint8Array) => actionCreators.deployContract(code);
export const fullAccessKey = () => actionCreators.fullAccessKey();
export const functionCall = (methodName: string, args: object | Uint8Array, gas: BN, deposit: BN, stringify?: typeof stringifyJsonOrBytes, jsContract?: boolean) => actionCreators.functionCall(methodName, args, gas, deposit, stringify, jsContract);
export const functionCallAccessKey = (receiverId: string, methodNames: string[], allowance?: BN) => actionCreators.functionCallAccessKey(receiverId, methodNames, allowance);
export const stake = (stake: BN, publicKey: PublicKey) => actionCreators.stake(stake, publicKey);
export const transfer = (deposit: BN) => actionCreators.transfer(deposit);

0 comments on commit e98d2f2

Please sign in to comment.