|
| 1 | +/** |
| 2 | + * Copyright 2025 Circle Internet Group, Inc. All rights reserved. |
| 3 | + * |
| 4 | + * SPDX-License-Identifier: Apache-2.0. |
| 5 | + * |
| 6 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | + * you may not use this file except in compliance with the License. |
| 8 | + * You may obtain a copy of the License at. |
| 9 | + * |
| 10 | + * Http://www.apache.org/licenses/LICENSE-2.0. |
| 11 | + * |
| 12 | + * Unless required by applicable law or agreed to in writing, software |
| 13 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | + * See the License for the specific language governing permissions and |
| 16 | + * limitations under the License. |
| 17 | + */ |
| 18 | + |
| 19 | +/** |
| 20 | + * Mocks for EIP-1193 rpc responses - eth_accounts and eth_requestAccounts. |
| 21 | + */ |
| 22 | +export const EthAccountsResponse = { |
| 23 | + result: ['0x2F96BdFdef089e4219375Df39fee743AF5D8C0BA'], |
| 24 | +} |
| 25 | + |
| 26 | +/** |
| 27 | + * Mocks for EIP-1193 rpc params - personal_sign. |
| 28 | + */ |
| 29 | +export const PersonalSignWrongAddressParams = ['0xdeadbeef', '0xdeadbeef'] |
| 30 | + |
| 31 | +/** |
| 32 | + * Mocks for EIP-1193 rpc params - personal_sign. |
| 33 | + */ |
| 34 | +export const PersonalSignParams = [ |
| 35 | + '0xdeadbeef', |
| 36 | + '0x2F96BdFdef089e4219375Df39fee743AF5D8C0BA', |
| 37 | +] |
| 38 | + |
| 39 | +/** |
| 40 | + * Mocks for EIP-1193 rpc responses - personal_sign. |
| 41 | + */ |
| 42 | +export const PersonalSignResponse = { |
| 43 | + result: |
| 44 | + '0x000000000000000000000000c83d88c018d143d08afe910221d445189fc6817a0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000046000000000000000000000000000000000000000000000000000000000000003c481d0dff1863bb58aafe20b10fc2e347a735fb95755f3bbcbc50e78da76846d7dad5b34b2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000340000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000020000000000000000000000005a2262d58eb72b84701d6efbf6bb6586c793a65b00000000000000000000000003431fb00fb2e26b5bc502dfef8da30e1c8643b80000000000000000000000000000000000000000000000000000000000000002a043327d77a74c1c55cfa799284b831fe09535a88b9f5fa4173d334e5ba0fd91d892482cc7e665eca1d358d318d38aa3a63c10247d473d04fc3538f4069ce4ae0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012b09685da7842117bfedb0668ffe1b6abe4d7e57298402cc996caafebce98b979edfd692718a0962b4ed55a3e768747fe0b6541c1f348fa1e7c2582c672da94c0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a1863bb58aafe20b10fc2e347a735fb95755f3bbcbc50e78da76846d7dad5b34b2000000000000000000000000000000000000000000000000000000000000004102000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000060a0c43a5828012752b439cca8e2b006a55f41737ae96057d38839ecd03271406f4beaf0d77def012616d6a863c1de9ac097a59c4340d57e8e714d17c4dc736c7600000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000001700000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d07b2274797065223a22776562617574686e2e676574222c226368616c6c656e6765223a22636f6f354d4238424162314d596673514d537748506d4d596f534e5754624a677962676d34466d6d372d49222c226f726967696e223a22616e64726f69643a61706b2d6b65792d686173683a50474f45667162664253726d6838666664526e45325a5453647072506c634152554a4e5a6e304156596c49222c22616e64726f69645061636b6167654e616d65223a22636972636c652e707773646b2e6277636f726573646b2e74657374227d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006492649264926492649264926492649264926492649264926492649264926492', |
| 45 | +} |
| 46 | + |
| 47 | +/** |
| 48 | + * Mocks for EIP-1193 rpc params - eth_sendTransaction. |
| 49 | + */ |
| 50 | +export const SendTransactionToAddressMissingParams = [ |
| 51 | + { |
| 52 | + data: '0xdeadbeef', |
| 53 | + value: 100000000n, |
| 54 | + }, |
| 55 | +] |
| 56 | + |
| 57 | +/** |
| 58 | + * Mocks for EIP-1193 rpc params - eth_sendTransaction. |
| 59 | + */ |
| 60 | +export const SendTransactionParams = [ |
| 61 | + { |
| 62 | + to: '0x2F96BdFdef089e4219375Df39fee743AF5D8C0BA', |
| 63 | + data: '0xdeadbeef', |
| 64 | + value: 100000000n, |
| 65 | + }, |
| 66 | +] |
| 67 | + |
| 68 | +/** |
| 69 | + * Mocks for EIP-1193 rpc responses - eth_sendTransaction. |
| 70 | + */ |
| 71 | +export const MockSendUserOperationResponse = '0xdeadbeef' |
| 72 | + |
| 73 | +/** |
| 74 | + * Mocks for EIP-1193 rpc responses - eth_sendTransaction. |
| 75 | + */ |
| 76 | +export const MockWaitForUserOperationReceiptResponse = { |
| 77 | + receipt: { |
| 78 | + transactionHash: '0xdeadbeef', |
| 79 | + }, |
| 80 | +} |
| 81 | + |
| 82 | +/** |
| 83 | + * Mocks for EIP-1193 rpc responses - eth_sendTransaction. |
| 84 | + */ |
| 85 | +export const MockSendTransactionResponse = { |
| 86 | + id: undefined, |
| 87 | + jsonrpc: undefined, |
| 88 | + result: MockWaitForUserOperationReceiptResponse.receipt.transactionHash, |
| 89 | +} |
| 90 | + |
| 91 | +/** |
| 92 | + * Mocks for EIP-1193 rpc params - eth_getTransactionReceipt. |
| 93 | + */ |
| 94 | +export const GetTransactionReceiptParams = ['0xdeadbeef'] |
| 95 | + |
| 96 | +/** |
| 97 | + * Mocks for EIP-1193 rpc responses - eth_getTransactionReceipt. |
| 98 | + */ |
| 99 | +export const MockGetTransactionReceiptResponse = { |
| 100 | + id: undefined, |
| 101 | + jsonrpc: undefined, |
| 102 | + result: { receipt: { transactionHash: GetTransactionReceiptParams[0] } }, |
| 103 | +} |
| 104 | + |
| 105 | +/** |
| 106 | + * Mocks for EIP-1193 rpc params - eth_signTypedData_v4. |
| 107 | + */ |
| 108 | +export const SignTypedDataV4WrongAddressParams = [ |
| 109 | + '0xdeadbeef', |
| 110 | + { |
| 111 | + domain: { |
| 112 | + name: 'MockDomain', |
| 113 | + version: '1', |
| 114 | + chainId: 1, |
| 115 | + verifyingContract: '0x9876543210fedcba9876543210fedcba98765432', |
| 116 | + }, |
| 117 | + message: { |
| 118 | + content: 'This is a test message', |
| 119 | + }, |
| 120 | + primaryType: 'Message', |
| 121 | + types: { |
| 122 | + EIP712Domain: [ |
| 123 | + { name: 'name', type: 'string' }, |
| 124 | + { name: 'version', type: 'string' }, |
| 125 | + { name: 'chainId', type: 'uint256' }, |
| 126 | + { name: 'verifyingContract', type: 'address' }, |
| 127 | + ], |
| 128 | + Message: [{ name: 'content', type: 'string' }], |
| 129 | + }, |
| 130 | + }, |
| 131 | +] |
| 132 | + |
| 133 | +/** |
| 134 | + * Mocks for EIP-1193 rpc params - eth_signTypedData_v4. |
| 135 | + */ |
| 136 | +export const SignTypedDataV4Params = [ |
| 137 | + '0x2F96BdFdef089e4219375Df39fee743AF5D8C0BA', |
| 138 | + { |
| 139 | + domain: { |
| 140 | + name: 'MockDomain', |
| 141 | + version: '1', |
| 142 | + chainId: 1, |
| 143 | + verifyingContract: '0x9876543210fedcba9876543210fedcba98765432', |
| 144 | + }, |
| 145 | + message: { |
| 146 | + content: 'This is a test message', |
| 147 | + }, |
| 148 | + primaryType: 'Message', |
| 149 | + types: { |
| 150 | + EIP712Domain: [ |
| 151 | + { name: 'name', type: 'string' }, |
| 152 | + { name: 'version', type: 'string' }, |
| 153 | + { name: 'chainId', type: 'uint256' }, |
| 154 | + { name: 'verifyingContract', type: 'address' }, |
| 155 | + ], |
| 156 | + Message: [{ name: 'content', type: 'string' }], |
| 157 | + }, |
| 158 | + }, |
| 159 | +] |
0 commit comments