@upcoming/multichain-library 0.6.1 → 0.7.0
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/GnosisTransaction.d.ts +14 -0
- package/dist/GnosisTransaction.js +12 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { RollingValueProvider } from 'cafe-utility';
|
|
2
|
+
import { MultichainLibrarySettings } from './Settings';
|
|
3
|
+
export interface GnosisTransaction {
|
|
4
|
+
blockHash: `0x${string}`;
|
|
5
|
+
blockNumber: `0x${string}`;
|
|
6
|
+
hash: `0x${string}`;
|
|
7
|
+
from: `0x${string}`;
|
|
8
|
+
to: `0x${string}`;
|
|
9
|
+
nonce: `0x${string}`;
|
|
10
|
+
value: `0x${string}`;
|
|
11
|
+
gas: `0x${string}`;
|
|
12
|
+
gasPrice: `0x${string}`;
|
|
13
|
+
}
|
|
14
|
+
export declare function getGnosisTransaction(transactionHash: `0x${string}`, settings: MultichainLibrarySettings, jsonRpcProvider: RollingValueProvider<string>): Promise<GnosisTransaction>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getGnosisTransaction = getGnosisTransaction;
|
|
4
|
+
const cafe_utility_1 = require("cafe-utility");
|
|
5
|
+
const Fetch_1 = require("./Fetch");
|
|
6
|
+
async function getGnosisTransaction(transactionHash, settings, jsonRpcProvider) {
|
|
7
|
+
const payload = { jsonrpc: '2.0', id: 1, method: 'eth_getTransactionByHash', params: [transactionHash] };
|
|
8
|
+
const response = await (0, Fetch_1.durableFetch)(jsonRpcProvider, settings, 'POST', payload);
|
|
9
|
+
const data = await response.json();
|
|
10
|
+
const object = cafe_utility_1.Types.asObject(data);
|
|
11
|
+
return object;
|
|
12
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { TransferGnosisBzzOptions } from './GnosisBzzTransfer';
|
|
|
5
5
|
import { TransferGnosisNativeOptions } from './GnosisNativeTransfer';
|
|
6
6
|
import { CreateBatchGnosisOptions } from './GnosisPostageStampCreateBatch';
|
|
7
7
|
import { GnosisSwapAutoOptions, GnosisSwapCustomOptions } from './GnosisSwap';
|
|
8
|
+
import { GnosisTransaction } from './GnosisTransaction';
|
|
8
9
|
import { MultiTransferGnosisNativeOptions, MultiTransferGnosisNativeResult } from './MultiGnosisNativeTransfer';
|
|
9
10
|
import { MultichainLibrarySettings } from './Settings';
|
|
10
11
|
import { SushiResponse } from './SushiSwap';
|
|
@@ -16,6 +17,7 @@ export declare class MultichainLibrary {
|
|
|
16
17
|
constants: typeof Constants;
|
|
17
18
|
constructor(settings?: Partial<MultichainLibrarySettings>);
|
|
18
19
|
updateSettings(settings: Partial<MultichainLibrarySettings>): void;
|
|
20
|
+
getGnosisTransaction(transactionHash: `0x${string}`): Promise<GnosisTransaction>;
|
|
19
21
|
getGnosisBzzBalance(address: string): Promise<FixedPointNumber>;
|
|
20
22
|
getGnosisNativeBalance(address: `0x${string}`): Promise<FixedPointNumber>;
|
|
21
23
|
getTokenPrice(tokenAddress: `0x${string}`, chainId: number): Promise<number>;
|
package/dist/index.js
CHANGED
|
@@ -11,6 +11,7 @@ const GnosisNativeTransfer_1 = require("./GnosisNativeTransfer");
|
|
|
11
11
|
const GnosisPostageStampCreateBatch_1 = require("./GnosisPostageStampCreateBatch");
|
|
12
12
|
const GnosisPostageStampStoragePrice_1 = require("./GnosisPostageStampStoragePrice");
|
|
13
13
|
const GnosisSwap_1 = require("./GnosisSwap");
|
|
14
|
+
const GnosisTransaction_1 = require("./GnosisTransaction");
|
|
14
15
|
const GnosisTransactionCount_1 = require("./GnosisTransactionCount");
|
|
15
16
|
const MultiGnosisNativeTransfer_1 = require("./MultiGnosisNativeTransfer");
|
|
16
17
|
const Settings_1 = require("./Settings");
|
|
@@ -29,6 +30,9 @@ class MultichainLibrary {
|
|
|
29
30
|
this.settings = cafe_utility_1.Objects.deepMerge2((0, Settings_1.getDefaultMultichainLibrarySettings)(), settings || {});
|
|
30
31
|
this.jsonRpcProvider = new cafe_utility_1.RollingValueProvider(this.settings.gnosisJsonRpcProviders);
|
|
31
32
|
}
|
|
33
|
+
getGnosisTransaction(transactionHash) {
|
|
34
|
+
return (0, GnosisTransaction_1.getGnosisTransaction)(transactionHash, this.settings, this.jsonRpcProvider);
|
|
35
|
+
}
|
|
32
36
|
getGnosisBzzBalance(address) {
|
|
33
37
|
return (0, GnosisBzzBalance_1.getGnosisBzzBalance)(address, this.settings, this.jsonRpcProvider);
|
|
34
38
|
}
|