@centrifuge/sdk 0.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 (147) hide show
  1. package/LICENSE +165 -0
  2. package/README.md +149 -0
  3. package/dist/Account.d.ts +11 -0
  4. package/dist/Account.d.ts.map +1 -0
  5. package/dist/Account.js +46 -0
  6. package/dist/Account.js.map +1 -0
  7. package/dist/Centrifuge.d.ts +7117 -0
  8. package/dist/Centrifuge.d.ts.map +1 -0
  9. package/dist/Centrifuge.js +464 -0
  10. package/dist/Centrifuge.js.map +1 -0
  11. package/dist/Entity.d.ts +12 -0
  12. package/dist/Entity.d.ts.map +1 -0
  13. package/dist/Entity.js +16 -0
  14. package/dist/Entity.js.map +1 -0
  15. package/dist/Pool.d.ts +27 -0
  16. package/dist/Pool.d.ts.map +1 -0
  17. package/dist/Pool.js +73 -0
  18. package/dist/Pool.js.map +1 -0
  19. package/dist/PoolNetwork.d.ts +82 -0
  20. package/dist/PoolNetwork.d.ts.map +1 -0
  21. package/dist/PoolNetwork.js +235 -0
  22. package/dist/PoolNetwork.js.map +1 -0
  23. package/dist/Reports/Processor.d.ts +38 -0
  24. package/dist/Reports/Processor.d.ts.map +1 -0
  25. package/dist/Reports/Processor.js +167 -0
  26. package/dist/Reports/Processor.js.map +1 -0
  27. package/dist/Reports/index.d.ts +24 -0
  28. package/dist/Reports/index.d.ts.map +1 -0
  29. package/dist/Reports/index.js +68 -0
  30. package/dist/Reports/index.js.map +1 -0
  31. package/dist/Reports/types.d.ts +102 -0
  32. package/dist/Reports/types.d.ts.map +1 -0
  33. package/dist/Reports/types.js +2 -0
  34. package/dist/Reports/types.js.map +1 -0
  35. package/dist/Vault.d.ts +96 -0
  36. package/dist/Vault.d.ts.map +1 -0
  37. package/dist/Vault.js +330 -0
  38. package/dist/Vault.js.map +1 -0
  39. package/dist/abi/CentrifugeRouter.abi.json +43 -0
  40. package/dist/abi/Currency.abi.json +14 -0
  41. package/dist/abi/Gateway.abi.json +1 -0
  42. package/dist/abi/InvestmentManager.abi.json +4 -0
  43. package/dist/abi/LiquidityPool.abi.json +79 -0
  44. package/dist/abi/PoolManager.abi.json +55 -0
  45. package/dist/abi/RestrictionManager.abi.json +22 -0
  46. package/dist/abi/Router.abi.json +1 -0
  47. package/dist/abi/index.d.ts +11 -0
  48. package/dist/abi/index.d.ts.map +1 -0
  49. package/dist/abi/index.js +20 -0
  50. package/dist/abi/index.js.map +1 -0
  51. package/dist/config/chains.d.ts +1575 -0
  52. package/dist/config/chains.d.ts.map +1 -0
  53. package/dist/config/chains.js +3 -0
  54. package/dist/config/chains.js.map +1 -0
  55. package/dist/config/lp.d.ts +17 -0
  56. package/dist/config/lp.d.ts.map +1 -0
  57. package/dist/config/lp.js +35 -0
  58. package/dist/config/lp.js.map +1 -0
  59. package/dist/constants.d.ts +3 -0
  60. package/dist/constants.d.ts.map +1 -0
  61. package/dist/constants.js +3 -0
  62. package/dist/constants.js.map +1 -0
  63. package/dist/index.d.ts +9 -0
  64. package/dist/index.d.ts.map +1 -0
  65. package/dist/index.js +9 -0
  66. package/dist/index.js.map +1 -0
  67. package/dist/queries/poolFeeSnapshots.d.ts +48 -0
  68. package/dist/queries/poolFeeSnapshots.d.ts.map +1 -0
  69. package/dist/queries/poolFeeSnapshots.js +62 -0
  70. package/dist/queries/poolFeeSnapshots.js.map +1 -0
  71. package/dist/queries/poolSnapshots.d.ts +73 -0
  72. package/dist/queries/poolSnapshots.d.ts.map +1 -0
  73. package/dist/queries/poolSnapshots.js +106 -0
  74. package/dist/queries/poolSnapshots.js.map +1 -0
  75. package/dist/queries/trancheSnapshots.d.ts +70 -0
  76. package/dist/queries/trancheSnapshots.d.ts.map +1 -0
  77. package/dist/queries/trancheSnapshots.js +76 -0
  78. package/dist/queries/trancheSnapshots.js.map +1 -0
  79. package/dist/tests/mocks/mockPoolFeeSnapshot.d.ts +3 -0
  80. package/dist/tests/mocks/mockPoolFeeSnapshot.d.ts.map +1 -0
  81. package/dist/tests/mocks/mockPoolFeeSnapshot.js +68 -0
  82. package/dist/tests/mocks/mockPoolFeeSnapshot.js.map +1 -0
  83. package/dist/tests/mocks/mockPoolMetadata.d.ts +3 -0
  84. package/dist/tests/mocks/mockPoolMetadata.d.ts.map +1 -0
  85. package/dist/tests/mocks/mockPoolMetadata.js +118 -0
  86. package/dist/tests/mocks/mockPoolMetadata.js.map +1 -0
  87. package/dist/tests/mocks/mockPoolSnapshots.d.ts +3 -0
  88. package/dist/tests/mocks/mockPoolSnapshots.d.ts.map +1 -0
  89. package/dist/tests/mocks/mockPoolSnapshots.js +64 -0
  90. package/dist/tests/mocks/mockPoolSnapshots.js.map +1 -0
  91. package/dist/tests/mocks/mockTrancheSnapshots.d.ts +3 -0
  92. package/dist/tests/mocks/mockTrancheSnapshots.d.ts.map +1 -0
  93. package/dist/tests/mocks/mockTrancheSnapshots.js +112 -0
  94. package/dist/tests/mocks/mockTrancheSnapshots.js.map +1 -0
  95. package/dist/tests/setup.d.ts +16 -0
  96. package/dist/tests/setup.d.ts.map +1 -0
  97. package/dist/tests/setup.js +41 -0
  98. package/dist/tests/setup.js.map +1 -0
  99. package/dist/tests/tenderly.d.ts +76 -0
  100. package/dist/tests/tenderly.d.ts.map +1 -0
  101. package/dist/tests/tenderly.js +219 -0
  102. package/dist/tests/tenderly.js.map +1 -0
  103. package/dist/types/index.d.ts +2 -0
  104. package/dist/types/index.d.ts.map +1 -0
  105. package/dist/types/index.js +2 -0
  106. package/dist/types/index.js.map +1 -0
  107. package/dist/types/poolMetadata.d.ts +92 -0
  108. package/dist/types/poolMetadata.d.ts.map +1 -0
  109. package/dist/types/poolMetadata.js +2 -0
  110. package/dist/types/poolMetadata.js.map +1 -0
  111. package/dist/types/query.d.ts +11 -0
  112. package/dist/types/query.d.ts.map +1 -0
  113. package/dist/types/query.js +2 -0
  114. package/dist/types/query.js.map +1 -0
  115. package/dist/types/transaction.d.ts +47 -0
  116. package/dist/types/transaction.d.ts.map +1 -0
  117. package/dist/types/transaction.js +2 -0
  118. package/dist/types/transaction.js.map +1 -0
  119. package/dist/utils/BigInt.d.ts +80 -0
  120. package/dist/utils/BigInt.d.ts.map +1 -0
  121. package/dist/utils/BigInt.js +215 -0
  122. package/dist/utils/BigInt.js.map +1 -0
  123. package/dist/utils/date.d.ts +17 -0
  124. package/dist/utils/date.d.ts.map +1 -0
  125. package/dist/utils/date.js +36 -0
  126. package/dist/utils/date.js.map +1 -0
  127. package/dist/utils/decimal.d.ts +6 -0
  128. package/dist/utils/decimal.d.ts.map +1 -0
  129. package/dist/utils/decimal.js +13 -0
  130. package/dist/utils/decimal.js.map +1 -0
  131. package/dist/utils/pinToApi.d.ts +2 -0
  132. package/dist/utils/pinToApi.d.ts.map +1 -0
  133. package/dist/utils/pinToApi.js +10 -0
  134. package/dist/utils/pinToApi.js.map +1 -0
  135. package/dist/utils/query.d.ts +2 -0
  136. package/dist/utils/query.d.ts.map +1 -0
  137. package/dist/utils/query.js +37 -0
  138. package/dist/utils/query.js.map +1 -0
  139. package/dist/utils/rx.d.ts +19 -0
  140. package/dist/utils/rx.d.ts.map +1 -0
  141. package/dist/utils/rx.js +45 -0
  142. package/dist/utils/rx.js.map +1 -0
  143. package/dist/utils/transaction.d.ts +14 -0
  144. package/dist/utils/transaction.d.ts.map +1 -0
  145. package/dist/utils/transaction.js +33 -0
  146. package/dist/utils/transaction.js.map +1 -0
  147. package/package.json +72 -0
package/LICENSE ADDED
@@ -0,0 +1,165 @@
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2019 Centrifuge GmbH <https://centrifuge.io/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+
9
+ This version of the GNU Lesser General Public License incorporates
10
+ the terms and conditions of version 3 of the GNU General Public
11
+ License, supplemented by the additional permissions listed below.
12
+
13
+ 0. Additional Definitions.
14
+
15
+ As used herein, "this License" refers to version 3 of the GNU Lesser
16
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
+ General Public License.
18
+
19
+ "The Library" refers to a covered work governed by this License,
20
+ other than an Application or a Combined Work as defined below.
21
+
22
+ An "Application" is any work that makes use of an interface provided
23
+ by the Library, but which is not otherwise based on the Library.
24
+ Defining a subclass of a class defined by the Library is deemed a mode
25
+ of using an interface provided by the Library.
26
+
27
+ A "Combined Work" is a work produced by combining or linking an
28
+ Application with the Library. The particular version of the Library
29
+ with which the Combined Work was made is also called the "Linked
30
+ Version".
31
+
32
+ The "Minimal Corresponding Source" for a Combined Work means the
33
+ Corresponding Source for the Combined Work, excluding any source code
34
+ for portions of the Combined Work that, considered in isolation, are
35
+ based on the Application, and not on the Linked Version.
36
+
37
+ The "Corresponding Application Code" for a Combined Work means the
38
+ object code and/or source code for the Application, including any data
39
+ and utility programs needed for reproducing the Combined Work from the
40
+ Application, but excluding the System Libraries of the Combined Work.
41
+
42
+ 1. Exception to Section 3 of the GNU GPL.
43
+
44
+ You may convey a covered work under sections 3 and 4 of this License
45
+ without being bound by section 3 of the GNU GPL.
46
+
47
+ 2. Conveying Modified Versions.
48
+
49
+ If you modify a copy of the Library, and, in your modifications, a
50
+ facility refers to a function or data to be supplied by an Application
51
+ that uses the facility (other than as an argument passed when the
52
+ facility is invoked), then you may convey a copy of the modified
53
+ version:
54
+
55
+ a) under this License, provided that you make a good faith effort to
56
+ ensure that, in the event an Application does not supply the
57
+ function or data, the facility still operates, and performs
58
+ whatever part of its purpose remains meaningful, or
59
+
60
+ b) under the GNU GPL, with none of the additional permissions of
61
+ this License applicable to that copy.
62
+
63
+ 3. Object Code Incorporating Material from Library Header Files.
64
+
65
+ The object code form of an Application may incorporate material from
66
+ a header file that is part of the Library. You may convey such object
67
+ code under terms of your choice, provided that, if the incorporated
68
+ material is not limited to numerical parameters, data structure
69
+ layouts and accessors, or small macros, inline functions and templates
70
+ (ten or fewer lines in length), you do both of the following:
71
+
72
+ a) Give prominent notice with each copy of the object code that the
73
+ Library is used in it and that the Library and its use are
74
+ covered by this License.
75
+
76
+ b) Accompany the object code with a copy of the GNU GPL and this license
77
+ document.
78
+
79
+ 4. Combined Works.
80
+
81
+ You may convey a Combined Work under terms of your choice that,
82
+ taken together, effectively do not restrict modification of the
83
+ portions of the Library contained in the Combined Work and reverse
84
+ engineering for debugging such modifications, if you also do each of
85
+ the following:
86
+
87
+ a) Give prominent notice with each copy of the Combined Work that
88
+ the Library is used in it and that the Library and its use are
89
+ covered by this License.
90
+
91
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
+ document.
93
+
94
+ c) For a Combined Work that displays copyright notices during
95
+ execution, include the copyright notice for the Library among
96
+ these notices, as well as a reference directing the user to the
97
+ copies of the GNU GPL and this license document.
98
+
99
+ d) Do one of the following:
100
+
101
+ 0) Convey the Minimal Corresponding Source under the terms of this
102
+ License, and the Corresponding Application Code in a form
103
+ suitable for, and under terms that permit, the user to
104
+ recombine or relink the Application with a modified version of
105
+ the Linked Version to produce a modified Combined Work, in the
106
+ manner specified by section 6 of the GNU GPL for conveying
107
+ Corresponding Source.
108
+
109
+ 1) Use a suitable shared library mechanism for linking with the
110
+ Library. A suitable mechanism is one that (a) uses at run time
111
+ a copy of the Library already present on the user's computer
112
+ system, and (b) will operate properly with a modified version
113
+ of the Library that is interface-compatible with the Linked
114
+ Version.
115
+
116
+ e) Provide Installation Information, but only if you would otherwise
117
+ be required to provide such information under section 6 of the
118
+ GNU GPL, and only to the extent that such information is
119
+ necessary to install and execute a modified version of the
120
+ Combined Work produced by recombining or relinking the
121
+ Application with a modified version of the Linked Version. (If
122
+ you use option 4d0, the Installation Information must accompany
123
+ the Minimal Corresponding Source and Corresponding Application
124
+ Code. If you use option 4d1, you must provide the Installation
125
+ Information in the manner specified by section 6 of the GNU GPL
126
+ for conveying Corresponding Source.)
127
+
128
+ 5. Combined Libraries.
129
+
130
+ You may place library facilities that are a work based on the
131
+ Library side by side in a single library together with other library
132
+ facilities that are not Applications and are not covered by this
133
+ License, and convey such a combined library under terms of your
134
+ choice, if you do both of the following:
135
+
136
+ a) Accompany the combined library with a copy of the same work based
137
+ on the Library, uncombined with any other library facilities,
138
+ conveyed under the terms of this License.
139
+
140
+ b) Give prominent notice with the combined library that part of it
141
+ is a work based on the Library, and explaining where to find the
142
+ accompanying uncombined form of the same work.
143
+
144
+ 6. Revised Versions of the GNU Lesser General Public License.
145
+
146
+ The Free Software Foundation may publish revised and/or new versions
147
+ of the GNU Lesser General Public License from time to time. Such new
148
+ versions will be similar in spirit to the present version, but may
149
+ differ in detail to address new problems or concerns.
150
+
151
+ Each version is given a distinguishing version number. If the
152
+ Library as you received it specifies that a certain numbered version
153
+ of the GNU Lesser General Public License "or any later version"
154
+ applies to it, you have the option of following the terms and
155
+ conditions either of that published version or of any later version
156
+ published by the Free Software Foundation. If the Library as you
157
+ received it does not specify a version number of the GNU Lesser
158
+ General Public License, you may choose any version of the GNU Lesser
159
+ General Public License ever published by the Free Software Foundation.
160
+
161
+ If the Library as you received it specifies that a proxy can decide
162
+ whether future versions of the GNU Lesser General Public License shall
163
+ apply, that proxy's public statement of acceptance of any version is
164
+ permanent authorization for you to choose that version for the
165
+ Library.
package/README.md ADDED
@@ -0,0 +1,149 @@
1
+ [![Codecov](https://codecov.io/gh/centrifuge/sdk/graph/badge.svg?token=Q2yU8QfefP)](https://codecov.io/gh/centrifuge/sdk)
2
+ [![Build CI status](https://github.com/centrifuge/sdk/actions/workflows/build-test-report.yml/badge.svg)](https://github.com/centrifuge/sdk/actions/workflows/build-test-report.yml)
3
+
4
+ <!-- [![npm version](https://badge.fury.io/js/@centrifuge%2Fsdk.svg)](https://www.npmjs.com/package/@centrifuge/sdk) -->
5
+
6
+ [![Latest Release](https://img.shields.io/github/v/release/centrifuge/sdk?sort=semver)](https://github.com/centrifuge/sdk/releases/latest)
7
+
8
+ # Centrifuge JavaScript SDK
9
+
10
+ CentrifugeSDK provides a JavaScript client to interact with the Centrifuge ecosystem. It provides a comprehensive interface to easily create and manage pools, nfts, loans and metadata.
11
+
12
+ ## Installation
13
+
14
+ CentrifugeSDK uses [Viem](https://viem.sh/) under the hood. It's necessary to install it alongside the SDK.
15
+
16
+ ```bash
17
+ npm install --save @centrifuge/sdk viem
18
+ ```
19
+
20
+ ## Init and config
21
+
22
+ Create an instance and pass optional configuration
23
+
24
+ ```js
25
+ import Centrifuge from '@centrifuge/sdk'
26
+
27
+ const centrifuge = new Centrifuge()
28
+ ```
29
+
30
+ The following config options can be passed on initilization of CentrifugeSDK:
31
+
32
+ - `environment: 'mainnet' | 'demo' | 'dev'`
33
+ - Optional
34
+ - Default value: `mainnet`
35
+ - `rpcUrls: Record<number, string>`
36
+ - Optional
37
+ - A object mapping chain ids to RPC URLs
38
+
39
+ ## Queries
40
+
41
+ Queries return Promise-like [Observables](https://rxjs.dev/guide/observable). They can be either awaited to get a single value, or subscribed to to get fresh data whenever on-chain data changes.
42
+
43
+ ```js
44
+ try {
45
+ const pool = await centrifuge.pools()
46
+ } catch (error) {
47
+ console.error(error)
48
+ }
49
+ ```
50
+
51
+ ```js
52
+ const subscription = centrifuge.pools().subscribe(
53
+ (pool) => console.log(pool),
54
+ (error) => console.error(error)
55
+ )
56
+ subscription.unsubscribe()
57
+ ```
58
+
59
+ The returned results are either immutable values, or entities that can be further queried.
60
+
61
+ ## Transactions
62
+
63
+ To perform transactions, you need to set a signer on the `centrifuge` instance.
64
+
65
+ ```js
66
+ centrifuge.setSigner(signer)
67
+ ```
68
+
69
+ `signer` can be a [EIP1193](https://eips.ethereum.org/EIPS/eip-1193)-compatible provider or a Viem [LocalAccount](https://viem.sh/docs/accounts/local)
70
+
71
+ With this you can call transaction methods. Similar to queries they can be awaited to get their final result, or subscribed to get get status updates.
72
+
73
+ ```js
74
+ const pool = await centrifuge.pool('1')
75
+ try {
76
+ const status = await pool.closeEpoch()
77
+ console.log(status)
78
+ } catch (error) {
79
+ console.error(error)
80
+ }
81
+ ```
82
+
83
+ ```js
84
+ const pool = await centrifuge.pool('1')
85
+ const subscription = pool.closeEpoch().subscribe(
86
+ (status) => console.log(pool),
87
+ (error) => console.error(error),
88
+ () => console.log('complete')
89
+ )
90
+ ```
91
+
92
+ ## Reports
93
+
94
+ Reports are generated from data from the Centrifuge API and are combined with pool metadata to provide a comprehensive view of the pool's financials.
95
+
96
+ Available reports are:
97
+
98
+ - `balanceSheet`
99
+ - `profitAndLoss`
100
+ - `cashflow`
101
+
102
+ ```ts
103
+ const pool = await centrifuge.pool('<pool-id>')
104
+ const balanceSheetReport = await pool.reports.balanceSheet()
105
+ ```
106
+
107
+ ### Report Filtering
108
+
109
+ Reports can be filtered using the `ReportFilter` type.
110
+
111
+ ```ts
112
+ type GroupBy = 'day' | 'month' | 'quarter' | 'year'
113
+
114
+ const balanceSheetReport = await pool.reports.balanceSheet({
115
+ from: '2024-01-01',
116
+ to: '2024-01-31',
117
+ groupBy: 'month',
118
+ })
119
+ ```
120
+
121
+ ## Developer Docs
122
+
123
+ ### Dev server
124
+
125
+ ```bash
126
+ yarn dev
127
+ ```
128
+
129
+ ### Build
130
+
131
+ ```bash
132
+ yarn build
133
+ ```
134
+
135
+ ### Test
136
+
137
+ ```bash
138
+ yarn test
139
+ yarn test:single <path-to-file>
140
+ yarn test:simple:single <path-to-file> # without setup file, faster and without tenderly setup
141
+ ```
142
+
143
+ ### PR Naming Convention
144
+
145
+ PR naming should follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification.
146
+
147
+ ### Semantic Versioning
148
+
149
+ PRs should be marked with the appropriate type: `major`, `minor`, `patch`, `no-release`.
@@ -0,0 +1,11 @@
1
+ import type { Centrifuge } from './Centrifuge.js';
2
+ import { Entity } from './Entity.js';
3
+ import type { HexString } from './types/index.js';
4
+ export declare class Account extends Entity {
5
+ accountId: HexString;
6
+ chainId: number;
7
+ constructor(_root: Centrifuge, accountId: HexString, chainId: number);
8
+ balances(): import("./index.js").Query<bigint>;
9
+ transfer(to: string, amount: bigint): import("./index.js").Transaction;
10
+ }
11
+ //# sourceMappingURL=Account.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Account.d.ts","sourceRoot":"","sources":["../src/Account.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAKjD,qBAAa,OAAQ,SAAQ,MAAM;IAGxB,SAAS,EAAE,SAAS;IACpB,OAAO,EAAE,MAAM;gBAFtB,KAAK,EAAE,UAAU,EACV,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,MAAM;IAKxB,QAAQ;IA8BR,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAapC"}
@@ -0,0 +1,46 @@
1
+ import { defer } from 'rxjs';
2
+ import { ABI } from './abi/index.js';
3
+ import { Entity } from './Entity.js';
4
+ import { repeatOnEvents } from './utils/rx.js';
5
+ const tUSD = '0x8503b4452Bf6238cC76CdbEE223b46d7196b1c93';
6
+ export class Account extends Entity {
7
+ accountId;
8
+ chainId;
9
+ constructor(_root, accountId, chainId) {
10
+ super(_root, ['account', accountId, chainId]);
11
+ this.accountId = accountId;
12
+ this.chainId = chainId;
13
+ }
14
+ balances() {
15
+ return this._query(['balances'], () => {
16
+ return defer(async () => {
17
+ const client = this._root.getClient(this.chainId);
18
+ const balance = (await client.readContract({
19
+ address: tUSD,
20
+ abi: ABI.Currency,
21
+ functionName: 'balanceOf',
22
+ args: [this.accountId],
23
+ }));
24
+ return balance;
25
+ }).pipe(repeatOnEvents(this._root, {
26
+ address: tUSD,
27
+ abi: ABI.Currency,
28
+ eventName: 'Transfer',
29
+ filter: (events) => {
30
+ return events.some((event) => {
31
+ return event.args.from === this.accountId || event.args.to === this.accountId;
32
+ });
33
+ },
34
+ }, this.chainId));
35
+ });
36
+ }
37
+ transfer(to, amount) {
38
+ return this._transact('Transfer', ({ walletClient }) => walletClient.writeContract({
39
+ address: tUSD,
40
+ abi: ABI.Currency,
41
+ functionName: 'transfer',
42
+ args: [to, amount],
43
+ }), this.chainId);
44
+ }
45
+ }
46
+ //# sourceMappingURL=Account.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Account.js","sourceRoot":"","sources":["../src/Account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAA;AAC5B,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AAEpC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE9C,MAAM,IAAI,GAAG,4CAA4C,CAAA;AAEzD,MAAM,OAAO,OAAQ,SAAQ,MAAM;IAGxB;IACA;IAHT,YACE,KAAiB,EACV,SAAoB,EACpB,OAAe;QAEtB,KAAK,CAAC,KAAK,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAA;QAHtC,cAAS,GAAT,SAAS,CAAW;QACpB,YAAO,GAAP,OAAO,CAAQ;IAGxB,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,EAAE,GAAG,EAAE;YACpC,OAAO,KAAK,CAAC,KAAK,IAAI,EAAE;gBACtB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAE,CAAA;gBAClD,MAAM,OAAO,GAAG,CAAC,MAAM,MAAM,CAAC,YAAY,CAAC;oBACzC,OAAO,EAAE,IAAI;oBACb,GAAG,EAAE,GAAG,CAAC,QAAQ;oBACjB,YAAY,EAAE,WAAW;oBACzB,IAAI,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC;iBACvB,CAAC,CAAW,CAAA;gBACb,OAAO,OAAO,CAAA;YAChB,CAAC,CAAC,CAAC,IAAI,CACL,cAAc,CACZ,IAAI,CAAC,KAAK,EACV;gBACE,OAAO,EAAE,IAAI;gBACb,GAAG,EAAE,GAAG,CAAC,QAAQ;gBACjB,SAAS,EAAE,UAAU;gBACrB,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE;oBACjB,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;wBAC3B,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,SAAS,CAAA;oBAC/E,CAAC,CAAC,CAAA;gBACJ,CAAC;aACF,EACD,IAAI,CAAC,OAAO,CACb,CACF,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,QAAQ,CAAC,EAAU,EAAE,MAAc;QACjC,OAAO,IAAI,CAAC,SAAS,CACnB,UAAU,EACV,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CACnB,YAAY,CAAC,aAAa,CAAC;YACzB,OAAO,EAAE,IAAI;YACb,GAAG,EAAE,GAAG,CAAC,QAAQ;YACjB,YAAY,EAAE,UAAU;YACxB,IAAI,EAAE,CAAC,EAAE,EAAE,MAAM,CAAC;SACnB,CAAC,EACJ,IAAI,CAAC,OAAO,CACb,CAAA;IACH,CAAC;CACF"}