@imtbl/x-client 2.0.0-alpha.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.
Files changed (82) hide show
  1. package/LICENSE.md +176 -0
  2. package/README.md +53 -0
  3. package/dist/browser/index.js +2 -0
  4. package/dist/node/index.cjs +2 -0
  5. package/dist/node/index.js +2 -0
  6. package/dist/types/IMXClient.d.ts +334 -0
  7. package/dist/types/config/config.test.d.ts +1 -0
  8. package/dist/types/config/index.d.ts +77 -0
  9. package/dist/types/contracts/@openzeppelin/contracts/index.d.ts +4 -0
  10. package/dist/types/contracts/@openzeppelin/contracts/token/ERC20/IERC20.d.ts +129 -0
  11. package/dist/types/contracts/@openzeppelin/contracts/token/ERC20/index.d.ts +1 -0
  12. package/dist/types/contracts/@openzeppelin/contracts/token/ERC721/IERC721.d.ts +199 -0
  13. package/dist/types/contracts/@openzeppelin/contracts/token/ERC721/index.d.ts +1 -0
  14. package/dist/types/contracts/@openzeppelin/contracts/token/index.d.ts +4 -0
  15. package/dist/types/contracts/@openzeppelin/contracts/utils/index.d.ts +2 -0
  16. package/dist/types/contracts/@openzeppelin/contracts/utils/introspection/IERC165.d.ts +29 -0
  17. package/dist/types/contracts/@openzeppelin/contracts/utils/introspection/index.d.ts +1 -0
  18. package/dist/types/contracts/@openzeppelin/index.d.ts +2 -0
  19. package/dist/types/contracts/common.d.ts +50 -0
  20. package/dist/types/contracts/contracts/index.d.ts +4 -0
  21. package/dist/types/contracts/contracts/v3/Core.d.ts +1088 -0
  22. package/dist/types/contracts/contracts/v3/Registration.d.ts +169 -0
  23. package/dist/types/contracts/contracts/v3/index.d.ts +2 -0
  24. package/dist/types/contracts/contracts/v4/CoreV4.d.ts +1650 -0
  25. package/dist/types/contracts/contracts/v4/RegistrationV4.d.ts +111 -0
  26. package/dist/types/contracts/contracts/v4/index.d.ts +2 -0
  27. package/dist/types/contracts/factories/@openzeppelin/contracts/index.d.ts +2 -0
  28. package/dist/types/contracts/factories/@openzeppelin/contracts/token/ERC20/IERC20__factory.d.ts +147 -0
  29. package/dist/types/contracts/factories/@openzeppelin/contracts/token/ERC20/index.d.ts +1 -0
  30. package/dist/types/contracts/factories/@openzeppelin/contracts/token/ERC721/IERC721__factory.d.ts +227 -0
  31. package/dist/types/contracts/factories/@openzeppelin/contracts/token/ERC721/index.d.ts +1 -0
  32. package/dist/types/contracts/factories/@openzeppelin/contracts/token/index.d.ts +2 -0
  33. package/dist/types/contracts/factories/@openzeppelin/contracts/utils/index.d.ts +1 -0
  34. package/dist/types/contracts/factories/@openzeppelin/contracts/utils/introspection/IERC165__factory.d.ts +21 -0
  35. package/dist/types/contracts/factories/@openzeppelin/contracts/utils/introspection/index.d.ts +1 -0
  36. package/dist/types/contracts/factories/@openzeppelin/index.d.ts +1 -0
  37. package/dist/types/contracts/factories/contracts/index.d.ts +2 -0
  38. package/dist/types/contracts/factories/contracts/v3/Core__factory.d.ts +1254 -0
  39. package/dist/types/contracts/factories/contracts/v3/Registration__factory.d.ts +214 -0
  40. package/dist/types/contracts/factories/contracts/v3/index.d.ts +2 -0
  41. package/dist/types/contracts/factories/contracts/v4/CoreV4__factory.d.ts +1890 -0
  42. package/dist/types/contracts/factories/contracts/v4/RegistrationV4__factory.d.ts +168 -0
  43. package/dist/types/contracts/factories/contracts/v4/index.d.ts +2 -0
  44. package/dist/types/contracts/factories/index.d.ts +2 -0
  45. package/dist/types/contracts/index.d.ts +19 -0
  46. package/dist/types/exportContracts.d.ts +2 -0
  47. package/dist/types/exportUtils.d.ts +1 -0
  48. package/dist/types/imx.test.d.ts +1 -0
  49. package/dist/types/index.d.ts +11 -0
  50. package/dist/types/types/api.d.ts +223 -0
  51. package/dist/types/types/errors.d.ts +9 -0
  52. package/dist/types/types/index.d.ts +6 -0
  53. package/dist/types/types/requests.d.ts +53 -0
  54. package/dist/types/types/signers.d.ts +37 -0
  55. package/dist/types/types/tokens.d.ts +51 -0
  56. package/dist/types/types/transfers.d.ts +17 -0
  57. package/dist/types/utils/convertToSignableToken.d.ts +8 -0
  58. package/dist/types/utils/crypto/crypto.d.ts +16 -0
  59. package/dist/types/utils/crypto/crypto.test.d.ts +1 -0
  60. package/dist/types/utils/crypto/index.d.ts +1 -0
  61. package/dist/types/utils/formatError.d.ts +7 -0
  62. package/dist/types/utils/formatError.test.d.ts +1 -0
  63. package/dist/types/utils/index.d.ts +5 -0
  64. package/dist/types/utils/stark/errors.d.ts +3 -0
  65. package/dist/types/utils/stark/getStarkPublicKeyFromImx.d.ts +12 -0
  66. package/dist/types/utils/stark/legacy/crypto/constants.d.ts +27 -0
  67. package/dist/types/utils/stark/legacy/crypto/crypto.d.ts +14 -0
  68. package/dist/types/utils/stark/legacy/crypto/index.d.ts +2 -0
  69. package/dist/types/utils/stark/legacy/crypto/points.d.ts +1 -0
  70. package/dist/types/utils/stark/legacy/crypto/types.d.ts +18 -0
  71. package/dist/types/utils/stark/starkCurve.d.ts +18 -0
  72. package/dist/types/utils/stark/starkCurve.test.d.ts +1 -0
  73. package/dist/types/utils/stark/starkSigner.d.ts +17 -0
  74. package/dist/types/utils/stark/starkSigner.test.d.ts +1 -0
  75. package/dist/types/workflows/errors.d.ts +3 -0
  76. package/dist/types/workflows/exchangeTransfers.d.ts +8 -0
  77. package/dist/types/workflows/index.d.ts +1 -0
  78. package/dist/types/workflows/minting.d.ts +4 -0
  79. package/dist/types/workflows/orders.d.ts +13 -0
  80. package/dist/types/workflows/trades.d.ts +8 -0
  81. package/dist/types/workflows/workflows.d.ts +29 -0
  82. package/package.json +70 -0
@@ -0,0 +1,168 @@
1
+ import { ContractFactory, ContractTransactionResponse } from "ethers";
2
+ import type { Signer, AddressLike, ContractDeployTransaction, ContractRunner } from "ethers";
3
+ import type { NonPayableOverrides } from "../../../common";
4
+ import type { RegistrationV4, RegistrationV4Interface } from "../../../contracts/v4/RegistrationV4";
5
+ type RegistrationV4ConstructorParams = [signer?: Signer] | ConstructorParameters<typeof ContractFactory>;
6
+ export declare class RegistrationV4__factory extends ContractFactory {
7
+ constructor(...args: RegistrationV4ConstructorParams);
8
+ getDeployTransaction(_imx: AddressLike, overrides?: NonPayableOverrides & {
9
+ from?: string;
10
+ }): Promise<ContractDeployTransaction>;
11
+ deploy(_imx: AddressLike, overrides?: NonPayableOverrides & {
12
+ from?: string;
13
+ }): Promise<RegistrationV4 & {
14
+ deploymentTransaction(): ContractTransactionResponse;
15
+ }>;
16
+ connect(runner: ContractRunner | null): RegistrationV4__factory;
17
+ static readonly bytecode = "0x60a06040523480156200001157600080fd5b50604051620012bc380380620012bc8339818101604052810190620000379190620000dc565b8073ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff1681525050506200010e565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620000a48262000077565b9050919050565b620000b68162000097565b8114620000c257600080fd5b50565b600081519050620000d681620000ab565b92915050565b600060208284031215620000f557620000f462000072565b5b60006200010584828501620000c5565b91505092915050565b608051611145620001776000396000818161016d01528181610229015281816102c2015281816102f30152818161038501528181610429015281816104bb0152818161056e01528181610629015281816106c9015281816107c4015261085b01526111456000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c8063352eb84c1161005b578063352eb84c146100da57806343fa186d146100f6578063579a698814610112578063d2fc99b5146101425761007d565b8063022cabbc146100825780630d8e6e2c1461009e5780630f08025f146100bc575b600080fd5b61009c600480360381019061009791906109fb565b61015e565b005b6100a6610225565b6040516100b39190610b13565b60405180910390f35b6100c46102c0565b6040516100d19190610b94565b60405180910390f35b6100f460048036038101906100ef9190610baf565b6102e4565b005b610110600480360381019061010b9190610c49565b61041a565b005b61012c60048036038101906101279190610d05565b610553565b6040516101399190610d4d565b60405180910390f35b61015c60048036038101906101579190610d68565b610625565b005b61016784610553565b6101fd577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663bea84187868686866040518563ffffffff1660e01b81526004016101ca9493929190610e26565b600060405180830381600087803b1580156101e457600080fd5b505af11580156101f8573d6000803e3d6000fd5b505050505b61021e8573ffffffffffffffffffffffffffffffffffffffff168583610625565b5050505050565b60607f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663ffa1ad746040518163ffffffff1660e01b8152600401600060405180830381865afa158015610292573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906102bb9190610f87565b905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b6102ed85610553565b610383577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663bea84187878787876040518563ffffffff1660e01b81526004016103509493929190610e26565b600060405180830381600087803b15801561036a57600080fd5b505af115801561037e573d6000803e3d6000fd5b505050505b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663019b417a8684846040518463ffffffff1660e01b81526004016103e093929190610fd0565b600060405180830381600087803b1580156103fa57600080fd5b505af115801561040e573d6000803e3d6000fd5b50505050505050505050565b61042386610553565b6104b9577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663bea84187888888886040518563ffffffff1660e01b81526004016104869493929190610e26565b600060405180830381600087803b1580156104a057600080fd5b505af11580156104b4573d6000803e3d6000fd5b505050505b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d91443b7878585856040518563ffffffff1660e01b81526004016105189493929190611007565b600060405180830381600087803b15801561053257600080fd5b505af1158015610546573d6000803e3d6000fd5b5050505050505050505050565b60008073ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16631dbd1da7846040518263ffffffff1660e01b81526004016105c59190611047565b602060405180830381865afa1580156105e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106069190611077565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663ec3161b085846040518363ffffffff1660e01b81526004016106829291906110a4565b602060405180830381865afa15801561069f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c391906110e2565b905060007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663ec3161b085856040518363ffffffff1660e01b81526004016107229291906110a4565b602060405180830381865afa15801561073f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076391906110e2565b90506000821480156107755750600081145b156107b95784846040517f1362cdf20000000000000000000000000000000000000000000000000000000081526004016107b09291906110a4565b60405180910390fd5b6000821115610850577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663441a3e7086856040518363ffffffff1660e01b815260040161081d9291906110a4565b600060405180830381600087803b15801561083757600080fd5b505af115801561084b573d6000803e3d6000fd5b505050505b60008111156108e7577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663441a3e7085856040518363ffffffff1660e01b81526004016108b49291906110a4565b600060405180830381600087803b1580156108ce57600080fd5b505af11580156108e2573d6000803e3d6000fd5b505050505b5050505050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061092d82610902565b9050919050565b61093d81610922565b811461094857600080fd5b50565b60008135905061095a81610934565b92915050565b6000819050919050565b61097381610960565b811461097e57600080fd5b50565b6000813590506109908161096a565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f8401126109bb576109ba610996565b5b8235905067ffffffffffffffff8111156109d8576109d761099b565b5b6020830191508360018202830111156109f4576109f36109a0565b5b9250929050565b600080600080600060808688031215610a1757610a166108f8565b5b6000610a258882890161094b565b9550506020610a3688828901610981565b945050604086013567ffffffffffffffff811115610a5757610a566108fd565b5b610a63888289016109a5565b93509350506060610a7688828901610981565b9150509295509295909350565b600081519050919050565b600082825260208201905092915050565b60005b83811015610abd578082015181840152602081019050610aa2565b60008484015250505050565b6000601f19601f8301169050919050565b6000610ae582610a83565b610aef8185610a8e565b9350610aff818560208601610a9f565b610b0881610ac9565b840191505092915050565b60006020820190508181036000830152610b2d8184610ada565b905092915050565b6000819050919050565b6000610b5a610b55610b5084610902565b610b35565b610902565b9050919050565b6000610b6c82610b3f565b9050919050565b6000610b7e82610b61565b9050919050565b610b8e81610b73565b82525050565b6000602082019050610ba96000830184610b85565b92915050565b60008060008060008060a08789031215610bcc57610bcb6108f8565b5b6000610bda89828a0161094b565b9650506020610beb89828a01610981565b955050604087013567ffffffffffffffff811115610c0c57610c0b6108fd565b5b610c1889828a016109a5565b94509450506060610c2b89828a01610981565b9250506080610c3c89828a01610981565b9150509295509295509295565b600080600080600080600060a0888a031215610c6857610c676108f8565b5b6000610c768a828b0161094b565b9750506020610c878a828b01610981565b965050604088013567ffffffffffffffff811115610ca857610ca76108fd565b5b610cb48a828b016109a5565b95509550506060610cc78a828b01610981565b935050608088013567ffffffffffffffff811115610ce857610ce76108fd565b5b610cf48a828b016109a5565b925092505092959891949750929550565b600060208284031215610d1b57610d1a6108f8565b5b6000610d2984828501610981565b91505092915050565b60008115159050919050565b610d4781610d32565b82525050565b6000602082019050610d626000830184610d3e565b92915050565b600080600060608486031215610d8157610d806108f8565b5b6000610d8f86828701610981565b9350506020610da086828701610981565b9250506040610db186828701610981565b9150509250925092565b610dc481610922565b82525050565b610dd381610960565b82525050565b600082825260208201905092915050565b82818337600083830152505050565b6000610e058385610dd9565b9350610e12838584610dea565b610e1b83610ac9565b840190509392505050565b6000606082019050610e3b6000830187610dbb565b610e486020830186610dca565b8181036040830152610e5b818486610df9565b905095945050505050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610ea382610ac9565b810181811067ffffffffffffffff82111715610ec257610ec1610e6b565b5b80604052505050565b6000610ed56108ee565b9050610ee18282610e9a565b919050565b600067ffffffffffffffff821115610f0157610f00610e6b565b5b610f0a82610ac9565b9050602081019050919050565b6000610f2a610f2584610ee6565b610ecb565b905082815260208101848484011115610f4657610f45610e66565b5b610f51848285610a9f565b509392505050565b600082601f830112610f6e57610f6d610996565b5b8151610f7e848260208601610f17565b91505092915050565b600060208284031215610f9d57610f9c6108f8565b5b600082015167ffffffffffffffff811115610fbb57610fba6108fd565b5b610fc784828501610f59565b91505092915050565b6000606082019050610fe56000830186610dca565b610ff26020830185610dca565b610fff6040830184610dca565b949350505050565b600060608201905061101c6000830187610dca565b6110296020830186610dca565b818103604083015261103c818486610df9565b905095945050505050565b600060208201905061105c6000830184610dca565b92915050565b60008151905061107181610934565b92915050565b60006020828403121561108d5761108c6108f8565b5b600061109b84828501611062565b91505092915050565b60006040820190506110b96000830185610dca565b6110c66020830184610dca565b9392505050565b6000815190506110dc8161096a565b92915050565b6000602082840312156110f8576110f76108f8565b5b6000611106848285016110cd565b9150509291505056fea2646970667358221220c33e1830b470bf1e012ac831ec80242d6268e5e6e990b7e1574a230f71533ebd64736f6c63430008130033";
18
+ static readonly abi: readonly [{
19
+ readonly inputs: readonly [{
20
+ readonly internalType: "address payable";
21
+ readonly name: "_imx";
22
+ readonly type: "address";
23
+ }];
24
+ readonly stateMutability: "nonpayable";
25
+ readonly type: "constructor";
26
+ }, {
27
+ readonly inputs: readonly [{
28
+ readonly internalType: "uint256";
29
+ readonly name: "ethKey";
30
+ readonly type: "uint256";
31
+ }, {
32
+ readonly internalType: "uint256";
33
+ readonly name: "starkKey";
34
+ readonly type: "uint256";
35
+ }];
36
+ readonly name: "NoFundsToWithdraw";
37
+ readonly type: "error";
38
+ }, {
39
+ readonly inputs: readonly [];
40
+ readonly name: "getVersion";
41
+ readonly outputs: readonly [{
42
+ readonly internalType: "string";
43
+ readonly name: "";
44
+ readonly type: "string";
45
+ }];
46
+ readonly stateMutability: "view";
47
+ readonly type: "function";
48
+ }, {
49
+ readonly inputs: readonly [];
50
+ readonly name: "imx";
51
+ readonly outputs: readonly [{
52
+ readonly internalType: "contract CoreV4";
53
+ readonly name: "";
54
+ readonly type: "address";
55
+ }];
56
+ readonly stateMutability: "view";
57
+ readonly type: "function";
58
+ }, {
59
+ readonly inputs: readonly [{
60
+ readonly internalType: "uint256";
61
+ readonly name: "starkKey";
62
+ readonly type: "uint256";
63
+ }];
64
+ readonly name: "isRegistered";
65
+ readonly outputs: readonly [{
66
+ readonly internalType: "bool";
67
+ readonly name: "";
68
+ readonly type: "bool";
69
+ }];
70
+ readonly stateMutability: "view";
71
+ readonly type: "function";
72
+ }, {
73
+ readonly inputs: readonly [{
74
+ readonly internalType: "address";
75
+ readonly name: "ethKey";
76
+ readonly type: "address";
77
+ }, {
78
+ readonly internalType: "uint256";
79
+ readonly name: "starkKey";
80
+ readonly type: "uint256";
81
+ }, {
82
+ readonly internalType: "bytes";
83
+ readonly name: "signature";
84
+ readonly type: "bytes";
85
+ }, {
86
+ readonly internalType: "uint256";
87
+ readonly name: "assetType";
88
+ readonly type: "uint256";
89
+ }];
90
+ readonly name: "registerAndWithdrawAll";
91
+ readonly outputs: readonly [];
92
+ readonly stateMutability: "nonpayable";
93
+ readonly type: "function";
94
+ }, {
95
+ readonly inputs: readonly [{
96
+ readonly internalType: "address";
97
+ readonly name: "ethKey";
98
+ readonly type: "address";
99
+ }, {
100
+ readonly internalType: "uint256";
101
+ readonly name: "starkKey";
102
+ readonly type: "uint256";
103
+ }, {
104
+ readonly internalType: "bytes";
105
+ readonly name: "signature";
106
+ readonly type: "bytes";
107
+ }, {
108
+ readonly internalType: "uint256";
109
+ readonly name: "assetType";
110
+ readonly type: "uint256";
111
+ }, {
112
+ readonly internalType: "uint256";
113
+ readonly name: "tokenId";
114
+ readonly type: "uint256";
115
+ }];
116
+ readonly name: "registerAndWithdrawNft";
117
+ readonly outputs: readonly [];
118
+ readonly stateMutability: "nonpayable";
119
+ readonly type: "function";
120
+ }, {
121
+ readonly inputs: readonly [{
122
+ readonly internalType: "address";
123
+ readonly name: "ethKey";
124
+ readonly type: "address";
125
+ }, {
126
+ readonly internalType: "uint256";
127
+ readonly name: "starkKey";
128
+ readonly type: "uint256";
129
+ }, {
130
+ readonly internalType: "bytes";
131
+ readonly name: "signature";
132
+ readonly type: "bytes";
133
+ }, {
134
+ readonly internalType: "uint256";
135
+ readonly name: "assetType";
136
+ readonly type: "uint256";
137
+ }, {
138
+ readonly internalType: "bytes";
139
+ readonly name: "mintingBlob";
140
+ readonly type: "bytes";
141
+ }];
142
+ readonly name: "registerWithdrawAndMint";
143
+ readonly outputs: readonly [];
144
+ readonly stateMutability: "nonpayable";
145
+ readonly type: "function";
146
+ }, {
147
+ readonly inputs: readonly [{
148
+ readonly internalType: "uint256";
149
+ readonly name: "ethKey";
150
+ readonly type: "uint256";
151
+ }, {
152
+ readonly internalType: "uint256";
153
+ readonly name: "starkKey";
154
+ readonly type: "uint256";
155
+ }, {
156
+ readonly internalType: "uint256";
157
+ readonly name: "assetType";
158
+ readonly type: "uint256";
159
+ }];
160
+ readonly name: "withdrawAll";
161
+ readonly outputs: readonly [];
162
+ readonly stateMutability: "nonpayable";
163
+ readonly type: "function";
164
+ }];
165
+ static createInterface(): RegistrationV4Interface;
166
+ static connect(address: string, runner?: ContractRunner | null): RegistrationV4;
167
+ }
168
+ export {};
@@ -0,0 +1,2 @@
1
+ export { CoreV4__factory } from "./CoreV4__factory";
2
+ export { RegistrationV4__factory } from "./RegistrationV4__factory";
@@ -0,0 +1,2 @@
1
+ export * as openzeppelin from "./@openzeppelin";
2
+ export * as contracts from "./contracts";
@@ -0,0 +1,19 @@
1
+ import type * as openzeppelin from "./@openzeppelin";
2
+ export type { openzeppelin };
3
+ import type * as contracts from "./contracts";
4
+ export type { contracts };
5
+ export * as factories from "./factories";
6
+ export type { IERC20 } from "./@openzeppelin/contracts/token/ERC20/IERC20";
7
+ export { IERC20__factory } from "./factories/@openzeppelin/contracts/token/ERC20/IERC20__factory";
8
+ export type { IERC721 } from "./@openzeppelin/contracts/token/ERC721/IERC721";
9
+ export { IERC721__factory } from "./factories/@openzeppelin/contracts/token/ERC721/IERC721__factory";
10
+ export type { IERC165 } from "./@openzeppelin/contracts/utils/introspection/IERC165";
11
+ export { IERC165__factory } from "./factories/@openzeppelin/contracts/utils/introspection/IERC165__factory";
12
+ export type { Core } from "./contracts/v3/Core";
13
+ export { Core__factory } from "./factories/contracts/v3/Core__factory";
14
+ export type { Registration } from "./contracts/v3/Registration";
15
+ export { Registration__factory } from "./factories/contracts/v3/Registration__factory";
16
+ export type { CoreV4 } from "./contracts/v4/CoreV4";
17
+ export { CoreV4__factory } from "./factories/contracts/v4/CoreV4__factory";
18
+ export type { RegistrationV4 } from "./contracts/v4/RegistrationV4";
19
+ export { RegistrationV4__factory } from "./factories/contracts/v4/RegistrationV4__factory";
@@ -0,0 +1,2 @@
1
+ export { Core__factory as Core, CoreV4__factory as CoreV4, Registration__factory as Registration, RegistrationV4__factory as RegistrationV4, IERC20__factory as IERC20, IERC721__factory as IERC721, } from './contracts';
2
+ export type { Core as CoreContract, CoreV4 as CoreV4Contract, Registration as RegistrationContract, RegistrationV4 as RegistrationV4Contract, } from './contracts';
@@ -0,0 +1 @@
1
+ export { generateLegacyStarkPrivateKey, generateStarkPrivateKey, createStarkSigner, starkEcOrder, serializePackedSignature, signRegisterEthAddress, } from './utils';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ export * from './config';
2
+ export { IMXClient, ImmutableX } from './IMXClient';
3
+ export * from './exportUtils';
4
+ export * as Contracts from './exportContracts';
5
+ export * from './types';
6
+ /**
7
+ * aliased exports to maintain backwards compatibility
8
+ */
9
+ export type { ImxModuleConfiguration as ImxClientModuleConfiguration } from './config';
10
+ export { generateLegacyStarkPrivateKey as imxClientGenerateLegacyStarkPrivateKey, createStarkSigner as imxClientCreateStarkSigner, } from './exportUtils';
11
+ export type { WalletConnection as ImxClientWalletConnection } from './types';
@@ -0,0 +1,223 @@
1
+ import { imx } from '@imtbl/generated-clients';
2
+ export type { TransactionResponse } from 'ethers';
3
+ /**
4
+ * Need to specifically export the classes and interfaces from the generated
5
+ * clients imx object for rollup to bundle them correctly.
6
+ */
7
+ export declare class AssetsApi extends imx.AssetsApi {
8
+ }
9
+ export declare class BalancesApi extends imx.BalancesApi {
10
+ }
11
+ export declare class CollectionsApi extends imx.CollectionsApi {
12
+ }
13
+ export declare class DepositsApi extends imx.DepositsApi {
14
+ }
15
+ export declare class EncodingApi extends imx.EncodingApi {
16
+ }
17
+ export declare class ExchangesApi extends imx.ExchangesApi {
18
+ }
19
+ export declare class MintsApi extends imx.MintsApi {
20
+ }
21
+ export declare class MetadataApi extends imx.MetadataApi {
22
+ }
23
+ export declare class MetadataRefreshesApi extends imx.MetadataRefreshesApi {
24
+ }
25
+ export declare class NftCheckoutPrimaryApi extends imx.NftCheckoutPrimaryApi {
26
+ }
27
+ export declare class OrdersApi extends imx.OrdersApi {
28
+ }
29
+ export declare class ProjectsApi extends imx.ProjectsApi {
30
+ }
31
+ export declare class TokensApi extends imx.TokensApi {
32
+ }
33
+ export declare class TradesApi extends imx.TradesApi {
34
+ }
35
+ export declare class TransfersApi extends imx.TransfersApi {
36
+ }
37
+ export declare class UsersApi extends imx.UsersApi {
38
+ }
39
+ export declare class WithdrawalsApi extends imx.WithdrawalsApi {
40
+ }
41
+ export interface AddMetadataSchemaToCollectionRequest extends imx.AddMetadataSchemaToCollectionRequest {
42
+ }
43
+ export interface APIError extends imx.APIError {
44
+ }
45
+ export interface Asset extends imx.Asset {
46
+ }
47
+ export interface AssetsApiGetAssetRequest extends imx.AssetsApiGetAssetRequest {
48
+ }
49
+ export interface AssetsApiListAssetsRequest extends imx.AssetsApiListAssetsRequest {
50
+ }
51
+ export interface Balance extends imx.Balance {
52
+ }
53
+ export interface BalancesApiGetBalanceRequest extends imx.BalancesApiGetBalanceRequest {
54
+ }
55
+ export interface BalancesApiListBalancesRequest extends imx.BalancesApiListBalancesRequest {
56
+ }
57
+ export interface CancelOrderResponse extends imx.CancelOrderResponse {
58
+ }
59
+ export interface Collection extends imx.Collection {
60
+ }
61
+ export interface CollectionFilter extends imx.CollectionFilter {
62
+ }
63
+ export interface CollectionsApiGetCollectionRequest extends imx.CollectionsApiGetCollectionRequest {
64
+ }
65
+ export interface CollectionsApiListCollectionFiltersRequest extends imx.CollectionsApiListCollectionFiltersRequest {
66
+ }
67
+ export interface CollectionsApiListCollectionsRequest extends imx.CollectionsApiListCollectionsRequest {
68
+ }
69
+ export interface CreateCollectionRequest extends imx.CreateCollectionRequest {
70
+ }
71
+ export interface CreateMetadataRefreshRequest extends imx.CreateMetadataRefreshRequest {
72
+ }
73
+ export interface CreateMetadataRefreshResponse extends imx.CreateMetadataRefreshResponse {
74
+ }
75
+ export interface CreateOrderResponse extends imx.CreateOrderResponse {
76
+ }
77
+ export interface CreateTradeResponse extends imx.CreateTradeResponse {
78
+ }
79
+ export interface CreateTransferResponseV1 extends imx.CreateTransferResponseV1 {
80
+ }
81
+ export interface CreateWithdrawalResponse extends imx.CreateWithdrawalResponse {
82
+ }
83
+ export interface CurrencyWithLimits extends imx.CurrencyWithLimits {
84
+ }
85
+ export interface Deposit extends imx.Deposit {
86
+ }
87
+ export interface DepositsApiGetDepositRequest extends imx.DepositsApiGetDepositRequest {
88
+ }
89
+ export interface DepositsApiListDepositsRequest extends imx.DepositsApiListDepositsRequest {
90
+ }
91
+ export interface Exchange extends imx.Exchange {
92
+ }
93
+ export interface ExchangeCreateExchangeAndURLResponse extends imx.ExchangeCreateExchangeAndURLResponse {
94
+ }
95
+ export interface ExchangesApiCreateExchangeRequest extends imx.ExchangesApiCreateExchangeRequest {
96
+ }
97
+ export interface ExchangesApiGetExchangeRequest extends imx.ExchangesApiGetExchangeRequest {
98
+ }
99
+ export interface ExchangesApiGetExchangesRequest extends imx.ExchangesApiGetExchangesRequest {
100
+ }
101
+ export interface GetMetadataRefreshes extends imx.GetMetadataRefreshes {
102
+ }
103
+ export interface GetMetadataRefreshErrorsResponse extends imx.GetMetadataRefreshErrorsResponse {
104
+ }
105
+ export interface GetMetadataRefreshResponse extends imx.GetMetadataRefreshResponse {
106
+ }
107
+ export interface GetSignableCancelOrderRequest extends imx.GetSignableCancelOrderRequest {
108
+ }
109
+ export interface GetSignableOrderRequest extends imx.GetSignableOrderRequest {
110
+ }
111
+ export interface GetSignableTradeRequest extends imx.GetSignableTradeRequest {
112
+ }
113
+ export interface GetTransactionsResponse extends imx.GetTransactionsResponse {
114
+ }
115
+ export interface GetUsersApiResponse extends imx.GetUsersApiResponse {
116
+ }
117
+ export interface ListAssetsResponse extends imx.ListAssetsResponse {
118
+ }
119
+ export interface ListBalancesResponse extends imx.ListBalancesResponse {
120
+ }
121
+ export interface ListCollectionsResponse extends imx.ListCollectionsResponse {
122
+ }
123
+ export interface ListDepositsResponse extends imx.ListDepositsResponse {
124
+ }
125
+ export interface ListMintsResponse extends imx.ListMintsResponse {
126
+ }
127
+ export interface ListOrdersResponseV3 extends imx.ListOrdersResponseV3 {
128
+ }
129
+ export interface ListTokensResponse extends imx.ListTokensResponse {
130
+ }
131
+ export interface ListTradesResponse extends imx.ListTradesResponse {
132
+ }
133
+ export interface ListTransfersResponse extends imx.ListTransfersResponse {
134
+ }
135
+ export interface ListWithdrawalsResponse extends imx.ListWithdrawalsResponse {
136
+ }
137
+ export interface MetadataApiGetMetadataSchemaRequest extends imx.MetadataApiGetMetadataSchemaRequest {
138
+ }
139
+ export interface MetadataSchemaProperty extends imx.MetadataSchemaProperty {
140
+ }
141
+ export interface MetadataSchemaRequest extends imx.MetadataSchemaRequest {
142
+ }
143
+ export interface Mint extends imx.Mint {
144
+ }
145
+ export interface MintFee extends imx.MintFee {
146
+ }
147
+ export interface MintRequest extends imx.MintRequest {
148
+ }
149
+ export interface MintResultDetails extends imx.MintResultDetails {
150
+ }
151
+ export interface MintsApiGetMintRequest extends imx.MintsApiGetMintRequest {
152
+ }
153
+ export interface MintsApiListMintsRequest extends imx.MintsApiListMintsRequest {
154
+ }
155
+ export interface MintsApiMintTokensRequest extends imx.MintsApiMintTokensRequest {
156
+ }
157
+ export interface MintTokenDataV2 extends imx.MintTokenDataV2 {
158
+ }
159
+ export interface MintTokensResponse extends imx.MintTokensResponse {
160
+ }
161
+ export interface MintUser extends imx.MintUser {
162
+ }
163
+ export interface NftCheckoutPrimaryApiCreateNftPrimaryRequest extends imx.NftCheckoutPrimaryApiCreateNftPrimaryRequest {
164
+ }
165
+ export interface NftCheckoutPrimaryApiGetCurrenciesNFTCheckoutPrimaryRequest extends imx.NftCheckoutPrimaryApiGetCurrenciesNFTCheckoutPrimaryRequest {
166
+ }
167
+ export interface NftCheckoutPrimaryApiGetNftPrimaryTransactionRequest extends imx.NftCheckoutPrimaryApiGetNftPrimaryTransactionRequest {
168
+ }
169
+ export interface NftCheckoutPrimaryApiGetNftPrimaryTransactionsRequest extends imx.NftCheckoutPrimaryApiGetNftPrimaryTransactionsRequest {
170
+ }
171
+ export interface NftprimarytransactionCreateResponse extends imx.NftprimarytransactionCreateResponse {
172
+ }
173
+ export interface NftprimarytransactionGetResponse extends imx.NftprimarytransactionGetResponse {
174
+ }
175
+ export interface NftprimarytransactionListTransactionsResponse extends imx.NftprimarytransactionListTransactionsResponse {
176
+ }
177
+ export interface OrdersApiCreateOrderV3Request extends imx.OrdersApiCreateOrderV3Request {
178
+ }
179
+ export interface OrdersApiGetOrderV3Request extends imx.OrdersApiGetOrderV3Request {
180
+ }
181
+ export interface OrdersApiListOrdersV3Request extends imx.OrdersApiListOrdersV3Request {
182
+ }
183
+ export interface OrderV3 extends imx.OrderV3 {
184
+ }
185
+ export interface Project extends imx.Project {
186
+ }
187
+ export interface SignableToken extends imx.SignableToken {
188
+ }
189
+ export interface SuccessResponse extends imx.SuccessResponse {
190
+ }
191
+ export interface TokenDetails extends imx.TokenDetails {
192
+ }
193
+ export interface TokensApiGetTokenRequest extends imx.TokensApiGetTokenRequest {
194
+ }
195
+ export interface TokensApiListTokensRequest extends imx.TokensApiListTokensRequest {
196
+ }
197
+ export interface Trade extends imx.Trade {
198
+ }
199
+ export interface TradesApiGetTradeV3Request extends imx.TradesApiGetTradeV3Request {
200
+ }
201
+ export interface TradesApiListTradesV3Request extends imx.TradesApiListTradesV3Request {
202
+ }
203
+ export interface Transfer extends imx.Transfer {
204
+ }
205
+ export interface TransfersApiGetTransferRequest extends imx.TransfersApiGetTransferRequest {
206
+ }
207
+ export interface TransfersApiListTransfersRequest extends imx.TransfersApiListTransfersRequest {
208
+ }
209
+ export interface UpdateCollectionRequest extends imx.UpdateCollectionRequest {
210
+ }
211
+ export interface Withdrawal extends imx.Withdrawal {
212
+ }
213
+ export interface WithdrawalsApiGetWithdrawalRequest extends imx.WithdrawalsApiGetWithdrawalRequest {
214
+ }
215
+ export interface WithdrawalsApiListWithdrawalsRequest extends imx.WithdrawalsApiListWithdrawalsRequest {
216
+ }
217
+ export declare const MetadataSchemaRequestTypeEnum: {
218
+ readonly Enum: 'enum';
219
+ readonly Text: 'text';
220
+ readonly Boolean: 'boolean';
221
+ readonly Continuous: 'continuous';
222
+ readonly Discrete: 'discrete';
223
+ };
@@ -0,0 +1,9 @@
1
+ import { imx } from '@imtbl/generated-clients';
2
+ /**
3
+ * Custom Error class that is returned from the API when a request fails
4
+ */
5
+ export declare class IMXError extends Error {
6
+ readonly code: string;
7
+ readonly details?: string;
8
+ constructor({ code, details, message }: imx.APIError);
9
+ }
@@ -0,0 +1,6 @@
1
+ export * from './signers';
2
+ export * from './tokens';
3
+ export * from './requests';
4
+ export * from './transfers';
5
+ export * from './errors';
6
+ export * from './api';
@@ -0,0 +1,53 @@
1
+ import { imx } from '@imtbl/generated-clients';
2
+ import { TokenAmount, ExchangeTokenAmount } from './tokens';
3
+ /**
4
+ * Parameter required to create an Order
5
+ */
6
+ export interface UnsignedOrderRequest {
7
+ /**
8
+ * The amount of tokens that will be bought for this order
9
+ */
10
+ buy: TokenAmount;
11
+ /**
12
+ * The amount of tokens that will be sold for this order
13
+ */
14
+ sell: TokenAmount;
15
+ /**
16
+ * ExpirationTimestamp in Unix time. Note: will be rounded down to the nearest hour
17
+ */
18
+ expiration_timestamp?: number;
19
+ /**
20
+ * Inclusion of either maker or taker fees
21
+ */
22
+ fees?: Array<imx.FeeEntry>;
23
+ }
24
+ /**
25
+ * Parameter required to create a Transfer
26
+ */
27
+ export type UnsignedTransferRequest = TokenAmount & {
28
+ /**
29
+ * Ethereum address of the receiving user
30
+ */
31
+ receiver: string;
32
+ };
33
+ /**
34
+ * Parameter required to Mint tokens
35
+ */
36
+ export type UnsignedMintRequest = Omit<imx.MintRequest, 'auth_signature'>;
37
+ /**
38
+ * Parameter required to create a Transfer
39
+ */
40
+ export type UnsignedExchangeTransferRequest = ExchangeTokenAmount & {
41
+ /**
42
+ * Ethereum address of the receiving user
43
+ */
44
+ receiver: string;
45
+ /**
46
+ * Exchange transaction ID
47
+ */
48
+ transactionID: string;
49
+ };
50
+ export interface StarkExContractVersion {
51
+ version: string;
52
+ message: string;
53
+ }
@@ -0,0 +1,37 @@
1
+ import { Signer as EthSigner } from 'ethers';
2
+ export type { EthSigner };
3
+ /**
4
+ * An abstraction of a Stark account, which can be used to sign messages and transactions on StarkEx to execute state changing operations
5
+ */
6
+ export interface StarkSigner {
7
+ /**
8
+ * Signs the prefixed-message
9
+ * @params message - this must be a UTF8-message
10
+ * @example "0x1234"
11
+ * @returns the signed prefixed-message
12
+ */
13
+ signMessage(message: string): Promise<string>;
14
+ /**
15
+ * Get the Signer address
16
+ * @returns the Signer's checksum address
17
+ */
18
+ getAddress(): string | Promise<string>;
19
+ /**
20
+ * Get the Y-coordinate of the public key
21
+ * @returns the Y-coordinate of the public key
22
+ */
23
+ getYCoordinate(): Promise<string>;
24
+ }
25
+ /**
26
+ * A pair of Signers
27
+ */
28
+ export interface WalletConnection {
29
+ /**
30
+ * The L1 signer
31
+ */
32
+ ethSigner: EthSigner;
33
+ /**
34
+ * The L2 signer
35
+ */
36
+ starkSigner: StarkSigner;
37
+ }
@@ -0,0 +1,51 @@
1
+ /**
2
+ * An ERC20 token
3
+ */
4
+ export interface ERC20Token {
5
+ type: 'ERC20';
6
+ tokenAddress: string;
7
+ }
8
+ /**
9
+ * An ERC721 token
10
+ */
11
+ export interface ERC721Token {
12
+ type: 'ERC721';
13
+ tokenId: string;
14
+ tokenAddress: string;
15
+ }
16
+ /**
17
+ * An ETH token
18
+ */
19
+ export interface ETHToken {
20
+ type: 'ETH';
21
+ }
22
+ /**
23
+ * An amount of ETH token of unit Wei
24
+ */
25
+ export interface ETHAmount extends ETHToken {
26
+ /**
27
+ * An amount in unit Wei
28
+ */
29
+ amount: string;
30
+ }
31
+ /**
32
+ * The token details and amount of ERC20 token units
33
+ */
34
+ export interface ERC20Amount extends ERC20Token {
35
+ /**
36
+ * An amount in units for the given ERC20 token
37
+ */
38
+ amount: string;
39
+ }
40
+ /**
41
+ * Union type that represents all token types
42
+ */
43
+ export type AnyToken = ETHToken | ERC721Token | ERC20Token;
44
+ /**
45
+ * Union type that represents all token type amounts
46
+ */
47
+ export type TokenAmount = ETHAmount | ERC20Amount | ERC721Token;
48
+ /**
49
+ * Union type that represents exchange token type amounts
50
+ */
51
+ export type ExchangeTokenAmount = ETHAmount | ERC20Amount;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Parameter required to create a batchNftTransfer
3
+ */
4
+ export interface NftTransferDetails {
5
+ /**
6
+ * Ethereum address of the receiving user
7
+ */
8
+ receiver: string;
9
+ /**
10
+ * The token ID
11
+ */
12
+ tokenId: string;
13
+ /**
14
+ * The token contract address
15
+ */
16
+ tokenAddress: string;
17
+ }
@@ -0,0 +1,8 @@
1
+ import { SignableToken } from '../types/api';
2
+ import { TokenAmount } from '../types/tokens';
3
+ /**
4
+ * Helper method to convert token type to a SignableToken type
5
+ * @param token - the token type to convert to a SignableToken type
6
+ * @returns the converted SignableToken
7
+ */
8
+ export declare function convertToSignableToken(token: TokenAmount): SignableToken;
@@ -0,0 +1,16 @@
1
+ import { Signer } from 'ethers';
2
+ import { StarkSigner } from '../../types';
3
+ export declare function signRaw(payload: string, signer: Signer): Promise<string>;
4
+ type IMXAuthorisationHeaders = {
5
+ timestamp: string;
6
+ signature: string;
7
+ };
8
+ export declare function generateIMXAuthorisationHeaders(ethSigner: Signer): Promise<IMXAuthorisationHeaders>;
9
+ export declare function signMessage(message: string, signer: Signer): Promise<{
10
+ message: string;
11
+ ethAddress: string;
12
+ ethSignature: string;
13
+ }>;
14
+ export declare function serializePackedSignature(sig: any, pubY: string): string;
15
+ export declare function signRegisterEthAddress(starkSigner: StarkSigner, ethAddress: string, starkPublicKey: string): Promise<string>;
16
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from './crypto';