From 588bef6eec5110d2c22162dbaa581543c846654a Mon Sep 17 00:00:00 2001 From: Daniyar Itegulov Date: Fri, 2 Dec 2022 15:29:28 +1100 Subject: [PATCH] migrate examples to not use top-level JSON values --- examples/src/standard-nft/test-approval-receiver.ts | 7 +++---- examples/src/standard-nft/test-token-receiver.ts | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/examples/src/standard-nft/test-approval-receiver.ts b/examples/src/standard-nft/test-approval-receiver.ts index 8c614091e..8f112dcbe 100644 --- a/examples/src/standard-nft/test-approval-receiver.ts +++ b/examples/src/standard-nft/test-approval-receiver.ts @@ -15,13 +15,12 @@ const PROMISE_CALL = 20_000_000_000_000n; const GAS_FOR_NFT_ON_APPROVE = BASE_GAS + PROMISE_CALL; interface ValueReturnInterface { - ok_go(msg: string): PromiseOrValue; + ok_go({ msg }: { msg: string }): PromiseOrValue; } @NearBindgen({ requireInit: true }) export class ApprovalReceiver - implements NonFungibleTokenApprovalReceiver, ValueReturnInterface -{ + implements NonFungibleTokenApprovalReceiver, ValueReturnInterface { public non_fungible_token_account_id: AccountId; constructor() { @@ -65,7 +64,7 @@ export class ApprovalReceiver } @call({}) - ok_go(msg: string): PromiseOrValue { + ok_go({ msg }: { msg: string }): PromiseOrValue { near.log(`in ok_go, msg=${msg}`); return msg; } diff --git a/examples/src/standard-nft/test-token-receiver.ts b/examples/src/standard-nft/test-token-receiver.ts index 9d4faf400..84223ff91 100644 --- a/examples/src/standard-nft/test-token-receiver.ts +++ b/examples/src/standard-nft/test-token-receiver.ts @@ -15,13 +15,12 @@ const PROMISE_CALL = 10_000_000_000_000n; const GAS_FOR_NFT_ON_TRANSFER = BASE_GAS + PROMISE_CALL; interface ValueReturnInterface { - ok_go(return_it: boolean): PromiseOrValue; + ok_go({ return_it }: { return_it: boolean }): PromiseOrValue; } @NearBindgen({ requireInit: true }) export class TokenReceiver - implements NonFungibleTokenReceiver, ValueReturnInterface -{ + implements NonFungibleTokenReceiver, ValueReturnInterface { public non_fungible_token_account_id: AccountId; constructor() { @@ -87,7 +86,7 @@ export class TokenReceiver } @call({}) - ok_go(return_it: boolean): PromiseOrValue { + ok_go({ return_it }: { return_it: boolean }): PromiseOrValue { near.log(`in ok_go, return_it=${return_it}`); return return_it; }