问题标签 [wavesplatform]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
328 浏览

javascript - 使用 Waveskeeper 进行身份验证:如何修复“未定义 Waves”

我正在尝试创建一个使用 Waveskeeper 对用户进行身份验证的页面。我在 chrome 上安装了插件 wavekeeper,但我不断收到错误消息:ReferenceError: Waves is not defined

试过chrome和brave,同样的错误。

0 投票
1 回答
56 浏览

wavesplatform - Reading Waves Wallet Balance from waves testnet

How do I read my testnode waves wallet balance from my PHP program ?

which URL should be used for reading from testnet nodes

Able to read the balance in live mode.

For live waves balance checking, I use the following cURL code:

0 投票
1 回答
94 浏览

wavesplatform - 如何在 Waves Keeper Web 应用程序中加密/解密数据?

目前在我的网络应用程序上开发一项新功能我有一个问题:

我加密了一些数据,因为我不希望它在区块链中公开,但我对此有些担心,理想情况下,加密/解密密码应该是 keeper 连接用户的私钥,但由于我们无法在 Waves Keeper 中访问此信息,最好的做法是什么?

我们如何使用 Waves Keeper 以分散的方式加密/解密数据?

我目前使用我预定义的密码作为服务器端的环境变量,但这远非理想,而且肯定是集中的,除了有几个缺点。

当然,备份选项很少,例如:

1) 避免将任何非公开数据放入区块链

2)在应用程序中添加一个加密/解密字段,要求用户每次输入密码

两者都可以,但只是解决问题而不理想,想先知道是否有任何好的解决方案:)

0 投票
1 回答
138 浏览

wavesplatform - 与以太坊相比,智能合约如何在波浪中工作?

我正在开发以太坊合约。这对我来说很容易。但是,客户希望在 wave 上签订合同。他已经在 Waves 区块链上创建了一个代币。是否可以将智能合约添加到已经存在的代币中?与以太坊相比,Waves 智能合约通常如何运作?

0 投票
1 回答
56 浏览

node.js - 无法从图书馆获得响应

我尝试执行此代码并接收当前的区块链块号

我没有忘记导入库

此代码已正确执行。

我正在使用下面的库

https://wavesplatform.github.io/waves-transactions/globals.html#currentheight

0 投票
0 回答
340 浏览

javascript - 创建钱包地址时出现错误无法解析模块“crypto”

我正在尝试创建一个钱包来在 wave 平台上保存新创建的硬币。

Metro Bundler 遇到内部错误,请检查您的终端错误输出以获取更多详细信息在尝试crypto从文件解析模块时,已成功找到C:\Users\El\.expo\bandzWallet\node_modules\@waves\waves-crypto\random.js该包。C:\Users\El\.expo\bandzWallet\node_modules\crypto\package.json但是,这个包本身指定了一个main无法解析的模块字段(C:\Users\El\.expo\bandzWallet\node_modules\crypto\index.js。事实上,这些文件都不存在:

  • C:\Users\El\.expo\bandzWallet\node_modules\crypto\index.js(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)
  • C:\Users\El\.expo\bandzWallet\node_modules\crypto\index.js\index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx) 构建 JavaScript 包失败。无法读取未定义的属性“状态”

    “使用严格”;Object.defineProperty(exports, "__esModule", { value: true }); const random = (count) => { if (isBrowser) { const arr = new Uint8Array(count); const crypto = (global.crypto || global.msCrypto); crypto.getRandomValues(arr); 返回 arr;} const crypto = 要求('crypto'); 返回 Uint8Array.from(crypto.randomBytes(count)); }; const ensureBuffer = () => { try { const b = new Buffer(1); } catch (e) { throw new Error('此环境不支持缓冲区。使用 Node.js 或 Browserify 来支持浏览器。'); } }; const isBrowser = typeof window !== 'undefined' && ({}).toString.call(window) === '[object Window]'; export.secureRandom = (count, type) => { switch (type) { case ' Array8':返回 Array.from(random(count)); case 'Array16': return Array.from(exports.secureRandom(count, 'Uint16Array')); case 'Array32': return Array.from(exports.secureRandom(count, 'Uint32Array')); 案例“缓冲区”:确保缓冲区();return Buffer.from(random(count)); 案例“Uint8Array”:返回随机数(计数);case 'Uint16Array': return new Uint16Array(count) .map(_ => random(2).reduce((a, b, i) => a | b << 8 * (1 - i), 0)); case 'Uint32Array': return new Uint32Array(count) .map(_ => random(4).reduce((a, b, i) => a | b << 8 * (1 - i), 0)); 默认:throw new Error(type + ' is unsupported.'); } }; //# sourceMappingURL=random.js.map

我正在尝试使用 @waves/waves-crypto 在测试网上创建一个钱包 adderss 和种子。

我正在使用 React Native 和 Expo cli

0 投票
2 回答
71 浏览

wavesplatform - data-service 编译运行大于0.18.1的版本

我无法从 0.18.1 版本开始启动 API。示例版本 0.20.0 我收到一个错误:

/home/ubuntu/data-service/node_modules/ts-node/src/index.ts:261 return new TSError(diagnosticText, diagnosticCodes) ^ TSError: ⨯ 无法编译 TypeScript: src/index.ts(15,34):错误 TS2497:此模块只能通过打开“esModuleInterop”标志并引用其默认导出来引用 ECMAScript 导入/导出。src/index.ts(26,35): error TS2345: Argument of type '{expose: string; 标头:布尔值;}' 不可分配给类型为 '{expose?: string | 的参数。不明确的; 标题?:字符串 | 不明确的; 查询?:字符串 | 不明确的; }'。属性“标题”的类型不兼容。类型 'boolean' 不可分配给类型 'string | 不明确的'。

我尝试了不同变体的不同版本。但错误几乎相同。什么版本,你用什么来编译?也许我启动错误?有一个细微差别让我回滚到 jest@23.6.0 因为 ts-jest 需要它。正确到什么程度?

0 投票
1 回答
46 浏览

javascript - 使用 js 库复制 Waves 密钥派生过程

我正在关注此文档页面,以找出公钥、Waves 测试网地址和 Waves 主网地址之间的关系。

我编写了这段代码片段,输入了我从 Waves Keeper 获得的 pub 密钥和地址:

这是我得到的输出: 在此处输入图像描述

显然,手动导出的地址是不同的。我错过了什么?

0 投票
2 回答
53 浏览

wavesplatform - 使用 Python 或 JS 编译 RIDE 合约

是否可以使用 Python 或 JS 在本地编译 RIDE 合约?我只找到了一个基于 Java 的编译器,它对于浏览器应用程序来说并不理想。

0 投票
1 回答
42 浏览

javascript - 在 RIDE 和 Waves JS 中匹配 keccak256

在我的帐户脚本中,当交易的附件包含存储在合约数据中的 keccak256 值的正确原像时,我想授权交易。

我使用waves-crypto计算JS中base58字符串的keccak256并将其存储在数据存储中:

我在我的 RIDE 合同中使用了以下谓词:

我已经检查了除 keccak 之外的所有条件 - 它们都按预期工作。但是,keccak 条件失败。我相信这可能是格式不匹配,但我不确定如何调试它。