Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added exports to functions so yarn build works #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import * as nearAPI from 'near-api-js';

// Our API could be improved here :)
// See: https://github.com/near/near-api-js/issues/612
async function viewMethodOnContract(nearConfig, method) {
export async function viewMethodOnContract(nearConfig, method) {
const provider = new nearAPI.providers.JsonRpcProvider(nearConfig.nodeUrl);
const rawResult = await provider.query(`call/${nearConfig.contractName}/${method}`, 'AQ4'); // Base 58 of '{}'
return JSON.parse(rawResult.result.map((x) => String.fromCharCode(x)).join(''));
}

function parseSolutionSeedPhrase(data, gridData) {
export function parseSolutionSeedPhrase(data, gridData) {
// JavaScript determining what the highest clue number is
// Example: 10 if there are ten clues, some which have both across and down clues
let totalClues = Object.keys(data.across).concat(Object.keys(data.down))
Expand Down Expand Up @@ -64,9 +64,4 @@ function parseSolutionSeedPhrase(data, gridData) {
},
},
};
*/

module.exports = {
viewMethodOnContract,
parseSolutionSeedPhrase
};
*/