@notabene/javascript-sdk 1.20.0 → 1.21.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.
- package/README.md +17 -0
- package/package.json +1 -1
- package/src/types.ts +8 -1
package/README.md
CHANGED
|
@@ -76,6 +76,23 @@ Once the widget determines the transaction is valid, it will call the `onValidSt
|
|
|
76
76
|
const currentTransactionInfo = notabene.tx;
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
+
###Supported asset formats
|
|
80
|
+
|
|
81
|
+
- `USDC` the simple asset code passed as a `string`, in case different chain (polygon) -> `USDC-POLY`
|
|
82
|
+
- `CAIP19` format
|
|
83
|
+
```js
|
|
84
|
+
{
|
|
85
|
+
caip19: 'eip155:1/erc20:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'; // for USDC
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
- `coingeckoId` and `network` format
|
|
89
|
+
```js
|
|
90
|
+
{
|
|
91
|
+
coingeckoId: "usd-coin",
|
|
92
|
+
network: "ethereum"
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
79
96
|
---
|
|
80
97
|
|
|
81
98
|
### Re-rendering
|
package/package.json
CHANGED
package/src/types.ts
CHANGED
|
@@ -63,9 +63,16 @@ export type BeneficiaryFields = {
|
|
|
63
63
|
beneficiaryPersonType?: PersonType;
|
|
64
64
|
};
|
|
65
65
|
|
|
66
|
+
export type CAIP19 = {
|
|
67
|
+
caip19: string;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export type CoingeckoIdAndNetwork = { coingeckoId: string; network: string };
|
|
71
|
+
|
|
72
|
+
export type TransactionAsset = string | CAIP19 | CoingeckoIdAndNetwork;
|
|
66
73
|
export type Transaction = OriginatorFields &
|
|
67
74
|
BeneficiaryFields & {
|
|
68
|
-
transactionAsset:
|
|
75
|
+
transactionAsset: TransactionAsset;
|
|
69
76
|
transactionAmount: string;
|
|
70
77
|
transactionBlockchainInfo?: TransactionBlockchainInfo;
|
|
71
78
|
isNonCustodial?: boolean;
|