Skip to content

Commit 263c969

Browse files
authored
Merge pull request #329 from near/fix-238
move IntoStorageKey alike feature to lib
2 parents d1ca261 + 542ba5e commit 263c969

File tree

7 files changed

+17
-12
lines changed

7 files changed

+17
-12
lines changed

examples/src/standard-nft/my-nft.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
import { NonFungibleToken } from "near-contract-standards/lib";
22
import {
33
assert,
4-
bytes,
54
call,
65
initialize,
76
near,
87
NearBindgen,
98
NearPromise,
109
PromiseOrValue,
1110
view,
11+
IntoStorageKey
1212
} from "near-sdk-js";
1313
import {
1414
NFTContractMetadata,
1515
NonFungibleTokenMetadataProvider,
1616
TokenMetadata,
1717
} from "near-contract-standards/lib/non_fungible_token/metadata";
1818
import {
19-
IntoStorageKey,
2019
Option,
2120
} from "near-contract-standards/lib/non_fungible_token/utils";
2221
import { AccountId } from "near-sdk-js";

packages/near-contract-standards/lib/non_fungible_token/impl.d.ts

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/near-contract-standards/lib/non_fungible_token/utils.d.ts

-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/near-contract-standards/src/non_fungible_token/impl.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ import {
99
bytes,
1010
serialize,
1111
str,
12+
IntoStorageKey,
1213
} from "near-sdk-js";
1314
import { TokenMetadata } from "./metadata";
1415
import {
1516
refund_storage_deposit,
1617
refund_deposit,
1718
refund_deposit_to_account,
1819
assert_at_least_one_yocto,
19-
IntoStorageKey,
2020
Option,
2121
assert_one_yocto,
2222
} from "./utils";

packages/near-contract-standards/src/non_fungible_token/utils.ts

-4
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,3 @@ export function assert_one_yocto(): void {
5858
}
5959

6060
export type Option<T> = T | null;
61-
62-
export interface IntoStorageKey {
63-
into_storage_key(): string;
64-
}

packages/near-sdk-js/lib/utils.d.ts

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/near-sdk-js/src/utils.ts

+7
Original file line numberDiff line numberDiff line change
@@ -222,3 +222,10 @@ export function encode(s: string): Uint8Array {
222222
export function decode(a: Uint8Array): string {
223223
return env.uint8array_to_utf8_string(a);
224224
}
225+
226+
/**
227+
* When implemented, allow object to be stored as collection key
228+
*/
229+
export interface IntoStorageKey {
230+
into_storage_key(): string;
231+
}

0 commit comments

Comments
 (0)