@ anywalletkit/runtime-hermes (英语)
一个电话,在应用程序条目,之后 react-native-get-random-values, (中文(简体) ), buffer (单位:千美元)
文本编码器多填充到位 :
安装
npm install @anywalletkit/runtime-hermes buffer fastestsmallesttextencoderdecoder react-native-url-polyfill
# or: pnpm add @anywalletkit/runtime-hermes buffer fastestsmallesttextencoderdecoder react-native-url-polyfill · yarn add @anywalletkit/runtime-hermes buffer fastestsmallesttextencoderdecoder react-native-url-polyfill
时间: @ anywalletkit/runtime-hermes (英语)发表于 发布工作流程 与出处。 只反应原生 / Hermes; 首先在您的条目文件中导入 .
import 'react-native-get-random-values'
import { Buffer } from 'buffer'
global.Buffer ??= Buffer
import 'fastestsmallesttextencoderdecoder/EncoderDecoderTogether.min.js'
import 'react-native-url-polyfill/auto'
import { installHermesRuntime } from '@anywalletkit/runtime-hermes'
installHermesRuntime()
它的安装, 仅在缺失时:
| 为什么 | |
|---|---|
Buffer.prototype.subarray 保留缓冲原型 | 赫尔墨斯没有 Symbol.species· ; @ton/core,比特币-lib 和其他节点风格的库 .copy() 编号 : .readUInt32BE() 切片缓冲 |
AbortSignal.timeout 编号 : AbortSignal.any | 在Hermes上丢失; 他们的缺席静静地打破了每次跨链互换执行一次 |
crypto.subtle.digest (SHA-256/384/512通过贵族) | 索拉纳 Ed25519 多填充 subtle 无 digest |
structuredClone | 在老赫尔墨斯失踪 |
当只有应用程序能提供的东西不存在时 crypto.getRandomValues, (中文(简体) ),
TextEncoder编号 :TextDecoder,以及一个完整的WhatWG URL (原始内容存档于2014-10-12). React Industrial's one has no
正在工作 searchParams; 提供者解析端点并用它查询字符串). SDK 包从不导入此包本身 .
地铁 : react-native-fast-pbkdf2
@anywalletkit/wallet-ton 停车 @ton/crypto-primitives,其反应原生建筑需要
本地语言 react-native-fast-pbkdf2 模块(TON 24字模式)和 expo-crypto。安装
expo-crypto,并将Metro指向纯-JS 投放这个包船,而不是本地模块:
// metro.config.js
const { getDefaultConfig } = require('expo/metro-config')
const config = getDefaultConfig(__dirname)
const resolveRequest = config.resolver.resolveRequest
config.resolver.resolveRequest = (context, moduleName, platform) =>
moduleName === 'react-native-fast-pbkdf2'
? { type: 'sourceFile', filePath: require.resolve('@anywalletkit/runtime-hermes/fast-pbkdf2') }
: (resolveRequest ?? context.resolveRequest)(context, moduleName, platform)
module.exports = config
与本地模块相同的调用形状( Base64 in, base64 out), PBKDF2 from @noble/hashes。 。 。 .