tangany 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.reek.yml +4 -0
- data/.rspec +3 -0
- data/.rubycritic.yml +7 -0
- data/.sasori/Dockerfile +51 -0
- data/.simplecov +13 -0
- data/CHANGELOG.md +5 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/Gemfile +20 -0
- data/Gemfile.lock +210 -0
- data/LICENSE.txt +21 -0
- data/README.md +410 -0
- data/Rakefile +133 -0
- data/bin/console +22 -0
- data/bin/setup +8 -0
- data/bin/test-live +170 -0
- data/lib/config/chains.json +22 -0
- data/lib/tangany/application_contract.rb +19 -0
- data/lib/tangany/collection.rb +13 -0
- data/lib/tangany/config.rb +24 -0
- data/lib/tangany/custody/client.rb +37 -0
- data/lib/tangany/custody/collection.rb +17 -0
- data/lib/tangany/custody/contracts/wallets/create.rb +23 -0
- data/lib/tangany/custody/contracts/wallets/list.rb +37 -0
- data/lib/tangany/custody/contracts/wallets/update.rb +21 -0
- data/lib/tangany/custody/contracts/wallets.rb +3 -0
- data/lib/tangany/custody/contracts.rb +1 -0
- data/lib/tangany/custody/objects/wallet.rb +17 -0
- data/lib/tangany/custody/objects/wallet_recovery.rb +10 -0
- data/lib/tangany/custody/objects/wallet_status.rb +10 -0
- data/lib/tangany/custody/objects.rb +3 -0
- data/lib/tangany/custody/resource.rb +29 -0
- data/lib/tangany/custody/resources/wallet_statuses_resource.rb +9 -0
- data/lib/tangany/custody/resources/wallets_resource.rb +34 -0
- data/lib/tangany/custody/resources.rb +2 -0
- data/lib/tangany/custody.rb +7 -0
- data/lib/tangany/customers/application_contract.rb +6 -0
- data/lib/tangany/customers/client.rb +37 -0
- data/lib/tangany/customers/collection.rb +16 -0
- data/lib/tangany/customers/contracts/customers/create.rb +17 -0
- data/lib/tangany/customers/contracts/customers/create_schemas/contract.rb +21 -0
- data/lib/tangany/customers/contracts/customers/create_schemas/customer.rb +34 -0
- data/lib/tangany/customers/contracts/customers/list.rb +17 -0
- data/lib/tangany/customers/contracts/customers/update.rb +14 -0
- data/lib/tangany/customers/contracts/customers/update_schemas/customer.rb +15 -0
- data/lib/tangany/customers/contracts/customers.rb +3 -0
- data/lib/tangany/customers/contracts/natural_persons/create.rb +23 -0
- data/lib/tangany/customers/contracts/natural_persons/create_schemas/address.rb +23 -0
- data/lib/tangany/customers/contracts/natural_persons/create_schemas/document.rb +25 -0
- data/lib/tangany/customers/contracts/natural_persons/create_schemas/kyc.rb +24 -0
- data/lib/tangany/customers/contracts/natural_persons/create_schemas/natural_person.rb +44 -0
- data/lib/tangany/customers/contracts/natural_persons/create_schemas/pep.rb +22 -0
- data/lib/tangany/customers/contracts/natural_persons/create_schemas/sanctions.rb +22 -0
- data/lib/tangany/customers/contracts/natural_persons/list.rb +17 -0
- data/lib/tangany/customers/contracts/natural_persons/update.rb +14 -0
- data/lib/tangany/customers/contracts/natural_persons/update_schemas/natural_person.rb +15 -0
- data/lib/tangany/customers/contracts/natural_persons.rb +3 -0
- data/lib/tangany/customers/contracts/wallet_links/create.rb +28 -0
- data/lib/tangany/customers/contracts/wallet_links/list.rb +17 -0
- data/lib/tangany/customers/contracts/wallet_links.rb +2 -0
- data/lib/tangany/customers/contracts.rb +3 -0
- data/lib/tangany/customers/objects/address.rb +11 -0
- data/lib/tangany/customers/objects/contract.rb +13 -0
- data/lib/tangany/customers/objects/customer.rb +14 -0
- data/lib/tangany/customers/objects/document.rb +17 -0
- data/lib/tangany/customers/objects/kyc.rb +16 -0
- data/lib/tangany/customers/objects/natural_person.rb +30 -0
- data/lib/tangany/customers/objects/pep.rb +12 -0
- data/lib/tangany/customers/objects/sanctions.rb +12 -0
- data/lib/tangany/customers/objects/wallet_link.rb +14 -0
- data/lib/tangany/customers/objects.rb +5 -0
- data/lib/tangany/customers/resource.rb +11 -0
- data/lib/tangany/customers/resources/customers_resource.rb +27 -0
- data/lib/tangany/customers/resources/natural_persons_resource.rb +26 -0
- data/lib/tangany/customers/resources/wallet_links_resource.rb +37 -0
- data/lib/tangany/customers/resources.rb +3 -0
- data/lib/tangany/customers.rb +8 -0
- data/lib/tangany/error.rb +34 -0
- data/lib/tangany/json_patch.rb +65 -0
- data/lib/tangany/object.rb +43 -0
- data/lib/tangany/operation.rb +10 -0
- data/lib/tangany/resource.rb +80 -0
- data/lib/tangany/types.rb +7 -0
- data/lib/tangany/version.rb +3 -0
- data/lib/tangany.rb +47 -0
- data/sig/tangany.rbs +4 -0
- metadata +217 -0
data/README.md
ADDED
@@ -0,0 +1,410 @@
|
|
1
|
+
# Tangany Ruby Library
|
2
|
+
|
3
|
+
[![CI](https://github.com/bitbond/tangany-ruby/actions/workflows/ci.yml/badge.svg)](https://github.com/bitbond/tangany-ruby/actions/workflows/ci.yml)
|
4
|
+
|
5
|
+
The Tangany Ruby library provides convenient access to the Tangany APIs from applications written in the Ruby language. It includes a pre-defined set of classes for API resources that initialize themselves dynamically from API responses.
|
6
|
+
|
7
|
+
---
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
You don't need this source code unless you want to modify the gem. If you just want to use the package, just run:
|
12
|
+
|
13
|
+
```sh
|
14
|
+
gem install tangany
|
15
|
+
```
|
16
|
+
|
17
|
+
If you want to build the gem from source:
|
18
|
+
|
19
|
+
```sh
|
20
|
+
gem build tangany.gemspec
|
21
|
+
```
|
22
|
+
|
23
|
+
### Requirements
|
24
|
+
|
25
|
+
- Ruby 2.7.5+.
|
26
|
+
|
27
|
+
### Bundler
|
28
|
+
|
29
|
+
If you are installing via bundler, you should be sure to use the https rubygems source in your Gemfile, as any gems fetched over http could potentially be compromised in transit and alter the code of gems fetched securely over https:
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
source "https://rubygems.org"
|
33
|
+
|
34
|
+
gem "tangany"
|
35
|
+
```
|
36
|
+
|
37
|
+
---
|
38
|
+
|
39
|
+
## Usage
|
40
|
+
|
41
|
+
The library needs to be configured with your account's secrets.
|
42
|
+
|
43
|
+
```ruby
|
44
|
+
require "tangany"
|
45
|
+
Tangany.client_id = "..."
|
46
|
+
Tangany.client_secret = "..."
|
47
|
+
Tangany.environment = "..." # mainnet or testnet
|
48
|
+
Tangany.subscription = "..."
|
49
|
+
Tangany.vault_url = "..."
|
50
|
+
|
51
|
+
customers_client = Tangany::Customers::Client.new
|
52
|
+
custody_client = Tangany::Custody::Client.new
|
53
|
+
```
|
54
|
+
|
55
|
+
---
|
56
|
+
|
57
|
+
## Customers API
|
58
|
+
|
59
|
+
### Natural persons
|
60
|
+
|
61
|
+
#### List natural_persons
|
62
|
+
|
63
|
+
```ruby
|
64
|
+
collection = customers_client.natural_persons.list(limit: 21, sort: "asc", pageToken: "foo")
|
65
|
+
```
|
66
|
+
|
67
|
+
#### Create natural person
|
68
|
+
|
69
|
+
```ruby
|
70
|
+
natural_person = customers_client.natural_persons.create(
|
71
|
+
id: "ent_123456789",
|
72
|
+
title: "Mr",
|
73
|
+
firstName: "John",
|
74
|
+
lastName: "Doe",
|
75
|
+
gender: "M",
|
76
|
+
birthDate: "1980-01-01",
|
77
|
+
birthPlace: "Milano",
|
78
|
+
birthCountry: "IT",
|
79
|
+
birthName: "John",
|
80
|
+
nationality: "IT",
|
81
|
+
address: {
|
82
|
+
country: "IT",
|
83
|
+
city: "Milano",
|
84
|
+
postcode: "20100",
|
85
|
+
streetName: "Via Roma",
|
86
|
+
streetNumber: "1",
|
87
|
+
},
|
88
|
+
email: "john.doe@example.com",
|
89
|
+
kyc: {
|
90
|
+
id: "kyc_123456789",
|
91
|
+
date: "2021-01-01T00:00:00.000Z",
|
92
|
+
method: "video_ident",
|
93
|
+
document: {
|
94
|
+
country: "IT",
|
95
|
+
nationality: "IT",
|
96
|
+
number: "123456789",
|
97
|
+
issuedBy: "Milano",
|
98
|
+
issueDate: "2015-01-01",
|
99
|
+
validUntil: "2025-01-01",
|
100
|
+
type: "id_card"
|
101
|
+
}
|
102
|
+
},
|
103
|
+
pep: {
|
104
|
+
checkDate: "2021-01-01T00:00:00.000Z",
|
105
|
+
isExposed: true,
|
106
|
+
source: "PEP source",
|
107
|
+
reason: "PEP reason"
|
108
|
+
},
|
109
|
+
sanctions: {
|
110
|
+
checkDate: "2021-01-01T00:00:00.000Z",
|
111
|
+
isExposed: true,
|
112
|
+
source: "Sanctions source",
|
113
|
+
reason: "Sanctions reason"
|
114
|
+
}
|
115
|
+
)
|
116
|
+
```
|
117
|
+
|
118
|
+
#### Retrieve natural person
|
119
|
+
|
120
|
+
```ruby
|
121
|
+
customer = customers_client.natural_persons.retrieve("ent_123456789")
|
122
|
+
```
|
123
|
+
|
124
|
+
#### Update natural person
|
125
|
+
|
126
|
+
```ruby
|
127
|
+
natural_person = customers_client.natural_persons.update(
|
128
|
+
"ent_123456789",
|
129
|
+
title: "Mr",
|
130
|
+
firstName: "John",
|
131
|
+
lastName: "Doe",
|
132
|
+
gender: "M",
|
133
|
+
birthDate: "1980-01-01",
|
134
|
+
birthPlace: "Milano",
|
135
|
+
birthCountry: "IT",
|
136
|
+
birthName: "John",
|
137
|
+
nationality: "IT",
|
138
|
+
address: {
|
139
|
+
country: "IT",
|
140
|
+
city: "Milano",
|
141
|
+
postcode: "20100",
|
142
|
+
streetName: "Via Roma",
|
143
|
+
streetNumber: "1",
|
144
|
+
},
|
145
|
+
email: "john.doe@example.com",
|
146
|
+
kyc: {
|
147
|
+
id: "kyc_123456789",
|
148
|
+
date: "2021-01-01T00:00:00.000Z",
|
149
|
+
method: "video_ident",
|
150
|
+
document: {
|
151
|
+
country: "IT",
|
152
|
+
nationality: "IT",
|
153
|
+
number: "123456789",
|
154
|
+
issuedBy: "Milano",
|
155
|
+
issueDate: "2015-01-01",
|
156
|
+
validUntil: "2025-01-01",
|
157
|
+
type: "id_card"
|
158
|
+
}
|
159
|
+
},
|
160
|
+
pep: {
|
161
|
+
checkDate: "2021-01-01T00:00:00.000Z",
|
162
|
+
isExposed: true,
|
163
|
+
source: "PEP source",
|
164
|
+
reason: "PEP reason"
|
165
|
+
},
|
166
|
+
sanctions: {
|
167
|
+
checkDate: "2021-01-01T00:00:00.000Z",
|
168
|
+
isExposed: true,
|
169
|
+
source: "Sanctions source",
|
170
|
+
reason: "Sanctions reason"
|
171
|
+
}
|
172
|
+
)
|
173
|
+
```
|
174
|
+
|
175
|
+
#### Delete natural person
|
176
|
+
|
177
|
+
```ruby
|
178
|
+
response = customers_client.natural_persons.delete("ent_123456789")
|
179
|
+
```
|
180
|
+
|
181
|
+
### Customers
|
182
|
+
|
183
|
+
#### List customers
|
184
|
+
|
185
|
+
```ruby
|
186
|
+
collection = customers_client.customers.list(limit: 21, sort: "asc", pageToken: "foo")
|
187
|
+
```
|
188
|
+
|
189
|
+
#### Create customer
|
190
|
+
|
191
|
+
```ruby
|
192
|
+
customer = customers_client.customers.create(
|
193
|
+
id: "cus_123456789",
|
194
|
+
owner: {
|
195
|
+
entityId: "ent_123456789",
|
196
|
+
},
|
197
|
+
authorized: {
|
198
|
+
entityId: "ent_123456789",
|
199
|
+
},
|
200
|
+
contracts: [{
|
201
|
+
type: "standard",
|
202
|
+
signedDate: "2020-09-04",
|
203
|
+
}]
|
204
|
+
)
|
205
|
+
```
|
206
|
+
|
207
|
+
#### Retrieve customer
|
208
|
+
|
209
|
+
```ruby
|
210
|
+
customer = customers_client.customers.retrieve("cus_123456789")
|
211
|
+
```
|
212
|
+
|
213
|
+
#### Update customer
|
214
|
+
|
215
|
+
```ruby
|
216
|
+
customer = customers_client.customers.update(
|
217
|
+
"cus_123456789",
|
218
|
+
owner: {
|
219
|
+
entityId: "ent_123456789",
|
220
|
+
},
|
221
|
+
authorized: {
|
222
|
+
entityId: "ent_123456789",
|
223
|
+
},
|
224
|
+
contracts: [{
|
225
|
+
type: "standard",
|
226
|
+
signedDate: "2020-09-04",
|
227
|
+
}]
|
228
|
+
)
|
229
|
+
```
|
230
|
+
|
231
|
+
#### Delete customer
|
232
|
+
|
233
|
+
```ruby
|
234
|
+
response = customers_client.customers.delete("cus_123456789")
|
235
|
+
```
|
236
|
+
|
237
|
+
### Wallet links
|
238
|
+
|
239
|
+
#### List wallet links
|
240
|
+
|
241
|
+
```ruby
|
242
|
+
collection = customers_client.wallet_links.list(limit: 21, sort: "asc", pageToken: "foo")
|
243
|
+
```
|
244
|
+
|
245
|
+
#### Create wallet link
|
246
|
+
|
247
|
+
With an address:
|
248
|
+
|
249
|
+
```ruby
|
250
|
+
wallet_link = customers_client.wallet_links.create(
|
251
|
+
id: "wl_123456789",
|
252
|
+
address: "0x1234567890abcdef1234567890abcdef12345678",
|
253
|
+
assetId: "ETH",
|
254
|
+
assignment: {
|
255
|
+
customerId: "cus_123456789",
|
256
|
+
}
|
257
|
+
)
|
258
|
+
```
|
259
|
+
|
260
|
+
With a wallet:
|
261
|
+
|
262
|
+
```ruby
|
263
|
+
wallet_link = customers_client.wallet_links.create(
|
264
|
+
id: "wl_123456789",
|
265
|
+
wallet: "wal_123456789",
|
266
|
+
assetId: "ETH",
|
267
|
+
assignment: {
|
268
|
+
customerId: "cus_123456789",
|
269
|
+
}
|
270
|
+
)
|
271
|
+
```
|
272
|
+
|
273
|
+
#### Retrieve wallet link
|
274
|
+
|
275
|
+
```ruby
|
276
|
+
wallet_link = customers_client.wallet_links.retrieve("wl_123456789")
|
277
|
+
```
|
278
|
+
|
279
|
+
---
|
280
|
+
|
281
|
+
## Custody API
|
282
|
+
|
283
|
+
See [lib/config/chains.json](lib/config/chains.json) for the list of available chains.
|
284
|
+
|
285
|
+
### Wallets
|
286
|
+
|
287
|
+
#### List wallets
|
288
|
+
|
289
|
+
```ruby
|
290
|
+
collection = custody_client.wallets.list(limit: 21, order: "wallet", sort: "asc", start: 42, tags: { tag0: "tag 0", tag1: "tag 1" }, xtags: { tag2: "tag 2", tag3: "tag 3" })
|
291
|
+
```
|
292
|
+
|
293
|
+
#### Create wallet
|
294
|
+
|
295
|
+
```ruby
|
296
|
+
wallet = custody_client.wallets.create(
|
297
|
+
wallet: "wal_123456789",
|
298
|
+
useHsm: false,
|
299
|
+
tags: [{
|
300
|
+
tag0: "tag 0"
|
301
|
+
}, {
|
302
|
+
tag1: "tag 1",
|
303
|
+
}, {
|
304
|
+
...
|
305
|
+
}, {
|
306
|
+
tag9: "tag 9"
|
307
|
+
}]
|
308
|
+
)
|
309
|
+
```
|
310
|
+
|
311
|
+
#### Retrieve wallet
|
312
|
+
|
313
|
+
```ruby
|
314
|
+
wallet = custody_client.wallets.retrieve("wal_123456789")
|
315
|
+
```
|
316
|
+
|
317
|
+
#### Update wallet
|
318
|
+
|
319
|
+
```ruby
|
320
|
+
wallet = custody_client.wallets.update(
|
321
|
+
"wal_123456789",
|
322
|
+
tags: [{
|
323
|
+
tag0: "tag 0"
|
324
|
+
}, {
|
325
|
+
tag1: "tag 1",
|
326
|
+
}, {
|
327
|
+
...
|
328
|
+
}, {
|
329
|
+
tag9: "tag 9"
|
330
|
+
}]
|
331
|
+
)
|
332
|
+
```
|
333
|
+
|
334
|
+
#### Delete wallet
|
335
|
+
|
336
|
+
```ruby
|
337
|
+
wallet_recovery = custody_client.customers.delete("wal_123456789")
|
338
|
+
```
|
339
|
+
|
340
|
+
### Wallet statuses
|
341
|
+
|
342
|
+
#### Retrieve wallet status
|
343
|
+
|
344
|
+
```ruby
|
345
|
+
wallet_status = custody_client.wallet_statuses(assetId: "ETH").retrieve("wal_123456789")
|
346
|
+
```
|
347
|
+
|
348
|
+
---
|
349
|
+
|
350
|
+
## Development
|
351
|
+
|
352
|
+
### Git config
|
353
|
+
|
354
|
+
Tell `git` where to find the project shared hooks:
|
355
|
+
|
356
|
+
```bash
|
357
|
+
git config core.hooksPath .githooks
|
358
|
+
```
|
359
|
+
|
360
|
+
### Interactive console
|
361
|
+
|
362
|
+
```sh
|
363
|
+
bin/console
|
364
|
+
```
|
365
|
+
|
366
|
+
### Testing
|
367
|
+
|
368
|
+
If Tangany API changes, edit the `spec/factories` and the `spec/generators` accordingly, then run all tests:
|
369
|
+
|
370
|
+
```sh
|
371
|
+
rspec
|
372
|
+
```
|
373
|
+
|
374
|
+
Fixtures will be regenerated automatically each time you run the tests.
|
375
|
+
|
376
|
+
It is also possible to run a test suite against the live API.
|
377
|
+
|
378
|
+
> :warning: Be sure to set environment variables **not to production values** before running the following command!
|
379
|
+
|
380
|
+
```sh
|
381
|
+
bin/test-live
|
382
|
+
```
|
383
|
+
|
384
|
+
### Linting and code quality
|
385
|
+
|
386
|
+
Run the linter:
|
387
|
+
|
388
|
+
```sh
|
389
|
+
rubocop
|
390
|
+
```
|
391
|
+
|
392
|
+
Run the code quality checker:
|
393
|
+
|
394
|
+
```sh
|
395
|
+
rake quality_check
|
396
|
+
```
|
397
|
+
|
398
|
+
---
|
399
|
+
|
400
|
+
## Contributing
|
401
|
+
|
402
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/bitbond/tangany-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/bitbond/tangany-ruby/blob/main/CODE_OF_CONDUCT.md).
|
403
|
+
|
404
|
+
## License
|
405
|
+
|
406
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
407
|
+
|
408
|
+
## Code of Conduct
|
409
|
+
|
410
|
+
Everyone interacting in the Tangany::Ruby project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/bitbond/tangany-ruby/blob/main/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
@@ -0,0 +1,133 @@
|
|
1
|
+
require "byebug"
|
2
|
+
require "bundler/gem_tasks"
|
3
|
+
require "factory_bot"
|
4
|
+
require "rspec/core/rake_task"
|
5
|
+
|
6
|
+
require_relative "spec/generators"
|
7
|
+
|
8
|
+
desc "Checks the quality of code and generate reports"
|
9
|
+
task :quality_check do
|
10
|
+
puts
|
11
|
+
puts "== Patch-level verification for bundler ".ljust(80, "=")
|
12
|
+
puts
|
13
|
+
abort unless system("bundle-audit update && bundle-audit")
|
14
|
+
|
15
|
+
puts "== Quality report generation ".ljust(80, "=")
|
16
|
+
puts
|
17
|
+
paths = FileList.new(
|
18
|
+
"lib/**/*.rb"
|
19
|
+
).join(" ")
|
20
|
+
abort unless system("rubycritic #{paths}")
|
21
|
+
end
|
22
|
+
|
23
|
+
desc "Regenerates the fixtures"
|
24
|
+
task :regenerate_fixtures do
|
25
|
+
puts
|
26
|
+
puts "== Regenerating fixtures ".ljust(80, "=")
|
27
|
+
|
28
|
+
# Customers API
|
29
|
+
|
30
|
+
## Natural persons
|
31
|
+
|
32
|
+
puts " -> Regenerating responses/customers/natural_persons/retrieve"
|
33
|
+
Tangany::Customers::NaturalPersonsResponsesGenerator.new.retrieve
|
34
|
+
|
35
|
+
puts " -> Regenerating inputs/customers/natural_persons/list"
|
36
|
+
Tangany::Customers::NaturalPersonsInputsGenerator.new.list
|
37
|
+
|
38
|
+
puts " -> Regenerating responses/customers/natural_persons/list"
|
39
|
+
Tangany::Customers::NaturalPersonsResponsesGenerator.new.list
|
40
|
+
|
41
|
+
puts " -> Regenerating inputs/customers/natural_persons/create"
|
42
|
+
Tangany::Customers::NaturalPersonsInputsGenerator.new.create
|
43
|
+
|
44
|
+
puts " -> Regenerating responses/customers/natural_persons/create"
|
45
|
+
Tangany::Customers::NaturalPersonsResponsesGenerator.new.create
|
46
|
+
|
47
|
+
puts " -> Regenerating inputs/customers/natural_persons/update"
|
48
|
+
Tangany::Customers::NaturalPersonsInputsGenerator.new.update
|
49
|
+
|
50
|
+
puts " -> Regenerating responses/customers/natural_persons/update"
|
51
|
+
Tangany::Customers::NaturalPersonsResponsesGenerator.new.update
|
52
|
+
|
53
|
+
puts " -> Regenerating responses/customers/natural_persons/delete"
|
54
|
+
Tangany::Customers::NaturalPersonsResponsesGenerator.new.delete
|
55
|
+
|
56
|
+
## Customers
|
57
|
+
|
58
|
+
puts " -> Regenerating responses/customers/customers/retrieve"
|
59
|
+
Tangany::Customers::CustomersResponsesGenerator.new.retrieve
|
60
|
+
|
61
|
+
puts " -> Regenerating inputs/customers/customers/list"
|
62
|
+
Tangany::Customers::CustomersInputsGenerator.new.list
|
63
|
+
|
64
|
+
puts " -> Regenerating responses/customers/customers/list"
|
65
|
+
Tangany::Customers::CustomersResponsesGenerator.new.list
|
66
|
+
|
67
|
+
puts " -> Regenerating inputs/customers/customers/create"
|
68
|
+
Tangany::Customers::CustomersInputsGenerator.new.create
|
69
|
+
|
70
|
+
puts " -> Regenerating responses/customers/customers/create"
|
71
|
+
Tangany::Customers::CustomersResponsesGenerator.new.create
|
72
|
+
|
73
|
+
puts " -> Regenerating inputs/customers/customers/update"
|
74
|
+
Tangany::Customers::CustomersInputsGenerator.new.update
|
75
|
+
|
76
|
+
puts " -> Regenerating responses/customers/customers/update"
|
77
|
+
Tangany::Customers::CustomersResponsesGenerator.new.update
|
78
|
+
|
79
|
+
puts " -> Regenerating responses/customers/customers/delete"
|
80
|
+
Tangany::Customers::CustomersResponsesGenerator.new.delete
|
81
|
+
|
82
|
+
## Wallet links
|
83
|
+
|
84
|
+
puts " -> Regenerating responses/customers/wallet_links/retrieve"
|
85
|
+
Tangany::Customers::WalletLinksResponsesGenerator.new.retrieve
|
86
|
+
|
87
|
+
puts " -> Regenerating inputs/customers/wallet-links/list"
|
88
|
+
Tangany::Customers::WalletLinksInputsGenerator.new.list
|
89
|
+
|
90
|
+
puts " -> Regenerating responses/customers/wallet_links/list"
|
91
|
+
Tangany::Customers::WalletLinksResponsesGenerator.new.list
|
92
|
+
|
93
|
+
puts " -> Regenerating inputs/customers/wallet_links/create"
|
94
|
+
Tangany::Customers::WalletLinksInputsGenerator.new.create
|
95
|
+
|
96
|
+
puts " -> Regenerating responses/customers/wallet_links/create"
|
97
|
+
Tangany::Customers::WalletLinksResponsesGenerator.new.create
|
98
|
+
|
99
|
+
puts " -> Regenerating responses/customers/wallet_links/delete"
|
100
|
+
Tangany::Customers::WalletLinksResponsesGenerator.new.delete
|
101
|
+
|
102
|
+
# Custody API
|
103
|
+
|
104
|
+
## Wallet statuses
|
105
|
+
|
106
|
+
puts " -> Regenerating responses/custody/wallet_statuses/retrieve"
|
107
|
+
Tangany::Custody::WalletStatusesResponsesGenerator.new.retrieve
|
108
|
+
|
109
|
+
## Wallets
|
110
|
+
|
111
|
+
puts " -> Regenerating responses/custody/wallets/retrieve"
|
112
|
+
Tangany::Custody::WalletsResponsesGenerator.new.retrieve
|
113
|
+
|
114
|
+
puts " -> Regenerating responses/custody/wallets/list"
|
115
|
+
Tangany::Custody::WalletsResponsesGenerator.new.list
|
116
|
+
|
117
|
+
puts " -> Regenerating inputs/custody/wallets/create"
|
118
|
+
Tangany::Custody::WalletsInputsGenerator.new.create
|
119
|
+
|
120
|
+
puts " -> Regenerating responses/custody/wallets/create"
|
121
|
+
Tangany::Custody::WalletsResponsesGenerator.new.create
|
122
|
+
|
123
|
+
puts " -> Regenerating inputs/custody/wallets/update"
|
124
|
+
Tangany::Custody::WalletsInputsGenerator.new.update
|
125
|
+
|
126
|
+
puts " -> Regenerating responses/custody/wallets/update"
|
127
|
+
Tangany::Custody::WalletsResponsesGenerator.new.update
|
128
|
+
|
129
|
+
puts " -> Regenerating responses/custody/wallets/delete"
|
130
|
+
Tangany::Custody::WalletsResponsesGenerator.new.delete
|
131
|
+
|
132
|
+
puts "== Fixtures regenerated ".ljust(80, "=")
|
133
|
+
end
|
data/bin/console
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "byebug"
|
5
|
+
|
6
|
+
require "tangany"
|
7
|
+
|
8
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
9
|
+
# with your gem easier. You can also use a different console, if you like.
|
10
|
+
|
11
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
12
|
+
# require "pry"
|
13
|
+
# Pry.start
|
14
|
+
|
15
|
+
Tangany.client_id = ENV.fetch("TEST_TANGANY_CLIENT_ID", "test")
|
16
|
+
Tangany.client_secret = ENV.fetch("TEST_TANGANY_CLIENT_SECRET", "test")
|
17
|
+
Tangany.environment = "testnet"
|
18
|
+
Tangany.subscription = ENV.fetch("TEST_TANGANY_SUBSCRIPTION", "test")
|
19
|
+
Tangany.vault_url = ENV.fetch("TEST_TANGANY_VAULT_URL", "test")
|
20
|
+
|
21
|
+
require "irb"
|
22
|
+
IRB.start(__FILE__)
|