@@ -25,26 +25,30 @@ import { decryptKeychainPrivateKey, Keychain, KeychainWithEncryptedPrv } from '.
25
25
import { IPendingApproval , PendingApproval , PendingApprovals } from '../pendingApproval' ;
26
26
import { TradingAccount } from '../trading' ;
27
27
import {
28
- inferAddressType ,
29
- RequestTracer ,
30
- TxRequest ,
31
28
EddsaUnsignedTransaction ,
29
+ inferAddressType ,
32
30
IntentOptionsForMessage ,
33
31
IntentOptionsForTypedData ,
32
+ RequestTracer ,
34
33
RequestType ,
34
+ TokenTransferRecipientParams ,
35
+ TokenType ,
36
+ TxRequest ,
35
37
} from '../utils' ;
36
38
import {
37
39
AccelerateTransactionOptions ,
38
40
AddressesOptions ,
39
41
BuildConsolidationTransactionOptions ,
40
42
BuildTokenEnablementOptions ,
43
+ BulkCreateShareOption ,
44
+ BulkWalletShareKeychain ,
45
+ BulkWalletShareOptions ,
41
46
ChangeFeeOptions ,
42
47
ConsolidateUnspentsOptions ,
43
48
CreateAddressOptions ,
49
+ CreateBulkWalletShareListResponse ,
44
50
CreatePolicyRuleOptions ,
45
51
CreateShareOptions ,
46
- BulkCreateShareOption ,
47
- BulkWalletShareOptions ,
48
52
CrossChainUTXO ,
49
53
DeployForwardersOptions ,
50
54
DownloadKeycardOptions ,
@@ -54,13 +58,15 @@ import {
54
58
ForwarderBalance ,
55
59
ForwarderBalanceOptions ,
56
60
FreezeOptions ,
61
+ FundForwarderParams ,
57
62
FundForwardersOptions ,
58
63
GetAddressOptions ,
59
64
GetPrvOptions ,
60
65
GetTransactionOptions ,
61
66
GetTransferOptions ,
62
67
GetUserPrvOptions ,
63
68
IWallet ,
69
+ ManageUnspentReservationOptions ,
64
70
MaximumSpendable ,
65
71
MaximumSpendableOptions ,
66
72
ModifyWebhookOptions ,
@@ -76,7 +82,9 @@ import {
76
82
SendNFTOptions ,
77
83
SendNFTResult ,
78
84
SendOptions ,
85
+ SharedKeyChain ,
79
86
ShareWalletOptions ,
87
+ SignAndSendTxRequestOptions ,
80
88
SimulateWebhookOptions ,
81
89
SubmitTransactionOptions ,
82
90
SubWalletType ,
@@ -94,12 +102,6 @@ import {
94
102
WalletSignTransactionOptions ,
95
103
WalletSignTypedDataOptions ,
96
104
WalletType ,
97
- CreateBulkWalletShareListResponse ,
98
- SharedKeyChain ,
99
- BulkWalletShareKeychain ,
100
- ManageUnspentReservationOptions ,
101
- SignAndSendTxRequestOptions ,
102
- FundForwarderParams ,
103
105
} from './iWallet' ;
104
106
import { GoStakingWallet , StakingWallet } from '../staking' ;
105
107
import EddsaUtils from '../utils/tss/eddsa' ;
@@ -2405,7 +2407,7 @@ export class Wallet implements IWallet {
2405
2407
if ( ! this . baseCoin . isValidAddress ( recipientAddress ) ) {
2406
2408
throw new Error ( `Invalid recipient address ${ recipientAddress } ` ) ;
2407
2409
}
2408
- const baseAddress = this . coinSpecific ( ) ?. baseAddress ;
2410
+ const baseAddress = this . coinSpecific ( ) ?. baseAddress || this . coinSpecific ( ) ?. rootAddress ;
2409
2411
if ( ! baseAddress ) {
2410
2412
throw new Error ( 'Missing base address for wallet' ) ;
2411
2413
}
@@ -2463,6 +2465,30 @@ export class Wallet implements IWallet {
2463
2465
] ,
2464
2466
} ) ;
2465
2467
}
2468
+
2469
+ case TokenType . DIGITAL_ASSET : {
2470
+ if ( ! nftBalance . collections [ sendNftOptions . tokenId ] ) {
2471
+ throw new Error (
2472
+ `Token ${ sendNftOptions . tokenId } not found in collection ${ tokenContractAddress } or does not have a spendable balance`
2473
+ ) ;
2474
+ }
2475
+ const tokenData : TokenTransferRecipientParams = {
2476
+ tokenType : sendNftOptions . type ,
2477
+ tokenQuantity : '1' , // This NFT standard will always have quantity of 1
2478
+ tokenContractAddress,
2479
+ tokenId : sendNftOptions . tokenId ,
2480
+ } ;
2481
+ return this . sendMany ( {
2482
+ ...sendOptions ,
2483
+ recipients : [
2484
+ {
2485
+ address : recipientAddress ,
2486
+ amount : '1' , // the amount needs to be non-zero for the transaction to be valid, it is ignored
2487
+ tokenData,
2488
+ } ,
2489
+ ] ,
2490
+ } ) ;
2491
+ }
2466
2492
}
2467
2493
}
2468
2494
0 commit comments