Skip to content

Commit e420ca2

Browse files
authored
Merge pull request #6369 from BitGo/WIN-5457_nft_soneium
chore: add support for token in soenium
2 parents 90289c5 + 1264d46 commit e420ca2

File tree

3 files changed

+63
-0
lines changed

3 files changed

+63
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import 'should';
2+
3+
import { TestBitGo } from '@bitgo/sdk-test';
4+
import { BitGoAPI } from '@bitgo/sdk-api';
5+
import { SoneiumToken } from '../../src';
6+
7+
describe('Soneium Token: ', function () {
8+
let bitgo;
9+
10+
describe('Soneium NFTs in test env:', function () {
11+
const tokenNames = ['tsoneium:test721', 'tsoneium:test1155'];
12+
13+
before(function () {
14+
bitgo = TestBitGo.decorate(BitGoAPI, { env: 'test' });
15+
SoneiumToken.createTokenConstructors().forEach(({ name, coinConstructor }) => {
16+
bitgo.safeRegister(name, coinConstructor);
17+
});
18+
bitgo.initializeTestVars();
19+
});
20+
21+
tokenNames.forEach((tokenName: string) => {
22+
it('should return constants', function () {
23+
const soneiumToken = bitgo.coin(tokenName);
24+
soneiumToken.getChain().should.equal(tokenName);
25+
soneiumToken.getBaseChain().should.equal('tsoneium');
26+
soneiumToken.getFullName().should.equal('Soneium Token');
27+
soneiumToken.type.should.equal(tokenName);
28+
soneiumToken.coin.should.equal('tsoneium');
29+
soneiumToken.network.should.equal('Testnet');
30+
});
31+
32+
it('should return same token by contract address', function () {
33+
const soneiumToken = bitgo.coin(tokenName);
34+
const tokencoinBycontractAddress = bitgo.coin(soneiumToken.tokenContractAddress);
35+
soneiumToken.should.deepEqual(tokencoinBycontractAddress);
36+
});
37+
});
38+
});
39+
});

modules/statics/src/base.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2526,6 +2526,8 @@ export enum UnderlyingAsset {
25262526
// generic NFTs
25272527
'erc721:soneiumtoken' = 'erc721:soneiumtoken',
25282528
'erc1155:soneiumtoken' = 'erc1155:soneiumtoken',
2529+
'tsoneium:test721' = 'tsoneium:test721',
2530+
'tsoneium:test1155' = 'tsoneium:test1155',
25292531

25302532
// coredao mainnet tokens
25312533
'coredao:stcore' = 'coredao:stcore',

modules/statics/src/coins.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2543,6 +2543,28 @@ export const coins = CoinMap.fromCoins([
25432543
Networks.test.soneium,
25442544
KeyCurve.Secp256k1
25452545
),
2546+
terc721(
2547+
'95bfa074-a3d0-4579-a18a-9bccafc2bd0b',
2548+
'tsoneium:test721',
2549+
'soneium Test ERC721',
2550+
'0xc78d4c49ccaa27a9ba9d0de9d93f50dbc67d4f8e',
2551+
GENERIC_TOKEN_FEATURES,
2552+
'',
2553+
'',
2554+
Networks.test.soneium,
2555+
KeyCurve.Secp256k1
2556+
),
2557+
terc1155(
2558+
'6299cdc3-07b8-40b3-a814-f2d9965bcbb4',
2559+
'tsoneium:test1155',
2560+
'soneium Test ERC1155',
2561+
'0xa8005b2990abfd688c0815b84509896f2c7bf78d',
2562+
GENERIC_TOKEN_FEATURES,
2563+
'',
2564+
'',
2565+
Networks.test.soneium,
2566+
KeyCurve.Secp256k1
2567+
),
25462568
arbethErc20(
25472569
'14a21e93-b123-4437-b99f-0489947d0379',
25482570
'arbeth:link',

0 commit comments

Comments
 (0)