@ingocollatz/sdk-tests
Version:
49 lines • 2.06 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const sdk_1 = require("@ingocollatz/sdk");
const config_1 = require("../config");
const protocol_kit_1 = __importDefault(require("@safe-global/protocol-kit"));
const sdk_ethers_adapter_1 = require("@ingocollatz/sdk-ethers-adapter");
const ethers_1 = require("ethers");
const protocol_kit_2 = require("@safe-global/protocol-kit");
(async () => {
// Ethers
const provider = new ethers_1.ethers.providers.JsonRpcProvider(config_1.RPC_URL);
const safe = await protocol_kit_1.default.create({
ethAdapter: new protocol_kit_2.EthersAdapter({
ethers: ethers_1.ethers,
signerOrProvider: provider,
}),
safeAddress: config_1.SAFE_ADDRESS_USER,
});
const abiEncoder = new sdk_ethers_adapter_1.EthersAbiEncoder();
const circlesSdk = new sdk_1.CirclesSdk(safe, abiEncoder);
const history = await circlesSdk.getTrustEvents({
// limit: 10,
// sortOrder: "Ascending",
});
console.log(`Existing trust events for ${config_1.SAFE_ADDRESS_USER}: `, history);
// Web3
// const web3 = new Web3(new Web3.providers.HttpProvider(RPC_URL));
// const safe = await Safe.create({
// ethAdapter: new Web3Adapter({
// web3: new Web3(new Web3.providers.HttpProvider(RPC_URL)),
// signerAddress: PUBLIC_KEY_1,
// }),
// safeAddress: SAFE_ADDRESS_USER,
// });
// const safeAddress = await safe.getAddress();
// const abiEncoder = new Web3AbiEncoder(web3);
// const circlesSdk = new CirclesSdk(safe, abiEncoder);
// const history = await circlesSdk.fetchTransactionHistory({
// limit: 10,
// offset: 0,
// type: "TRUST",
// trustConnections: true,
// });
// console.log(`Existing trust connections for ${SAFE_ADDRESS_USER}: `, history.trust);
})();
//# sourceMappingURL=get-trust-events.js.map