wrapscanby polywrap
DocsSupport

safe-protocol-kit

Allows interaction with Safe Smart Contracts

View more
type Module @imports(
  types: [
    "Ethers_Module",
    "Ethers_Connection",
    "Ethers_Eip1559FeesEstimate",
    "Ethers_TxOptions",
    "Ethers_StaticTxResult",
    "Ethers_TxResponse",
    "Ethers_AccessItem",
    "Ethers_TxRequest",
    "Ethers_TxReceipt",
    "Ethers_Log"
  ]
) {
  createProxy(
    address: String!
    safeMasterCopyAddress: String!
    initializer: String!
    saltNonce: UInt32!
    connection: Ethers_Connection
    txOptions: Ethers_TxOptions
  ): String!

  proxyCreationCode(
    address: String!
    connection: Ethers_Connection
  ): String!

  """
  GnosisSafeContractEthers methods
  """
  getNonce(
    address: String!
    connection: Ethers_Connection
  ): BigInt!

  getVersion(
    address: String!
    connection: Ethers_Connection
  ): String!

  approvedHashes(
    address: String!
    ownerAddress: String!
    hash: String!
    connection: Ethers_Connection
  ): BigInt!

  approveHash(
    safeAddress: String!
    hash: String!
    options: TransactionOptions
    connection: Ethers_Connection
  ): Ethers_TxReceipt!

  getSafeContractNetworks(
    version: String!
    chainId: String!
    isL1Safe: Boolean
    filter: ContractNetworksFilter
  ): ContractNetworksConfig!

  encodeExecTransaction(
    safeAddress: String!
    safeTransaction: SafeTransaction!
  ): String!

  deploySafe(
    input: DeploymentInput!
    txOptions: Ethers_TxOptions
  ): String!

  predictSafeAddress(
    input: DeploymentInput!
  ): String!

  encodeDeploySafe(
    input: DeploymentInput!
  ): String!

  safeIsDeployed(
    safeAddress: String!
    connection: Ethers_Connection!
  ): Boolean!

  getSafeInitializer(
    config: SafeAccountConfig!
  ): String!

  """
  Safe methods
  """
  createTransaction(
    tx: SafeTransactionDataPartial!
  ): SafeTransaction!

  createMultiSendTransaction(
    txs: [SafeTransactionDataPartial!]!
    options: SafeTransactionOptions
    onlyCalls: Boolean
    customMultiSendContractAddress: String
  ): SafeTransaction! @env(required: true)

  addSignature(
    tx: SafeTransaction!
    signingMethod: String
  ): SafeTransaction! @env(required: true)

  getTransactionHash(
    tx: SafeTransactionData!
  ): String! @env(required: true)

  signTransactionHash(
    hash: String!
  ): SafeSignature! @env(required: true)

  approveTransactionHash(
    hash: String!
    options: TransactionOptions
  ): Ethers_TxReceipt! @env(required: true)

  executeTransaction(
    tx: SafeTransaction!
    options: TransactionOptions
  ): Ethers_TxReceipt! @env(required: true)

  getOwnersWhoApprovedTx(
    hash: String!
  ): [String!]! @env(required: true)

  getSignature(
    tx: SafeTransaction!
    signingMethod: String
    safeAddress: String!
    connection: Ethers_Connection!
  ): SafeTransaction!

  """
  Owner manager methods
  """
  getOwners(
    safeAddress: String!
    connection: Ethers_Connection
  ): [String!]!

  getThreshold(
    safeAddress: String!
    connection: Ethers_Connection
  ): UInt32!

  isOwner(
    ownerAddress: String!
    safeAddress: String!
    connection: Ethers_Connection
  ): Boolean!

  """
  Module manager methods
  """
  getModules: [String!]! @env(required: true)

  isModuleEnabled(
    moduleAddress: String!
  ): Boolean! @env(required: true)

  """
  Utilities for transactions
  """
  encodeEnableModuleData(
    moduleAddress: String!
  ): String! @env(required: true)

  encodeDisableModuleData(
    moduleAddress: String!
  ): String! @env(required: true)

  encodeMultiSendData(
    txs: [SafeTransactionDataPartial!]!
  ): String!

  encodeAddOwnerWithThresholdData(
    ownerAddress: String!
    threshold: UInt32
  ): String! @env(required: true)

  encodeRemoveOwnerData(
    ownerAddress: String!
    threshold: UInt32
  ): String! @env(required: true)

  encodeSwapOwnerData(
    oldOwnerAddress: String!
    newOwnerAddress: String!
  ): String! @env(required: true)

  encodeChangeThresholdData(
    threshold: UInt32!
  ): String! @env(required: true)
}

type Env {
  safeAddress: String!
  connection: Ethers_Connection!
}

type ContractNetworksConfig {
  multiSendAddress: String
  multiSendCallOnlyAddress: String
  safeMasterCopyAddress: String
  safeProxyFactoryAddress: String
  fallbackHandlerAddress: String
}

type ContractNetworksFilter {
  multiSendAddress: Boolean!
  multiSendCallOnlyAddress: Boolean!
  safeMasterCopyAddress: Boolean!
  safeProxyFactoryAddress: Boolean!
  fallbackHandlerAddress: Boolean!
}

type CustomContract {
  proxyFactoryContract: String
  safeFactoryContract: String
}

type DeploymentPayload {
  safeContractAddress: String!
  safeFactoryContractAddress: String!
  initializer: String!
  saltNonce: String!
}

type SafeAccountConfig {
  owners: [String!]!
  threshold: UInt!
  to: String
  data: String
  fallbackHandler: String
  paymentToken: String
  payment: BigInt
  paymentReceiver: String
}

type SafeDeploymentConfig {
  saltNonce: String!
  isL1Safe: Boolean
  version: String
}

type DeploymentInput {
  safeAccountConfig: SafeAccountConfig!
  safeDeploymentConfig: SafeDeploymentConfig
  customContractAddresses: CustomContract
  connection: Ethers_Connection
}

type SafeSignature {
  signer: String!
  data: String!
}

type SafeTransaction {
  signatures: Map @annotate(type: "Map<String!, SafeSignature!>")
  data: SafeTransactionData!
}

type MetaTransactionData {
  to: String!
  value: BigInt!
  data: String!
  operation: OperationType
}

type SafeTransactionData implements MetaTransactionData {
  safeTxGas: BigInt!
  baseGas: BigInt!
  gasPrice: BigInt!
  gasToken: String!
  refundReceiver: String!
  nonce: Int!
  to: String!
  value: BigInt!
  data: String!
  operation: OperationType
}

type TransactionOptions {
  from: String
  gas: BigInt
  gasLimit: BigInt
  gasPrice: BigInt
  maxFeePerGas: BigInt
  maxPriorityFeePerGas: String
  nonce: BigInt
}

type SafeTransactionDataPartial implements MetaTransactionData {
  safeTxGas: BigInt
  baseGas: BigInt
  gasPrice: BigInt
  gasToken: String
  refundReceiver: String
  nonce: Int
  to: String!
  value: BigInt!
  data: String!
  operation: OperationType
}

type SafeTransactionOptions {
  safeTxGas: BigInt
  baseGas: BigInt
  gasPrice: BigInt
  gasToken: String
  refundReceiver: String
  nonce: Int
}

enum OperationType {
  Call
  DelegateCall
}

### Imported Modules START ###

type Ethers_Module @imported(
  uri: "wrapscan.io/polywrap/ethers@1.1.1",
  namespace: "Ethers",
  nativeType: "Module"
) {
  getChainId(
    connection: Ethers_Connection
  ): String!

  getSignerAddress(
    connection: Ethers_Connection
  ): String!

  getSignerBalance(
    blockTag: BigInt
    connection: Ethers_Connection
  ): BigInt!

  getGasPrice(
    connection: Ethers_Connection
  ): BigInt!

  estimateEip1559Fees(
    connection: Ethers_Connection
  ): Ethers_Eip1559FeesEstimate!

  getSignerTransactionCount(
    blockTag: BigInt
    connection: Ethers_Connection
  ): BigInt!

  checkAddress(
    address: String!
    connection: Ethers_Connection
  ): Boolean!

  callContractView(
    address: String!
    method: String!
    args: [String!]
    connection: Ethers_Connection
  ): String!

  callContractStatic(
    address: String!
    method: String!
    args: [String!]
    options: Ethers_TxOptions
    connection: Ethers_Connection
  ): Ethers_StaticTxResult!

  getBalance(
    address: String!
    blockTag: BigInt
    connection: Ethers_Connection
  ): BigInt!

  getTransaction(
    hash: String!
    connection: Ethers_Connection
  ): Ethers_TxResponse!

  sendRpc(
    method: String!
    params: [String!]!
    connection: Ethers_Connection
  ): String!

  estimateTransactionGas(
    tx: Ethers_TxRequest!
    connection: Ethers_Connection
  ): BigInt!

  awaitTransaction(
    txHash: String!
    confirmations: UInt32!
    timeout: UInt32
    connection: Ethers_Connection
  ): Ethers_TxReceipt!

  sendTransaction(
    tx: Ethers_TxRequest!
    connection: Ethers_Connection
  ): Ethers_TxResponse!

  sendTransactionAndWait(
    tx: Ethers_TxRequest!
    connection: Ethers_Connection
  ): Ethers_TxReceipt!

  deployContract(
    abi: String!
    bytecode: String!
    args: [String!]
    options: Ethers_TxOptions
    connection: Ethers_Connection
  ): String!

  estimateContractCallGas(
    address: String!
    method: String!
    args: [String!]
    options: Ethers_TxOptions
    connection: Ethers_Connection
  ): BigInt!

  callContractMethod(
    address: String!
    method: String!
    args: [String!]
    options: Ethers_TxOptions
    connection: Ethers_Connection
  ): Ethers_TxResponse!

  callContractMethodAndWait(
    address: String!
    method: String!
    args: [String!]
    options: Ethers_TxOptions
    connection: Ethers_Connection
  ): Ethers_TxReceipt!

  signMessage(
    message: String!
    connection: Ethers_Connection
  ): String!

  signMessageBytes(
    bytes: Bytes!
    connection: Ethers_Connection
  ): String!

  signTransaction(
    tx: Ethers_TxRequest!
    connection: Ethers_Connection
  ): String!

  signTypedData(
    payload: JSON!
    connection: Ethers_Connection
  ): String!

  generateCreate2Address(
    address: String!
    salt: String!
    initCode: String!
  ): String!

  keccak256BytesEncodePacked(
    value: String!
  ): String!

  keccak256(
    value: String!
  ): String!

  encodeMetaTransaction(
    operation: BigInt
    to: String!
    value: BigInt!
    data: String!
  ): String!

  encodeParams(
    types: [String!]!
    values: [String!]!
  ): String!

  encodeFunction(
    method: String!
    args: [String!]
  ): String!

  toWei(
    eth: String!
  ): String!

  toEth(
    wei: String!
  ): String!

  solidityPack(
    types: [String!]!
    values: [String!]!
  ): String!
}

### Imported Modules END ###

### Imported Objects START ###

type Ethers_Connection @imported(
  uri: "wrapscan.io/polywrap/ethers@1.1.1",
  namespace: "Ethers",
  nativeType: "Connection"
) {
  node: String
  networkNameOrChainId: String
}

type Ethers_Eip1559FeesEstimate @imported(
  uri: "wrapscan.io/polywrap/ethers@1.1.1",
  namespace: "Ethers",
  nativeType: "Eip1559FeesEstimate"
) {
  maxFeePerGas: BigInt!
  maxPriorityFeePerGas: BigInt!
}

type Ethers_TxOptions @imported(
  uri: "wrapscan.io/polywrap/ethers@1.1.1",
  namespace: "Ethers",
  nativeType: "TxOptions"
) {
  """
  Gas supplied for the transaction
  """
  gasLimit: BigInt
  """
    The max total fee to pay per unit of gas.
The difference between maxFeePerGas and baseFeePerGas + maxPriorityFeePerGas is “refunded” to the user.
This property is ignored when gasPrice is not null.
  """
  maxFeePerGas: BigInt
  """
    The gas price paid is baseFeePerGas + maxPriorityFeePerGas.
The difference between maxFeePerGas and baseFeePerGas + maxPriorityFeePerGas is “refunded” to the user.
This property is ignored when gasPrice is not null.
  """
  maxPriorityFeePerGas: BigInt
  """
    The gas price for legacy transactions.
If this property is not null, a legacy transaction will be sent and maxFeePerGas and maxPriorityFeePerGas will be ignored.
  """
  gasPrice: BigInt
  """
  Ether value sent with transaction
  """
  value: BigInt
  """
  Override default nonce
  """
  nonce: UInt32
}

type Ethers_StaticTxResult @imported(
  uri: "wrapscan.io/polywrap/ethers@1.1.1",
  namespace: "Ethers",
  nativeType: "StaticTxResult"
) {
  result: String!
  error: Boolean!
}

type Ethers_TxResponse @imported(
  uri: "wrapscan.io/polywrap/ethers@1.1.1",
  namespace: "Ethers",
  nativeType: "TxResponse"
) {
  hash: String!
  to: String
  from: String!
  nonce: UInt32!
  gasLimit: BigInt!
  maxFeePerGas: BigInt
  maxPriorityFeePerGas: BigInt
  gasPrice: BigInt
  value: BigInt!
  chainId: BigInt!
  blockNumber: BigInt
  blockHash: String
  timestamp: UInt32
  r: String
  s: String
  v: UInt32
  type: UInt32
  accessList: [Ethers_AccessItem!]
}

type Ethers_AccessItem @imported(
  uri: "wrapscan.io/polywrap/ethers@1.1.1",
  namespace: "Ethers",
  nativeType: "AccessItem"
) {
  address: String!
  storageKeys: [String!]!
}

type Ethers_TxRequest @imported(
  uri: "wrapscan.io/polywrap/ethers@1.1.1",
  namespace: "Ethers",
  nativeType: "TxRequest"
) {
  to: String
  from: String
  data: String
  type: UInt32
  chainId: BigInt
  accessList: [Ethers_AccessItem!]
  """
  Gas supplied for the transaction
  """
  gasLimit: BigInt
  """
    The max total fee to pay per unit of gas.
The difference between maxFeePerGas and baseFeePerGas + maxPriorityFeePerGas is “refunded” to the user.
This property is ignored when gasPrice is not null.
  """
  maxFeePerGas: BigInt
  """
    The gas price paid is baseFeePerGas + maxPriorityFeePerGas.
The difference between maxFeePerGas and baseFeePerGas + maxPriorityFeePerGas is “refunded” to the user.
This property is ignored when gasPrice is not null.
  """
  maxPriorityFeePerGas: BigInt
  """
    The gas price for legacy transactions.
If this property is not null, a legacy transaction will be sent and maxFeePerGas and maxPriorityFeePerGas will be ignored.
  """
  gasPrice: BigInt
  """
  Ether value sent with transaction
  """
  value: BigInt
  """
  Override default nonce
  """
  nonce: UInt32
}

type Ethers_TxReceipt @imported(
  uri: "wrapscan.io/polywrap/ethers@1.1.1",
  namespace: "Ethers",
  nativeType: "TxReceipt"
) {
  to: String!
  from: String!
  contractAddress: String!
  transactionIndex: UInt32!
  root: String
  gasUsed: BigInt!
  logsBloom: String!
  transactionHash: String!
  logs: [Ethers_Log!]!
  blockNumber: BigInt!
  blockHash: String!
  confirmations: UInt32!
  cumulativeGasUsed: BigInt!
  effectiveGasPrice: BigInt!
  type: UInt32!
  status: UInt32
}

type Ethers_Log @imported(
  uri: "wrapscan.io/polywrap/ethers@1.1.1",
  namespace: "Ethers",
  nativeType: "Log"
) {
  blockNumber: BigInt!
  blockHash: String!
  transactionIndex: UInt32!
  removed: Boolean!
  address: String!
  data: String!
  topics: [String!]!
  transactionHash: String!
  logIndex: UInt32!
}

### Imported Objects END ###

### Imported Envs START ###

### Imported Envs END ###