@t-0/provider-starter-ts 0.4.8 → 0.4.10

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@t-0/provider-starter-ts",
3
- "version": "0.4.8",
3
+ "version": "0.4.10",
4
4
  "description": "CLI tool to scaffold a Node.js t-0 Network integration service",
5
5
  "main": "dist/create.js",
6
6
  "bin": {
@@ -30,7 +30,6 @@
30
30
  "author": "New Settlement Technologies Inc.",
31
31
  "license": "MIT",
32
32
  "dependencies": {
33
- "@t-0/provider-sdk": "^1.0.49",
34
33
  "chalk": "^4.1.2",
35
34
  "fs-extra": "^11.1.1",
36
35
  "inquirer": "^8.2.5"
@@ -9,7 +9,7 @@
9
9
  "version": "1.0.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "@t-0/provider-sdk": "1.0.36",
12
+ "@t-0/provider-sdk": "^1.0.50",
13
13
  "dotenv": "^16.3.1",
14
14
  "tiny-invariant": "^1.3.3"
15
15
  },
@@ -23,15 +23,13 @@
23
23
  "version": "2.10.0",
24
24
  "resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-2.10.0.tgz",
25
25
  "integrity": "sha512-fdRs9PSrBF7QUntpZpq6BTw58fhgGJojgg39m9oFOJGZT+nip9b0so5cYY1oWl5pvemDLr0cPPsH46vwThEbpQ==",
26
- "license": "(Apache-2.0 AND BSD-3-Clause)",
27
- "peer": true
26
+ "license": "(Apache-2.0 AND BSD-3-Clause)"
28
27
  },
29
28
  "node_modules/@connectrpc/connect": {
30
29
  "version": "2.1.0",
31
30
  "resolved": "https://registry.npmjs.org/@connectrpc/connect/-/connect-2.1.0.tgz",
32
31
  "integrity": "sha512-xhiwnYlJNHzmFsRw+iSPIwXR/xweTvTw8x5HiwWp10sbVtd4OpOXbRgE7V58xs1EC17fzusF1f5uOAy24OkBuA==",
33
32
  "license": "Apache-2.0",
34
- "peer": true,
35
33
  "peerDependencies": {
36
34
  "@bufbuild/protobuf": "^2.7.0"
37
35
  }
@@ -122,9 +120,9 @@
122
120
  }
123
121
  },
124
122
  "node_modules/@t-0/provider-sdk": {
125
- "version": "1.0.36",
126
- "resolved": "https://registry.npmjs.org/@t-0/provider-sdk/-/provider-sdk-1.0.36.tgz",
127
- "integrity": "sha512-0BwJR9KgM9+CTt2F2A/DFXIOhI/Cu+gwWQsOAJg/4X4NNhECCCFAne+wkdb/gPSwCmqb8PfXJ3RmqFA/iFkB/g==",
123
+ "version": "1.0.50",
124
+ "resolved": "https://registry.npmjs.org/@t-0/provider-sdk/-/provider-sdk-1.0.50.tgz",
125
+ "integrity": "sha512-8Lb2mqGBB9aOOpocbXNql6dWBCl7iuqSU/o49E1qXtvuzUwzer3hu5QqKg6YBAegH/RU5VjbzNwQHz1Pu2svlg==",
128
126
  "dependencies": {
129
127
  "@bufbuild/protobuf": "^2.10.0",
130
128
  "@connectrpc/connect": "^2.1.0",
@@ -168,7 +166,6 @@
168
166
  "integrity": "sha512-ZsJzA5thDQMSQO788d7IocwwQbI8B5OPzmqNvpf3NY/+MHDAS759Wo0gd2WQeXYt5AAAQjzcrTVC6SKCuYgoCQ==",
169
167
  "dev": true,
170
168
  "license": "MIT",
171
- "peer": true,
172
169
  "dependencies": {
173
170
  "undici-types": "~6.21.0"
174
171
  }
@@ -298,7 +295,6 @@
298
295
  "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
299
296
  "dev": true,
300
297
  "license": "Apache-2.0",
301
- "peer": true,
302
298
  "bin": {
303
299
  "tsc": "bin/tsc",
304
300
  "tsserver": "bin/tsserver"
@@ -12,7 +12,7 @@
12
12
  "author": "",
13
13
  "license": "MIT",
14
14
  "dependencies": {
15
- "@t-0/provider-sdk": "1.0.36",
15
+ "@t-0/provider-sdk": "^1.0.50",
16
16
  "dotenv": "^16.3.1",
17
17
  "tiny-invariant": "^1.3.3"
18
18
  },
@@ -3,14 +3,12 @@ import {fromProtoDecimal, toProtoDecimal} from "./lib";
3
3
 
4
4
  export default async function getQuote(networkClient: Client<typeof NetworkService>) {
5
5
  const eurgbp = await networkClient.getQuote({
6
- payInCurrency: "EUR",
7
- payInMethod: PaymentMethodType.SEPA,
8
6
  payOutCurrency: "GBP",
9
7
  payOutMethod: PaymentMethodType.SWIFT,
10
8
  quoteType: QuoteType.REALTIME,
11
9
  amount: {
12
10
  amount: {
13
- case: 'payInAmount',
11
+ case: 'payOutAmount',
14
12
  value: toProtoDecimal(10, 0)
15
13
  },
16
14
  }
@@ -18,7 +16,7 @@ export default async function getQuote(networkClient: Client<typeof NetworkServi
18
16
 
19
17
  switch (eurgbp.result.case) {
20
18
  case 'success':
21
- console.log(`EUR/GBP: ${fromProtoDecimal(eurgbp.result.value.rate!)}`)
19
+ console.log(`USD/GBP: ${fromProtoDecimal(eurgbp.result.value.rate!)}`)
22
20
  break;
23
21
  case 'failure':
24
22
  console.error(eurgbp.result.value.reason)
@@ -1,24 +1,24 @@
1
1
  import {type Client, NetworkService, PaymentMethodType} from "@t-0/provider-sdk";
2
+ import {toProtoDecimal} from "./lib";
2
3
 
3
4
  export default async function submitPayment(networkClient: Client<typeof NetworkService>): Promise<void> {
4
5
  // TODO: Step 2.3 replace this with receiving quotes from you systems and publishing them into t-0 Network. We recommend publishing at least once per 5 seconds, but not more than once per second
5
6
  await networkClient.createPayment({
6
- payIn: {
7
- currency: 'EUR',
8
- paymentMethod: PaymentMethodType.SEPA,
7
+ currency: 'GBP',
8
+ amount: {
9
+ amount: {
10
+ case: "payOutAmount",
11
+ value: toProtoDecimal(10, 0),
12
+ },
9
13
  },
10
- payOut: {
11
- currency: 'GBP',
12
- paymentDetails: {
13
- details: {
14
- case: "sepa",
15
- value: {
16
- iban: 'GB12345567890',
17
- beneficiaryName: 'Max Mustermann',
18
- }
14
+ paymentDetails: {
15
+ details: {
16
+ case: "sepa",
17
+ value: {
18
+ iban: 'GB12345567890',
19
+ beneficiaryName: 'Max Mustermann',
19
20
  }
20
21
  }
21
- }
22
-
22
+ },
23
23
  })
24
24
  }