@appliedblockchain/silentdatarollup-ethers-provider-fireblocks 1.0.0 → 1.0.1

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.
Files changed (2) hide show
  1. package/README.md +18 -16
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -71,22 +71,24 @@ const provider = new SilentDataRollupFireblocksProvider({
71
71
  const balance = await provider.getBalance('YOUR_ADDRESS')
72
72
  console.log(balance)
73
73
 
74
- const signer = await provider.getSigner()
75
- const contractAddress = 'YOUR_CONTRACT_ADDRESS'
76
- const abi = [
77
- /* Your contract ABI */
78
- ]
79
- const methodsToSign = ['balance'] // Contract read calls that require signing
80
-
81
- const contract = new SilentDataRollupContract(
82
- contractAddress,
83
- abi,
84
- signer,
85
- methodsToSign,
86
- )
87
-
88
- const tokenBalance = await contract.balance('YOUR_ADDRESS')
89
- console.log(tokenBalance)
74
+ const contractConfig = {
75
+ contractAddress: 'YOUR_CONTRACT_ADDRESS'
76
+ abi: [ /* Your contract ABI */ ],
77
+ runner: signer,
78
+ methodsToSign: ['method1', 'method2'] // Contract read calls that require signing
79
+ }
80
+
81
+ const contract = new SilentDataRollupContract(contractConfig)
82
+
83
+ // Now you can call "private" contract methods. These calls will be signed,
84
+ // and msg.sender will be available in the contract, representing the signer's address.
85
+ const privateMethodResult = await contract.method1('param1', 'param2')
86
+ console.log('Private method result:', privateMethodResult)
87
+
88
+ // You can also call methods that don't require signing.
89
+ // These calls won't include a signature, and msg.sender won't be available in the contract.
90
+ const publicMethodResult = await contract.method3('param1', 'param2')
91
+ console.log('Public method result:', publicMethodResult)
90
92
  ```
91
93
 
92
94
  **Note:** The SilentDataRollupFireblocksProvider adds an additional namespace on top of the Fireblocks provider for debugging purposes. This namespace is the same as the Fireblocks namespace with an additional `:silentdata-interceptor` suffix. For example, if the Fireblocks namespace is `fireblocks:web3-provider`, the SilentData provider's namespace would be `fireblocks:web3-provider:silentdata-interceptor`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appliedblockchain/silentdatarollup-ethers-provider-fireblocks",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
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",
@@ -32,7 +32,7 @@
32
32
  "prepack": "npm run build"
33
33
  },
34
34
  "dependencies": {
35
- "@appliedblockchain/silentdatarollup-core": "1.0.0",
35
+ "@appliedblockchain/silentdatarollup-core": "1.0.1",
36
36
  "@fireblocks/fireblocks-web3-provider": "1.3.8",
37
37
  "debug": "4.3.4",
38
38
  "ethers": "6.13.2"