@@ -498,6 +498,48 @@ export class NomadContext extends MultiProvider {
498498 return message as TransferMessage ;
499499 }
500500
501+ /**
502+ * Send tokens from one domain to another. Approves the bridge if necessary.
503+ *
504+ * @param token The token to update details for
505+ * @param domains An array of the domains to updateDetails on
506+ * @param overrides Any tx overrides (e.g. gas price)
507+ * @returns a {@link TransferMessage} object representing the in-flight
508+ * transfer
509+ * @throws On missing signers, missing tokens, tx issues, etc.
510+ */
511+ async setDetails (
512+ token : TokenIdentifier ,
513+ domains : ( string | number ) [ ] ,
514+ overrides : ethers . Overrides = { } ,
515+ ) : Promise < ethers . ContractReceipt [ ] > {
516+ // get canonical token contract & query canonical details
517+ const { name, symbol, decimals } = await this . getCanonicalTokenDetails (
518+ token ,
519+ ) ;
520+ // for each domain, setDetails
521+ const receiptPromises : Promise < ethers . ContractReceipt > [ ] = [ ] ;
522+ for ( const domain of domains ) {
523+ // get the token representation on that chain
524+ const representation = await this . resolveRepresentation ( domain , token ) ;
525+ if ( ! representation ) {
526+ throw new Error ( `Token not available on ${ domain } ` ) ;
527+ }
528+ // send setDetails transaction
529+ const tx = await representation . setDetails (
530+ name ,
531+ symbol ,
532+ decimals ,
533+ overrides ,
534+ ) ;
535+ // push transaction receipt promise
536+ const receiptPromise = tx . wait ( ) ;
537+ receiptPromises . push ( receiptPromise ) ;
538+ }
539+ // return all transaction promises
540+ return Promise . all ( receiptPromises ) ;
541+ }
542+
501543 /**
502544 * Queries the name, symbol and details of a canonical token.
503545 *
0 commit comments