Skip to content

Commit b5dceae

Browse files
authored
Merge pull request #645 from TokenScript/staging
- Release v2.5.0
2 parents 3b1df7a + a75792b commit b5dceae

35 files changed

+1768
-939
lines changed

.eslintrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"extends": [
88
"eslint:recommended",
99
"plugin:@typescript-eslint/eslint-recommended",
10-
"plugin:@typescript-eslint/recommended"
10+
"plugin:@typescript-eslint/recommended",
11+
"prettier"
1112
],
1213
"rules": {
1314
"@typescript-eslint/ban-ts-comment": "off",
@@ -54,7 +55,6 @@
5455
"undefined"
5556
],
5657
"id-match": "error",
57-
"indent": ["error", "tab", { "SwitchCase": 1 }],
5858
"no-eval": "error",
5959
"no-redeclare": "error",
6060
"no-trailing-spaces": "off",

.github/workflows/tn-p1.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,18 @@ jobs:
4343
npm i -E "@tokenscript/attestation@${ATTESTATION_VER}"
4444
cat package.json
4545
fi
46+
# make SNAPSHOT-staging package to use @tokenscript/attestation:SNAPSHOT-staging
47+
if [ "${GITHUB_EVENT_NAME}" = "push" -a "${GITHUB_REF_NAME}" = "staging" ]; then
48+
echo "//npm.pkg.github.com/:_authToken=${GPR_KEY}" >> .npmrc
49+
echo "@tokenscript:registry=https://npm.pkg.github.com" >> .npmrc
50+
cat .npmrc
51+
npm i "@tokenscript/attestation@SNAPSHOT-staging"
52+
fi
53+
rm -f .npmrc
4654
env:
4755
ATTESTATION_VER: ${{ inputs.attestation_ver }}
4856
USE_GITHUB_PACKAGES: ${{ inputs.use_github_packages }}
49-
GPR_USER: ${{ secrets.GPR_USER }}
50-
GPR_KEY: ${{ secrets.GPR_KEY }}
57+
GPR_KEY: ${{ secrets.GITHUB_TOKEN }}
5158

5259
- name: build
5360
run: |
@@ -79,8 +86,8 @@ jobs:
7986
if: github.event_name == 'push' && contains('refs/heads/staging refs/heads/main', github.ref)
8087
uses: actions/setup-node@v3
8188
with:
82-
node-version: '16.x'
83-
registry-url: 'https://npm.pkg.github.com'
89+
node-version: "16.x"
90+
registry-url: "https://npm.pkg.github.com"
8491

8592
- name: "Publish NPM snapshot"
8693
if: github.event_name == 'push' && contains('refs/heads/staging refs/heads/main', github.ref)
@@ -98,4 +105,4 @@ jobs:
98105
package-name: token-negotiator
99106
package-type: npm
100107
min-versions-to-keep: 4
101-
delete-only-pre-release-versions: "true"
108+
delete-only-pre-release-versions: "true"

.github/workflows/tn-snapshot.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ jobs:
2323
- name: install dependencies
2424
run: |
2525
npm ci
26+
# make SNAPSHOT-staging package to use @tokenscript/attestation:SNAPSHOT-staging
27+
if [ "${GITHUB_REF_NAME}" = "staging" ]; then
28+
echo "//npm.pkg.github.com/:_authToken=${GPR_KEY}" >> .npmrc
29+
echo "@tokenscript:registry=https://npm.pkg.github.com" >> .npmrc
30+
npm i "@tokenscript/attestation@SNAPSHOT-staging"
31+
fi
32+
env:
33+
GPR_KEY: ${{ secrets.GITHUB_TOKEN }}
2634

2735
- name: build
2836
run: |
@@ -31,8 +39,8 @@ jobs:
3139
- name: "Setup registry"
3240
uses: actions/setup-node@v3
3341
with:
34-
node-version: '16.x'
35-
registry-url: 'https://npm.pkg.github.com'
42+
node-version: "16.x"
43+
registry-url: "https://npm.pkg.github.com"
3644

3745
- name: "Publish NPM snapshot"
3846
env:
@@ -49,4 +57,4 @@ jobs:
4957
package-name: token-negotiator
5058
package-type: npm
5159
min-versions-to-keep: 4
52-
delete-only-pre-release-versions: "true"
60+
delete-only-pre-release-versions: "true"

.github/workflows/tn.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313
jobs:
1414
tn-p1:
1515
uses: ./.github/workflows/tn-p1.yml
16+
secrets: inherit
1617

1718
sonarcloud:
1819
needs:

.prettierrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = {
99
"useTabs": true,
1010
"singleQuote": true,
1111
"trailingComma": "all",
12-
"printWidth": 120,
12+
"printWidth": 140,
1313
"semi": false
1414
}
1515
},

CHANGELOG.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
11
> Description
22
3-
The patch release addresses compatibility issues with the es6 version of the build.
3+
Feature release with fixes, added support through Wallet Connect V2, and use of signatures via Solana and Flow.
44

55
### Upgrade Steps
66

7-
* Update NPM package to version 2.4.3
7+
* Update NPM package to version 2.5.0
88

99
### Breaking Changes
1010

1111
[none]
1212

1313
### New Features
1414

15-
[none]
15+
* Tokens loaded event hook added
16+
* Wallet Connect V2 IM token wallet support
17+
* Added sign/verify for flow and solana
1618

1719
### Bug Fixes
1820

19-
* Imported Wallect Connect V2 reference
20-
* TS config update for ES6 compatibility issue found
21-
* Corrections to README
22-
* base64 to Uint8array
21+
* Sonar Cloud code quality updates
22+
* Namespace prefix for off chain communication
23+
* ES LINT update
24+
* Ability to extend library classes
25+
* Support for es5 browsers
26+
* Disabled support of iOS Edge with Torus
2327

2428
### Performance Improvements
2529

@@ -31,4 +35,4 @@ The patch release addresses compatibility issues with the es6 version of the bui
3135

3236
**Full Change log**:
3337

34-
https://github.com/TokenScript/token-negotiator/compare/v2.4.0...v2.4.3
38+
https://github.com/TokenScript/token-negotiator/compare/v2.4.3...v2.5.0

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,10 @@ negotiator.on("tokens-selected", (tokens) => {
250250
// use tokens
251251
});
252252

253+
negotiator.on("tokens-loaded", (data) => {
254+
// use the collections information which were loaded
255+
})
256+
253257
negotiator.on("token-proof", (proof) => {
254258
// use proof
255259
});
@@ -285,6 +289,10 @@ negotiator.on("tokens", (issuerTokens) => {
285289
// use tokens
286290
});
287291

292+
negotiator.on("tokens-loaded", (data) => {
293+
// use the collections information which were loaded
294+
})
295+
288296
negotiator.on("token-proof", (tokenProof) => {
289297
// use proof
290298
});
@@ -316,7 +324,7 @@ const onChainIssuer = {
316324
```
317325

318326
### Managing Issuers on chain (Solana)
319-
327+
:warning: You must supply a certified collectionAddress OR a combination of symbol and either ownerProgram or updateAuthority.
320328
```javascript
321329
/**
322330
* @param {String} blockchain string of which blockchain is needed (optional input: default is 'evm')
@@ -422,6 +430,10 @@ negotiator.on("tokens-selected", callback);
422430
<td>'tokens'</td>
423431
<td>Tokens when using passive mode (auto selected)</td>
424432
</tr>
433+
<tr>
434+
<td>'tokens-loaded'</td>
435+
<td>Collections information(the count) which were loaded</td>
436+
</tr>
425437
<tr>
426438
<td>'network-change'</td>
427439
<td>Chain</td>

index.html

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
</head>
1515
<body onload="init()">
1616
<button onclick="switchTheme()">Switch theme</button>
17+
<button onclick="reloadIssuers()">Reload</button>
1718
<div class="overlay-tn"></div>
1819
<script>
1920
var theme = "dark";
@@ -239,8 +240,70 @@
239240
console.log(proof);
240241
});
241242

243+
window.negotiator.on('tokens-loaded', (data) => {
244+
console.log(`${data.loadedCollections} tokens were loaded`)
245+
})
246+
242247
window.negotiator.negotiate();
243248
}
249+
250+
function reloadIssuers() {
251+
window.negotiator.negotiate([
252+
{
253+
collectionID: "penthouse-panther-club",
254+
collectionAddress: "ff846ef2eed57e5367cf8826e63f4d53fe28d28aa67417accb6e4b48cbd19136",
255+
updateAuthority: "92oYPmrr1BHznizuZmpKZ3MFRadMFYRTCxo9Pf34mZKX",
256+
tokenProgram: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
257+
onChain: true,
258+
symbol: "PPC",
259+
chain: "mainnet",
260+
blockchain: "solana",
261+
},
262+
{
263+
hideToggle : false,
264+
collectionID: "pixel",
265+
collectionAddress: "166424b16c4c7f40eb852f9eb2d0d6869a9ed7ac54a8e6afbd516676bfbbeb19",
266+
onChain: true,
267+
symbol: "PIXEL",
268+
chain: "mainnet",
269+
blockchain: "solana",
270+
},
271+
{
272+
onChain: true,
273+
collectionID: "expansion-punks",
274+
contract: '0x0d0167a823c6619d430b1a96ad85b888bcf97c37',
275+
chain: 'eth',
276+
blockchain: "evm",
277+
},
278+
{
279+
onChain: true,
280+
collectionID: "fantom-collection-test",
281+
contract: '0x94e22c14118353651636f9af43cd0a5a08b93da3',
282+
chain: 'fantom',
283+
blockchain: "evm",
284+
},
285+
{
286+
hideToggle : true,
287+
noTokenMsg: "<p>If you have a token please:</p><p>1. Open your magic link inside this browser.<br/>2. Refresh this page.</p>",
288+
onChain: true,
289+
collectionID: "bsc-collection-test",
290+
contract: '0xF5db804101d8600c26598A1Ba465166c33CdAA4b',
291+
chain: 'bsc',
292+
blockchain: "evm",
293+
},
294+
{
295+
onChain: true,
296+
collectionID: "tt",
297+
contract: '0x76be3b62873462d2142405439777e971754e8e77',
298+
chain: 'eth',
299+
blockchain: "evm",
300+
},
301+
{ onChain: true, collectionID: "Perion", contract: '0x96af92ae2d822a0f191455ceca4d4e7ee227668e', chain: 'mumbai', blockchain: "evm" },
302+
{ collectionID: 'COOLCATS-#2426-14', onChain: true, contract: '0x3C7e352481F4b2fdEc1e642a3f0018661c77513D', chain: 'eth', openSeaSlug: 'devcon-vi-suit-up-collection' },
303+
{ collectionID: 'Town-Hall', onChain: true, contract: '0x81b30ff521D1fEB67EDE32db726D95714eb00637', chain: 'Optimism' },
304+
])
305+
306+
}
244307
function switchTheme() {
245308
theme = theme === "dark" ? "light" : "dark";
246309
window.negotiator.switchTheme(theme);

0 commit comments

Comments
 (0)