File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -75,6 +75,14 @@ export class SolToken extends Sol {
7575 return Math . pow ( 10 , this . tokenConfig . decimalPlaces ) ;
7676 }
7777
78+ /**
79+ * Token standard for consolidation intents (wallet-platform).
80+ * @returns {string } SPL token type identifier
81+ */
82+ getTokenType ( ) : string {
83+ return 'SPL' ;
84+ }
85+
7886 /**
7987 * Flag for sending value of 0
8088 * @returns {boolean } True if okay to send 0 value, false otherwise
Original file line number Diff line number Diff line change @@ -28,4 +28,12 @@ describe('SOL Token:', function () {
2828 solTokenCoin . tokenAddress . should . equal ( 'J3NKxxXZcnNiMjKw9hYb2K4LUxgwB6t1FtPtQVsv3KFr' ) ;
2929 solTokenCoin . contractAddress . should . equal ( 'J3NKxxXZcnNiMjKw9hYb2K4LUxgwB6t1FtPtQVsv3KFr' ) ;
3030 } ) ;
31+
32+ it ( 'should return SPL token type for mainnet token' , function ( ) {
33+ solTokenCoin . getTokenType ( ) . should . equal ( 'SPL' ) ;
34+ } ) ;
35+
36+ it ( 'should return SPL token type for testnet token' , function ( ) {
37+ ( bitgo . coin ( 'tsol:usdc' ) as SolToken ) . getTokenType ( ) . should . equal ( 'SPL' ) ;
38+ } ) ;
3139} ) ;
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ import {
4141 trimmedDynamicBaseChainConfig ,
4242} from './resources/amsTokenConfig' ;
4343import { EthLikeErc20Token } from '../../../sdk-coin-evm/src' ;
44+ import { ProgramID } from '../../src/account' ;
4445import { allCoinsAndTokens } from '../../src/allCoinsAndTokens' ;
4546
4647interface DuplicateCoinObject {
@@ -1012,6 +1013,15 @@ describe('Token contract address field defaults', () => {
10121013 solToken . contractAddress . should . eql ( solToken . tokenAddress ) ;
10131014 } ) ;
10141015 } ) ;
1016+
1017+ it ( 'have valid programId (SPL or Token-2022)' , ( ) => {
1018+ const validProgramIds = [ ProgramID . TokenProgramId , ProgramID . Token2022ProgramId ] ;
1019+ coins
1020+ . filter ( ( coin ) => coin . family === CoinFamily . SOL && coin instanceof SolCoin )
1021+ . forEach ( ( coin ) => {
1022+ validProgramIds . should . containEql ( ( coin as SolCoin ) . programId ) ;
1023+ } ) ;
1024+ } ) ;
10151025 } ) ;
10161026 describe ( 'XRP tokens' , function ( ) {
10171027 it ( 'have `contractAddress` === `issuerAddress::currencyCode`' , ( ) => {
You can’t perform that action at this time.
0 commit comments