@appliedblockchain/silentdatarollup-ethers-provider-fireblocks 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +20 -23
- package/dist/index.mjs +19 -23
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -2,6 +2,10 @@ import { BaseConfig } from '@appliedblockchain/silentdatarollup-core';
|
|
|
2
2
|
import { BrowserProvider, Eip1193Provider, Networkish, BrowserProviderOptions } from 'ethers';
|
|
3
3
|
|
|
4
4
|
declare const DEBUG_NAMESPACE_SILENTDATA_INTERCEPTOR = "fireblocks-web3-provider:silentdata-interceptor";
|
|
5
|
+
declare const EIP712Domain: {
|
|
6
|
+
name: string;
|
|
7
|
+
type: string;
|
|
8
|
+
}[];
|
|
5
9
|
|
|
6
10
|
declare class SilentDataRollupFireblocksProvider extends BrowserProvider {
|
|
7
11
|
private lastNonce;
|
|
@@ -62,4 +66,4 @@ declare class SilentDataRollupFireblocksProvider extends BrowserProvider {
|
|
|
62
66
|
clone(): SilentDataRollupFireblocksProvider;
|
|
63
67
|
}
|
|
64
68
|
|
|
65
|
-
export { DEBUG_NAMESPACE_SILENTDATA_INTERCEPTOR, SilentDataRollupFireblocksProvider };
|
|
69
|
+
export { DEBUG_NAMESPACE_SILENTDATA_INTERCEPTOR, EIP712Domain, SilentDataRollupFireblocksProvider };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,10 @@ import { BaseConfig } from '@appliedblockchain/silentdatarollup-core';
|
|
|
2
2
|
import { BrowserProvider, Eip1193Provider, Networkish, BrowserProviderOptions } from 'ethers';
|
|
3
3
|
|
|
4
4
|
declare const DEBUG_NAMESPACE_SILENTDATA_INTERCEPTOR = "fireblocks-web3-provider:silentdata-interceptor";
|
|
5
|
+
declare const EIP712Domain: {
|
|
6
|
+
name: string;
|
|
7
|
+
type: string;
|
|
8
|
+
}[];
|
|
5
9
|
|
|
6
10
|
declare class SilentDataRollupFireblocksProvider extends BrowserProvider {
|
|
7
11
|
private lastNonce;
|
|
@@ -62,4 +66,4 @@ declare class SilentDataRollupFireblocksProvider extends BrowserProvider {
|
|
|
62
66
|
clone(): SilentDataRollupFireblocksProvider;
|
|
63
67
|
}
|
|
64
68
|
|
|
65
|
-
export { DEBUG_NAMESPACE_SILENTDATA_INTERCEPTOR, SilentDataRollupFireblocksProvider };
|
|
69
|
+
export { DEBUG_NAMESPACE_SILENTDATA_INTERCEPTOR, EIP712Domain, SilentDataRollupFireblocksProvider };
|
package/dist/index.js
CHANGED
|
@@ -44784,6 +44784,7 @@ var require_fireblocks_sdk = __commonJS({
|
|
|
44784
44784
|
var index_exports = {};
|
|
44785
44785
|
__export(index_exports, {
|
|
44786
44786
|
DEBUG_NAMESPACE_SILENTDATA_INTERCEPTOR: () => DEBUG_NAMESPACE_SILENTDATA_INTERCEPTOR,
|
|
44787
|
+
EIP712Domain: () => EIP712Domain,
|
|
44787
44788
|
SilentDataRollupFireblocksProvider: () => SilentDataRollupFireblocksProvider
|
|
44788
44789
|
});
|
|
44789
44790
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -44791,6 +44792,11 @@ module.exports = __toCommonJS(index_exports);
|
|
|
44791
44792
|
// src/constants.ts
|
|
44792
44793
|
var import_fireblocks_web3_provider = require("@fireblocks/fireblocks-web3-provider");
|
|
44793
44794
|
var DEBUG_NAMESPACE_SILENTDATA_INTERCEPTOR = `${import_fireblocks_web3_provider.DEBUG_NAMESPACE}:silentdata-interceptor`;
|
|
44795
|
+
var EIP712Domain = [
|
|
44796
|
+
{ name: "name", type: "string" },
|
|
44797
|
+
{ name: "version", type: "string" },
|
|
44798
|
+
{ name: "chainId", type: "uint256" }
|
|
44799
|
+
];
|
|
44794
44800
|
|
|
44795
44801
|
// src/provider.ts
|
|
44796
44802
|
var import_fireblocks_web3_provider2 = require("@fireblocks/fireblocks-web3-provider");
|
|
@@ -44839,9 +44845,8 @@ var SilentDataRollupFireblocksBase = class extends import_silentdatarollup_core.
|
|
|
44839
44845
|
return signature;
|
|
44840
44846
|
}
|
|
44841
44847
|
async signRawDelegateHeader(provider, message) {
|
|
44842
|
-
|
|
44843
|
-
|
|
44844
|
-
const hashedMessage = (0, import_ethers.hashMessage)(stringifiedMessage).slice(2);
|
|
44848
|
+
log("Signing raw delegate header. Message:", message);
|
|
44849
|
+
const hashedMessage = (0, import_ethers.hashMessage)(message).slice(2);
|
|
44845
44850
|
return this.createPersonalSignature(
|
|
44846
44851
|
provider,
|
|
44847
44852
|
hashedMessage,
|
|
@@ -44849,18 +44854,15 @@ var SilentDataRollupFireblocksBase = class extends import_silentdatarollup_core.
|
|
|
44849
44854
|
import_silentdatarollup_core.SignatureType.Raw
|
|
44850
44855
|
);
|
|
44851
44856
|
}
|
|
44852
|
-
async signTypedDelegateHeader(provider, message) {
|
|
44857
|
+
async signTypedDelegateHeader(provider, chainId, message) {
|
|
44853
44858
|
log("Signing typed delegate header. Message:", message);
|
|
44854
44859
|
const content = {
|
|
44855
44860
|
types: {
|
|
44856
|
-
EIP712Domain
|
|
44857
|
-
{ name: "name", type: "string" },
|
|
44858
|
-
{ name: "version", type: "string" }
|
|
44859
|
-
],
|
|
44861
|
+
EIP712Domain,
|
|
44860
44862
|
...import_silentdatarollup_core.delegateEIP721Types
|
|
44861
44863
|
},
|
|
44862
44864
|
primaryType: "Ticket",
|
|
44863
|
-
domain: import_silentdatarollup_core.eip721Domain,
|
|
44865
|
+
domain: { ...import_silentdatarollup_core.eip721Domain, chainId },
|
|
44864
44866
|
message
|
|
44865
44867
|
};
|
|
44866
44868
|
log("EIP712 content created:", content);
|
|
@@ -44871,9 +44873,9 @@ var SilentDataRollupFireblocksBase = class extends import_silentdatarollup_core.
|
|
|
44871
44873
|
import_silentdatarollup_core.SignatureType.EIP712
|
|
44872
44874
|
);
|
|
44873
44875
|
}
|
|
44874
|
-
async signAuthHeaderRawMessage(provider, payload, timestamp) {
|
|
44876
|
+
async signAuthHeaderRawMessage(provider, payload, timestamp, chainId) {
|
|
44875
44877
|
log("Preparing raw message for signing");
|
|
44876
|
-
const message = this.prepareSignatureMessage(payload, timestamp);
|
|
44878
|
+
const message = this.prepareSignatureMessage(chainId, payload, timestamp);
|
|
44877
44879
|
log("Raw message:", message);
|
|
44878
44880
|
let signature;
|
|
44879
44881
|
if (this.config.delegate) {
|
|
@@ -44893,27 +44895,25 @@ var SilentDataRollupFireblocksBase = class extends import_silentdatarollup_core.
|
|
|
44893
44895
|
log("Raw signature generated:", signature);
|
|
44894
44896
|
return signature;
|
|
44895
44897
|
}
|
|
44896
|
-
async signAuthHeaderTypedData(provider, payload, timestamp) {
|
|
44898
|
+
async signAuthHeaderTypedData(provider, payload, timestamp, chainId) {
|
|
44897
44899
|
const types = (0, import_silentdatarollup_core.getAuthEIP721Types)(payload);
|
|
44898
44900
|
const message = this.prepareSignatureTypedData(payload, timestamp);
|
|
44899
44901
|
const content = {
|
|
44900
44902
|
types: {
|
|
44901
|
-
EIP712Domain
|
|
44902
|
-
{ name: "name", type: "string" },
|
|
44903
|
-
{ name: "version", type: "string" }
|
|
44904
|
-
],
|
|
44903
|
+
EIP712Domain,
|
|
44905
44904
|
...types
|
|
44906
44905
|
},
|
|
44907
44906
|
primaryType: "Call",
|
|
44908
|
-
domain: import_silentdatarollup_core.eip721Domain,
|
|
44907
|
+
domain: { ...import_silentdatarollup_core.eip721Domain, chainId },
|
|
44909
44908
|
message
|
|
44910
44909
|
};
|
|
44911
44910
|
log("EIP712 content created:", content);
|
|
44912
44911
|
let signature;
|
|
44913
44912
|
if (this.config.delegate) {
|
|
44914
44913
|
const delegateSigner = await this.getDelegateSigner(this);
|
|
44914
|
+
const domain = { ...import_silentdatarollup_core.eip721Domain, chainId: chainId.toString() };
|
|
44915
44915
|
signature = await delegateSigner.signTypedData(
|
|
44916
|
-
|
|
44916
|
+
domain,
|
|
44917
44917
|
types,
|
|
44918
44918
|
message
|
|
44919
44919
|
);
|
|
@@ -45055,11 +45055,7 @@ var SilentDataRollupFireblocksProvider = class _SilentDataRollupFireblocksProvid
|
|
|
45055
45055
|
if (payload.method === "eth_sendTransaction") {
|
|
45056
45056
|
return that.sendTransaction(payload);
|
|
45057
45057
|
}
|
|
45058
|
-
const requiresAuthHeaders = import_silentdatarollup_core2.SIGN_RPC_METHODS.includes(payload.method) || (0, import_silentdatarollup_core2.isSignableContractCall)(
|
|
45059
|
-
payload,
|
|
45060
|
-
this.baseProvider.contractMethodsToSign,
|
|
45061
|
-
this.baseProvider.contract
|
|
45062
|
-
);
|
|
45058
|
+
const requiresAuthHeaders = import_silentdatarollup_core2.SIGN_RPC_METHODS.includes(payload.method) || (0, import_silentdatarollup_core2.isSignableContractCall)(payload, this.baseProvider.contracts);
|
|
45063
45059
|
const delegateHeaders = [];
|
|
45064
45060
|
if (requiresAuthHeaders) {
|
|
45065
45061
|
log2(`Intercepted request: ${JSON.stringify(payload, null, 2)}`);
|
|
@@ -45122,6 +45118,7 @@ var SilentDataRollupFireblocksProvider = class _SilentDataRollupFireblocksProvid
|
|
|
45122
45118
|
// Annotate the CommonJS export names for ESM import in node:
|
|
45123
45119
|
0 && (module.exports = {
|
|
45124
45120
|
DEBUG_NAMESPACE_SILENTDATA_INTERCEPTOR,
|
|
45121
|
+
EIP712Domain,
|
|
45125
45122
|
SilentDataRollupFireblocksProvider
|
|
45126
45123
|
});
|
|
45127
45124
|
/*! Bundled license information:
|
package/dist/index.mjs
CHANGED
|
@@ -44788,6 +44788,11 @@ var require_fireblocks_sdk = __commonJS({
|
|
|
44788
44788
|
// src/constants.ts
|
|
44789
44789
|
import { DEBUG_NAMESPACE } from "@fireblocks/fireblocks-web3-provider";
|
|
44790
44790
|
var DEBUG_NAMESPACE_SILENTDATA_INTERCEPTOR = `${DEBUG_NAMESPACE}:silentdata-interceptor`;
|
|
44791
|
+
var EIP712Domain = [
|
|
44792
|
+
{ name: "name", type: "string" },
|
|
44793
|
+
{ name: "version", type: "string" },
|
|
44794
|
+
{ name: "chainId", type: "uint256" }
|
|
44795
|
+
];
|
|
44791
44796
|
|
|
44792
44797
|
// src/provider.ts
|
|
44793
44798
|
var import_fireblocks_sdk2 = __toESM(require_fireblocks_sdk());
|
|
@@ -44856,9 +44861,8 @@ var SilentDataRollupFireblocksBase = class extends SilentDataRollupBase {
|
|
|
44856
44861
|
return signature;
|
|
44857
44862
|
}
|
|
44858
44863
|
async signRawDelegateHeader(provider, message) {
|
|
44859
|
-
|
|
44860
|
-
|
|
44861
|
-
const hashedMessage = hashMessage(stringifiedMessage).slice(2);
|
|
44864
|
+
log("Signing raw delegate header. Message:", message);
|
|
44865
|
+
const hashedMessage = hashMessage(message).slice(2);
|
|
44862
44866
|
return this.createPersonalSignature(
|
|
44863
44867
|
provider,
|
|
44864
44868
|
hashedMessage,
|
|
@@ -44866,18 +44870,15 @@ var SilentDataRollupFireblocksBase = class extends SilentDataRollupBase {
|
|
|
44866
44870
|
SignatureType.Raw
|
|
44867
44871
|
);
|
|
44868
44872
|
}
|
|
44869
|
-
async signTypedDelegateHeader(provider, message) {
|
|
44873
|
+
async signTypedDelegateHeader(provider, chainId, message) {
|
|
44870
44874
|
log("Signing typed delegate header. Message:", message);
|
|
44871
44875
|
const content = {
|
|
44872
44876
|
types: {
|
|
44873
|
-
EIP712Domain
|
|
44874
|
-
{ name: "name", type: "string" },
|
|
44875
|
-
{ name: "version", type: "string" }
|
|
44876
|
-
],
|
|
44877
|
+
EIP712Domain,
|
|
44877
44878
|
...delegateEIP721Types
|
|
44878
44879
|
},
|
|
44879
44880
|
primaryType: "Ticket",
|
|
44880
|
-
domain: eip721Domain,
|
|
44881
|
+
domain: { ...eip721Domain, chainId },
|
|
44881
44882
|
message
|
|
44882
44883
|
};
|
|
44883
44884
|
log("EIP712 content created:", content);
|
|
@@ -44888,9 +44889,9 @@ var SilentDataRollupFireblocksBase = class extends SilentDataRollupBase {
|
|
|
44888
44889
|
SignatureType.EIP712
|
|
44889
44890
|
);
|
|
44890
44891
|
}
|
|
44891
|
-
async signAuthHeaderRawMessage(provider, payload, timestamp) {
|
|
44892
|
+
async signAuthHeaderRawMessage(provider, payload, timestamp, chainId) {
|
|
44892
44893
|
log("Preparing raw message for signing");
|
|
44893
|
-
const message = this.prepareSignatureMessage(payload, timestamp);
|
|
44894
|
+
const message = this.prepareSignatureMessage(chainId, payload, timestamp);
|
|
44894
44895
|
log("Raw message:", message);
|
|
44895
44896
|
let signature;
|
|
44896
44897
|
if (this.config.delegate) {
|
|
@@ -44910,27 +44911,25 @@ var SilentDataRollupFireblocksBase = class extends SilentDataRollupBase {
|
|
|
44910
44911
|
log("Raw signature generated:", signature);
|
|
44911
44912
|
return signature;
|
|
44912
44913
|
}
|
|
44913
|
-
async signAuthHeaderTypedData(provider, payload, timestamp) {
|
|
44914
|
+
async signAuthHeaderTypedData(provider, payload, timestamp, chainId) {
|
|
44914
44915
|
const types = getAuthEIP721Types(payload);
|
|
44915
44916
|
const message = this.prepareSignatureTypedData(payload, timestamp);
|
|
44916
44917
|
const content = {
|
|
44917
44918
|
types: {
|
|
44918
|
-
EIP712Domain
|
|
44919
|
-
{ name: "name", type: "string" },
|
|
44920
|
-
{ name: "version", type: "string" }
|
|
44921
|
-
],
|
|
44919
|
+
EIP712Domain,
|
|
44922
44920
|
...types
|
|
44923
44921
|
},
|
|
44924
44922
|
primaryType: "Call",
|
|
44925
|
-
domain: eip721Domain,
|
|
44923
|
+
domain: { ...eip721Domain, chainId },
|
|
44926
44924
|
message
|
|
44927
44925
|
};
|
|
44928
44926
|
log("EIP712 content created:", content);
|
|
44929
44927
|
let signature;
|
|
44930
44928
|
if (this.config.delegate) {
|
|
44931
44929
|
const delegateSigner = await this.getDelegateSigner(this);
|
|
44930
|
+
const domain = { ...eip721Domain, chainId: chainId.toString() };
|
|
44932
44931
|
signature = await delegateSigner.signTypedData(
|
|
44933
|
-
|
|
44932
|
+
domain,
|
|
44934
44933
|
types,
|
|
44935
44934
|
message
|
|
44936
44935
|
);
|
|
@@ -45072,11 +45071,7 @@ var SilentDataRollupFireblocksProvider = class _SilentDataRollupFireblocksProvid
|
|
|
45072
45071
|
if (payload.method === "eth_sendTransaction") {
|
|
45073
45072
|
return that.sendTransaction(payload);
|
|
45074
45073
|
}
|
|
45075
|
-
const requiresAuthHeaders = SIGN_RPC_METHODS.includes(payload.method) || isSignableContractCall(
|
|
45076
|
-
payload,
|
|
45077
|
-
this.baseProvider.contractMethodsToSign,
|
|
45078
|
-
this.baseProvider.contract
|
|
45079
|
-
);
|
|
45074
|
+
const requiresAuthHeaders = SIGN_RPC_METHODS.includes(payload.method) || isSignableContractCall(payload, this.baseProvider.contracts);
|
|
45080
45075
|
const delegateHeaders = [];
|
|
45081
45076
|
if (requiresAuthHeaders) {
|
|
45082
45077
|
log2(`Intercepted request: ${JSON.stringify(payload, null, 2)}`);
|
|
@@ -45138,6 +45133,7 @@ var SilentDataRollupFireblocksProvider = class _SilentDataRollupFireblocksProvid
|
|
|
45138
45133
|
};
|
|
45139
45134
|
export {
|
|
45140
45135
|
DEBUG_NAMESPACE_SILENTDATA_INTERCEPTOR,
|
|
45136
|
+
EIP712Domain,
|
|
45141
45137
|
SilentDataRollupFireblocksProvider
|
|
45142
45138
|
};
|
|
45143
45139
|
/*! Bundled license information:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appliedblockchain/silentdatarollup-ethers-provider-fireblocks",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "Ethers.js provider for Silent Data [Rollup] with Fireblocks integration",
|
|
5
5
|
"author": "Applied Blockchain",
|
|
6
6
|
"homepage": "https://github.com/appliedblockchain/silent-data-rollup-providers#readme",
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"dist"
|
|
28
28
|
],
|
|
29
29
|
"scripts": {
|
|
30
|
-
"build": "tsup src/index.ts --format cjs,esm --dts --clean",
|
|
30
|
+
"build": "tsc --noEmit && tsup src/index.ts --format cjs,esm --dts --clean",
|
|
31
31
|
"check-exports": "attw --pack . --profile node16",
|
|
32
32
|
"prepack": "npm run build"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@appliedblockchain/silentdatarollup-core": "1.0.
|
|
35
|
+
"@appliedblockchain/silentdatarollup-core": "1.0.5",
|
|
36
36
|
"@fireblocks/fireblocks-web3-provider": "1.3.8",
|
|
37
37
|
"debug": "4.3.4",
|
|
38
38
|
"ethers": "6.13.2"
|