@0xsequence/provider
Advanced tools
Comparing version 0.0.0-20240829183049 to 0.0.0-20240903183150
{ | ||
"name": "@0xsequence/provider", | ||
"version": "0.0.0-20240829183049", | ||
"version": "0.0.0-20240903183150", | ||
"description": "provider sub-package for Sequence", | ||
@@ -15,11 +15,11 @@ "repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/provider", | ||
"webextension-polyfill": "^0.10.0", | ||
"@0xsequence/abi": "0.0.0-20240829183049", | ||
"@0xsequence/account": "0.0.0-20240829183049", | ||
"@0xsequence/auth": "0.0.0-20240829183049", | ||
"@0xsequence/core": "0.0.0-20240829183049", | ||
"@0xsequence/migration": "0.0.0-20240829183049", | ||
"@0xsequence/network": "0.0.0-20240829183049", | ||
"@0xsequence/relayer": "0.0.0-20240829183049", | ||
"@0xsequence/utils": "0.0.0-20240829183049", | ||
"@0xsequence/wallet": "0.0.0-20240829183049" | ||
"@0xsequence/abi": "0.0.0-20240903183150", | ||
"@0xsequence/account": "0.0.0-20240903183150", | ||
"@0xsequence/auth": "0.0.0-20240903183150", | ||
"@0xsequence/core": "0.0.0-20240903183150", | ||
"@0xsequence/network": "0.0.0-20240903183150", | ||
"@0xsequence/migration": "0.0.0-20240903183150", | ||
"@0xsequence/relayer": "0.0.0-20240903183150", | ||
"@0xsequence/utils": "0.0.0-20240903183150", | ||
"@0xsequence/wallet": "0.0.0-20240903183150" | ||
}, | ||
@@ -26,0 +26,0 @@ "peerDependencies": { |
@@ -13,3 +13,3 @@ import { | ||
import { BaseWalletTransport } from '../base-wallet-transport' | ||
import { logger, base64DecodeObject, bigintReplacer } from '@0xsequence/utils' | ||
import { logger, base64DecodeObject } from '@0xsequence/utils' | ||
import { overrideLogs } from './overridelogs' | ||
@@ -108,3 +108,3 @@ | ||
// prepare payload | ||
const payload = JSON.stringify(message, bigintReplacer) | ||
const payload = JSON.stringify(message) | ||
@@ -111,0 +111,0 @@ // post-message to app. |
import { OpenWalletIntent, ProviderMessage, InitState, WindowSessionParams } from '../../types' | ||
import { BaseProviderTransport } from '../base-provider-transport' | ||
import { base64EncodeObject, bigintReplacer } from '@0xsequence/utils' | ||
import { base64EncodeObject } from '@0xsequence/utils' | ||
import { overrideLogs } from './overridelogs' | ||
@@ -117,3 +117,3 @@ | ||
sendMessage(message: ProviderMessage<unknown>) { | ||
const postedMessage = typeof message !== 'string' ? JSON.stringify(message, bigintReplacer) : message | ||
const postedMessage = typeof message !== 'string' ? JSON.stringify(message) : message | ||
console.log('Sending message to wallet:', postedMessage) | ||
@@ -120,0 +120,0 @@ window.ue?.sequencewallettransport?.sendmessagetowallet(postedMessage) |
@@ -13,3 +13,3 @@ import { | ||
import { BaseWalletTransport } from '../base-wallet-transport' | ||
import { logger, base64DecodeObject, bigintReviver, bigintReplacer } from '@0xsequence/utils' | ||
import { logger, base64DecodeObject } from '@0xsequence/utils' | ||
import { ethers } from 'ethers' | ||
@@ -97,3 +97,10 @@ | ||
try { | ||
request = JSON.parse(event.data, bigintReviver) | ||
request = JSON.parse(event.data, (key, value) => { | ||
// BigNumber compatibility with older versions of sequence.js | ||
if (isBigNumberSerialized(value)) { | ||
return BigInt(value.hex) | ||
} | ||
return value | ||
}) | ||
} catch (err) { | ||
@@ -123,3 +130,3 @@ // event is not a ProviderMessage JSON object, skip | ||
// prepare payload | ||
const payload = JSON.stringify(message, bigintReplacer) | ||
const payload = JSON.stringify(message) | ||
@@ -168,1 +175,5 @@ // post-message to app. | ||
} | ||
const isBigNumberSerialized = (value: any): boolean => { | ||
return typeof value === 'object' && value.type === 'BigNumber' && ethers.isHexString(value.hex) | ||
} |
import { OpenWalletIntent, ProviderMessage, InitState, WindowSessionParams } from '../../types' | ||
import { BaseProviderTransport } from '../base-provider-transport' | ||
import { logger, base64EncodeObject, bigintReplacer, bigintReviver } from '@0xsequence/utils' | ||
import { logger, base64EncodeObject } from '@0xsequence/utils' | ||
import { isBrowserExtension, isUnityPlugin } from '../../utils' | ||
@@ -175,3 +175,3 @@ | ||
try { | ||
message = JSON.parse(event.data, bigintReviver) | ||
message = JSON.parse(event.data) | ||
} catch (err) { | ||
@@ -195,5 +195,5 @@ // event is not a ProviderMessage JSON object, skip | ||
} | ||
const postedMessage = typeof message !== 'string' ? JSON.stringify(message, bigintReplacer) : message | ||
const postedMessage = typeof message !== 'string' ? JSON.stringify(message) : message | ||
this.walletWindow.postMessage(postedMessage, this.walletURL.origin) | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
699787
17864
+ Added@0xsequence/abi@0.0.0-20240903183150(transitive)
+ Added@0xsequence/account@0.0.0-20240903183150(transitive)
+ Added@0xsequence/api@0.0.0-20240903183150(transitive)
+ Added@0xsequence/auth@0.0.0-20240903183150(transitive)
+ Added@0xsequence/core@0.0.0-20240903183150(transitive)
+ Added@0xsequence/indexer@0.0.0-20240903183150(transitive)
+ Added@0xsequence/metadata@0.0.0-20240903183150(transitive)
+ Added@0xsequence/migration@0.0.0-20240903183150(transitive)
+ Added@0xsequence/network@0.0.0-20240903183150(transitive)
+ Added@0xsequence/relayer@0.0.0-20240903183150(transitive)
+ Added@0xsequence/replacer@0.0.0-20240903183150(transitive)
+ Added@0xsequence/sessions@0.0.0-20240903183150(transitive)
+ Added@0xsequence/signhub@0.0.0-20240903183150(transitive)
+ Added@0xsequence/utils@0.0.0-20240903183150(transitive)
+ Added@0xsequence/wallet@0.0.0-20240903183150(transitive)
- Removed@0xsequence/abi@0.0.0-20240829183049(transitive)
- Removed@0xsequence/account@0.0.0-20240829183049(transitive)
- Removed@0xsequence/api@0.0.0-20240829183049(transitive)
- Removed@0xsequence/auth@0.0.0-20240829183049(transitive)
- Removed@0xsequence/core@0.0.0-20240829183049(transitive)
- Removed@0xsequence/indexer@0.0.0-20240829183049(transitive)
- Removed@0xsequence/metadata@0.0.0-20240829183049(transitive)
- Removed@0xsequence/migration@0.0.0-20240829183049(transitive)
- Removed@0xsequence/network@0.0.0-20240829183049(transitive)
- Removed@0xsequence/relayer@0.0.0-20240829183049(transitive)
- Removed@0xsequence/replacer@0.0.0-20240829183049(transitive)
- Removed@0xsequence/sessions@0.0.0-20240829183049(transitive)
- Removed@0xsequence/signhub@0.0.0-20240829183049(transitive)
- Removed@0xsequence/utils@0.0.0-20240829183049(transitive)
- Removed@0xsequence/wallet@0.0.0-20240829183049(transitive)